From 75a49281346c3ce30c25609b8af942ac663f5cfb Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 24 Aug 2018 21:08:30 +0100 Subject: [PATCH] Split edge.cuts and courtyard layer defaults. Fixes: lp:1788876 * https://bugs.launchpad.net/kicad/+bug/1788876 --- include/board_design_settings.h | 4 +- pcbnew/board_design_settings.cpp | 14 ++++++- .../dialog_global_edit_text_and_graphics.cpp | 41 ++++++++++--------- .../dialogs/panel_setup_text_and_graphics.cpp | 5 ++- .../panel_setup_text_and_graphics_base.cpp | 7 ++-- .../panel_setup_text_and_graphics_base.fbp | 4 +- pcbnew/footprint_editor_options.cpp | 7 +++- 7 files changed, 53 insertions(+), 29 deletions(-) diff --git a/include/board_design_settings.h b/include/board_design_settings.h index e2a9f4dbf7..77c2a21fa4 100644 --- a/include/board_design_settings.h +++ b/include/board_design_settings.h @@ -32,7 +32,8 @@ #define DEFAULT_SILK_LINE_WIDTH 0.12 #define DEFAULT_COPPER_LINE_WIDTH 0.20 -#define DEFAULT_EDGE_WIDTH 0.05 // used for Edge.Cuts and CrtYds +#define DEFAULT_EDGE_WIDTH 0.05 +#define DEFAULT_COURTYARD_WIDTH 0.05 #define DEFAULT_LINE_WIDTH 0.10 #define DEFAULT_SILK_TEXT_SIZE 1.0 @@ -152,6 +153,7 @@ enum LAYER_CLASS_SILK = 0, LAYER_CLASS_COPPER, LAYER_CLASS_EDGES, + LAYER_CLASS_COURTYARD, LAYER_CLASS_OTHERS, LAYER_CLASS_COUNT diff --git a/pcbnew/board_design_settings.cpp b/pcbnew/board_design_settings.cpp index 70734cac9f..d36f0b1a3e 100644 --- a/pcbnew/board_design_settings.cpp +++ b/pcbnew/board_design_settings.cpp @@ -432,6 +432,13 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS() : m_TextItalic[ LAYER_CLASS_EDGES ] = false; m_TextUpright[ LAYER_CLASS_EDGES ] = true; + m_LineThickness[ LAYER_CLASS_COURTYARD ] = Millimeter2iu( DEFAULT_COURTYARD_WIDTH ); + m_TextSize[ LAYER_CLASS_COURTYARD ] = wxSize( Millimeter2iu( DEFAULT_TEXT_SIZE ), + Millimeter2iu( DEFAULT_TEXT_SIZE ) ); + m_TextThickness[ LAYER_CLASS_COURTYARD ] = Millimeter2iu( DEFAULT_TEXT_WIDTH ); + m_TextItalic[ LAYER_CLASS_COURTYARD ] = false; + m_TextUpright[ LAYER_CLASS_COURTYARD ] = true; + m_LineThickness[ LAYER_CLASS_OTHERS ] = Millimeter2iu( DEFAULT_LINE_WIDTH ); m_TextSize[ LAYER_CLASS_OTHERS ] = wxSize( Millimeter2iu( DEFAULT_TEXT_SIZE ), Millimeter2iu( DEFAULT_TEXT_SIZE ) ); @@ -585,11 +592,16 @@ void BOARD_DESIGN_SETTINGS::AppendConfigs( BOARD* aBoard, PARAM_CFG_ARRAY* aResu aResult->push_back( new PARAM_CFG_BOOL( wxT( "CopperTextUpright" ), &m_TextUpright[ LAYER_CLASS_COPPER ], true ) ); - aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "EdgesAndCourtyardsLineWidth" ), + aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "EdgeCutLineWidth" ), &m_LineThickness[ LAYER_CLASS_EDGES ], Millimeter2iu( DEFAULT_SILK_LINE_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ), nullptr, MM_PER_IU, wxT( "BoardOutlineThickness" ) ) ); + aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "CourtyardLineWidth" ), + &m_LineThickness[ LAYER_CLASS_COURTYARD ], + Millimeter2iu( DEFAULT_SILK_LINE_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ), + nullptr, MM_PER_IU ) ); + aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "OthersLineWidth" ), &m_LineThickness[ LAYER_CLASS_OTHERS ], Millimeter2iu( DEFAULT_SILK_LINE_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ), diff --git a/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp b/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp index 4df2ca4f45..cd1fc91404 100644 --- a/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp +++ b/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp @@ -55,6 +55,7 @@ enum ROW_SILK, ROW_COPPER, ROW_EDGES, + ROW_COURTYARD, ROW_OTHERS }; @@ -144,7 +145,7 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataToWindow() m_Visible->Set3StateValue( wxCHK_UNDETERMINED ); m_LayerCtrl->SetLayerSelection( UNDEFINED_LAYER ); -#define SET_GRID_VALUE( aRow, aCol, aValue ) \ +#define SET_INT_VALUE( aRow, aCol, aValue ) \ m_grid->SetCellValue( aRow, aCol, StringFromValue( GetUserUnits(), aValue, true, true ) ) #define SET_BOOL_VALUE( aRow, aCol, aValue ) \ @@ -158,31 +159,33 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataToWindow() const BOARD_DESIGN_SETTINGS& bds = m_parent->GetBoard()->GetDesignSettings(); wxGridCellAttr* attr; - m_grid->SetCellValue( ROW_SILK, COL_CLASS_NAME, _( "Silk Layers" ) ); - m_grid->SetCellValue( ROW_COPPER, COL_CLASS_NAME, _( "Copper Layers" ) ); - m_grid->SetCellValue( ROW_EDGES, COL_CLASS_NAME, _( "Edges & Courtyards" ) ); - m_grid->SetCellValue( ROW_OTHERS, COL_CLASS_NAME, _( "Other Layers" ) ); + m_grid->SetCellValue( ROW_SILK, COL_CLASS_NAME, _( "Silk Layers" ) ); + m_grid->SetCellValue( ROW_COPPER, COL_CLASS_NAME, _( "Copper Layers" ) ); + m_grid->SetCellValue( ROW_EDGES, COL_CLASS_NAME, _( "Edge Cuts" ) ); + m_grid->SetCellValue( ROW_COURTYARD, COL_CLASS_NAME, _( "Courtyards" ) ); + m_grid->SetCellValue( ROW_OTHERS, COL_CLASS_NAME, _( "Other Layers" ) ); m_grid->SetCellValue( ROW_HEADER, COL_LINE_THICKNESS, _( "Line Thickness" ) ); - SET_GRID_VALUE( ROW_SILK, COL_LINE_THICKNESS, bds.m_LineThickness[ LAYER_CLASS_SILK ] ); - SET_GRID_VALUE( ROW_COPPER, COL_LINE_THICKNESS, bds.m_LineThickness[ LAYER_CLASS_COPPER ] ); - SET_GRID_VALUE( ROW_EDGES, COL_LINE_THICKNESS, bds.m_LineThickness[ LAYER_CLASS_EDGES ] ); - SET_GRID_VALUE( ROW_OTHERS, COL_LINE_THICKNESS, bds.m_LineThickness[ LAYER_CLASS_OTHERS ] ); + SET_INT_VALUE( ROW_SILK, COL_LINE_THICKNESS, bds.m_LineThickness[ LAYER_CLASS_SILK ] ); + SET_INT_VALUE( ROW_COPPER, COL_LINE_THICKNESS, bds.m_LineThickness[ LAYER_CLASS_COPPER ] ); + SET_INT_VALUE( ROW_EDGES, COL_LINE_THICKNESS, bds.m_LineThickness[ LAYER_CLASS_EDGES ] ); + SET_INT_VALUE( ROW_COURTYARD, COL_LINE_THICKNESS, bds.m_LineThickness[ LAYER_CLASS_COURTYARD ] ); + SET_INT_VALUE( ROW_OTHERS, COL_LINE_THICKNESS, bds.m_LineThickness[ LAYER_CLASS_OTHERS ] ); m_grid->SetCellValue( ROW_HEADER, COL_TEXT_WIDTH, _( "Text Width" ) ); - SET_GRID_VALUE( ROW_SILK, COL_TEXT_WIDTH, bds.m_TextSize[ LAYER_CLASS_SILK ].x ); - SET_GRID_VALUE( ROW_COPPER, COL_TEXT_WIDTH, bds.m_TextSize[ LAYER_CLASS_COPPER ].x ); - SET_GRID_VALUE( ROW_OTHERS, COL_TEXT_WIDTH, bds.m_TextSize[ LAYER_CLASS_OTHERS ].x ); + SET_INT_VALUE( ROW_SILK, COL_TEXT_WIDTH, bds.m_TextSize[ LAYER_CLASS_SILK ].x ); + SET_INT_VALUE( ROW_COPPER, COL_TEXT_WIDTH, bds.m_TextSize[ LAYER_CLASS_COPPER ].x ); + SET_INT_VALUE( ROW_OTHERS, COL_TEXT_WIDTH, bds.m_TextSize[ LAYER_CLASS_OTHERS ].x ); m_grid->SetCellValue( ROW_HEADER, COL_TEXT_HEIGHT, _( "Text Height" ) ); - SET_GRID_VALUE( ROW_SILK, COL_TEXT_HEIGHT, bds.m_TextSize[ LAYER_CLASS_SILK ].y ); - SET_GRID_VALUE( ROW_COPPER, COL_TEXT_HEIGHT, bds.m_TextSize[ LAYER_CLASS_COPPER ].y ); - SET_GRID_VALUE( ROW_OTHERS, COL_TEXT_HEIGHT, bds.m_TextSize[ LAYER_CLASS_OTHERS ].y ); + SET_INT_VALUE( ROW_SILK, COL_TEXT_HEIGHT, bds.m_TextSize[ LAYER_CLASS_SILK ].y ); + SET_INT_VALUE( ROW_COPPER, COL_TEXT_HEIGHT, bds.m_TextSize[ LAYER_CLASS_COPPER ].y ); + SET_INT_VALUE( ROW_OTHERS, COL_TEXT_HEIGHT, bds.m_TextSize[ LAYER_CLASS_OTHERS ].y ); m_grid->SetCellValue( ROW_HEADER, COL_TEXT_THICKNESS, _( "Text Thickness" ) ); - SET_GRID_VALUE( ROW_SILK, COL_TEXT_THICKNESS, bds.m_TextThickness[ LAYER_CLASS_SILK ] ); - SET_GRID_VALUE( ROW_COPPER, COL_TEXT_THICKNESS, bds.m_TextThickness[ LAYER_CLASS_COPPER ] ); - SET_GRID_VALUE( ROW_OTHERS, COL_TEXT_THICKNESS, bds.m_TextThickness[ LAYER_CLASS_OTHERS ] ); + SET_INT_VALUE( ROW_SILK, COL_TEXT_THICKNESS, bds.m_TextThickness[ LAYER_CLASS_SILK ] ); + SET_INT_VALUE( ROW_COPPER, COL_TEXT_THICKNESS, bds.m_TextThickness[ LAYER_CLASS_COPPER ] ); + SET_INT_VALUE( ROW_OTHERS, COL_TEXT_THICKNESS, bds.m_TextThickness[ LAYER_CLASS_OTHERS ] ); m_grid->SetCellValue( ROW_HEADER, COL_TEXT_ITALIC, _( "Italic" ) ); SET_BOOL_VALUE( ROW_SILK, COL_TEXT_ITALIC, bds.m_TextItalic[ LAYER_CLASS_SILK ] ); @@ -196,7 +199,7 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataToWindow() return true; -#undef SET_GRID_VALUE +#undef SET_INT_VALUE #undef SET_BOOL_VALUE } diff --git a/pcbnew/dialogs/panel_setup_text_and_graphics.cpp b/pcbnew/dialogs/panel_setup_text_and_graphics.cpp index 63e34b0937..b665464848 100644 --- a/pcbnew/dialogs/panel_setup_text_and_graphics.cpp +++ b/pcbnew/dialogs/panel_setup_text_and_graphics.cpp @@ -48,6 +48,7 @@ enum ROW_SILK = 0, ROW_COPPER, ROW_EDGES, + ROW_COURTYARD, ROW_OTHERS, ROW_COUNT @@ -94,7 +95,7 @@ bool PANEL_SETUP_TEXT_AND_GRAPHICS::TransferDataToWindow() { SET_MILS_CELL( i, COL_LINE_THICKNESS, m_BrdSettings->m_LineThickness[ i ] ); - if( i == ROW_EDGES ) + if( i == ROW_EDGES || i == ROW_COURTYARD ) { DISABLE_CELL( i, COL_TEXT_WIDTH ); DISABLE_CELL( i, COL_TEXT_HEIGHT ); @@ -167,7 +168,7 @@ bool PANEL_SETUP_TEXT_AND_GRAPHICS::TransferDataFromWindow() { m_BrdSettings->m_LineThickness[ i ] = getGridValue( i, COL_LINE_THICKNESS ); - if( i == ROW_EDGES ) // edges & courtyards only define line thickness + if( i == ROW_EDGES || i == ROW_COURTYARD ) continue; m_BrdSettings->m_TextSize[ i ] = diff --git a/pcbnew/dialogs/panel_setup_text_and_graphics_base.cpp b/pcbnew/dialogs/panel_setup_text_and_graphics_base.cpp index f32f6fc280..1cc762b73a 100644 --- a/pcbnew/dialogs/panel_setup_text_and_graphics_base.cpp +++ b/pcbnew/dialogs/panel_setup_text_and_graphics_base.cpp @@ -25,7 +25,7 @@ PANEL_SETUP_TEXT_AND_GRAPHICS_BASE::PANEL_SETUP_TEXT_AND_GRAPHICS_BASE( wxWindow m_grid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); // Grid - m_grid->CreateGrid( 4, 6 ); + m_grid->CreateGrid( 5, 6 ); m_grid->EnableEditing( true ); m_grid->EnableGridLines( true ); m_grid->EnableDragGridSize( false ); @@ -54,8 +54,9 @@ PANEL_SETUP_TEXT_AND_GRAPHICS_BASE::PANEL_SETUP_TEXT_AND_GRAPHICS_BASE( wxWindow m_grid->SetRowLabelSize( 132 ); m_grid->SetRowLabelValue( 0, _("Silk Layers") ); m_grid->SetRowLabelValue( 1, _("Copper Layers") ); - m_grid->SetRowLabelValue( 2, _("Edges & Courtyards") ); - m_grid->SetRowLabelValue( 3, _("Other Layers") ); + m_grid->SetRowLabelValue( 2, _("Edge Cuts") ); + m_grid->SetRowLabelValue( 3, _("Courtyards") ); + m_grid->SetRowLabelValue( 4, _("Other Layers") ); m_grid->SetRowLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTRE ); // Label Appearance diff --git a/pcbnew/dialogs/panel_setup_text_and_graphics_base.fbp b/pcbnew/dialogs/panel_setup_text_and_graphics_base.fbp index 8bb193a124..a7dea06e37 100644 --- a/pcbnew/dialogs/panel_setup_text_and_graphics_base.fbp +++ b/pcbnew/dialogs/panel_setup_text_and_graphics_base.fbp @@ -249,10 +249,10 @@ Resizable wxALIGN_LEFT 132 - "Silk Layers" "Copper Layers" "Edges & Courtyards" "Other Layers" + "Silk Layers" "Copper Layers" "Edge Cuts" "Courtyards" "Other Layers" wxALIGN_CENTRE - 4 + 5 1 WX_GRID; widgets/wx_grid.h; forward_declare diff --git a/pcbnew/footprint_editor_options.cpp b/pcbnew/footprint_editor_options.cpp index c60c2fc894..2dec427773 100644 --- a/pcbnew/footprint_editor_options.cpp +++ b/pcbnew/footprint_editor_options.cpp @@ -149,11 +149,16 @@ PARAM_CFG_ARRAY& FOOTPRINT_EDIT_FRAME::GetConfigurationSettings() m_configParams.push_back( new PARAM_CFG_BOOL( true, wxT( "FpEditorCopperTextItalic" ), &settings.m_TextItalic[ LAYER_CLASS_COPPER ] ) ); - m_configParams.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorEdgesAndCourtyardsLineWidth" ), + m_configParams.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorEdgeCutLineWidth" ), &settings.m_LineThickness[ LAYER_CLASS_EDGES ], Millimeter2iu( DEFAULT_SILK_LINE_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ), nullptr, MM_PER_IU ) ); + m_configParams.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorCourtyardLineWidth" ), + &settings.m_LineThickness[ LAYER_CLASS_COURTYARD ], + Millimeter2iu( DEFAULT_SILK_LINE_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ), + nullptr, MM_PER_IU ) ); + m_configParams.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorOthersLineWidth" ), &settings.m_LineThickness[ LAYER_CLASS_OTHERS ], Millimeter2iu( DEFAULT_SILK_LINE_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ),