diff --git a/eeschema/dialogs/dialog_sim_model.cpp b/eeschema/dialogs/dialog_sim_model.cpp index 559a687c05..5c7e8ecca5 100644 --- a/eeschema/dialogs/dialog_sim_model.cpp +++ b/eeschema/dialogs/dialog_sim_model.cpp @@ -231,7 +231,6 @@ bool DIALOG_SIM_MODEL::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::TransferDataFromWindow() template void DIALOG_SIM_MODEL::updateWidgets() { - m_overrideCheckbox->SetValue( curModel().HasNonInstanceOverrides() ); - updateIbisWidgets(); updateInstanceWidgets(); updateModelParamsTab(); @@ -335,7 +332,6 @@ void DIALOG_SIM_MODEL::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::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( *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::updateModelParamsTab() ( *it )->GetCell( col ).SetFgCol( fgCol ); } + SIM_PROPERTY* prop = dynamic_cast( *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::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::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::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::onIbisModelComboboxTextEnter( wxCommandEvent& aEvent ) onIbisPinCombobox( aEvent ); } -template -void DIALOG_SIM_MODEL::onOverrideCheckbox( wxCommandEvent& aEvent ) -{ - updateWidgets(); -} - template void DIALOG_SIM_MODEL::onDifferentialCheckbox( wxCommandEvent& aEvent ) { diff --git a/eeschema/dialogs/dialog_sim_model.h b/eeschema/dialogs/dialog_sim_model.h index 793f023d95..3de82adc79 100644 --- a/eeschema/dialogs/dialog_sim_model.h +++ b/eeschema/dialogs/dialog_sim_model.h @@ -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; diff --git a/eeschema/dialogs/dialog_sim_model_base.cpp b/eeschema/dialogs/dialog_sim_model_base.cpp index 187bc2595a..a500d478dc 100644 --- a/eeschema/dialogs/dialog_sim_model_base.cpp +++ b/eeschema/dialogs/dialog_sim_model_base.cpp @@ -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 ); diff --git a/eeschema/dialogs/dialog_sim_model_base.fbp b/eeschema/dialogs/dialog_sim_model_base.fbp index 9e8e76ba15..e388d57e38 100644 --- a/eeschema/dialogs/dialog_sim_model_base.fbp +++ b/eeschema/dialogs/dialog_sim_model_base.fbp @@ -624,71 +624,16 @@ - 40 + 5 1 - 2 - wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL + 3 + wxEXPAND 1 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Override - - 0 - - - 0 - - 1 - m_overrideCheckbox - 1 - - + + 0 protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - onOverrideCheckbox + 0 diff --git a/eeschema/dialogs/dialog_sim_model_base.h b/eeschema/dialogs/dialog_sim_model_base.h index a2ce895c86..c59075a96d 100644 --- a/eeschema/dialogs/dialog_sim_model_base.h +++ b/eeschema/dialogs/dialog_sim_model_base.h @@ -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(); }