diff --git a/3d-viewer/3d_draw.cpp b/3d-viewer/3d_draw.cpp index 4801a6bde7..b4d6890895 100644 --- a/3d-viewer/3d_draw.cpp +++ b/3d-viewer/3d_draw.cpp @@ -817,8 +817,8 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas ) glNormal3f( 0.0, 0.0, 1.0 ); // Normal is Z axis nlmax = g_Parm_3D_Visu.m_Layers - 1; - Oncu = (m_Masque_Layer & CUIVRE_LAYER) ? TRUE : FALSE; - Oncmp = (m_Masque_Layer & CMP_LAYER) ? TRUE : FALSE; + Oncu = (m_Masque_Layer & LAYER_BACK) ? TRUE : FALSE; + Oncmp = (m_Masque_Layer & LAYER_FRONT) ? TRUE : FALSE; Both = Oncu && Oncmp; switch( m_PadShape & 0x7F ) diff --git a/include/pcbstruct.h b/include/pcbstruct.h index e5f0ffef45..2647215e6b 100644 --- a/include/pcbstruct.h +++ b/include/pcbstruct.h @@ -75,7 +75,6 @@ #define LAYER_BACK (1 << LAYER_N_BACK) ///< bit mask for copper layer -#define CUIVRE_LAYER (1 << LAYER_N_BACK) ///< bit mask for copper layer #define LAYER_2 (1 << LAYER_N_2) ///< bit mask for layer 2 #define LAYER_3 (1 << LAYER_N_3) ///< bit mask for layer 3 #define LAYER_4 (1 << LAYER_N_4) ///< bit mask for layer 4 @@ -90,7 +89,6 @@ #define LAYER_13 (1 << LAYER_N_13) ///< bit mask for layer 13 #define LAYER_14 (1 << LAYER_N_14) ///< bit mask for layer 14 #define LAYER_15 (1 << LAYER_N_15) ///< bit mask for layer 15 -#define CMP_LAYER (1 << LAYER_N_FRONT) ///< bit mask for component layer #define LAYER_FRONT (1 << LAYER_N_FRONT) ///< bit mask for component layer #define ADHESIVE_LAYER_CU (1 << ADHESIVE_N_CU) #define ADHESIVE_LAYER_CMP (1 << ADHESIVE_N_CMP) diff --git a/pcbnew/autoplac.cpp b/pcbnew/autoplac.cpp index 308a6198af..a651b18300 100644 --- a/pcbnew/autoplac.cpp +++ b/pcbnew/autoplac.cpp @@ -526,9 +526,9 @@ void WinEDA_PcbFrame::GenModuleOnBoard( MODULE* Module ) masque_layer = 0; if( Module->GetLayer() == LAYER_N_FRONT ) - masque_layer = CMP_LAYER; + masque_layer = LAYER_FRONT; if( Module->GetLayer() == LAYER_N_BACK ) - masque_layer = CUIVRE_LAYER; + masque_layer = LAYER_BACK; TraceFilledRectangle( GetBoard(), ox, oy, fx, fy, masque_layer, CELL_is_MODULE, WRITE_OR_CELL ); @@ -602,9 +602,9 @@ int WinEDA_PcbFrame::RecherchePlacementModule( MODULE* Module, wxDC* DC ) if( Nb_Sides == TWO_SIDES ) { D_PAD* Pad; int masque_otherlayer; - masque_otherlayer = CUIVRE_LAYER; + masque_otherlayer = LAYER_BACK; if( Module->GetLayer() == LAYER_N_BACK ) - masque_otherlayer = CMP_LAYER; + masque_otherlayer = LAYER_FRONT; for( Pad = Module->m_Pads; Pad != NULL; Pad = Pad->Next() ) { diff --git a/pcbnew/class_board_item.cpp b/pcbnew/class_board_item.cpp index d135be4977..cf31678a69 100644 --- a/pcbnew/class_board_item.cpp +++ b/pcbnew/class_board_item.cpp @@ -65,9 +65,9 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const << wxT( "\" (" ); if ( (pad->m_Masque_Layer & ALL_CU_LAYERS) == ALL_CU_LAYERS ) text << _("all copper layers"); - else if( (pad->m_Masque_Layer & CUIVRE_LAYER) == CUIVRE_LAYER ) + else if( (pad->m_Masque_Layer & LAYER_BACK) == LAYER_BACK ) text << aPcb->GetLayerName( LAYER_N_BACK ).Trim(); - else if( (pad->m_Masque_Layer & CMP_LAYER) == CMP_LAYER ) + else if( (pad->m_Masque_Layer & LAYER_FRONT) == LAYER_FRONT ) text << aPcb->GetLayerName( LAYER_N_FRONT ); else text << _("???"); text << _( ") of " ) << ( (MODULE*) GetParent() )->GetReference(); diff --git a/pcbnew/class_module_transform_functions.cpp b/pcbnew/class_module_transform_functions.cpp index f24e5cd980..a29b7c81fc 100644 --- a/pcbnew/class_module_transform_functions.cpp +++ b/pcbnew/class_module_transform_functions.cpp @@ -79,17 +79,17 @@ static int ChangeSideMaskLayer( int masque ) { int newmasque; - newmasque = masque & ~(CUIVRE_LAYER | CMP_LAYER | + newmasque = masque & ~(LAYER_BACK | LAYER_FRONT | SILKSCREEN_LAYER_CU | SILKSCREEN_LAYER_CMP | ADHESIVE_LAYER_CU | ADHESIVE_LAYER_CMP | SOLDERMASK_LAYER_CU | SOLDERMASK_LAYER_CMP | SOLDERPASTE_LAYER_CU | SOLDERPASTE_LAYER_CMP | ADHESIVE_LAYER_CU | ADHESIVE_LAYER_CMP); - if( masque & CUIVRE_LAYER ) - newmasque |= CMP_LAYER; - if( masque & CMP_LAYER ) - newmasque |= CUIVRE_LAYER; + if( masque & LAYER_BACK ) + newmasque |= LAYER_FRONT; + if( masque & LAYER_FRONT ) + newmasque |= LAYER_BACK; if( masque & SILKSCREEN_LAYER_CU ) newmasque |= SILKSCREEN_LAYER_CMP; diff --git a/pcbnew/class_pad.cpp b/pcbnew/class_pad.cpp index eecba5c520..d0e0c32634 100644 --- a/pcbnew/class_pad.cpp +++ b/pcbnew/class_pad.cpp @@ -643,11 +643,11 @@ void D_PAD::DisplayInfo( WinEDA_DrawFrame* frame ) } else { -#define INTERIOR_COPPER (ALL_CU_LAYERS & ~(CUIVRE_LAYER | CMP_LAYER)) +#define INTERIOR_COPPER (ALL_CU_LAYERS & ~(LAYER_BACK | LAYER_FRONT)) static const wxChar* andInternal = _( " & int" ); - if( (m_Masque_Layer & (CUIVRE_LAYER | CMP_LAYER)) == CUIVRE_LAYER ) + if( (m_Masque_Layer & (LAYER_BACK | LAYER_FRONT)) == LAYER_BACK ) { layerInfo = board->GetLayerName( LAYER_N_BACK ); @@ -655,7 +655,7 @@ void D_PAD::DisplayInfo( WinEDA_DrawFrame* frame ) layerInfo += andInternal; } - else if( (m_Masque_Layer & (CUIVRE_LAYER | CMP_LAYER)) == (CUIVRE_LAYER | CMP_LAYER) ) + else if( (m_Masque_Layer & (LAYER_BACK | LAYER_FRONT)) == (LAYER_BACK | LAYER_FRONT) ) { layerInfo = board->GetLayerName( LAYER_N_BACK ) + wxT(", ") + board->GetLayerName( LAYER_N_FRONT ); @@ -664,7 +664,7 @@ void D_PAD::DisplayInfo( WinEDA_DrawFrame* frame ) layerInfo += andInternal; } - else if( (m_Masque_Layer & (CUIVRE_LAYER | CMP_LAYER)) == CMP_LAYER ) + else if( (m_Masque_Layer & (LAYER_BACK | LAYER_FRONT)) == LAYER_FRONT ) { layerInfo = board->GetLayerName( LAYER_N_FRONT ); diff --git a/pcbnew/class_pad.h b/pcbnew/class_pad.h index eee6c2c501..2c71e6e0b6 100644 --- a/pcbnew/class_pad.h +++ b/pcbnew/class_pad.h @@ -16,13 +16,13 @@ class Pcb3D_GLCanvas; SOLDERMASK_LAYER_CMP // PAD_CONN: -#define PAD_CONN_DEFAULT_LAYERS CMP_LAYER | SOLDERPASTE_LAYER_CMP | SOLDERMASK_LAYER_CMP +#define PAD_CONN_DEFAULT_LAYERS LAYER_FRONT | SOLDERPASTE_LAYER_CMP | SOLDERMASK_LAYER_CMP // PAD_SMD: -#define PAD_SMD_DEFAULT_LAYERS CMP_LAYER | SOLDERMASK_LAYER_CMP +#define PAD_SMD_DEFAULT_LAYERS LAYER_FRONT | SOLDERMASK_LAYER_CMP //PAD_HOLE_NOT_PLATED: -#define PAD_HOLE_NOT_PLATED_DEFAULT_LAYERS CUIVRE_LAYER | SILKSCREEN_LAYER_CMP | \ +#define PAD_HOLE_NOT_PLATED_DEFAULT_LAYERS LAYER_BACK | SILKSCREEN_LAYER_CMP | \ SOLDERMASK_LAYER_CU | SOLDERMASK_LAYER_CMP diff --git a/pcbnew/class_pad_draw_functions.cpp b/pcbnew/class_pad_draw_functions.cpp index e157884f0c..03aa320dae 100644 --- a/pcbnew/class_pad_draw_functions.cpp +++ b/pcbnew/class_pad_draw_functions.cpp @@ -48,10 +48,10 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, fillpad = 0; #endif - if( m_Masque_Layer & CMP_LAYER ) + if( m_Masque_Layer & LAYER_FRONT ) color = g_PadCMPColor; - if( m_Masque_Layer & CUIVRE_LAYER ) + if( m_Masque_Layer & LAYER_BACK ) color |= g_PadCUColor; if( color == 0 ) /* Not on copper layer */ @@ -133,9 +133,9 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, // or the current layer is one of said 2 external copper layers, // then highlight only the current layer. if( ( ( 1 << routeTop ) | ( 1 << routeBot ) ) - == ( CUIVRE_LAYER | CMP_LAYER ) + == ( LAYER_BACK | LAYER_FRONT ) || ( ( 1 << screen->m_Active_Layer ) - & ( CUIVRE_LAYER | CMP_LAYER ) ) ) + & ( LAYER_BACK | LAYER_FRONT ) ) ) { if( !IsOnLayer( screen->m_Active_Layer ) ) { @@ -431,11 +431,11 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, dx0 = MIN( dx0, dy0 ); int nc_color = BLUE; - if( m_Masque_Layer & CMP_LAYER ) /* Draw \ */ + if( m_Masque_Layer & LAYER_FRONT ) /* Draw \ */ GRLine( &panel->m_ClipBox, DC, cx0 - dx0, cy0 - dx0, cx0 + dx0, cy0 + dx0, 0, nc_color ); - if( m_Masque_Layer & CUIVRE_LAYER ) /* Draw / */ + if( m_Masque_Layer & LAYER_BACK ) /* Draw / */ GRLine( &panel->m_ClipBox, DC, cx0 + dx0, cy0 - dx0, cx0 - dx0, cy0 + dx0, 0, nc_color ); } diff --git a/pcbnew/class_track.h b/pcbnew/class_track.h index 72af5a702a..59ce3c3daa 100644 --- a/pcbnew/class_track.h +++ b/pcbnew/class_track.h @@ -194,7 +194,7 @@ public: * Function ReturnMaskLayer * returns a "layer mask", which is a bitmap of all layers on which the * TRACK segment or SEGVIA physically resides. - * @return int - a layer mask, see pcbstruct.h's CUIVRE_LAYER, etc. + * @return int - a layer mask, see pcbstruct.h's LAYER_BACK, etc. */ int ReturnMaskLayer(); diff --git a/pcbnew/dialog_SVG_print.cpp b/pcbnew/dialog_SVG_print.cpp index 4b381ba476..59286d7373 100644 --- a/pcbnew/dialog_SVG_print.cpp +++ b/pcbnew/dialog_SVG_print.cpp @@ -30,7 +30,7 @@ static int s_PrintPenMinWidth = 1; static bool s_Print_Frame_Ref = true; static int s_PlotBlackAndWhite = 0; -static long s_SelectedLayers = CUIVRE_LAYER | CMP_LAYER | +static long s_SelectedLayers = LAYER_BACK | LAYER_FRONT | SILKSCREEN_LAYER_CMP | SILKSCREEN_LAYER_CU; class DIALOG_SVG_PRINT : public DIALOG_SVG_PRINT_base diff --git a/pcbnew/dialog_layers_setup.cpp b/pcbnew/dialog_layers_setup.cpp index 2680e03564..7070825d64 100644 --- a/pcbnew/dialog_layers_setup.cpp +++ b/pcbnew/dialog_layers_setup.cpp @@ -175,19 +175,19 @@ static const int presets[] = 0, // shift the array index up by one, matches with "Custom". // "Two layers, parts on Front only" - EDGE_LAYER | CMP_LAYER | CUIVRE_LAYER | FRONT_AUX, + EDGE_LAYER | LAYER_FRONT | LAYER_BACK | FRONT_AUX, // "Two layers, parts on Back only", - EDGE_LAYER | CMP_LAYER | CUIVRE_LAYER | BACK_AUX, + EDGE_LAYER | LAYER_FRONT | LAYER_BACK | BACK_AUX, // "Two layers, parts on Front and Back", - EDGE_LAYER | CMP_LAYER | CUIVRE_LAYER | BACK_AUX | FRONT_AUX, + EDGE_LAYER | LAYER_FRONT | LAYER_BACK | BACK_AUX | FRONT_AUX, // "Four layers, parts on Front only" - EDGE_LAYER | CMP_LAYER | CUIVRE_LAYER | LAYER_2 | LAYER_3 | FRONT_AUX, + EDGE_LAYER | LAYER_FRONT | LAYER_BACK | LAYER_2 | LAYER_3 | FRONT_AUX, // "Four layers, parts on Front and Back" - EDGE_LAYER | CMP_LAYER | CUIVRE_LAYER | LAYER_2 | LAYER_3 | FRONT_AUX | BACK_AUX, + EDGE_LAYER | LAYER_FRONT | LAYER_BACK | LAYER_2 | LAYER_3 | FRONT_AUX | BACK_AUX, // "All layers on", ALL_LAYERS, diff --git a/pcbnew/dialog_pad_properties.cpp b/pcbnew/dialog_pad_properties.cpp index bbf3f9c50a..04a9a36cf9 100644 --- a/pcbnew/dialog_pad_properties.cpp +++ b/pcbnew/dialog_pad_properties.cpp @@ -381,8 +381,8 @@ void DIALOG_PAD_PROPERTIES::SetPadLayersList( long layer_mask ) * @param layer_mask = pad layer mask (ORed layers bit mask) */ { - m_PadLayerCu->SetValue( ( layer_mask & CUIVRE_LAYER ) ); - m_PadLayerCmp->SetValue( ( layer_mask & CMP_LAYER ) ); + m_PadLayerCu->SetValue( ( layer_mask & LAYER_BACK ) ); + m_PadLayerCmp->SetValue( ( layer_mask & LAYER_FRONT ) ); m_PadLayerAdhCmp->SetValue( ( layer_mask & ADHESIVE_LAYER_CMP ) ); m_PadLayerAdhCu->SetValue( ( layer_mask & ADHESIVE_LAYER_CU ) ); @@ -488,10 +488,10 @@ void DIALOG_PAD_PROPERTIES::PadPropertiesAccept( wxCommandEvent& event ) PadLayerMask = 0; if( m_PadLayerCu->GetValue() ) - PadLayerMask |= CUIVRE_LAYER; + PadLayerMask |= LAYER_BACK; if( m_PadLayerCmp->GetValue() ) - PadLayerMask |= CMP_LAYER; - if( ( PadLayerMask & (CUIVRE_LAYER | CMP_LAYER) ) == (CUIVRE_LAYER | CMP_LAYER) ) + PadLayerMask |= LAYER_FRONT; + if( ( PadLayerMask & (LAYER_BACK | LAYER_FRONT) ) == (LAYER_BACK | LAYER_FRONT) ) PadLayerMask |= ALL_CU_LAYERS; if( m_PadLayerAdhCmp->GetValue() ) PadLayerMask |= ADHESIVE_LAYER_CMP; diff --git a/pcbnew/export_gencad.cpp b/pcbnew/export_gencad.cpp index 2d9eda86af..7905263185 100644 --- a/pcbnew/export_gencad.cpp +++ b/pcbnew/export_gencad.cpp @@ -351,14 +351,14 @@ void CreateShapesSection( FILE* file, BOARD* pcb ) for( pad = module->m_Pads; pad != NULL; pad = pad->Next() ) { layer = "ALL"; - if( ( pad->m_Masque_Layer & ALL_CU_LAYERS ) == CUIVRE_LAYER ) + if( ( pad->m_Masque_Layer & ALL_CU_LAYERS ) == LAYER_BACK ) { if( module->GetLayer() == LAYER_N_FRONT ) layer = "BOTTOM"; else layer = "TOP"; } - else if( ( pad->m_Masque_Layer & ALL_CU_LAYERS ) == CMP_LAYER ) + else if( ( pad->m_Masque_Layer & ALL_CU_LAYERS ) == LAYER_FRONT ) { if( module->GetLayer() == LAYER_N_FRONT ) layer = "TOP"; diff --git a/pcbnew/gen_modules_placefile.cpp b/pcbnew/gen_modules_placefile.cpp index a7e948c1e9..79437e7178 100644 --- a/pcbnew/gen_modules_placefile.cpp +++ b/pcbnew/gen_modules_placefile.cpp @@ -434,9 +434,9 @@ void WinEDA_PcbFrame::GenModuleReport( wxCommandEvent& event ) fputs( line, rptfile ); int layer = 0; - if( pad->m_Masque_Layer & CUIVRE_LAYER ) + if( pad->m_Masque_Layer & LAYER_BACK ) layer = 1; - if( pad->m_Masque_Layer & CMP_LAYER ) + if( pad->m_Masque_Layer & LAYER_FRONT ) layer |= 2; const char* layer_name[4] = { "??? ", "copper", "component", "all" }; sprintf( line, "Layer %s\n", layer_name[layer] ); diff --git a/pcbnew/gpcb_exchange.cpp b/pcbnew/gpcb_exchange.cpp index 998cfc86a9..6da446ab3c 100644 --- a/pcbnew/gpcb_exchange.cpp +++ b/pcbnew/gpcb_exchange.cpp @@ -317,12 +317,12 @@ bool MODULE::Read_GPCB_Descr( const wxString& CmpFullFileName ) { // format: Pad [x1 y1 x2 y2 thickness clearance mask "name" "pad_number" flags] Pad = new D_PAD( this ); Pad->m_PadShape = PAD_RECT; - Pad->m_Masque_Layer = CMP_LAYER | SOLDERMASK_LAYER_CMP | SOLDERPASTE_LAYER_CMP; + Pad->m_Masque_Layer = LAYER_FRONT | SOLDERMASK_LAYER_CMP | SOLDERPASTE_LAYER_CMP; // Set shape from flags iflgidx = params.GetCount() - 2; if( TestFlags( params[iflgidx], 0x0080, wxT( "onsolder" ) ) ) - Pad->m_Masque_Layer = CUIVRE_LAYER | SOLDERMASK_LAYER_CU | SOLDERPASTE_LAYER_CU; + Pad->m_Masque_Layer = LAYER_BACK | SOLDERMASK_LAYER_CU | SOLDERPASTE_LAYER_CU; for( unsigned ii = 0; ii < 5; ii++ ) { diff --git a/pcbnew/muonde.cpp b/pcbnew/muonde.cpp index 898126a1d3..73c0a31528 100644 --- a/pcbnew/muonde.cpp +++ b/pcbnew/muonde.cpp @@ -595,7 +595,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveBasicShape( const wxString& name, pad->m_Pos = Module->m_Pos; pad->m_PadShape = PAD_RECT; pad->m_Attribut = PAD_SMD; - pad->m_Masque_Layer = CMP_LAYER; + pad->m_Masque_Layer = LAYER_FRONT; Line.Printf( wxT( "%d" ), pad_num ); pad->SetPadName( Line ); pad_num++; diff --git a/pcbnew/pcbplot.cpp b/pcbnew/pcbplot.cpp index 2073c70cf1..ba24e80a9d 100644 --- a/pcbnew/pcbplot.cpp +++ b/pcbnew/pcbplot.cpp @@ -43,7 +43,7 @@ PCB_Plot_Options::PCB_Plot_Options() PlotScaleOpt = 1; } -static long s_SelectedLayers = CUIVRE_LAYER | CMP_LAYER | +static long s_SelectedLayers = LAYER_BACK | LAYER_FRONT | SILKSCREEN_LAYER_CMP | SILKSCREEN_LAYER_CU; static bool s_PlotOriginIsAuxAxis = FALSE; diff --git a/pcbnew/plot_rtn.cpp b/pcbnew/plot_rtn.cpp index 3f9f941d8a..5ece551131 100644 --- a/pcbnew/plot_rtn.cpp +++ b/pcbnew/plot_rtn.cpp @@ -98,9 +98,9 @@ void WinEDA_BasePcbFrame::Plot_Serigraphie( PLOTTER* plotter, if( (pt_pad->m_Masque_Layer & masque_layer) == 0 /* Copper pads go on copper silk, component * pads go on component silk */ - && ( ( (pt_pad->m_Masque_Layer & CUIVRE_LAYER) == 0 ) + && ( ( (pt_pad->m_Masque_Layer & LAYER_BACK) == 0 ) || ( (masque_layer & SILKSCREEN_LAYER_CU) == 0 ) ) - && ( ( (pt_pad->m_Masque_Layer & CMP_LAYER) == 0 ) + && ( ( (pt_pad->m_Masque_Layer & LAYER_FRONT) == 0 ) || ( (masque_layer & SILKSCREEN_LAYER_CMP) == 0 ) ) ) { if( !g_pcb_plot_options.Plot_Pads_All_Layers ) @@ -921,9 +921,9 @@ void WinEDA_BasePcbFrame::Plot_Standard_Layer( PLOTTER* aPlotter, // is SOLDERMASK_LAYER_CU or SOLDERMASK_LAYER_CMP,vias are drawn, // if they are on an external copper layer int via_mask_layer = Via->ReturnMaskLayer(); - if( via_mask_layer & CUIVRE_LAYER ) + if( via_mask_layer & LAYER_BACK ) via_mask_layer |= SOLDERMASK_LAYER_CU; - if( via_mask_layer & CMP_LAYER ) + if( via_mask_layer & LAYER_FRONT ) via_mask_layer |= SOLDERMASK_LAYER_CMP; if( ( via_mask_layer & aLayerMask ) == 0 ) continue; diff --git a/pcbnew/tracepcb.cpp b/pcbnew/tracepcb.cpp index 0617a63f8b..982198afc5 100644 --- a/pcbnew/tracepcb.cpp +++ b/pcbnew/tracepcb.cpp @@ -161,14 +161,14 @@ void BOARD::Draw( WinEDA_DrawPanel* aPanel, wxDC* DC, { if( module->GetLayer() == LAYER_N_FRONT ) display = FALSE; - layerMask &= ~CMP_LAYER; + layerMask &= ~LAYER_FRONT; } if( !DisplayOpt.Show_Modules_Cu ) { if( module->GetLayer() == LAYER_N_BACK ) display = FALSE; - layerMask &= ~CUIVRE_LAYER; + layerMask &= ~LAYER_BACK; } if( display )