Revert changing inference checkbox to radio button

Reverts 5e1561fc22
and 6c84e0c2f0.
This commit is contained in:
Mikolaj Wielgus 2022-10-31 07:28:58 +01:00
parent ed4a40ee4f
commit 355d5014f5
5 changed files with 454 additions and 765 deletions

View File

@ -137,15 +137,7 @@ template <typename T>
bool DIALOG_SIM_MODEL<T>::TransferDataToWindow()
{
wxCommandEvent dummyEvent;
int pinCount = m_sortedSymbolPins.size();
std::string ref = SIM_MODEL::GetFieldValue( &m_fields, SIM_MODEL::REFERENCE_FIELD );
std::string libraryFilename = SIM_MODEL::GetFieldValue( &m_fields, SIM_LIBRARY::LIBRARY_FIELD );
SIM_MODEL::DEVICE_TYPE_ inferredDevice = SIM_MODEL::InferDeviceTypeFromRef( ref );
if( inferredDevice == SIM_MODEL::DEVICE_TYPE_::NONE )
m_inferInstanceModelRadioButton->Enable( false );
wxString libraryFilename = SIM_MODEL::GetFieldValue( &m_fields, SIM_LIBRARY::LIBRARY_FIELD );
if( libraryFilename != "" )
{
@ -207,33 +199,23 @@ bool DIALOG_SIM_MODEL<T>::TransferDataToWindow()
else
{
// The model is sourced from the instance.
std::string device = SIM_MODEL::GetFieldValue( &m_fields, SIM_MODEL::DEVICE_TYPE_FIELD );
SIM_MODEL::TYPE type = SIM_MODEL::ReadTypeFromFields( m_fields, pinCount );
bool inferred = m_inferInstanceModelRadioButton->IsEnabled() && device.empty();
if( inferred )
m_inferInstanceModelRadioButton->SetValue( true );
else
m_useInstanceModelRadioButton->SetValue( true );
m_useInstanceModelRadioButton->SetValue( true );
SIM_MODEL::TYPE type = SIM_MODEL::ReadTypeFromFields( m_fields, m_sortedSymbolPins.size() );
try
{
m_models.at( static_cast<int>( type ) ) = SIM_MODEL::Create( pinCount, m_fields );
m_models.at( static_cast<int>( SIM_MODEL::ReadTypeFromFields( m_fields,
m_sortedSymbolPins.size() ) ) ) =
SIM_MODEL::Create( m_sortedSymbolPins.size(), m_fields );
}
catch( const IO_ERROR& e )
{
if( !inferred )
{
DisplayErrorMessage( this, _( "Failed to read simulation model from fields." )
+ wxT( "\n\n" )
+ e.What() );
}
}
DisplayErrorMessage( this, _( "Failed to read simulation model from fields." )
+ wxT( "\n\n" )
+ e.What() );
if( m_inferInstanceModelRadioButton->IsEnabled() )
{
m_inferredDevice->SetValue( SIM_MODEL::DeviceTypeInfo( inferredDevice ).description );
m_inferredType->SetValue( SIM_MODEL::TypeInfo( type ).description );
onRadioButton( dummyEvent );
return DIALOG_SIM_MODEL_BASE::TransferDataToWindow();
}
m_curModelType = type;
@ -241,9 +223,13 @@ bool DIALOG_SIM_MODEL<T>::TransferDataToWindow()
m_overrideCheckbox->SetValue( curModel().HasNonInstanceOverrides() );
m_excludeCheckbox->SetValue( !curModel().IsEnabled() );
m_inferCheckbox->SetValue( curModel().IsInferred() );
std::string ref = SIM_MODEL::GetFieldValue( &m_fields, SIM_MODEL::REFERENCE_FIELD );
m_inferCheckbox->Show( SIM_MODEL::InferDeviceTypeFromRef( ref )
!= SIM_MODEL::DEVICE_TYPE_::NONE );
onRadioButton( dummyEvent );
return DIALOG_SIM_MODEL_BASE::TransferDataToWindow();
}
@ -294,7 +280,6 @@ bool DIALOG_SIM_MODEL<T>::TransferDataFromWindow()
}
}
curModel().SetIsInferred( m_inferInstanceModelRadioButton->GetValue() );
curModel().WriteFields( m_fields );
return true;
@ -307,13 +292,16 @@ void DIALOG_SIM_MODEL<T>::updateWidgets()
m_overrideCheckbox->SetValue( curModel().HasNonInstanceOverrides() );
updateIbisWidgets();
updateInstanceWidgets();
updateModelParamsTab();
updateModelCodeTab();
updatePinAssignments();
m_excludeCheckbox->SetValue( !curModel().IsEnabled() );
std::string ref = SIM_MODEL::GetFieldValue( &m_fields, SIM_MODEL::REFERENCE_FIELD );
m_inferCheckbox->Enable( SIM_MODEL::InferDeviceTypeFromRef( ref ) == curModel().GetDeviceType() );
m_inferCheckbox->SetValue( curModel().IsInferred() );
m_modelPanel->Layout();
m_pinAssignmentsPanel->Layout();
m_parametersPanel->Layout();
@ -328,8 +316,32 @@ void DIALOG_SIM_MODEL<T>::updateWidgets()
template <typename T>
void DIALOG_SIM_MODEL<T>::updateIbisWidgets()
{
SIM_MODEL_KIBIS* modelkibis = isIbisLoaded() ? dynamic_cast<SIM_MODEL_KIBIS*>( &curModel() )
: nullptr;
SIM_MODEL_KIBIS* modelkibis = nullptr;
if( isIbisLoaded() )
{
modelkibis = dynamic_cast<SIM_MODEL_KIBIS*>( &curModel() );
for ( wxSizerItem* item : m_sourceSizer->GetChildren() )
{
if ( item->GetWindow() == m_differentialCheckbox )
item->SetFlag( item->GetFlag() | wxRESERVE_SPACE_EVEN_IF_HIDDEN );
if ( item->GetWindow() == m_overrideCheckbox )
item->SetFlag( item->GetFlag() & ~wxRESERVE_SPACE_EVEN_IF_HIDDEN );
}
}
else
{
for ( wxSizerItem* item : m_sourceSizer->GetChildren() )
{
if ( item->GetWindow() == m_differentialCheckbox )
item->SetFlag( item->GetFlag() | wxRESERVE_SPACE_EVEN_IF_HIDDEN );
if ( item->GetWindow() == m_overrideCheckbox )
item->SetFlag( item->GetFlag() & ~wxRESERVE_SPACE_EVEN_IF_HIDDEN );
}
}
m_ibisModelCombobox->Show( isIbisLoaded() );
m_ibisPinCombobox->Show( isIbisLoaded() );
@ -343,44 +355,35 @@ void DIALOG_SIM_MODEL<T>::updateIbisWidgets()
}
template <typename T>
void DIALOG_SIM_MODEL<T>::updateInstanceWidgets()
{
SIM_MODEL::DEVICE_TYPE_ deviceType = SIM_MODEL::TypeInfo( curModel().GetType() ).deviceType;
// Change the Type choice to match the current device type.
if( !m_prevModel || deviceType != m_prevModel->GetDeviceType() )
{
m_deviceTypeChoice->SetSelection( static_cast<int>( deviceType ) );
m_inferredDevice->SetValue( m_deviceTypeChoice->GetString( static_cast<int>( deviceType ) ) );
m_typeChoice->Clear();
for( SIM_MODEL::TYPE type : SIM_MODEL::TYPE_ITERATOR() )
{
if( SIM_MODEL::TypeInfo( type ).deviceType == deviceType )
{
wxString description = SIM_MODEL::TypeInfo( type ).description;
if( !description.IsEmpty() )
m_typeChoice->Append( description );
if( type == curModel().GetType() )
{
m_typeChoice->SetSelection( m_typeChoice->GetCount() - 1 );
m_inferredType->SetValue( description );
}
}
}
}
}
template <typename T>
void DIALOG_SIM_MODEL<T>::updateModelParamsTab()
{
if( &curModel() != m_prevModel )
{
SIM_MODEL::DEVICE_TYPE_ deviceType = SIM_MODEL::TypeInfo( curModel().GetType() ).deviceType;
// Change the Type choice to match the current device type.
if( !m_prevModel || deviceType != m_prevModel->GetDeviceType() )
{
m_deviceTypeChoice->SetSelection( static_cast<int>( deviceType ) );
m_typeChoice->Clear();
for( SIM_MODEL::TYPE type : SIM_MODEL::TYPE_ITERATOR() )
{
if( SIM_MODEL::TypeInfo( type ).deviceType == deviceType )
{
wxString description = SIM_MODEL::TypeInfo( type ).description;
if( !description.IsEmpty() )
m_typeChoice->Append( description );
if( type == curModel().GetType() )
m_typeChoice->SetSelection( m_typeChoice->GetCount() - 1 );
}
}
}
// This wxPropertyGridManager column and header stuff has to be here because it segfaults in
// the constructor.
@ -957,8 +960,6 @@ template <typename T>
void DIALOG_SIM_MODEL<T>::onRadioButton( wxCommandEvent& aEvent )
{
bool fromLibrary = m_useLibraryModelRadioButton->GetValue();
bool inferred = m_inferInstanceModelRadioButton->GetValue();
bool fromInstance = m_useInstanceModelRadioButton->GetValue();
m_pathLabel->Enable( fromLibrary );
m_tclibraryPathName->Enable( fromLibrary );
@ -972,15 +973,10 @@ void DIALOG_SIM_MODEL<T>::onRadioButton( wxCommandEvent& aEvent )
m_ibisModelLabel->Enable( fromLibrary );
m_ibisModelCombobox->Enable( fromLibrary );
m_staticTextDevType->Enable( fromInstance );
m_deviceTypeChoice->Enable( fromInstance );
m_staticTextSpiceType->Enable( fromInstance );
m_typeChoice->Enable( fromInstance );
m_inferredDeviceLabel->Enable( inferred );
m_inferredDevice->Enable( inferred );
m_inferredTypeLabel->Enable( inferred );
m_inferredType->Enable( inferred );
m_staticTextDevType->Enable( !fromLibrary );
m_deviceTypeChoice->Enable( !fromLibrary );
m_staticTextSpiceType->Enable( !fromLibrary );
m_typeChoice->Enable( !fromLibrary );
updateWidgets();
}
@ -1241,6 +1237,13 @@ void DIALOG_SIM_MODEL<T>::onExcludeCheckbox( wxCommandEvent& aEvent )
}
template <typename T>
void DIALOG_SIM_MODEL<T>::onInferCheckbox( wxCommandEvent& aEvent )
{
curModel().SetIsInferred( m_inferCheckbox->GetValue() );
}
template <typename T>
void DIALOG_SIM_MODEL<T>::onParamGridSetFocus( wxFocusEvent& aEvent )
{

View File

@ -92,7 +92,6 @@ private:
void updateWidgets();
void updateIbisWidgets();
void updateInstanceWidgets();
void updateModelParamsTab();
void updateModelCodeTab();
void updatePinAssignments();
@ -130,6 +129,7 @@ private:
void onPinAssignmentsGridCellChange( wxGridEvent& aEvent ) override;
void onPinAssignmentsGridSize( wxSizeEvent& aEvent ) override;
void onExcludeCheckbox( wxCommandEvent& aEvent ) override;
void onInferCheckbox( wxCommandEvent& aEvent ) override;
void onDifferentialCheckbox( wxCommandEvent& event ) override;
void onParamGridSetFocus( wxFocusEvent& aEvent );

View File

@ -29,74 +29,64 @@ DIALOG_SIM_MODEL_BASE::DIALOG_SIM_MODEL_BASE( wxWindow* parent, wxWindowID id, c
m_useLibraryModelRadioButton = new wxRadioButton( m_modelPanel, wxID_ANY, _("From library:"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
bSizerMargins->Add( m_useLibraryModelRadioButton, 0, wxLEFT, 5 );
wxGridBagSizer* gbSizer1;
gbSizer1 = new wxGridBagSizer( 3, 5 );
gbSizer1->SetFlexibleDirection( wxBOTH );
gbSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_sourceSizer = new wxFlexGridSizer( 0, 3, 2, 0 );
m_sourceSizer->AddGrowableCol( 1 );
m_sourceSizer->AddGrowableRow( 0 );
m_sourceSizer->SetFlexibleDirection( wxBOTH );
m_sourceSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_pathLabel = new wxStaticText( m_modelPanel, wxID_ANY, _("Library path:"), wxDefaultPosition, wxDefaultSize, 0 );
m_pathLabel->Wrap( -1 );
gbSizer1->Add( m_pathLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
wxBoxSizer* bSizer7;
bSizer7 = new wxBoxSizer( wxHORIZONTAL );
m_sourceSizer->Add( m_pathLabel, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
m_tclibraryPathName = new wxTextCtrl( m_modelPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
bSizer7->Add( m_tclibraryPathName, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 3 );
m_sourceSizer->Add( m_tclibraryPathName, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_browseButton = new wxBitmapButton( m_modelPanel, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
bSizer7->Add( m_browseButton, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
gbSizer1->Add( bSizer7, wxGBPosition( 0, 1 ), wxGBSpan( 1, 2 ), wxEXPAND, 5 );
m_sourceSizer->Add( m_browseButton, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_modelNameLabel = new wxStaticText( m_modelPanel, wxID_ANY, _("Model:"), wxDefaultPosition, wxDefaultSize, 0 );
m_modelNameLabel->Wrap( -1 );
gbSizer1->Add( m_modelNameLabel, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
m_sourceSizer->Add( m_modelNameLabel, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT, 5 );
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, 5 );
m_sourceSizer->Add( m_modelNameCombobox, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
m_overrideCheckbox = new wxCheckBox( m_modelPanel, wxID_ANY, _("Allow overrides"), wxDefaultPosition, wxDefaultSize, 0 );
gbSizer1->Add( m_overrideCheckbox, wxGBPosition( 1, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 40 );
m_overrideCheckbox = new wxCheckBox( m_modelPanel, wxID_ANY, _("Override"), wxDefaultPosition, wxDefaultSize, 0 );
m_sourceSizer->Add( m_overrideCheckbox, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 7 );
m_ibisPinLabel = new wxStaticText( m_modelPanel, wxID_ANY, _("Pin:"), wxDefaultPosition, wxDefaultSize, 0 );
m_ibisPinLabel->Wrap( -1 );
gbSizer1->Add( m_ibisPinLabel, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
m_sourceSizer->Add( m_ibisPinLabel, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT, 5 );
m_ibisPinCombobox = new wxComboBox( m_modelPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxTE_PROCESS_ENTER );
gbSizer1->Add( m_ibisPinCombobox, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), 0, 5 );
m_sourceSizer->Add( m_ibisPinCombobox, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
m_differentialCheckbox = new wxCheckBox( m_modelPanel, wxID_ANY, _("Differential"), wxDefaultPosition, wxDefaultSize, 0 );
gbSizer1->Add( m_differentialCheckbox, wxGBPosition( 2, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 40 );
m_sourceSizer->Add( m_differentialCheckbox, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 7 );
m_ibisModelLabel = new wxStaticText( m_modelPanel, wxID_ANY, _("Model:"), wxDefaultPosition, wxDefaultSize, 0 );
m_ibisModelLabel->Wrap( -1 );
gbSizer1->Add( m_ibisModelLabel, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
m_sourceSizer->Add( m_ibisModelLabel, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT, 5 );
m_ibisModelCombobox = new wxComboBox( m_modelPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxTE_PROCESS_ENTER );
gbSizer1->Add( m_ibisModelCombobox, wxGBPosition( 3, 1 ), wxGBSpan( 1, 1 ), 0, 5 );
m_sourceSizer->Add( m_ibisModelCombobox, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
gbSizer1->AddGrowableCol( 1 );
bSizerMargins->Add( gbSizer1, 0, wxLEFT|wxEXPAND, 28 );
bSizerMargins->Add( 0, 18, 0, 0, 5 );
bSizerMargins->Add( m_sourceSizer, 0, wxEXPAND|wxBOTTOM|wxLEFT, 24 );
m_useInstanceModelRadioButton = new wxRadioButton( m_modelPanel, wxID_ANY, _("From symbol instance:"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerMargins->Add( m_useInstanceModelRadioButton, 0, wxBOTTOM|wxLEFT, 5 );
wxFlexGridSizer* fgSizer16;
fgSizer16 = new wxFlexGridSizer( 0, 2, 6, 5 );
fgSizer16 = new wxFlexGridSizer( 0, 2, 8, 0 );
fgSizer16->AddGrowableCol( 1 );
fgSizer16->SetFlexibleDirection( wxBOTH );
fgSizer16->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_staticTextDevType = new wxStaticText( m_modelPanel, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextDevType->Wrap( -1 );
fgSizer16->Add( m_staticTextDevType, 0, wxALIGN_CENTER_VERTICAL, 5 );
fgSizer16->Add( m_staticTextDevType, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
wxArrayString m_deviceTypeChoiceChoices;
m_deviceTypeChoice = new wxChoice( m_modelPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_deviceTypeChoiceChoices, 0 );
@ -105,7 +95,7 @@ DIALOG_SIM_MODEL_BASE::DIALOG_SIM_MODEL_BASE( wxWindow* parent, wxWindowID id, c
m_staticTextSpiceType = new wxStaticText( m_modelPanel, wxID_ANY, _("Type:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextSpiceType->Wrap( -1 );
fgSizer16->Add( m_staticTextSpiceType, 0, wxALIGN_CENTER_VERTICAL, 5 );
fgSizer16->Add( m_staticTextSpiceType, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
wxArrayString m_typeChoiceChoices;
m_typeChoice = new wxChoice( m_modelPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_typeChoiceChoices, 0 );
@ -113,39 +103,10 @@ DIALOG_SIM_MODEL_BASE::DIALOG_SIM_MODEL_BASE( wxWindow* parent, wxWindowID id, c
fgSizer16->Add( m_typeChoice, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT, 10 );
bSizerMargins->Add( fgSizer16, 0, wxEXPAND|wxLEFT, 28 );
bSizerMargins->Add( fgSizer16, 0, wxEXPAND|wxLEFT, 24 );
bSizerMargins->Add( 0, 22, 0, 0, 5 );
m_inferInstanceModelRadioButton = new wxRadioButton( m_modelPanel, wxID_ANY, _("From symbol's reference designator and value:"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerMargins->Add( m_inferInstanceModelRadioButton, 0, wxBOTTOM|wxLEFT, 5 );
wxFlexGridSizer* fgSizer3;
fgSizer3 = new wxFlexGridSizer( 0, 2, 5, 5 );
fgSizer3->AddGrowableCol( 1 );
fgSizer3->SetFlexibleDirection( wxBOTH );
fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_inferredDeviceLabel = new wxStaticText( m_modelPanel, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0 );
m_inferredDeviceLabel->Wrap( -1 );
fgSizer3->Add( m_inferredDeviceLabel, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_inferredDevice = new wxTextCtrl( m_modelPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
fgSizer3->Add( m_inferredDevice, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 10 );
m_inferredTypeLabel = new wxStaticText( m_modelPanel, wxID_ANY, _("Type:"), wxDefaultPosition, wxDefaultSize, 0 );
m_inferredTypeLabel->Wrap( -1 );
fgSizer3->Add( m_inferredTypeLabel, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_inferredType = new wxTextCtrl( m_modelPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
fgSizer3->Add( m_inferredType, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT, 10 );
bSizerMargins->Add( fgSizer3, 0, wxEXPAND|wxLEFT, 28 );
bSizerMargins->Add( 0, 5, 0, 0, 5 );
bSizerMargins->Add( 0, 10, 0, 0, 5 );
m_notebook4 = new wxNotebook( m_modelPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_parametersPanel = new wxPanel( m_notebook4, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
@ -268,14 +229,20 @@ DIALOG_SIM_MODEL_BASE::DIALOG_SIM_MODEL_BASE( wxWindow* parent, wxWindowID id, c
bSizer8->Add( m_notebook, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bSizerBottom;
bSizerBottom = new wxBoxSizer( wxHORIZONTAL );
wxGridSizer* gSizer1;
gSizer1 = new wxGridSizer( 0, 2, 0, 0 );
m_excludeCheckbox = new wxCheckBox( this, wxID_ANY, _("Exclude from simulation"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerBottom->Add( m_excludeCheckbox, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
gSizer1->Add( m_excludeCheckbox, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_inferCheckbox = new wxCheckBox( this, wxID_ANY, _("Store in Reference and Value"), wxDefaultPosition, wxDefaultSize, 0 );
gSizer1->Add( m_inferCheckbox, 0, wxALIGN_RIGHT|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizerBottom->Add( 30, 0, 1, wxEXPAND, 5 );
bSizer8->Add( gSizer1, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizer8->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
m_sdbSizer1 = new wxStdDialogButtonSizer();
m_sdbSizer1OK = new wxButton( this, wxID_OK );
@ -284,10 +251,7 @@ DIALOG_SIM_MODEL_BASE::DIALOG_SIM_MODEL_BASE( wxWindow* parent, wxWindowID id, c
m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
m_sdbSizer1->Realize();
bSizerBottom->Add( m_sdbSizer1, 0, wxEXPAND|wxALL, 5 );
bSizer8->Add( bSizerBottom, 0, wxEXPAND|wxLEFT, 5 );
bSizer8->Add( m_sdbSizer1, 0, wxEXPAND|wxALL, 5 );
this->SetSizer( bSizer8 );
@ -326,12 +290,12 @@ DIALOG_SIM_MODEL_BASE::DIALOG_SIM_MODEL_BASE( wxWindow* parent, wxWindowID id, c
m_deviceTypeChoice->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SIM_MODEL_BASE::onDeviceTypeChoiceUpdate ), NULL, this );
m_staticTextSpiceType->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SIM_MODEL_BASE::onTypeLabelUpdate ), NULL, this );
m_typeChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onTypeChoice ), NULL, this );
m_inferInstanceModelRadioButton->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onRadioButton ), NULL, this );
m_paramGridMgr->Connect( wxEVT_PG_CHANGED, wxPropertyGridEventHandler( DIALOG_SIM_MODEL_BASE::onParamGridChanged ), NULL, this );
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_excludeCheckbox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onExcludeCheckbox ), NULL, this );
m_inferCheckbox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onInferCheckbox ), NULL, this );
}
DIALOG_SIM_MODEL_BASE::~DIALOG_SIM_MODEL_BASE()
@ -366,11 +330,11 @@ DIALOG_SIM_MODEL_BASE::~DIALOG_SIM_MODEL_BASE()
m_deviceTypeChoice->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SIM_MODEL_BASE::onDeviceTypeChoiceUpdate ), NULL, this );
m_staticTextSpiceType->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SIM_MODEL_BASE::onTypeLabelUpdate ), NULL, this );
m_typeChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onTypeChoice ), NULL, this );
m_inferInstanceModelRadioButton->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onRadioButton ), NULL, this );
m_paramGridMgr->Disconnect( wxEVT_PG_CHANGED, wxPropertyGridEventHandler( DIALOG_SIM_MODEL_BASE::onParamGridChanged ), NULL, this );
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_excludeCheckbox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onExcludeCheckbox ), NULL, this );
m_inferCheckbox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onInferCheckbox ), NULL, this );
}

File diff suppressed because it is too large Load Diff

View File

@ -26,10 +26,9 @@ class WX_GRID;
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/button.h>
#include <wx/sizer.h>
#include <wx/combobox.h>
#include <wx/checkbox.h>
#include <wx/gbsizer.h>
#include <wx/sizer.h>
#include <wx/choice.h>
#include <wx/propgrid/propgrid.h>
#include <wx/propgrid/manager.h>
@ -38,6 +37,7 @@ class WX_GRID;
#include <wx/stc/stc.h>
#include <wx/notebook.h>
#include <wx/grid.h>
#include <wx/statline.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
@ -54,6 +54,7 @@ class DIALOG_SIM_MODEL_BASE : public DIALOG_SHIM
wxNotebook* m_notebook;
wxPanel* m_modelPanel;
wxRadioButton* m_useLibraryModelRadioButton;
wxFlexGridSizer* m_sourceSizer;
wxStaticText* m_pathLabel;
wxTextCtrl* m_tclibraryPathName;
wxBitmapButton* m_browseButton;
@ -70,11 +71,6 @@ class DIALOG_SIM_MODEL_BASE : public DIALOG_SHIM
wxChoice* m_deviceTypeChoice;
wxStaticText* m_staticTextSpiceType;
wxChoice* m_typeChoice;
wxRadioButton* m_inferInstanceModelRadioButton;
wxStaticText* m_inferredDeviceLabel;
wxTextCtrl* m_inferredDevice;
wxStaticText* m_inferredTypeLabel;
wxTextCtrl* m_inferredType;
wxNotebook* m_notebook4;
wxPanel* m_parametersPanel;
wxPropertyGridManager* m_paramGridMgr;
@ -84,6 +80,8 @@ class DIALOG_SIM_MODEL_BASE : public DIALOG_SHIM
wxPanel* m_pinAssignmentsPanel;
WX_GRID* m_pinAssignmentsGrid;
wxCheckBox* m_excludeCheckbox;
wxCheckBox* m_inferCheckbox;
wxStaticLine* m_staticline1;
wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Cancel;
@ -118,6 +116,7 @@ class DIALOG_SIM_MODEL_BASE : public DIALOG_SHIM
virtual void onPinAssignmentsGridCellChange( wxGridEvent& event ) { event.Skip(); }
virtual void onPinAssignmentsGridSize( wxSizeEvent& event ) { event.Skip(); }
virtual void onExcludeCheckbox( wxCommandEvent& event ) { event.Skip(); }
virtual void onInferCheckbox( wxCommandEvent& event ) { event.Skip(); }
public: