From bb06e672e7f042cb32680b3861d27675cef0152d Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 30 Jan 2020 09:22:21 +0100 Subject: [PATCH] DIALOG_UPDATE_FROM_PCB: fix incorrect wording of an option. Shared sheets can create issues in a complex hierarchy. This is not related to sharing sheets between projects. (Sharing sheets between projects is not supported by Kicad) --- eeschema/dialogs/dialog_update_from_pcb.cpp | 10 +- .../dialogs/dialog_update_from_pcb_base.cpp | 139 +++++++++--------- .../dialogs/dialog_update_from_pcb_base.fbp | 27 ++-- .../dialogs/dialog_update_from_pcb_base.h | 39 +++-- 4 files changed, 99 insertions(+), 116 deletions(-) diff --git a/eeschema/dialogs/dialog_update_from_pcb.cpp b/eeschema/dialogs/dialog_update_from_pcb.cpp index c1efb9e48c..55008b5fd2 100644 --- a/eeschema/dialogs/dialog_update_from_pcb.cpp +++ b/eeschema/dialogs/dialog_update_from_pcb.cpp @@ -59,11 +59,11 @@ DIALOG_UPDATE_FROM_PCB::DIALOG_UPDATE_FROM_PCB( SCH_EDIT_FRAME* aParent ) // We use a sdbSizer to get platform-dependent ordering of the action buttons, but // that requires us to correct the button labels here. - m_sdbSizer1OK->SetLabel( _( "Update Schematic" ) ); - m_sdbSizer1Cancel->SetLabel( _( "Close" ) ); - m_sdbSizer1->Layout(); + m_sdbSizerOK->SetLabel( _( "Update Schematic" ) ); + m_sdbSizerCancel->SetLabel( _( "Close" ) ); + m_sdbSizer->Layout(); - m_sdbSizer1OK->SetDefault(); + m_sdbSizerOK->SetDefault(); FinishDialogSettings(); } @@ -83,7 +83,7 @@ void DIALOG_UPDATE_FROM_PCB::updateData() if( backAnno.FetchNetlistFromPCB( netlist ) ) successfulRun = backAnno.BackAnnotateSymbols( netlist ); - m_sdbSizer1OK->Enable( successfulRun ); + m_sdbSizerOK->Enable( successfulRun ); m_messagePanel->Flush( false ); } diff --git a/eeschema/dialogs/dialog_update_from_pcb_base.cpp b/eeschema/dialogs/dialog_update_from_pcb_base.cpp index 3eb94ccb6b..d5fdc7f30f 100644 --- a/eeschema/dialogs/dialog_update_from_pcb_base.cpp +++ b/eeschema/dialogs/dialog_update_from_pcb_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Sep 1 2019) +// C++ code generated with wxFormBuilder (version Jul 10 2019) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -13,98 +13,91 @@ DIALOG_UPDATE_FROM_PCB_BASE::DIALOG_UPDATE_FROM_PCB_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) { - this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize ); + this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize ); - wxBoxSizer* bMainSizer; - bMainSizer = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* bMainSizer; + bMainSizer = new wxBoxSizer( wxVERTICAL ); - wxBoxSizer* bUpperSizer; - bUpperSizer = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* bUpperSizer; + bUpperSizer = new wxBoxSizer( wxVERTICAL ); - wxStaticBoxSizer* sbSizer1; - sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options") ), wxVERTICAL ); + wxStaticBoxSizer* sbSizerOptions; + sbSizerOptions = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options") ), wxVERTICAL ); - wxBoxSizer* bSizer1; - bSizer1 = new wxBoxSizer( wxVERTICAL ); + wxGridBagSizer* gbSizerOpts; + gbSizerOpts = new wxGridBagSizer( 0, 0 ); + gbSizerOpts->SetFlexibleDirection( wxBOTH ); + gbSizerOpts->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_ALL ); + + m_cbUpdateReferences = new wxCheckBox( sbSizerOptions->GetStaticBox(), wxID_ANY, _("Update references"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbUpdateReferences->SetValue(true); + m_cbUpdateReferences->SetToolTip( _("Update references of symbols that have been changed in the PCB editor.") ); + + gbSizerOpts->Add( m_cbUpdateReferences, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 ); + + m_cbUpdateFootprints = new wxCheckBox( sbSizerOptions->GetStaticBox(), wxID_ANY, _("Update footprints"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbUpdateFootprints->SetToolTip( _("Update footprint associations of symbols whose footprints have been replaced with different footprints in PCB.") ); + + gbSizerOpts->Add( m_cbUpdateFootprints, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 ); + + m_cbUpdateValues = new wxCheckBox( sbSizerOptions->GetStaticBox(), wxID_ANY, _("Update values"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbUpdateValues->SetToolTip( _("Update symbols values that have been replaced in the PCB editor.") ); + + gbSizerOpts->Add( m_cbUpdateValues, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 ); + + m_cbIgnoreOtherProjects = new wxCheckBox( sbSizerOptions->GetStaticBox(), wxID_ANY, _("Ignore errors in shared schematic sheets"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbIgnoreOtherProjects->SetToolTip( _("Shared schematic sheets used in complex hierarchies have constraints. They are not always compatible with back annotation when updating footprints and values . \nIf this option is selected, errors generated by sharing will be disabled.") ); + + gbSizerOpts->Add( m_cbIgnoreOtherProjects, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); - sbSizer1->Add( bSizer1, 1, wxEXPAND, 5 ); - - wxGridBagSizer* gbSizer2; - gbSizer2 = new wxGridBagSizer( 0, 0 ); - gbSizer2->SetFlexibleDirection( wxBOTH ); - gbSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_ALL ); - - m_cbUpdateReferences = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Update references"), wxDefaultPosition, wxDefaultSize, 0 ); - m_cbUpdateReferences->SetValue(true); - m_cbUpdateReferences->SetToolTip( _("Update references of symbols that have been changed in the PCB editor.") ); - - gbSizer2->Add( m_cbUpdateReferences, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 ); - - m_cbUpdateFootprints = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Update footprints"), wxDefaultPosition, wxDefaultSize, 0 ); - m_cbUpdateFootprints->SetToolTip( _("Update footprint associations of symbols whose footprints have been replaced with different footprints in PCB.") ); - - gbSizer2->Add( m_cbUpdateFootprints, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 ); - - m_cbUpdateValues = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Update values"), wxDefaultPosition, wxDefaultSize, 0 ); - m_cbUpdateValues->SetToolTip( _("Update symbols values that have been replaced in the PCB editor.") ); - - gbSizer2->Add( m_cbUpdateValues, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 ); - - m_cbIgnoreOtherProjects = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Ignore errors in other projects"), wxDefaultPosition, wxDefaultSize, 0 ); - m_cbIgnoreOtherProjects->SetToolTip( _("Schematic sheets used in multiple projects are not compatible with back annotation. If this option is selected, errors generated by multiple use will be disabled.") ); - - gbSizer2->Add( m_cbIgnoreOtherProjects, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); + sbSizerOptions->Add( gbSizerOpts, 1, wxEXPAND, 5 ); - sbSizer1->Add( gbSizer2, 1, wxEXPAND, 5 ); + bUpperSizer->Add( sbSizerOptions, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - bUpperSizer->Add( sbSizer1, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + bMainSizer->Add( bUpperSizer, 0, wxALL|wxEXPAND, 5 ); + + wxBoxSizer* bLowerSizer; + bLowerSizer = new wxBoxSizer( wxVERTICAL ); + + bLowerSizer->SetMinSize( wxSize( 660,300 ) ); + m_messagePanel = new WX_HTML_REPORT_PANEL( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + bLowerSizer->Add( m_messagePanel, 1, wxEXPAND | wxALL, 5 ); - bMainSizer->Add( bUpperSizer, 0, wxALL|wxEXPAND, 5 ); + bMainSizer->Add( bLowerSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - wxBoxSizer* bLowerSizer; - bLowerSizer = new wxBoxSizer( wxVERTICAL ); + m_sdbSizer = new wxStdDialogButtonSizer(); + m_sdbSizerOK = new wxButton( this, wxID_OK ); + m_sdbSizer->AddButton( m_sdbSizerOK ); + m_sdbSizerCancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizer->AddButton( m_sdbSizerCancel ); + m_sdbSizer->Realize(); - bLowerSizer->SetMinSize( wxSize( 660,300 ) ); - m_messagePanel = new WX_HTML_REPORT_PANEL( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - bLowerSizer->Add( m_messagePanel, 1, wxEXPAND | wxALL, 5 ); + bMainSizer->Add( m_sdbSizer, 0, wxALL|wxEXPAND, 5 ); - bMainSizer->Add( bLowerSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + this->SetSizer( bMainSizer ); + this->Layout(); + bMainSizer->Fit( this ); - m_sdbSizer1 = new wxStdDialogButtonSizer(); - m_sdbSizer1OK = new wxButton( this, wxID_OK ); - m_sdbSizer1->AddButton( m_sdbSizer1OK ); - m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); - m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); - m_sdbSizer1->Realize(); - - bMainSizer->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 5 ); - - - this->SetSizer( bMainSizer ); - this->Layout(); - bMainSizer->Fit( this ); - - // Connect Events - m_cbUpdateReferences->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_FROM_PCB_BASE::OnOptionChanged ), NULL, this ); - m_cbUpdateFootprints->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_FROM_PCB_BASE::OnOptionChanged ), NULL, this ); - m_cbUpdateValues->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_FROM_PCB_BASE::OnOptionChanged ), NULL, this ); - m_cbIgnoreOtherProjects->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_FROM_PCB_BASE::OnOptionChanged ), NULL, this ); - m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_FROM_PCB_BASE::OnUpdateClick ), NULL, this ); + // Connect Events + m_cbUpdateReferences->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_FROM_PCB_BASE::OnOptionChanged ), NULL, this ); + m_cbUpdateFootprints->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_FROM_PCB_BASE::OnOptionChanged ), NULL, this ); + m_cbUpdateValues->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_FROM_PCB_BASE::OnOptionChanged ), NULL, this ); + m_cbIgnoreOtherProjects->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_FROM_PCB_BASE::OnOptionChanged ), NULL, this ); + m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_FROM_PCB_BASE::OnUpdateClick ), NULL, this ); } DIALOG_UPDATE_FROM_PCB_BASE::~DIALOG_UPDATE_FROM_PCB_BASE() { - // Disconnect Events - m_cbUpdateReferences->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_FROM_PCB_BASE::OnOptionChanged ), NULL, this ); - m_cbUpdateFootprints->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_FROM_PCB_BASE::OnOptionChanged ), NULL, this ); - m_cbUpdateValues->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_FROM_PCB_BASE::OnOptionChanged ), NULL, this ); - m_cbIgnoreOtherProjects->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_FROM_PCB_BASE::OnOptionChanged ), NULL, this ); - m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_FROM_PCB_BASE::OnUpdateClick ), NULL, this ); + // Disconnect Events + m_cbUpdateReferences->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_FROM_PCB_BASE::OnOptionChanged ), NULL, this ); + m_cbUpdateFootprints->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_FROM_PCB_BASE::OnOptionChanged ), NULL, this ); + m_cbUpdateValues->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_FROM_PCB_BASE::OnOptionChanged ), NULL, this ); + m_cbIgnoreOtherProjects->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_FROM_PCB_BASE::OnOptionChanged ), NULL, this ); + m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_FROM_PCB_BASE::OnUpdateClick ), NULL, this ); } - diff --git a/eeschema/dialogs/dialog_update_from_pcb_base.fbp b/eeschema/dialogs/dialog_update_from_pcb_base.fbp index 0990c9d625..4e6850ecc3 100644 --- a/eeschema/dialogs/dialog_update_from_pcb_base.fbp +++ b/eeschema/dialogs/dialog_update_from_pcb_base.fbp @@ -14,6 +14,7 @@ dialog_update_from_pcb_base 1000 none + 1 dialog_update_from_pcb_base @@ -25,6 +26,7 @@ 1 1 UI + 0 1 0 @@ -75,21 +77,10 @@ wxID_ANY Options - sbSizer1 + sbSizerOptions wxVERTICAL 1 none - - 5 - wxEXPAND - 1 - - - bSizer1 - wxVERTICAL - none - - 5 wxEXPAND @@ -101,7 +92,7 @@ 0 - gbSizer2 + gbSizerOpts wxFLEX_GROWMODE_ALL none 0 @@ -345,7 +336,7 @@ 0 0 wxID_ANY - Ignore errors in other projects + Ignore errors in shared schematic sheets 0 @@ -366,7 +357,7 @@ ; ; forward_declare 0 - Schematic sheets used in multiple projects are not compatible with back annotation. If this option is selected, errors generated by multiple use will be disabled. + Shared schematic sheets used in complex hierarchies have constraints. They are not always compatible with back annotation when updating footprints and values . If this option is selected, errors generated by sharing will be disabled. wxFILTER_NONE wxDefaultValidator @@ -383,11 +374,11 @@ - + 5 wxEXPAND|wxTOP|wxRIGHT|wxLEFT 1 - + 660,300 bLowerSizer wxVERTICAL @@ -465,7 +456,7 @@ 0 0 - m_sdbSizer1 + m_sdbSizer protected OnUpdateClick diff --git a/eeschema/dialogs/dialog_update_from_pcb_base.h b/eeschema/dialogs/dialog_update_from_pcb_base.h index 612de9214e..a61d055426 100644 --- a/eeschema/dialogs/dialog_update_from_pcb_base.h +++ b/eeschema/dialogs/dialog_update_from_pcb_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Sep 1 2019) +// C++ code generated with wxFormBuilder (version Jul 10 2019) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -13,14 +13,14 @@ class WX_HTML_REPORT_PANEL; #include "dialog_shim.h" -#include -#include #include #include +#include #include #include #include #include +#include #include #include #include @@ -33,28 +33,27 @@ class WX_HTML_REPORT_PANEL; /////////////////////////////////////////////////////////////////////////////// class DIALOG_UPDATE_FROM_PCB_BASE : public DIALOG_SHIM { - private: + private: - protected: - wxCheckBox* m_cbUpdateReferences; - wxCheckBox* m_cbUpdateFootprints; - wxCheckBox* m_cbUpdateValues; - wxCheckBox* m_cbIgnoreOtherProjects; - WX_HTML_REPORT_PANEL* m_messagePanel; - wxStdDialogButtonSizer* m_sdbSizer1; - wxButton* m_sdbSizer1OK; - wxButton* m_sdbSizer1Cancel; + protected: + wxCheckBox* m_cbUpdateReferences; + wxCheckBox* m_cbUpdateFootprints; + wxCheckBox* m_cbUpdateValues; + wxCheckBox* m_cbIgnoreOtherProjects; + WX_HTML_REPORT_PANEL* m_messagePanel; + wxStdDialogButtonSizer* m_sdbSizer; + wxButton* m_sdbSizerOK; + wxButton* m_sdbSizerCancel; - // Virtual event handlers, overide them in your derived class - virtual void OnOptionChanged( wxCommandEvent& event ) { event.Skip(); } - virtual void OnUpdateClick( wxCommandEvent& event ) { event.Skip(); } + // Virtual event handlers, overide them in your derived class + virtual void OnOptionChanged( wxCommandEvent& event ) { event.Skip(); } + virtual void OnUpdateClick( wxCommandEvent& event ) { event.Skip(); } - public: + public: - DIALOG_UPDATE_FROM_PCB_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Update Schematic from PCB"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DIALOG_UPDATE_FROM_PCB_BASE(); + DIALOG_UPDATE_FROM_PCB_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Update Schematic from PCB"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_UPDATE_FROM_PCB_BASE(); }; -