Sim Model Editor: Remove Override checkbox

This commit is contained in:
Mikolaj Wielgus 2022-11-13 02:13:44 +01:00
parent ce3362ee12
commit b288e162d2
5 changed files with 16 additions and 101 deletions

View File

@ -231,7 +231,6 @@ bool DIALOG_SIM_MODEL<T>::TransferDataToWindow()
m_curModelTypeOfDeviceType[deviceType] = type;
}
m_overrideCheckbox->SetValue( curModel().HasNonInstanceOverrides() );
m_excludeCheckbox->SetValue( !curModel().IsEnabled() );
m_inferCheckbox->SetValue( curModel().IsInferred() );
@ -300,8 +299,6 @@ bool DIALOG_SIM_MODEL<T>::TransferDataFromWindow()
template <typename T>
void DIALOG_SIM_MODEL<T>::updateWidgets()
{
m_overrideCheckbox->SetValue( curModel().HasNonInstanceOverrides() );
updateIbisWidgets();
updateInstanceWidgets();
updateModelParamsTab();
@ -335,7 +332,6 @@ void DIALOG_SIM_MODEL<T>::updateIbisWidgets()
m_ibisPinCombobox->Show( isIbisLoaded() );
m_ibisModelLabel->Show( isIbisLoaded() );
m_ibisPinLabel->Show( isIbisLoaded() );
m_overrideCheckbox->Show( !isIbisLoaded() );
m_differentialCheckbox->Show( isIbisLoaded() && modelkibis && modelkibis->CanDifferential() );
@ -434,15 +430,10 @@ void DIALOG_SIM_MODEL<T>::updateModelParamsTab()
m_paramGrid->Expand( "Waveform" );
}
// Either enable all properties or disable all except the principal ones.
// Set all properties to default colors.
// Update properties in models that have autofill.
for( wxPropertyGridIterator it = m_paramGrid->GetIterator(); !it.AtEnd(); ++it )
{
SIM_PROPERTY* prop = dynamic_cast<SIM_PROPERTY*>( *it );
if( !prop )
continue;
wxColour bgCol = m_paramGrid->GetGrid()->GetPropertyDefaultCell().GetBgCol();
wxColour fgCol = m_paramGrid->GetGrid()->GetPropertyDefaultCell().GetFgCol();
@ -452,6 +443,11 @@ void DIALOG_SIM_MODEL<T>::updateModelParamsTab()
( *it )->GetCell( col ).SetFgCol( fgCol );
}
SIM_PROPERTY* prop = dynamic_cast<SIM_PROPERTY*>( *it );
if( !prop )
continue;
const SIM_MODEL::PARAM& param = prop->GetParam();
// Model values other than the currently edited value may have changed. Update them.
@ -459,13 +455,6 @@ void DIALOG_SIM_MODEL<T>::updateModelParamsTab()
// models that don't have it for performance reasons.
if( curModel().HasAutofill() )
( *it )->SetValueFromString( param.value->ToString() );
// Most of the values are disabled when the override checkbox is unchecked.
( *it )->Enable( isIbisLoaded()
|| m_useInstanceModelRadioButton->GetValue()
|| ( param.info.isInstanceParam
&& param.info.category == SIM_MODEL::PARAM::CATEGORY::PRINCIPAL )
|| m_overrideCheckbox->GetValue() );
}
}
@ -857,13 +846,6 @@ wxPGProperty* DIALOG_SIM_MODEL<T>::newParamProperty( int aParamIndex ) const
prop->SetCell( PARAM_COLUMN::TYPE, typeStr );
if( m_useLibraryModelRadioButton->GetValue()
&& !m_overrideCheckbox->GetValue()
&& !param.info.isInstanceParam )
{
prop->Enable( false );
}
return prop;
}
@ -960,7 +942,6 @@ void DIALOG_SIM_MODEL<T>::onRadioButton( wxCommandEvent& aEvent )
m_browseButton->Enable( fromLibrary );
m_modelNameLabel->Enable( fromLibrary );
m_modelNameCombobox->Enable( fromLibrary );
m_overrideCheckbox->Enable( fromLibrary );
m_ibisPinLabel->Enable( fromLibrary );
m_ibisPinCombobox->Enable( fromLibrary );
m_differentialCheckbox->Enable( fromLibrary );
@ -1100,12 +1081,6 @@ void DIALOG_SIM_MODEL<T>::onIbisModelComboboxTextEnter( wxCommandEvent& aEvent )
onIbisPinCombobox( aEvent );
}
template <typename T>
void DIALOG_SIM_MODEL<T>::onOverrideCheckbox( wxCommandEvent& aEvent )
{
updateWidgets();
}
template <typename T>
void DIALOG_SIM_MODEL<T>::onDifferentialCheckbox( wxCommandEvent& aEvent )
{

View File

@ -121,7 +121,6 @@ private:
void onIbisPinComboboxTextEnter( wxCommandEvent& event ) override;
void onIbisModelCombobox( wxCommandEvent& event ) override;
void onIbisModelComboboxTextEnter( wxCommandEvent& event ) override;
void onOverrideCheckbox( wxCommandEvent& aEvent ) override;
void onDeviceTypeChoice( wxCommandEvent& aEvent ) override;
void onTypeChoice( wxCommandEvent& aEvent ) override;
void onParamGridChanged( wxPropertyGridEvent& aEvent ) override;

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-88b0f50)
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -57,8 +57,8 @@ DIALOG_SIM_MODEL_BASE::DIALOG_SIM_MODEL_BASE( wxWindow* parent, wxWindowID id, c
m_modelNameCombobox = new wxComboBox( m_modelPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxTE_PROCESS_ENTER );
gbSizer1->Add( m_modelNameCombobox, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
m_overrideCheckbox = new wxCheckBox( m_modelPanel, wxID_ANY, _("Override"), wxDefaultPosition, wxDefaultSize, 0 );
gbSizer1->Add( m_overrideCheckbox, wxGBPosition( 1, 2 ), wxGBSpan( 1, 1 ), wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 40 );
gbSizer1->Add( 0, 0, wxGBPosition( 1, 3 ), wxGBSpan( 1, 1 ), wxEXPAND, 5 );
m_ibisPinLabel = new wxStaticText( m_modelPanel, wxID_ANY, _("Pin:"), wxDefaultPosition, wxDefaultSize, 0 );
m_ibisPinLabel->Wrap( -1 );
@ -281,7 +281,6 @@ DIALOG_SIM_MODEL_BASE::DIALOG_SIM_MODEL_BASE( wxWindow* parent, wxWindowID id, c
m_modelNameCombobox->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_SIM_MODEL_BASE::onModelNameComboboxKillFocus ), NULL, this );
m_modelNameCombobox->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onModelNameComboboxTextEnter ), NULL, this );
m_modelNameCombobox->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SIM_MODEL_BASE::onModelNameComboboxUpdate ), NULL, this );
m_overrideCheckbox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onOverrideCheckbox ), NULL, this );
m_ibisPinLabel->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SIM_MODEL_BASE::onIbisPinLabelUpdate ), NULL, this );
m_ibisPinCombobox->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onIbisPinCombobox ), NULL, this );
m_ibisPinCombobox->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_SIM_MODEL_BASE::onModelNameComboboxKillFocus ), NULL, this );
@ -321,7 +320,6 @@ DIALOG_SIM_MODEL_BASE::~DIALOG_SIM_MODEL_BASE()
m_modelNameCombobox->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_SIM_MODEL_BASE::onModelNameComboboxKillFocus ), NULL, this );
m_modelNameCombobox->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onModelNameComboboxTextEnter ), NULL, this );
m_modelNameCombobox->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SIM_MODEL_BASE::onModelNameComboboxUpdate ), NULL, this );
m_overrideCheckbox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onOverrideCheckbox ), NULL, this );
m_ibisPinLabel->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SIM_MODEL_BASE::onIbisPinLabelUpdate ), NULL, this );
m_ibisPinCombobox->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onIbisPinCombobox ), NULL, this );
m_ibisPinCombobox->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_SIM_MODEL_BASE::onModelNameComboboxKillFocus ), NULL, this );

