From 558c38b5c5a071aa8383d35742e2a6ff816fc8cf Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 23 Nov 2018 18:34:38 +0100 Subject: [PATCH] Very minor enhancement in plot dialog. Inside the layers listbox, the context menu can select all fabrication layers. The courtyard layers (only used for DRC) are now not selected. --- pcbnew/dialogs/dialog_plot.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pcbnew/dialogs/dialog_plot.cpp b/pcbnew/dialogs/dialog_plot.cpp index e43008cc6f..95504647b0 100644 --- a/pcbnew/dialogs/dialog_plot.cpp +++ b/pcbnew/dialogs/dialog_plot.cpp @@ -223,16 +223,19 @@ void DIALOG_PLOT::OnRightClick( wxMouseEvent& event ) #include void DIALOG_PLOT::OnPopUpLayers( wxCommandEvent& event ) { - unsigned int i; + // Build a list of layers for usual fabrication: + // copper layers + tech layers without courtyard + LSET fab_layer_set = ( LSET::AllCuMask() | LSET::AllTechMask() ) + & ~LSET( 2, B_CrtYd, F_CrtYd ); switch( event.GetId() ) { case ID_LAYER_FAB: // Select layers usually needed to build a board - for( i = 0; i < m_layerList.size(); i++ ) + for( unsigned i = 0; i < m_layerList.size(); i++ ) { LSET layermask( m_layerList[ i ] ); - if( ( layermask & ( LSET::AllCuMask() | LSET::AllTechMask() ) ).any() ) + if( ( layermask & fab_layer_set ).any() ) m_layerCheckListBox->Check( i, true ); else m_layerCheckListBox->Check( i, false ); @@ -240,7 +243,7 @@ void DIALOG_PLOT::OnPopUpLayers( wxCommandEvent& event ) break; case ID_SELECT_COPPER_LAYERS: - for( i = 0; i < m_layerList.size(); i++ ) + for( unsigned i = 0; i < m_layerList.size(); i++ ) { if( IsCopperLayer( m_layerList[i] ) ) m_layerCheckListBox->Check( i, true ); @@ -248,7 +251,7 @@ void DIALOG_PLOT::OnPopUpLayers( wxCommandEvent& event ) break; case ID_DESELECT_COPPER_LAYERS: - for( i = 0; i < m_layerList.size(); i++ ) + for( unsigned i = 0; i < m_layerList.size(); i++ ) { if( IsCopperLayer( m_layerList[i] ) ) m_layerCheckListBox->Check( i, false ); @@ -256,12 +259,12 @@ void DIALOG_PLOT::OnPopUpLayers( wxCommandEvent& event ) break; case ID_SELECT_ALL_LAYERS: - for( i = 0; i < m_layerList.size(); i++ ) + for( unsigned i = 0; i < m_layerList.size(); i++ ) m_layerCheckListBox->Check( i, true ); break; case ID_DESELECT_ALL_LAYERS: - for( i = 0; i < m_layerList.size(); i++ ) + for( unsigned i = 0; i < m_layerList.size(); i++ ) m_layerCheckListBox->Check( i, false ); break;