From 085d80e3f3d919bb2f939667242a42e0b0d80efd Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 13 Mar 2020 09:53:44 +0000 Subject: [PATCH] Remove duplicated settings from preferences. These have now moved to project-specific settings. --- common/project.cpp | 2 +- .../dialog_global_edit_text_and_graphics.cpp | 6 +- .../dialogs/dialog_sch_import_settings.cpp | 3 + .../dialog_sch_import_settings_base.cpp | 9 + .../dialog_sch_import_settings_base.fbp | 192 +++++ .../dialogs/dialog_sch_import_settings_base.h | 3 + eeschema/dialogs/dialog_sch_sheet_props.cpp | 4 +- eeschema/dialogs/dialog_schematic_setup.cpp | 26 +- .../panel_eeschema_display_options.cpp | 53 +- .../dialogs/panel_eeschema_display_options.h | 4 - .../panel_eeschema_display_options_base.cpp | 64 -- .../panel_eeschema_display_options_base.fbp | 726 ------------------ .../panel_eeschema_display_options_base.h | 17 +- .../panel_eeschema_template_fieldnames.cpp | 9 + .../panel_eeschema_template_fieldnames.h | 2 + eeschema/dialogs/panel_setup_formatting.cpp | 8 +- eeschema/dialogs/panel_setup_formatting.h | 3 +- .../dialogs/panel_setup_formatting_base.cpp | 22 +- .../dialogs/panel_setup_formatting_base.fbp | 206 ++++- .../dialogs/panel_setup_formatting_base.h | 5 +- eeschema/eeschema_config.cpp | 149 ++-- eeschema/eeschema_config.h | 21 +- eeschema/sch_eagle_plugin.cpp | 10 +- eeschema/sch_edit_frame.h | 2 + eeschema/sch_junction.cpp | 5 +- eeschema/sch_junction.h | 7 +- eeschema/sch_legacy_plugin.cpp | 30 +- eeschema/sch_sheet.h | 14 - eeschema/sch_sheet_path.cpp | 38 +- eeschema/sch_sheet_path.h | 2 + eeschema/tools/sch_edit_tool.cpp | 15 +- eeschema/tools/sch_editor_control.cpp | 22 +- pcbnew/dialogs/dialog_update_pcb_base.fbp | 680 ++++++++-------- qa/eeschema/test_sch_sheet_path.cpp | 2 +- 34 files changed, 978 insertions(+), 1383 deletions(-) diff --git a/common/project.cpp b/common/project.cpp index cb62ea91f1..3234f1367b 100644 --- a/common/project.cpp +++ b/common/project.cpp @@ -378,7 +378,7 @@ void PROJECT::ConfigSave( const SEARCH_STACK& aSList, const wxString& aGroupName cfg->SetPath( wxT( "/" ) ); - // cfg is deleted here by std::unique_ptr, that saves the *.pro file to disk + cfg->Flush(); } diff --git a/eeschema/dialogs/dialog_global_edit_text_and_graphics.cpp b/eeschema/dialogs/dialog_global_edit_text_and_graphics.cpp index 49736a2271..1aec48a4b3 100644 --- a/eeschema/dialogs/dialog_global_edit_text_and_graphics.cpp +++ b/eeschema/dialogs/dialog_global_edit_text_and_graphics.cpp @@ -352,7 +352,11 @@ void DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem( const SCH_SHEET_PATH& aShe else if( m_sheetTitles->GetValue() && aItem->Type() == SCH_SHEET_T ) { if( !m_textSize.IsIndeterminate() ) - static_cast( aItem )->SetSheetNameSize( m_textSize.GetValue() ); + { + SCH_SHEET* sheet = static_cast( aItem ); + wxSize size( (int) m_textSize.GetValue(), (int) m_textSize.GetValue() ); + sheet->GetFields()[SHEETNAME].SetTextSize( size ); + } } else if( m_sheetPins->GetValue() && aItem->Type() == SCH_SHEET_PIN_T ) processItem( aSheetPath, aItem ); diff --git a/eeschema/dialogs/dialog_sch_import_settings.cpp b/eeschema/dialogs/dialog_sch_import_settings.cpp index e362d19a88..88a56f672d 100644 --- a/eeschema/dialogs/dialog_sch_import_settings.cpp +++ b/eeschema/dialogs/dialog_sch_import_settings.cpp @@ -81,5 +81,8 @@ bool DIALOG_SCH_IMPORT_SETTINGS::TransferDataFromWindow() void DIALOG_SCH_IMPORT_SETTINGS::OnSelectAll( wxCommandEvent& event ) { + m_formattingOpt->SetValue( true ); + m_fieldNameTemplatesOpt->SetValue( true ); + m_pinMapOpt->SetValue( true ); m_SeveritiesOpt->SetValue( true ); } diff --git a/eeschema/dialogs/dialog_sch_import_settings_base.cpp b/eeschema/dialogs/dialog_sch_import_settings_base.cpp index 4e9bdbbc0e..2081984c40 100644 --- a/eeschema/dialogs/dialog_sch_import_settings_base.cpp +++ b/eeschema/dialogs/dialog_sch_import_settings_base.cpp @@ -45,6 +45,15 @@ DIALOG_SCH_IMPORT_SETTINGS_BASE::DIALOG_SCH_IMPORT_SETTINGS_BASE( wxWindow* pare importLabel->Wrap( -1 ); bmiddleSizer->Add( importLabel, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 ); + m_formattingOpt = new wxCheckBox( this, wxID_ANY, _("Formatting preferences"), wxDefaultPosition, wxDefaultSize, 0 ); + bmiddleSizer->Add( m_formattingOpt, 0, wxALL, 5 ); + + m_fieldNameTemplatesOpt = new wxCheckBox( this, wxID_ANY, _("Field name templates"), wxDefaultPosition, wxDefaultSize, 0 ); + bmiddleSizer->Add( m_fieldNameTemplatesOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_pinMapOpt = new wxCheckBox( this, wxID_ANY, _("Pin Map"), wxDefaultPosition, wxDefaultSize, 0 ); + bmiddleSizer->Add( m_pinMapOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + m_SeveritiesOpt = new wxCheckBox( this, wxID_ANY, _("Violation severities"), wxDefaultPosition, wxDefaultSize, 0 ); bmiddleSizer->Add( m_SeveritiesOpt, 0, wxRIGHT|wxLEFT, 5 ); diff --git a/eeschema/dialogs/dialog_sch_import_settings_base.fbp b/eeschema/dialogs/dialog_sch_import_settings_base.fbp index 186901b758..5e601e42f6 100644 --- a/eeschema/dialogs/dialog_sch_import_settings_base.fbp +++ b/eeschema/dialogs/dialog_sch_import_settings_base.fbp @@ -337,6 +337,198 @@ -1 + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Formatting preferences + + 0 + + + 0 + + 1 + m_formattingOpt + 1 + + + public + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Field name templates + + 0 + + + 0 + + 1 + m_fieldNameTemplatesOpt + 1 + + + public + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Pin Map + + 0 + + + 0 + + 1 + m_pinMapOpt + 1 + + + public + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + 5 wxRIGHT|wxLEFT diff --git a/eeschema/dialogs/dialog_sch_import_settings_base.h b/eeschema/dialogs/dialog_sch_import_settings_base.h index 50af1ff09f..a4888d7d79 100644 --- a/eeschema/dialogs/dialog_sch_import_settings_base.h +++ b/eeschema/dialogs/dialog_sch_import_settings_base.h @@ -52,6 +52,9 @@ class DIALOG_SCH_IMPORT_SETTINGS_BASE : public DIALOG_SHIM public: + wxCheckBox* m_formattingOpt; + wxCheckBox* m_fieldNameTemplatesOpt; + wxCheckBox* m_pinMapOpt; wxCheckBox* m_SeveritiesOpt; DIALOG_SCH_IMPORT_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Import Settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); diff --git a/eeschema/dialogs/dialog_sch_sheet_props.cpp b/eeschema/dialogs/dialog_sch_sheet_props.cpp index b6ff2bbe7d..bea10a0bd3 100644 --- a/eeschema/dialogs/dialog_sch_sheet_props.cpp +++ b/eeschema/dialogs/dialog_sch_sheet_props.cpp @@ -412,8 +412,8 @@ bool DIALOG_SCH_SHEET_PROPS::TransferDataFromWindow() { // Create a temporary sheet for recursion testing to prevent a possible recursion error. std::unique_ptr< SCH_SHEET> tmpSheet( new SCH_SHEET ); - tmpSheet->SetName( m_fields->at( SHEETNAME ).GetText() ); - tmpSheet->SetFileName( nativeFileName.GetFullPath() ); + tmpSheet->GetFields()[SHEETNAME] = m_fields->at( SHEETNAME ); + tmpSheet->GetFields()[SHEETFILENAME].SetText( nativeFileName.GetFullPath() ); tmpSheet->SetScreen( useScreen ); // No need to check for valid library IDs if we are using an existing screen. diff --git a/eeschema/dialogs/dialog_schematic_setup.cpp b/eeschema/dialogs/dialog_schematic_setup.cpp index 065dbb29bf..8d3fc715cf 100644 --- a/eeschema/dialogs/dialog_schematic_setup.cpp +++ b/eeschema/dialogs/dialog_schematic_setup.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include "dialog_schematic_setup.h" #include "panel_eeschema_template_fieldnames.h" @@ -101,11 +102,34 @@ void DIALOG_SCHEMATIC_SETUP::OnAuxiliaryAction( wxCommandEvent& event ) cfg->SetExpandEnvVars( false ); cfg->SetPath( wxCONFIG_PATH_SEPARATOR ); + if( importDlg.m_formattingOpt->GetValue() ) + { + std::vector params; + m_frame->AddFormattingParameters( params ); + + wxConfigLoadParams( cfg, params, GROUP_SCH_EDIT ); + m_formatting->TransferDataToWindow(); + } + + if( importDlg.m_fieldNameTemplatesOpt->GetValue() ) + { + TEMPLATES templateMgr; + PARAM_CFG_FIELDNAMES param( &templateMgr ); + param.ReadParam( cfg ); + + m_fieldNameTemplates->ImportSettingsFrom( &templateMgr ); + } + + if( importDlg.m_pinMapOpt->GetValue() ) + { + // JEY TODO + } + if( importDlg.m_SeveritiesOpt->GetValue() ) { ERC_SETTINGS settings; settings.LoadDefaults(); - wxConfigLoadParams( cfg, settings.GetProjectFileParameters(), GROUP_SCH ); + wxConfigLoadParams( cfg, settings.GetProjectFileParameters(), GROUP_SCH_EDIT ); m_severities->ImportSettingsFrom( settings.m_Severities ); } diff --git a/eeschema/dialogs/panel_eeschema_display_options.cpp b/eeschema/dialogs/panel_eeschema_display_options.cpp index 64f8345fd7..b1fbe12508 100644 --- a/eeschema/dialogs/panel_eeschema_display_options.cpp +++ b/eeschema/dialogs/panel_eeschema_display_options.cpp @@ -23,8 +23,6 @@ */ #include -#include -#include #include #include #include @@ -36,10 +34,7 @@ PANEL_EESCHEMA_DISPLAY_OPTIONS::PANEL_EESCHEMA_DISPLAY_OPTIONS( SCH_EDIT_FRAME* aFrame, wxWindow* aWindow ) : PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( aWindow ), - m_frame( aFrame ), - m_busWidth( aFrame, m_busWidthLabel, m_busWidthCtrl, m_busWidthUnits, true ), - m_wireWidth( aFrame, m_wireWidthLabel, m_wireWidthCtrl, m_wireWidthUnits, true ), - m_junctionSize( aFrame, m_jctSizeLabel, m_jctSizeCtrl, m_jctSizeUnits, true ) + m_frame( aFrame ) { KIGFX::GAL_DISPLAY_OPTIONS& galOptions = m_frame->GetGalDisplayOptions(); m_galOptsPanel = new GAL_OPTIONS_PANEL( this, galOptions ); @@ -54,27 +49,6 @@ PANEL_EESCHEMA_DISPLAY_OPTIONS::PANEL_EESCHEMA_DISPLAY_OPTIONS( SCH_EDIT_FRAME* bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataToWindow() { - // Reference style one of: "A" ".A" "-A" "_A" ".1" "-1" "_1" - int refStyleSelection; - - switch( LIB_PART::GetSubpartIdSeparator() ) - { - default: - case 0: refStyleSelection = 0; break; - case '.': refStyleSelection = LIB_PART::GetSubpartFirstId() == '1' ? 4 : 1; break; - case '-': refStyleSelection = LIB_PART::GetSubpartFirstId() == '1' ? 5 : 2; break; - case '_': refStyleSelection = LIB_PART::GetSubpartFirstId() == '1' ? 6 : 3; break; - } - - m_choiceSeparatorRefId->SetSelection( refStyleSelection ); - - m_busWidth.SetUnits( EDA_UNITS::INCHES, true ); - m_wireWidth.SetUnits( EDA_UNITS::INCHES, true ); - m_junctionSize.SetUnits( EDA_UNITS::INCHES, true ); - - m_busWidth.SetValue( GetDefaultBusThickness() ); - m_wireWidth.SetValue( GetDefaultWireThickness() ); - m_junctionSize.SetValue( SCH_JUNCTION::GetSymbolSize() ); m_checkShowHiddenPins->SetValue( m_frame->GetShowAllPins() ); int superSubFlags = ENABLE_SUBSCRIPT_MARKUP | ENABLE_SUPERSCRIPT_MARKUP; @@ -96,31 +70,6 @@ bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataToWindow() bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataFromWindow() { - // Reference style one of: "A" ".A" "-A" "_A" ".1" "-1" "_1" - int firstRefId, refSeparator; - - switch( m_choiceSeparatorRefId->GetSelection() ) - { - default: - case 0: firstRefId = 'A'; refSeparator = 0; break; - case 1: firstRefId = 'A'; refSeparator = '.'; break; - case 2: firstRefId = 'A'; refSeparator = '-'; break; - case 3: firstRefId = 'A'; refSeparator = '_'; break; - case 4: firstRefId = '1'; refSeparator = '.'; break; - case 5: firstRefId = '1'; refSeparator = '-'; break; - case 6: firstRefId = '1'; refSeparator = '_'; break; - } - - if( refSeparator != LIB_PART::GetSubpartIdSeparator() || - firstRefId != LIB_PART::GetSubpartFirstId() ) - { - LIB_PART::SetSubpartIdNotation( refSeparator, firstRefId ); - m_frame->SaveProjectSettings(); - } - - SetDefaultBusThickness( m_busWidth.GetValue() ); - SetDefaultWireThickness( m_wireWidth.GetValue() ); - SCH_JUNCTION::SetSymbolSize( m_junctionSize.GetValue() ); m_frame->SetShowAllPins( m_checkShowHiddenPins->GetValue() ); m_frame->SetShowPageLimits( m_checkPageLimits->GetValue() ); SetSelectionTextAsBox( m_checkSelTextBox->GetValue() ); diff --git a/eeschema/dialogs/panel_eeschema_display_options.h b/eeschema/dialogs/panel_eeschema_display_options.h index d9d0409fba..b29402ac10 100644 --- a/eeschema/dialogs/panel_eeschema_display_options.h +++ b/eeschema/dialogs/panel_eeschema_display_options.h @@ -33,10 +33,6 @@ class PANEL_EESCHEMA_DISPLAY_OPTIONS : public PANEL_EESCHEMA_DISPLAY_OPTIONS_BAS GAL_OPTIONS_PANEL* m_galOptsPanel; - UNIT_BINDER m_busWidth; - UNIT_BINDER m_wireWidth; - UNIT_BINDER m_junctionSize; - public: PANEL_EESCHEMA_DISPLAY_OPTIONS( SCH_EDIT_FRAME* aFrame, wxWindow* aWindow ); diff --git a/eeschema/dialogs/panel_eeschema_display_options_base.cpp b/eeschema/dialogs/panel_eeschema_display_options_base.cpp index 9a05766d20..c8a5c6757e 100644 --- a/eeschema/dialogs/panel_eeschema_display_options_base.cpp +++ b/eeschema/dialogs/panel_eeschema_display_options_base.cpp @@ -22,73 +22,9 @@ PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( wxWind wxBoxSizer* bRightColumn; bRightColumn = new wxBoxSizer( wxVERTICAL ); - wxStaticBoxSizer* sbSizer2; - sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Dimensions") ), wxVERTICAL ); - - wxFlexGridSizer* fgSizer32; - fgSizer32 = new wxFlexGridSizer( 0, 3, 3, 0 ); - fgSizer32->AddGrowableCol( 1 ); - fgSizer32->SetFlexibleDirection( wxBOTH ); - fgSizer32->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_busWidthLabel = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("&Bus thickness:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_busWidthLabel->Wrap( -1 ); - fgSizer32->Add( m_busWidthLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - m_busWidthCtrl = new wxTextCtrl( sbSizer2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP ); - fgSizer32->Add( m_busWidthCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - - m_busWidthUnits = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); - m_busWidthUnits->Wrap( -1 ); - fgSizer32->Add( m_busWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - m_wireWidthLabel = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("&Wire thickness:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_wireWidthLabel->Wrap( -1 ); - fgSizer32->Add( m_wireWidthLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - m_wireWidthCtrl = new wxTextCtrl( sbSizer2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP ); - fgSizer32->Add( m_wireWidthCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - - m_wireWidthUnits = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); - m_wireWidthUnits->Wrap( -1 ); - fgSizer32->Add( m_wireWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - m_jctSizeLabel = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Junction size:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_jctSizeLabel->Wrap( -1 ); - fgSizer32->Add( m_jctSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - m_jctSizeCtrl = new wxTextCtrl( sbSizer2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer32->Add( m_jctSizeCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_jctSizeUnits = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); - m_jctSizeUnits->Wrap( -1 ); - fgSizer32->Add( m_jctSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - - sbSizer2->Add( fgSizer32, 0, wxBOTTOM|wxRIGHT|wxEXPAND, 5 ); - - - bRightColumn->Add( sbSizer2, 0, wxEXPAND|wxTOP, 5 ); - wxStaticBoxSizer* sbSizer1; sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Appearance") ), wxVERTICAL ); - wxBoxSizer* bSizer6; - bSizer6 = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText26 = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("Symbol unit notation:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText26->Wrap( -1 ); - bSizer6->Add( m_staticText26, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); - - wxString m_choiceSeparatorRefIdChoices[] = { _("A"), _(".A"), _("-A"), _("_A"), _(".1"), _("-1"), _("_1") }; - int m_choiceSeparatorRefIdNChoices = sizeof( m_choiceSeparatorRefIdChoices ) / sizeof( wxString ); - m_choiceSeparatorRefId = new wxChoice( sbSizer1->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceSeparatorRefIdNChoices, m_choiceSeparatorRefIdChoices, 0 ); - m_choiceSeparatorRefId->SetSelection( 0 ); - bSizer6->Add( m_choiceSeparatorRefId, 1, wxEXPAND|wxRIGHT, 5 ); - - - sbSizer1->Add( bSizer6, 0, wxEXPAND|wxBOTTOM|wxRIGHT, 5 ); - m_checkShowHiddenPins = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("S&how hidden pins"), wxDefaultPosition, wxDefaultSize, 0 ); sbSizer1->Add( m_checkShowHiddenPins, 0, wxEXPAND|wxALL, 5 ); diff --git a/eeschema/dialogs/panel_eeschema_display_options_base.fbp b/eeschema/dialogs/panel_eeschema_display_options_base.fbp index a7750c980f..cddd78082d 100644 --- a/eeschema/dialogs/panel_eeschema_display_options_base.fbp +++ b/eeschema/dialogs/panel_eeschema_display_options_base.fbp @@ -74,596 +74,6 @@ bRightColumn wxVERTICAL none - - 5 - wxEXPAND|wxTOP - 0 - - wxID_ANY - Dimensions - - sbSizer2 - wxVERTICAL - 1 - none - - 5 - wxBOTTOM|wxRIGHT|wxEXPAND - 0 - - 3 - wxBOTH - 1 - - 0 - -1,-1 - fgSizer32 - wxFLEX_GROWMODE_SPECIFIED - none - 0 - 3 - - 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Bus thickness: - 0 - - 0 - - - 0 - - 1 - m_busWidthLabel - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxEXPAND|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - - 1 - m_busWidthCtrl - 1 - - - protected - 1 - - Resizable - 1 - - wxSP_ARROW_KEYS|wxSP_WRAP - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mils - 0 - - 0 - - - 0 - - 1 - m_busWidthUnits - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Wire thickness: - 0 - - 0 - - - 0 - - 1 - m_wireWidthLabel - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxEXPAND|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - - 1 - m_wireWidthCtrl - 1 - - - protected - 1 - - Resizable - 1 - - wxSP_ARROW_KEYS|wxSP_WRAP - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mils - 0 - - 0 - - - 0 - - 1 - m_wireWidthUnits - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Junction size: - 0 - - 0 - - - 0 - - 1 - m_jctSizeLabel - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - - - -1 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - - 1 - m_jctSizeCtrl - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mils - 0 - - 0 - - - 0 - - 1 - m_jctSizeUnits - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - - - -1 - - - - - - 5 wxEXPAND|wxTOP @@ -676,142 +86,6 @@ wxVERTICAL 1 none - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT - 0 - - - bSizer6 - wxHORIZONTAL - none - - 5 - wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Symbol unit notation: - 0 - - 0 - - - 0 - - 1 - m_staticText26 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxEXPAND|wxRIGHT - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "A" ".A" "-A" "_A" ".1" "-1" "_1" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_choiceSeparatorRefId - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 wxEXPAND|wxALL diff --git a/eeschema/dialogs/panel_eeschema_display_options_base.h b/eeschema/dialogs/panel_eeschema_display_options_base.h index c956db5071..0dedc9a888 100644 --- a/eeschema/dialogs/panel_eeschema_display_options_base.h +++ b/eeschema/dialogs/panel_eeschema_display_options_base.h @@ -13,14 +13,12 @@ #include #include #include -#include +#include #include #include #include -#include #include -#include -#include +#include #include #include @@ -35,17 +33,6 @@ class PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE : public wxPanel protected: wxBoxSizer* m_galOptionsSizer; - wxStaticText* m_busWidthLabel; - wxTextCtrl* m_busWidthCtrl; - wxStaticText* m_busWidthUnits; - wxStaticText* m_wireWidthLabel; - wxTextCtrl* m_wireWidthCtrl; - wxStaticText* m_wireWidthUnits; - wxStaticText* m_jctSizeLabel; - wxTextCtrl* m_jctSizeCtrl; - wxStaticText* m_jctSizeUnits; - wxStaticText* m_staticText26; - wxChoice* m_choiceSeparatorRefId; wxCheckBox* m_checkShowHiddenPins; wxCheckBox* m_checkSuperSub; wxCheckBox* m_checkPageLimits; diff --git a/eeschema/dialogs/panel_eeschema_template_fieldnames.cpp b/eeschema/dialogs/panel_eeschema_template_fieldnames.cpp index 284281b297..cf4e12c8e8 100644 --- a/eeschema/dialogs/panel_eeschema_template_fieldnames.cpp +++ b/eeschema/dialogs/panel_eeschema_template_fieldnames.cpp @@ -187,3 +187,12 @@ void PANEL_EESCHEMA_TEMPLATE_FIELDNAMES::OnSizeGrid( wxSizeEvent& event ) event.Skip(); } + + +void PANEL_EESCHEMA_TEMPLATE_FIELDNAMES::ImportSettingsFrom( TEMPLATES* templateMgr ) +{ + m_fields = templateMgr->GetTemplateFieldNames( m_global ); + TransferDataToGrid(); +} + + diff --git a/eeschema/dialogs/panel_eeschema_template_fieldnames.h b/eeschema/dialogs/panel_eeschema_template_fieldnames.h index aac3635ccb..c5330efe73 100644 --- a/eeschema/dialogs/panel_eeschema_template_fieldnames.h +++ b/eeschema/dialogs/panel_eeschema_template_fieldnames.h @@ -61,6 +61,8 @@ public: PANEL_EESCHEMA_TEMPLATE_FIELDNAMES( SCH_EDIT_FRAME* aFrame, wxWindow* aWindow, bool aGlobal ); ~PANEL_EESCHEMA_TEMPLATE_FIELDNAMES() override; + void ImportSettingsFrom( TEMPLATES* templateMgr ); + private: void AdjustGridColumns( int aWidth ); diff --git a/eeschema/dialogs/panel_setup_formatting.cpp b/eeschema/dialogs/panel_setup_formatting.cpp index 24efded116..e36ae58621 100644 --- a/eeschema/dialogs/panel_setup_formatting.cpp +++ b/eeschema/dialogs/panel_setup_formatting.cpp @@ -31,6 +31,7 @@ PANEL_SETUP_FORMATTING::PANEL_SETUP_FORMATTING( wxWindow* aWindow, SCH_EDIT_FRAME* aFrame ) : PANEL_SETUP_FORMATTING_BASE( aWindow ), m_frame( aFrame ), + m_textSize( aFrame, m_textSizeLabel, m_textSizeCtrl, m_textSizeUnits, true ), m_busWidth( aFrame, m_busWidthLabel, m_busWidthCtrl, m_busWidthUnits, true ), m_wireWidth( aFrame, m_wireWidthLabel, m_wireWidthCtrl, m_wireWidthUnits, true ), m_junctionSize( aFrame, m_jctSizeLabel, m_jctSizeCtrl, m_jctSizeUnits, true ) @@ -57,13 +58,15 @@ bool PANEL_SETUP_FORMATTING::TransferDataToWindow() m_choiceSeparatorRefId->SetSelection( refStyleSelection ); + m_textSize.SetUnits( EDA_UNITS::INCHES, true ); m_busWidth.SetUnits( EDA_UNITS::INCHES, true ); m_wireWidth.SetUnits( EDA_UNITS::INCHES, true ); m_junctionSize.SetUnits( EDA_UNITS::INCHES, true ); + m_textSize.SetValue( GetDefaultTextSize() ); m_busWidth.SetValue( GetDefaultBusThickness() ); m_wireWidth.SetValue( GetDefaultWireThickness() ); - m_junctionSize.SetValue( SCH_JUNCTION::GetSymbolSize() ); + m_junctionSize.SetValue( SCH_JUNCTION::g_SymbolSize ); int superSubFlags = ENABLE_SUBSCRIPT_MARKUP | ENABLE_SUPERSCRIPT_MARKUP; m_checkSuperSub->SetValue( GetTextMarkupFlags() & superSubFlags ); @@ -96,9 +99,10 @@ bool PANEL_SETUP_FORMATTING::TransferDataFromWindow() m_frame->SaveProjectSettings(); } + SetDefaultTextSize( m_textSize.GetValue() ); SetDefaultBusThickness( m_busWidth.GetValue() ); SetDefaultWireThickness( m_wireWidth.GetValue() ); - SCH_JUNCTION::SetSymbolSize( m_junctionSize.GetValue() ); + SCH_JUNCTION::g_SymbolSize = m_junctionSize.GetValue(); int superSubFlags = ENABLE_SUBSCRIPT_MARKUP | ENABLE_SUPERSCRIPT_MARKUP; diff --git a/eeschema/dialogs/panel_setup_formatting.h b/eeschema/dialogs/panel_setup_formatting.h index d361e19aa0..76ac48f916 100644 --- a/eeschema/dialogs/panel_setup_formatting.h +++ b/eeschema/dialogs/panel_setup_formatting.h @@ -31,6 +31,8 @@ class PANEL_SETUP_FORMATTING : public PANEL_SETUP_FORMATTING_BASE { SCH_EDIT_FRAME* m_frame; + UNIT_BINDER m_textSize; + UNIT_BINDER m_busWidth; UNIT_BINDER m_wireWidth; UNIT_BINDER m_junctionSize; @@ -38,7 +40,6 @@ class PANEL_SETUP_FORMATTING : public PANEL_SETUP_FORMATTING_BASE public: PANEL_SETUP_FORMATTING( wxWindow* aWindow, SCH_EDIT_FRAME* aFrame ); -private: bool TransferDataToWindow() override; bool TransferDataFromWindow() override; }; diff --git a/eeschema/dialogs/panel_setup_formatting_base.cpp b/eeschema/dialogs/panel_setup_formatting_base.cpp index 5b3e436eb8..6163034c5c 100644 --- a/eeschema/dialogs/panel_setup_formatting_base.cpp +++ b/eeschema/dialogs/panel_setup_formatting_base.cpp @@ -42,10 +42,30 @@ PANEL_SETUP_FORMATTING_BASE::PANEL_SETUP_FORMATTING_BASE( wxWindow* parent, wxWi wxStaticBoxSizer* sbSizer4; sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Text") ), wxVERTICAL ); + wxFlexGridSizer* fgSizer2; + fgSizer2 = new wxFlexGridSizer( 0, 3, 0, 0 ); + fgSizer2->AddGrowableCol( 1 ); + fgSizer2->SetFlexibleDirection( wxBOTH ); + fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_textSizeLabel = new wxStaticText( sbSizer4->GetStaticBox(), wxID_ANY, _("Default text size:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_textSizeLabel->Wrap( -1 ); + fgSizer2->Add( m_textSizeLabel, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_textSizeCtrl = new wxTextCtrl( sbSizer4->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer2->Add( m_textSizeCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + + m_textSizeUnits = new wxStaticText( sbSizer4->GetStaticBox(), wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); + m_textSizeUnits->Wrap( -1 ); + fgSizer2->Add( m_textSizeUnits, 0, wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + + sbSizer4->Add( fgSizer2, 1, wxEXPAND|wxBOTTOM, 5 ); + m_checkSuperSub = new wxCheckBox( sbSizer4->GetStaticBox(), wxID_ANY, _("Enable superscript/subscript markup"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkSuperSub->SetToolTip( _("Use '^' for superscript and '#' for subscript") ); - sbSizer4->Add( m_checkSuperSub, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + sbSizer4->Add( m_checkSuperSub, 0, wxEXPAND|wxALL, 5 ); m_superSubHint = new wxStaticText( sbSizer4->GetStaticBox(), wxID_ANY, _("(preceed superscript text with ^; subscript text with #)"), wxDefaultPosition, wxDefaultSize, 0 ); m_superSubHint->Wrap( -1 ); diff --git a/eeschema/dialogs/panel_setup_formatting_base.fbp b/eeschema/dialogs/panel_setup_formatting_base.fbp index 8c0a5eefe6..9ddc0818de 100644 --- a/eeschema/dialogs/panel_setup_formatting_base.fbp +++ b/eeschema/dialogs/panel_setup_formatting_base.fbp @@ -227,7 +227,211 @@ none 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + wxEXPAND|wxBOTTOM + 1 + + 3 + wxBOTH + 1 + + 0 + + fgSizer2 + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 0 + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Default text size: + 0 + + 0 + + + 0 + + 1 + m_textSizeLabel + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_textSizeCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 5 + wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mils + 0 + + 0 + + + 0 + + 1 + m_textSizeUnits + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + + + 5 + wxEXPAND|wxALL 0 1 diff --git a/eeschema/dialogs/panel_setup_formatting_base.h b/eeschema/dialogs/panel_setup_formatting_base.h index 38e33a04ff..01c6f6b9b5 100644 --- a/eeschema/dialogs/panel_setup_formatting_base.h +++ b/eeschema/dialogs/panel_setup_formatting_base.h @@ -19,8 +19,8 @@ #include #include #include -#include #include +#include #include /////////////////////////////////////////////////////////////////////////// @@ -35,6 +35,9 @@ class PANEL_SETUP_FORMATTING_BASE : public wxPanel protected: wxStaticText* m_staticText26; wxChoice* m_choiceSeparatorRefId; + wxStaticText* m_textSizeLabel; + wxTextCtrl* m_textSizeCtrl; + wxStaticText* m_textSizeUnits; wxCheckBox* m_checkSuperSub; wxStaticText* m_superSubHint; wxStaticText* m_busWidthLabel; diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index 55058417ba..e0fd81e3bd 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -68,56 +68,49 @@ static int s_selectThickness = Mils2iu( DEFAULTSELECTIONTHICKNESS ); #define FieldNameTemplatesKey wxT( "FieldNameTemplates" ) -class PARAM_CFG_FIELDNAMES : public PARAM_CFG +PARAM_CFG_FIELDNAMES::PARAM_CFG_FIELDNAMES( TEMPLATES * ptparam, const wxChar* group ) : + PARAM_CFG( wxEmptyString, PARAM_SEVERITIES, group ) { -protected: - TEMPLATES * m_Pt_param; ///< Pointer to the parameter value + m_Pt_param = ptparam; +} -public: - PARAM_CFG_FIELDNAMES( TEMPLATES * ptparam, const wxChar* group = nullptr ) : - PARAM_CFG( wxEmptyString, PARAM_SEVERITIES, group ) +void PARAM_CFG_FIELDNAMES::ReadParam( wxConfigBase* aConfig ) const +{ + if( !m_Pt_param || !aConfig ) + return; + + wxString templateFieldNames = aConfig->Read( FieldNameTemplatesKey, wxEmptyString ); + + if( !templateFieldNames.IsEmpty() ) { - m_Pt_param = ptparam; - } + TEMPLATE_FIELDNAMES_LEXER lexer( TO_UTF8( templateFieldNames ) ); - void ReadParam( wxConfigBase* aConfig ) const override - { - if( !m_Pt_param || !aConfig ) - return; - - wxString templateFieldNames = aConfig->Read( FieldNameTemplatesKey, wxEmptyString ); - - if( !templateFieldNames.IsEmpty() ) + try { - TEMPLATE_FIELDNAMES_LEXER lexer( TO_UTF8( templateFieldNames ) ); - - try - { - m_Pt_param->Parse( &lexer, false ); - } - catch( const IO_ERROR& DBG( e ) ) - { - // @todo show error msg - DBG( printf( "templatefieldnames parsing error: '%s'\n", TO_UTF8( e.What() ) ); ) - } + m_Pt_param->Parse( &lexer, false ); + } + catch( const IO_ERROR& DBG( e ) ) + { + // @todo show error msg + DBG( printf( "templatefieldnames parsing error: '%s'\n", TO_UTF8( e.What() ) ); ) } } +} - void SaveParam( wxConfigBase* aConfig ) const override - { - if( !m_Pt_param || !aConfig ) - return; +void PARAM_CFG_FIELDNAMES::SaveParam( wxConfigBase* aConfig ) const +{ + if( !m_Pt_param || !aConfig ) + return; - STRING_FORMATTER sf; - m_Pt_param->Format( &sf, 0, false ); + STRING_FORMATTER sf; + m_Pt_param->Format( &sf, 0, false ); - wxString record = FROM_UTF8( sf.GetString().c_str() ); - record.Replace( wxT("\n"), wxT(""), true ); // strip all newlines - record.Replace( wxT(" "), wxT(" "), true ); // double space to single + wxString record = FROM_UTF8( sf.GetString().c_str() ); + record.Replace( wxT("\n"), wxT(""), true ); // strip all newlines + record.Replace( wxT(" "), wxT(" "), true ); // double space to single - aConfig->Write( FieldNameTemplatesKey, record ); - } -}; + aConfig->Write( FieldNameTemplatesKey, record ); +} class PARAM_CFG_SEVERITIES : public PARAM_CFG @@ -356,12 +349,41 @@ void SCH_EDIT_FRAME::InstallPreferences( PAGED_DIALOG* aParent, } -std::vector& SCH_EDIT_FRAME::GetProjectFileParameters() - +void SCH_EDIT_FRAME::AddFormattingParameters( std::vector& params ) { - // JEY TODO: everything in here which has a GUI needs to move from Preferences to - // Schematic Setup Dialog... + EESCHEMA_SETTINGS* appSettings = dynamic_cast( Kiface().KifaceSettings() ); + params.push_back( new PARAM_CFG_INT( wxT( "SubpartIdSeparator" ), + LIB_PART::SubpartIdSeparatorPtr(), 0, 0, 126 ) ); + params.push_back( new PARAM_CFG_INT( wxT( "SubpartFirstId" ), + LIB_PART::SubpartFirstIdPtr(), 'A', '1', 'z' ) ); + + params.push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "LabSize" ), + &s_defaultTextSize, + Mils2iu( DEFAULT_SIZE_TEXT ), + 5, 1000, nullptr, 1 / IU_PER_MILS ) ); + params.push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "LineThickness" ), + &s_drawDefaultLineThickness, + Mils2iu( appSettings->m_Drawing.default_line_thickness ), + 5, 1000, nullptr, 1 / IU_PER_MILS ) ); + + params.push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "BusThickness" ), + &s_defaultBusThickness, + Mils2iu( appSettings->m_Drawing.default_bus_thickness ), + 5, 1000, nullptr, 1 / IU_PER_MILS ) ); + params.push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "WireThickness" ), + &s_defaultWireThickness, + Mils2iu( appSettings->m_Drawing.default_wire_thickness ), + 5, 1000, nullptr, 1 / IU_PER_MILS ) ); + params.push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "JunctionSize" ), + &SCH_JUNCTION::g_SymbolSize, + Mils2iu( appSettings->m_Drawing.default_junction_size ), + 5, 1000, nullptr, 1 / IU_PER_MILS ) ); +} + + +std::vector& SCH_EDIT_FRAME::GetProjectFileParameters() +{ if( !m_projectFileParams.empty() ) return m_projectFileParams; @@ -373,20 +395,15 @@ std::vector& SCH_EDIT_FRAME::GetProjectFileParameters() params.push_back( new PARAM_CFG_FILENAME( wxT( "PlotDirectoryName" ), &m_plotDirectoryName ) ); - params.push_back( new PARAM_CFG_INT( wxT( "SubpartIdSeparator" ), - LIB_PART::SubpartIdSeparatorPtr(), 0, 0, 126 ) ); - params.push_back( new PARAM_CFG_INT( wxT( "SubpartFirstId" ), - LIB_PART::SubpartFirstIdPtr(), 'A', '1', 'z' ) ); - params.push_back( new PARAM_CFG_WXSTRING( wxT( "NetFmtName" ), &m_netListFormat) ); params.push_back( new PARAM_CFG_BOOL( wxT( "SpiceAjustPassiveValues" ), &m_spiceAjustPassiveValues, false ) ); - params.push_back( new PARAM_CFG_INT( wxT( "LabSize" ), - &s_defaultTextSize, DEFAULT_SIZE_TEXT, 5, 1000 ) ); + AddFormattingParameters( params ); params.push_back( new PARAM_CFG_FIELDNAMES( &m_templateFieldNames ) ); + params.push_back( new PARAM_CFG_SEVERITIES( &m_ercSettings ) ); return params; @@ -405,14 +422,8 @@ std::vector ERC_SETTINGS::GetProjectFileParameters() bool SCH_EDIT_FRAME::LoadProjectFile() { - // Read library list and library path list - bool ret = Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH, GetProjectFileParameters() ); - - // Read schematic editor setup - ret &= Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH_EDIT, GetProjectFileParameters() ); - - // Convert default text size to internal units. - SetDefaultTextSize( Mils2iu( GetDefaultTextSize() ) ); + bool ret = Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH_EDIT, + GetProjectFileParameters() ); // Verify some values, because the config file can be edited by hand, // and have bad values: @@ -462,12 +473,7 @@ void SCH_EDIT_FRAME::SaveProjectSettings() wxString path = fn.GetFullPath(); - // Convert default text size from internal units temporarily. - SetDefaultTextSize( Iu2Mils( GetDefaultTextSize() ) ); - prj.ConfigSave( Kiface().KifaceSearch(), GROUP_SCH_EDIT, GetProjectFileParameters(), path ); - - SetDefaultTextSize( Mils2iu( GetDefaultTextSize() ) ); } @@ -480,24 +486,11 @@ void SCH_EDIT_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg ) m_repeatStep.x = Mils2iu( cfg->m_Drawing.default_repeat_offset_x ); m_repeatStep.y = Mils2iu( cfg->m_Drawing.default_repeat_offset_y ); - // LibEdit owns this one, but we must read it in if LibEdit hasn't set it yet - if( GetDefaultLineThickness() < 0 ) - SetDefaultLineThickness( Mils2iu( cfg->m_Drawing.default_line_thickness ) ); - - SetDefaultBusThickness( Mils2iu( cfg->m_Drawing.default_bus_thickness ) ); - - // Property introduced in 6.0; use DefaultLineWidth for earlier projects - SetDefaultWireThickness( Mils2iu( cfg->m_Drawing.default_wire_thickness) ); - SetSelectionTextAsBox( cfg->m_Selection.text_as_box ); SetSelectionDrawChildItems( cfg->m_Selection.draw_selected_children ); SetSelectionFillShapes( cfg->m_Selection.fill_shapes ); SetSelectionThickness( Mils2iu( cfg->m_Selection.thickness ) ); - SetTextMarkupFlags( cfg->m_Drawing.text_markup_flags ); - - SCH_JUNCTION::SetSymbolSize( Mils2iu( cfg->m_Drawing.default_junction_size ) ); - m_footprintPreview = cfg->m_Appearance.footprint_preview; m_navigatorStaysOpen = cfg->m_Appearance.navigator_stays_open; m_showAllPins = cfg->m_Appearance.show_hidden_pins; @@ -557,12 +550,8 @@ void SCH_EDIT_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg ) cfg->m_AutoplaceFields.allow_rejustify = m_autoplaceJustify; cfg->m_AutoplaceFields.align_to_grid = m_autoplaceAlign; - cfg->m_Drawing.default_bus_thickness = Iu2Mils( GetDefaultBusThickness() ); - cfg->m_Drawing.default_line_thickness = Iu2Mils( GetDefaultLineThickness() ); - cfg->m_Drawing.default_junction_size = Iu2Mils( SCH_JUNCTION::GetSymbolSize() ); cfg->m_Drawing.default_repeat_offset_x = Iu2Mils( m_repeatStep.x ); cfg->m_Drawing.default_repeat_offset_y = Iu2Mils( m_repeatStep.y ); - cfg->m_Drawing.default_wire_thickness = Iu2Mils( GetDefaultWireThickness() ); cfg->m_Drawing.hv_lines_only = GetForceHVLines(); cfg->m_Drawing.repeat_label_increment = m_repeatDeltaLabel; cfg->m_Drawing.text_markup_flags = GetTextMarkupFlags(); diff --git a/eeschema/eeschema_config.h b/eeschema/eeschema_config.h index 31090f353a..8b6e5a2405 100644 --- a/eeschema/eeschema_config.h +++ b/eeschema/eeschema_config.h @@ -17,10 +17,6 @@ * with this program. If not, see . */ -/** - * @file eeschema_config.h - */ - #ifndef EESCHEMA_CONFIG_H #define EESCHEMA_CONFIG_H @@ -33,4 +29,21 @@ extern const wxChar AutoplaceAlignEntry[]; extern const wxChar LibIconScaleEntry[]; extern const wxChar SchIconScaleEntry[]; +class TEMPLATES; + + +class PARAM_CFG_FIELDNAMES : public PARAM_CFG +{ +protected: + TEMPLATES* m_Pt_param; ///< Pointer to the parameter value + +public: + PARAM_CFG_FIELDNAMES( TEMPLATES* ptparam, const wxChar* group = nullptr ); + + void ReadParam( wxConfigBase* aConfig ) const override; + void SaveParam( wxConfigBase* aConfig ) const override; +}; + + + #endif // EESCHEMA_CONFIG_H diff --git a/eeschema/sch_eagle_plugin.cpp b/eeschema/sch_eagle_plugin.cpp index 9df839adeb..b363d7b25b 100644 --- a/eeschema/sch_eagle_plugin.cpp +++ b/eeschema/sch_eagle_plugin.cpp @@ -686,26 +686,28 @@ void SCH_EAGLE_PLUGIN::loadSheet( wxXmlNode* aSheetNode, int aSheetIndex ) wxString des; std::string filename; + SCH_FIELD& sheetNameField = m_currentSheet->GetFields()[SHEETNAME]; + SCH_FIELD& filenameField = m_currentSheet->GetFields()[SHEETFILENAME]; if( descriptionNode ) { des = descriptionNode->GetContent(); des.Replace( "\n", "_", true ); - m_currentSheet->SetName( des ); + sheetNameField.SetText( des ); filename = des.ToStdString(); } else { filename = wxString::Format( "%s_%d", m_filename.GetName(), aSheetIndex ); - m_currentSheet->SetName( filename ); + sheetNameField.SetText( filename ); } ReplaceIllegalFileNameChars( &filename ); replace( filename.begin(), filename.end(), ' ', '_' ); wxString fn = wxString( filename + ".sch" ); - m_currentSheet->SetFileName( fn ); - wxFileName fileName = m_currentSheet->GetFileName(); + filenameField.SetText( fn ); + wxFileName fileName( fn ); m_currentSheet->GetScreen()->SetFileName( fileName.GetFullPath() ); // Loop through all busses diff --git a/eeschema/sch_edit_frame.h b/eeschema/sch_edit_frame.h index 9dede208e6..b93e37feef 100644 --- a/eeschema/sch_edit_frame.h +++ b/eeschema/sch_edit_frame.h @@ -246,6 +246,8 @@ public: const wxString& GetPlotDirectoryName() const { return m_plotDirectoryName; } void SetPlotDirectoryName( const wxString& aDirName ) { m_plotDirectoryName = aDirName; } + void AddFormattingParameters( std::vector& params ); + /** * Return the project file parameter list for Eeschema. * diff --git a/eeschema/sch_junction.cpp b/eeschema/sch_junction.cpp index 3270c5e137..395c038147 100644 --- a/eeschema/sch_junction.cpp +++ b/eeschema/sch_junction.cpp @@ -32,7 +32,6 @@ #include #include #include -#include #include #include @@ -42,12 +41,12 @@ #include -int SCH_JUNCTION::m_symbolSize = Mils2iu( 40 ); // Default diameter of the junction symbol +int SCH_JUNCTION::g_SymbolSize = Mils2iu( 40 ); // Default diameter of the junction symbol int SCH_JUNCTION::GetEffectiveSymbolSize() { - return std::max( GetDefaultLineThickness(), m_symbolSize ); + return std::max( GetDefaultLineThickness(), g_SymbolSize ); } diff --git a/eeschema/sch_junction.h b/eeschema/sch_junction.h index 86631ad707..f8f1a50934 100644 --- a/eeschema/sch_junction.h +++ b/eeschema/sch_junction.h @@ -32,7 +32,9 @@ class NETLIST_OBJECT_LIST; class SCH_JUNCTION : public SCH_ITEM { wxPoint m_pos; // Position of the junction. - static int m_symbolSize; // diameter of the junction graphic symbol + +public: + static int g_SymbolSize; // diameter of the junction graphic symbol public: SCH_JUNCTION( const wxPoint& pos = wxPoint( 0, 0 ) ); @@ -51,9 +53,6 @@ public: return wxT( "SCH_JUNCTION" ); } - static int GetSymbolSize() { return m_symbolSize; } - static void SetSymbolSize( int aSize ) { m_symbolSize = aSize; } - // Return the size the symbol should be drawn at. This is GetSymbolSize() clamped to be // no less than the current wire width. static int GetEffectiveSymbolSize(); diff --git a/eeschema/sch_legacy_plugin.cpp b/eeschema/sch_legacy_plugin.cpp index bdd5c6efb5..1836221258 100644 --- a/eeschema/sch_legacy_plugin.cpp +++ b/eeschema/sch_legacy_plugin.cpp @@ -1006,16 +1006,9 @@ SCH_SHEET* SCH_LEGACY_PLUGIN::loadSheet( LINE_READER& aReader ) parseQuotedString( text, aReader, line, &line ); size = Mils2Iu( parseInt( aReader, line, &line ) ); - if( fieldId == 0 ) - { - sheet->SetName( text ); - sheet->SetSheetNameSize( size ); - } - else - { - sheet->SetFileName( text ); - sheet->SetFileNameSize( size ); - } + SCH_FIELD& field = sheet->GetFields()[ fieldId ]; + field.SetText( text ); + field.SetTextSize( wxSize( size, size ) ); } else // Sheet pin. { @@ -2184,15 +2177,18 @@ void SCH_LEGACY_PLUGIN::saveSheet( SCH_SHEET* aSheet ) m_out->Print( 0, "U %8.8X\n", aSheet->m_Uuid.AsLegacyTimestamp() ); - if( !aSheet->GetName().IsEmpty() ) - m_out->Print( 0, "F0 %s %d\n", - EscapedUTF8( aSheet->GetName() ).c_str(), - Iu2Mils( aSheet->GetSheetNameSize() ) ); + SCH_FIELD& sheetName = aSheet->GetFields()[SHEETNAME]; + SCH_FIELD& fileName = aSheet->GetFields()[SHEETFILENAME]; - if( !aSheet->GetFileName().IsEmpty() ) + if( !sheetName.GetText().IsEmpty() ) + m_out->Print( 0, "F0 %s %d\n", + EscapedUTF8( sheetName.GetText() ).c_str(), + Iu2Mils( sheetName.GetTextSize().x ) ); + + if( !fileName.GetText().IsEmpty() ) m_out->Print( 0, "F1 %s %d\n", - EscapedUTF8( aSheet->GetFileName() ).c_str(), - Iu2Mils( aSheet->GetFileNameSize() ) ); + EscapedUTF8( fileName.GetText() ).c_str(), + Iu2Mils( fileName.GetTextSize().x ) ); for( const SCH_SHEET_PIN* pin : aSheet->GetPins() ) { diff --git a/eeschema/sch_sheet.h b/eeschema/sch_sheet.h index b9e75480fd..050dab1ff9 100644 --- a/eeschema/sch_sheet.h +++ b/eeschema/sch_sheet.h @@ -277,21 +277,7 @@ public: m_fields = aFields; // vector copying, length is changed possibly } - // JEY TODO: retite these once new dialog is implemented... wxString GetName() const { return m_fields[ SHEETNAME ].GetText(); } - void SetName( const wxString& aName ) { m_fields[ SHEETNAME ].SetText( aName ); } - - bool GetShowSheetName() const { return m_fields[ SHEETNAME ].IsVisible(); } - void SetShowSheetName( bool show ) { m_fields[ SHEETNAME ].SetVisible( show ); } - - int GetSheetNameSize() const { return m_fields[ SHEETNAME ].GetTextSize().x; } - void SetSheetNameSize( int aSize ) { m_fields[ SHEETNAME ].SetTextSize( wxSize( aSize, aSize ) ); } - - bool GetShowFileName() const { return m_fields[ SHEETFILENAME ].IsVisible(); } - void SetShowFileName( bool show ) { m_fields[ SHEETFILENAME ].SetVisible( show ); } - - int GetFileNameSize() const { return m_fields[ SHEETFILENAME ].GetTextSize().x; } - void SetFileNameSize( int aSize ) { m_fields[ SHEETFILENAME ].SetTextSize( wxSize( aSize, aSize ) ); } SCH_SCREEN* GetScreen() { return m_screen; } diff --git a/eeschema/sch_sheet_path.cpp b/eeschema/sch_sheet_path.cpp index 66d4efa6e9..01f529d9db 100644 --- a/eeschema/sch_sheet_path.cpp +++ b/eeschema/sch_sheet_path.cpp @@ -372,11 +372,23 @@ void SCH_SHEET_LIST::BuildSheetList( SCH_SHEET* aSheet ) } +bool SCH_SHEET_LIST::NameExists( const wxString& aSheetName ) +{ + for( const SCH_SHEET_PATH& sheet : *this ) + { + if( sheet.Last()->GetName() == aSheetName ) + return true; + } + + return false; +} + + bool SCH_SHEET_LIST::IsModified() { - for( SCH_SHEET_PATHS_ITER it = begin(); it != end(); ++it ) + for( const SCH_SHEET_PATH& sheet : *this ) { - if( (*it).LastScreen() && (*it).LastScreen()->IsModify() ) + if( sheet.LastScreen() && sheet.LastScreen()->IsModify() ) return true; } @@ -386,10 +398,10 @@ bool SCH_SHEET_LIST::IsModified() void SCH_SHEET_LIST::ClearModifyStatus() { - for( SCH_SHEET_PATHS_ITER it = begin(); it != end(); ++it ) + for( const SCH_SHEET_PATH& sheet : *this ) { - if( (*it).LastScreen() ) - (*it).LastScreen()->ClrModify(); + if( sheet.LastScreen() ) + sheet.LastScreen()->ClrModify(); } } @@ -403,11 +415,9 @@ void SCH_SHEET_LIST::AnnotatePowerSymbols() SCH_MULTI_UNIT_REFERENCE_MAP lockedComponents; // Build the list of power components: - for( SCH_SHEET_PATHS_ITER it = begin(); it != end(); ++it ) + for( SCH_SHEET_PATH& sheet : *this ) { - SCH_SHEET_PATH& spath = *it; - - for( auto item : spath.LastScreen()->Items().OfType( SCH_COMPONENT_T ) ) + for( auto item : sheet.LastScreen()->Items().OfType( SCH_COMPONENT_T ) ) { auto component = static_cast( item ); LIB_PART* part = component->GetPartRef().get(); @@ -417,7 +427,7 @@ void SCH_SHEET_LIST::AnnotatePowerSymbols() if( part ) { - SCH_REFERENCE schReference( component, part, spath ); + SCH_REFERENCE schReference( component, part, sheet ); references.AddItem( schReference ); } } @@ -472,8 +482,8 @@ void SCH_SHEET_LIST::AnnotatePowerSymbols() void SCH_SHEET_LIST::GetComponents( SCH_REFERENCE_LIST& aReferences, bool aIncludePowerSymbols, bool aForceIncludeOrphanComponents ) { - for( SCH_SHEET_PATHS_ITER it = begin(); it != end(); ++it ) - (*it).GetComponents( aReferences, aIncludePowerSymbols, aForceIncludeOrphanComponents ); + for( SCH_SHEET_PATH& sheet : *this ) + sheet.GetComponents( aReferences, aIncludePowerSymbols, aForceIncludeOrphanComponents ); } void SCH_SHEET_LIST::GetMultiUnitComponents( SCH_MULTI_UNIT_REFERENCE_MAP &aRefList, @@ -503,8 +513,8 @@ bool SCH_SHEET_LIST::SetComponentFootprint( const wxString& aReference, { bool found = false; - for( SCH_SHEET_PATHS_ITER it = begin(); it != end(); ++it ) - found = (*it).SetComponentFootprint( aReference, aFootPrint, aSetVisible ); + for( SCH_SHEET_PATH& sheet : *this ) + found = sheet.SetComponentFootprint( aReference, aFootPrint, aSetVisible ); return found; } diff --git a/eeschema/sch_sheet_path.h b/eeschema/sch_sheet_path.h index db9e08d796..bcb26278e0 100644 --- a/eeschema/sch_sheet_path.h +++ b/eeschema/sch_sheet_path.h @@ -431,6 +431,8 @@ public: * @throw std::bad_alloc if the memory for the sheet path list could not be allocated. */ void BuildSheetList( SCH_SHEET* aSheet ); + + bool NameExists( const wxString& aSheetName ); }; #endif // CLASS_DRAWSHEET_PATH_H diff --git a/eeschema/tools/sch_edit_tool.cpp b/eeschema/tools/sch_edit_tool.cpp index f26592382b..fbb42c195e 100644 --- a/eeschema/tools/sch_edit_tool.cpp +++ b/eeschema/tools/sch_edit_tool.cpp @@ -787,9 +787,18 @@ int SCH_EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent ) case SCH_SHEET_T: { - SCH_SHEET* sheet = (SCH_SHEET*) newItem; - // Duplicate sheet names are not valid. Generate a UUID-based sheet name. - sheet->SetName( wxString::Format( wxT( "Sheet%s" ), sheet->m_Uuid.AsString() ) ); + SCH_SHEET_LIST hierarchy( g_RootSheet ); + SCH_SHEET* sheet = (SCH_SHEET*) newItem; + SCH_FIELD& nameField = sheet->GetFields()[SHEETNAME]; + wxString baseName = nameField.GetText(); + wxString candidateName = baseName; + int uniquifier = 1; + + while( hierarchy.NameExists( candidateName ) ) + candidateName = wxString::Format( wxT( "%s%d" ), baseName, uniquifier++ ); + + nameField.SetText( candidateName ); + sheet->SetParent( m_frame->GetScreen() ); m_frame->AddToScreen( sheet ); diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 408de54e12..95a6323878 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -998,18 +998,6 @@ int SCH_EDITOR_CONTROL::Copy( const TOOL_EVENT& aEvent ) } -bool sheetNameExists( const SCH_SHEET_LIST& hierarchy, const wxString& aName ) -{ - for( const SCH_SHEET_PATH& sheet : hierarchy ) - { - if( sheet.Last()->GetName() == aName ) - return true; - } - - return false; -} - - int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent ) { wxTextEntry* textEntry = dynamic_cast( wxWindow::FindFocus() ); @@ -1145,16 +1133,18 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent ) if( item->Type() == SCH_SHEET_T ) { SCH_SHEET* sheet = (SCH_SHEET*) item; + SCH_FIELD& nameField = sheet->GetFields()[SHEETNAME]; wxFileName fn = sheet->GetFileName(); SCH_SCREEN* existingScreen = nullptr; bool dropSheetAnnotations = false; - wxString sheetName = sheet->GetName(); + wxString baseName = nameField.GetText(); + wxString candidateName = baseName; int uniquifier = 1; - while( sheetNameExists( hierarchy, sheetName ) ) - sheetName = sheet->GetName() << uniquifier++; + while( hierarchy.NameExists( candidateName ) ) + candidateName = wxString::Format( wxT( "%s%d" ), baseName, uniquifier++ ); - sheet->SetName( sheetName ); + nameField.SetText( candidateName ); sheet->SetParent( g_CurrentSheet->Last() ); sheet->SetScreen( nullptr ); diff --git a/pcbnew/dialogs/dialog_update_pcb_base.fbp b/pcbnew/dialogs/dialog_update_pcb_base.fbp index 1c21a2000b..10a023f949 100644 --- a/pcbnew/dialogs/dialog_update_pcb_base.fbp +++ b/pcbnew/dialogs/dialog_update_pcb_base.fbp @@ -67,73 +67,6 @@ bUpperSizer wxVERTICAL none - - 5 - wxALIGN_TOP|wxEXPAND|wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Update footprint references to match any changed symbol references" "Update footprint associations by existing references" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Match Method - 1 - - 0 - - - 0 - - 1 - m_matchByTimestamp - 1 - - - protected - 1 - - Resizable - 0 - 1 - - wxRA_SPECIFY_COLS - - 0 - The first option uses the existing links between symbols and their footprints to update the footprints based on changes made to their symbols. The second option uses the symbol and footprint references to establish a new set of links between symbols and footprints, and then updates the footprints accordingly. - - wxFILTER_NONE - wxDefaultValidator - - - - - OnMatchChanged - - 5 wxEXPAND|wxTOP|wxRIGHT|wxLEFT @@ -148,291 +81,336 @@ none 5 - wxEXPAND - 1 - - - wxBOTH - - - 0 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Re-link footprints to schematic symbols based on their current references + + 0 + + + 0 - gbSizer1 - wxFLEX_GROWMODE_SPECIFIED - none - 2 - - 5 - 2 - 0 - wxALL - 0 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Replace footprints of symbols whose footprint assignments have changed - - 0 - - - 0 - - 1 - m_cbUpdateFootprints - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - Normally footprints on the board should be changed to match footprint assignment changes made in the schematic. Uncheck this only if you don't want to change existing footprints on the board. - - wxFILTER_NONE - wxDefaultValidator - - - - - OnOptionChanged - - - - 5 - 1 - 0 - wxBOTTOM|wxRIGHT|wxLEFT - 1 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Delete footprints with no associated symbol - - 0 - - - 0 - - 1 - m_cbDeleteExtraFootprints - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - Remove from the board not locked footprints, if they are not attached to a schematic symbol. - - wxFILTER_NONE - wxDefaultValidator - - - - - OnOptionChanged - - - - 5 - 1 - 1 - wxBOTTOM|wxRIGHT|wxLEFT - 1 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Delete nets containing only a single pad - - 0 - - - 0 - - 1 - m_cbDeleteSinglePadNets - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - Clear the net name of pads when there is only one pad belonging to this net. - - wxFILTER_NONE - wxDefaultValidator - - - - - OnOptionChanged - - - - 5 - 1 - 0 - wxBOTTOM|wxRIGHT|wxLEFT - 2 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Warn for no net pads - - 0 - - - 0 - - 1 - m_cbWarnNoNetPad - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Display a warning if a pad in a footprint does not appear in netlist. Only pads on a copper layer and having a name are tested. - - wxFILTER_NONE - wxDefaultValidator - - - - - OnOptionChanged - - + 1 + m_checkBox5 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Delete footprints with no linked symbol + + 0 + + + 0 + + 1 + m_cbDeleteExtraFootprints + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + Remove from the board not locked footprints, if they are not attached to a schematic symbol. + + wxFILTER_NONE + wxDefaultValidator + + + + + OnOptionChanged + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Update footprints to footprint specified in linked schematic symbol + + 0 + + + 0 + + 1 + m_cbUpdateFootprints + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + Normally footprints on the board should be changed to match footprint assignment changes made in the schematic. Uncheck this only if you don't want to change existing footprints on the board. + + wxFILTER_NONE + wxDefaultValidator + + + + + OnOptionChanged + + + + 5 + wxEXPAND|wxTOP + 1 + + 0 + protected + 0 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Delete nets containing only a single pad + + 0 + + + 0 + + 1 + m_cbDeleteSinglePadNets + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + Clear the net name of pads when there is only one pad belonging to this net. + + wxFILTER_NONE + wxDefaultValidator + + + + + OnOptionChanged + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Generate warnings for pads with no nets + + 0 + + + 0 + + 1 + m_cbWarnNoNetPad + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + Display a warning if a pad in a footprint does not appear in netlist. Only pads on a copper layer and having a name are tested. + + wxFILTER_NONE + wxDefaultValidator + + + + + OnOptionChanged diff --git a/qa/eeschema/test_sch_sheet_path.cpp b/qa/eeschema/test_sch_sheet_path.cpp index cf1ba00781..dbfd8ac6b4 100644 --- a/qa/eeschema/test_sch_sheet_path.cpp +++ b/qa/eeschema/test_sch_sheet_path.cpp @@ -48,7 +48,7 @@ public: std::ostringstream ss; ss << "Sheet" << i; - m_sheets[i].SetName( ss.str() ); + m_sheets[i].GetFields()[SHEETNAME].SetText( ss.str() ); } // 0->1->2