Sim: Rename Sim_Disabled field to Sim_Enable

This commit is contained in:
Mikolaj Wielgus 2022-10-16 00:45:54 +02:00
parent 73e1676bdb
commit c8e13813d9
8 changed files with 26 additions and 26 deletions

View File

@ -188,7 +188,7 @@ bool DIALOG_SIM_MODEL<T>::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<T>::onPinAssignmentsGridSize( wxSizeEvent& aEvent )
template <typename T>
void DIALOG_SIM_MODEL<T>::onExcludeSymbolCheckbox( wxCommandEvent& aEvent )
void DIALOG_SIM_MODEL<T>::onExcludeCheckbox( wxCommandEvent& aEvent )
{
curModel().SetIsEnabled( !m_excludeSymbolCheckbox->GetValue() );
curModel().SetIsEnabled( !m_excludeCheckbox->GetValue() );
}

View File

@ -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;

View File

@ -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 );
}

View File

@ -1831,7 +1831,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Exclude symbol from simulation</property>
<property name="label">Exclude from simulation</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -1839,7 +1839,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_excludeSymbolCheckbox</property>
<property name="name">m_excludeCheckbox</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -1860,7 +1860,7 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnCheckBox">onExcludeSymbolCheckbox</event>
<event name="OnCheckBox">onExcludeCheckbox</event>
</object>
</object>
<object class="sizeritem" expanded="1">

View File

@ -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:

View File

@ -1001,7 +1001,7 @@ void SIM_MODEL::WriteInferredDataFields( std::vector<T>& 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 <typename T>
void SIM_MODEL::doReadDataFields( unsigned aSymbolPinCount, const std::vector<T>* 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<T>& 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";
}

View File

@ -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 <typename T>
void InferredReadDataFields( unsigned aSymbolPinCount, const std::vector<T>* 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 );

View File

@ -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))