View File

@ -624,71 +624,16 @@
</object>
</object>
<object class="gbsizeritem" expanded="1">
<property name="border">40</property>
<property name="border">5</property>
<property name="colspan">1</property>
<property name="column">2</property>
<property name="flag">wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL</property>
<property name="column">3</property>
<property name="flag">wxEXPAND</property>
<property name="row">1</property>
<property name="rowspan">1</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Override</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_overrideCheckbox</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnCheckBox">onOverrideCheckbox</event>
<property name="width">0</property>
</object>
</object>
<object class="gbsizeritem" expanded="1">

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-88b0f50)
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -60,7 +60,6 @@ class DIALOG_SIM_MODEL_BASE : public DIALOG_SHIM
wxBitmapButton* m_browseButton;
wxStaticText* m_modelNameLabel;
wxComboBox* m_modelNameCombobox;
wxCheckBox* m_overrideCheckbox;
wxStaticText* m_ibisPinLabel;
wxComboBox* m_ibisPinCombobox;
wxCheckBox* m_differentialCheckbox;
@ -97,7 +96,6 @@ class DIALOG_SIM_MODEL_BASE : public DIALOG_SHIM
virtual void onModelNameComboboxKillFocus( wxFocusEvent& event ) { event.Skip(); }
virtual void onModelNameComboboxTextEnter( wxCommandEvent& event ) { event.Skip(); }
virtual void onModelNameComboboxUpdate( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void onOverrideCheckbox( wxCommandEvent& event ) { event.Skip(); }
virtual void onIbisPinLabelUpdate( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void onIbisPinCombobox( wxCommandEvent& event ) { event.Skip(); }
virtual void onIbisPinComboboxTextEnter( wxCommandEvent& event ) { event.Skip(); }