diff --git a/eeschema/dialogs/dialog_sim_model.cpp b/eeschema/dialogs/dialog_sim_model.cpp index a3bc567b02..8eac1bef87 100644 --- a/eeschema/dialogs/dialog_sim_model.cpp +++ b/eeschema/dialogs/dialog_sim_model.cpp @@ -188,7 +188,7 @@ bool DIALOG_SIM_MODEL::TransferDataToWindow() } m_overrideCheckbox->SetValue( curModel().HasNonInstanceOverrides() ); - m_excludeSymbolCheckbox->SetValue( !curModel().IsEnabled() ); + m_excludeCheckbox->SetValue( !curModel().IsEnabled() ); updateWidgets(); @@ -1129,9 +1129,9 @@ void DIALOG_SIM_MODEL::onPinAssignmentsGridSize( wxSizeEvent& aEvent ) template -void DIALOG_SIM_MODEL::onExcludeSymbolCheckbox( wxCommandEvent& aEvent ) +void DIALOG_SIM_MODEL::onExcludeCheckbox( wxCommandEvent& aEvent ) { - curModel().SetIsEnabled( !m_excludeSymbolCheckbox->GetValue() ); + curModel().SetIsEnabled( !m_excludeCheckbox->GetValue() ); } diff --git a/eeschema/dialogs/dialog_sim_model.h b/eeschema/dialogs/dialog_sim_model.h index c863d09634..c3f1ea39c2 100644 --- a/eeschema/dialogs/dialog_sim_model.h +++ b/eeschema/dialogs/dialog_sim_model.h @@ -114,7 +114,7 @@ private: void onCodePreviewSetFocus( wxFocusEvent& aEvent ) override; void onPinAssignmentsGridCellChange( wxGridEvent& aEvent ) override; void onPinAssignmentsGridSize( wxSizeEvent& aEvent ) override; - void onExcludeSymbolCheckbox( wxCommandEvent& aEvent ) override; + void onExcludeCheckbox( wxCommandEvent& aEvent ) override; void onLibraryPathUpdate( wxUpdateUIEvent& aEvent ) override; void onBrowseButtonUpdate( wxUpdateUIEvent& aEvent ) override; diff --git a/eeschema/dialogs/dialog_sim_model_base.cpp b/eeschema/dialogs/dialog_sim_model_base.cpp index c318e986cd..fa25e535d9 100644 --- a/eeschema/dialogs/dialog_sim_model_base.cpp +++ b/eeschema/dialogs/dialog_sim_model_base.cpp @@ -236,8 +236,8 @@ DIALOG_SIM_MODEL_BASE::DIALOG_SIM_MODEL_BASE( wxWindow* parent, wxWindowID id, c m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); bSizer8->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); - m_excludeSymbolCheckbox = new wxCheckBox( this, wxID_ANY, _("Exclude symbol from simulation"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer8->Add( m_excludeSymbolCheckbox, 0, wxALL, 5 ); + m_excludeCheckbox = new wxCheckBox( this, wxID_ANY, _("Exclude from simulation"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer8->Add( m_excludeCheckbox, 0, wxALL, 5 ); m_sdbSizer1 = new wxStdDialogButtonSizer(); m_sdbSizer1OK = new wxButton( this, wxID_OK ); @@ -282,7 +282,7 @@ DIALOG_SIM_MODEL_BASE::DIALOG_SIM_MODEL_BASE( wxWindow* parent, wxWindowID id, c m_codePreview->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( DIALOG_SIM_MODEL_BASE::onCodePreviewSetFocus ), NULL, this ); m_pinAssignmentsGrid->Connect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( DIALOG_SIM_MODEL_BASE::onPinAssignmentsGridCellChange ), NULL, this ); m_pinAssignmentsGrid->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_SIM_MODEL_BASE::onPinAssignmentsGridSize ), NULL, this ); - m_excludeSymbolCheckbox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onExcludeSymbolCheckbox ), NULL, this ); + m_excludeCheckbox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onExcludeCheckbox ), NULL, this ); } DIALOG_SIM_MODEL_BASE::~DIALOG_SIM_MODEL_BASE() @@ -315,6 +315,6 @@ DIALOG_SIM_MODEL_BASE::~DIALOG_SIM_MODEL_BASE() m_codePreview->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( DIALOG_SIM_MODEL_BASE::onCodePreviewSetFocus ), NULL, this ); m_pinAssignmentsGrid->Disconnect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( DIALOG_SIM_MODEL_BASE::onPinAssignmentsGridCellChange ), NULL, this ); m_pinAssignmentsGrid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_SIM_MODEL_BASE::onPinAssignmentsGridSize ), NULL, this ); - m_excludeSymbolCheckbox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onExcludeSymbolCheckbox ), NULL, this ); + m_excludeCheckbox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onExcludeCheckbox ), NULL, this ); } diff --git a/eeschema/dialogs/dialog_sim_model_base.fbp b/eeschema/dialogs/dialog_sim_model_base.fbp index de737f5ec4..9fe5acfb16 100644 --- a/eeschema/dialogs/dialog_sim_model_base.fbp +++ b/eeschema/dialogs/dialog_sim_model_base.fbp @@ -1831,7 +1831,7 @@ 0 0 wxID_ANY - Exclude symbol from simulation + Exclude from simulation 0 @@ -1839,7 +1839,7 @@ 0 1 - m_excludeSymbolCheckbox + m_excludeCheckbox 1 @@ -1860,7 +1860,7 @@ - onExcludeSymbolCheckbox + onExcludeCheckbox diff --git a/eeschema/dialogs/dialog_sim_model_base.h b/eeschema/dialogs/dialog_sim_model_base.h index 960775618d..a608ef5e67 100644 --- a/eeschema/dialogs/dialog_sim_model_base.h +++ b/eeschema/dialogs/dialog_sim_model_base.h @@ -78,7 +78,7 @@ class DIALOG_SIM_MODEL_BASE : public DIALOG_SHIM wxPanel* m_pinAssignmentsPanel; WX_GRID* m_pinAssignmentsGrid; wxStaticLine* m_staticline1; - wxCheckBox* m_excludeSymbolCheckbox; + wxCheckBox* m_excludeCheckbox; wxStdDialogButtonSizer* m_sdbSizer1; wxButton* m_sdbSizer1OK; wxButton* m_sdbSizer1Cancel; @@ -106,7 +106,7 @@ class DIALOG_SIM_MODEL_BASE : public DIALOG_SHIM virtual void onCodePreviewSetFocus( wxFocusEvent& event ) { event.Skip(); } virtual void onPinAssignmentsGridCellChange( wxGridEvent& event ) { event.Skip(); } virtual void onPinAssignmentsGridSize( wxSizeEvent& event ) { event.Skip(); } - virtual void onExcludeSymbolCheckbox( wxCommandEvent& event ) { event.Skip(); } + virtual void onExcludeCheckbox( wxCommandEvent& event ) { event.Skip(); } public: diff --git a/eeschema/sim/sim_model.cpp b/eeschema/sim/sim_model.cpp index fadff44ca4..f861ac57b9 100644 --- a/eeschema/sim/sim_model.cpp +++ b/eeschema/sim/sim_model.cpp @@ -1001,7 +1001,7 @@ void SIM_MODEL::WriteInferredDataFields( std::vector& aFields, const std::str SetFieldValue( aFields, DEVICE_TYPE_FIELD, "" ); SetFieldValue( aFields, TYPE_FIELD, "" ); SetFieldValue( aFields, PARAMS_FIELD, "" ); - SetFieldValue( aFields, DISABLED_FIELD, "" ); + SetFieldValue( aFields, ENABLE_FIELD, "" ); } @@ -1140,14 +1140,14 @@ void SIM_MODEL::ParsePinsField( unsigned aSymbolPinCount, const std::string& aPi } -void SIM_MODEL::ParseDisabledField( const std::string& aDisabledField ) +void SIM_MODEL::ParseEnableField( const std::string& aEnableField ) { - if( aDisabledField == "" ) + if( aEnableField == "" ) return; - char c = boost::to_lower_copy( aDisabledField )[0]; + char c = boost::to_lower_copy( aEnableField )[0]; - if( c == 'y' || c == 't' || c == '1' ) + if( c == 'n' || c == 'f' || c == '0' ) m_isEnabled = false; } @@ -1155,7 +1155,7 @@ void SIM_MODEL::ParseDisabledField( const std::string& aDisabledField ) template void SIM_MODEL::doReadDataFields( unsigned aSymbolPinCount, const std::vector* aFields ) { - ParseDisabledField( GetFieldValue( aFields, DISABLED_FIELD ) ); + ParseEnableField( GetFieldValue( aFields, ENABLE_FIELD ) ); ParsePinsField( aSymbolPinCount, GetFieldValue( aFields, PINS_FIELD ) ); if( GetFieldValue( aFields, PARAMS_FIELD ) != "" ) @@ -1233,7 +1233,7 @@ void SIM_MODEL::doWriteFields( std::vector& aFields ) const SetFieldValue( aFields, TYPE_FIELD, generateTypeField() ); SetFieldValue( aFields, PINS_FIELD, generatePinsField() ); SetFieldValue( aFields, PARAMS_FIELD, GenerateParamsField( " " ) ); - SetFieldValue( aFields, DISABLED_FIELD, generateDisabledField() ); + SetFieldValue( aFields, ENABLE_FIELD, generateEnableField() ); } @@ -1271,9 +1271,9 @@ std::string SIM_MODEL::generatePinsField() const } -std::string SIM_MODEL::generateDisabledField() const +std::string SIM_MODEL::generateEnableField() const { - return m_isEnabled ? "" : "1"; + return m_isEnabled ? "" : "0"; } diff --git a/eeschema/sim/sim_model.h b/eeschema/sim/sim_model.h index 0e92038099..1444de18f9 100644 --- a/eeschema/sim/sim_model.h +++ b/eeschema/sim/sim_model.h @@ -153,7 +153,7 @@ public: static constexpr auto TYPE_FIELD = "Sim_Type"; static constexpr auto PINS_FIELD = "Sim_Pins"; static constexpr auto PARAMS_FIELD = "Sim_Params"; - static constexpr auto DISABLED_FIELD = "Sim_Disabled"; + static constexpr auto ENABLE_FIELD = "Sim_Enable"; // There's a trailing '_' because `DEVICE_TYPE` collides with something in Windows headers. @@ -620,7 +620,7 @@ protected: void ParseParamsField( const std::string& aParamsField ); void ParsePinsField( unsigned aSymbolPinCount, const std::string& aPinsField ); - void ParseDisabledField( const std::string& aDisabledField ); + void ParseEnableField( const std::string& aDisabledField ); template void InferredReadDataFields( unsigned aSymbolPinCount, const std::vector* aFields, @@ -645,7 +645,7 @@ private: std::string generateTypeField() const; std::string generatePinsField() const; - std::string generateDisabledField() const; + std::string generateEnableField() const; std::string parseFieldFloatValue( std::string aFieldFloatValue ); diff --git a/qa/data/eeschema/spice_netlists/switches/switches.kicad_sch b/qa/data/eeschema/spice_netlists/switches/switches.kicad_sch index 0463073bc7..03b45ef60f 100644 --- a/qa/data/eeschema/spice_netlists/switches/switches.kicad_sch +++ b/qa/data/eeschema/spice_netlists/switches/switches.kicad_sch @@ -588,7 +588,7 @@ (property "Sim_Pins" "1 6 3 5" (at 163.83 121.92 0) (effects (font (size 1.27 1.27)) hide) ) - (property "Sim_Disabled" "1" (at 163.83 121.92 0) + (property "Sim_Enable" "0" (at 163.83 121.92 0) (effects (font (size 1.27 1.27)) hide) ) (pin "1" (uuid 76e69abc-f617-4b9c-a790-060112fdebed))