Sim Model Editor: Checkbox for toggling inference
This commit is contained in:
parent
c8e13813d9
commit
2475a703d6
|
@ -189,6 +189,11 @@ 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 );
|
||||
|
||||
updateWidgets();
|
||||
|
||||
|
@ -248,10 +253,18 @@ bool DIALOG_SIM_MODEL<T>::TransferDataFromWindow()
|
|||
template <typename T>
|
||||
void DIALOG_SIM_MODEL<T>::updateWidgets()
|
||||
{
|
||||
m_overrideCheckbox->SetValue( curModel().HasNonInstanceOverrides() );
|
||||
|
||||
updateIbisWidgets();
|
||||
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();
|
||||
|
@ -1135,6 +1148,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>::onLibraryPathUpdate( wxUpdateUIEvent& aEvent )
|
||||
{
|
||||
|
|
|
@ -115,6 +115,7 @@ private:
|
|||
void onPinAssignmentsGridCellChange( wxGridEvent& aEvent ) override;
|
||||
void onPinAssignmentsGridSize( wxSizeEvent& aEvent ) override;
|
||||
void onExcludeCheckbox( wxCommandEvent& aEvent ) override;
|
||||
void onInferCheckbox( wxCommandEvent& aEvent ) override;
|
||||
|
||||
void onLibraryPathUpdate( wxUpdateUIEvent& aEvent ) override;
|
||||
void onBrowseButtonUpdate( wxUpdateUIEvent& aEvent ) override;
|
||||
|
|
|
@ -236,8 +236,17 @@ 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 );
|
||||
|
||||
wxGridSizer* gSizer1;
|
||||
gSizer1 = new wxGridSizer( 0, 2, 0, 0 );
|
||||
|
||||
m_excludeCheckbox = new wxCheckBox( this, wxID_ANY, _("Exclude from simulation"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer8->Add( m_excludeCheckbox, 0, wxALL, 5 );
|
||||
gSizer1->Add( m_excludeCheckbox, 0, wxALL, 5 );
|
||||
|
||||
m_inferCheckbox = new wxCheckBox( this, wxID_ANY, _("Store in Reference and Value"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
gSizer1->Add( m_inferCheckbox, 0, wxALIGN_RIGHT|wxALL, 5 );
|
||||
|
||||
|
||||
bSizer8->Add( gSizer1, 0, wxEXPAND, 5 );
|
||||
|
||||
m_sdbSizer1 = new wxStdDialogButtonSizer();
|
||||
m_sdbSizer1OK = new wxButton( this, wxID_OK );
|
||||
|
@ -283,6 +292,7 @@ DIALOG_SIM_MODEL_BASE::DIALOG_SIM_MODEL_BASE( wxWindow* parent, wxWindowID id, c
|
|||
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()
|
||||
|
@ -316,5 +326,6 @@ DIALOG_SIM_MODEL_BASE::~DIALOG_SIM_MODEL_BASE()
|
|||
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 );
|
||||
|
||||
}
|
||||
|
|
|
@ -1800,67 +1800,146 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</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">Exclude from simulation</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>
|
||||
<object class="wxGridSizer" expanded="1">
|
||||
<property name="cols">2</property>
|
||||
<property name="hgap">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_excludeCheckbox</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></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">onExcludeCheckbox</event>
|
||||
<property name="name">gSizer1</property>
|
||||
<property name="permission">none</property>
|
||||
<property name="rows">0</property>
|
||||
<property name="vgap">0</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</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">Exclude from simulation</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_excludeCheckbox</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></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">onExcludeCheckbox</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_RIGHT|wxALL</property>
|
||||
<property name="proportion">0</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">Store in Reference and Value</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_inferCheckbox</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></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">onInferCheckbox</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
|
|
|
@ -79,6 +79,7 @@ class DIALOG_SIM_MODEL_BASE : public DIALOG_SHIM
|
|||
WX_GRID* m_pinAssignmentsGrid;
|
||||
wxStaticLine* m_staticline1;
|
||||
wxCheckBox* m_excludeCheckbox;
|
||||
wxCheckBox* m_inferCheckbox;
|
||||
wxStdDialogButtonSizer* m_sdbSizer1;
|
||||
wxButton* m_sdbSizer1OK;
|
||||
wxButton* m_sdbSizer1Cancel;
|
||||
|
@ -107,6 +108,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:
|
||||
|
|
|
@ -432,6 +432,26 @@ TYPE SIM_MODEL::ReadTypeFromFields( const std::vector<T>& aFields )
|
|||
}
|
||||
|
||||
|
||||
DEVICE_TYPE SIM_MODEL::InferDeviceTypeFromRef( const std::string& aRef )
|
||||
{
|
||||
|
||||
if( boost::starts_with( aRef, "R" ) )
|
||||
return DEVICE_TYPE::R;
|
||||
else if( boost::starts_with( aRef, "C" ) )
|
||||
return DEVICE_TYPE::C;
|
||||
else if( boost::starts_with( aRef, "L" ) )
|
||||
return DEVICE_TYPE::L;
|
||||
else if( boost::starts_with( aRef, "V" ) )
|
||||
return DEVICE_TYPE::V;
|
||||
else if( boost::starts_with( aRef, "I" ) )
|
||||
return DEVICE_TYPE::I;
|
||||
else if( boost::starts_with( aRef, "TL" ) )
|
||||
return DEVICE_TYPE::TLINE;
|
||||
|
||||
return DEVICE_TYPE::NONE;
|
||||
}
|
||||
|
||||
|
||||
TYPE SIM_MODEL::InferTypeFromRefAndValue( const std::string& aRef, const std::string& aValue )
|
||||
{
|
||||
std::string prefix;
|
||||
|
@ -454,22 +474,7 @@ TYPE SIM_MODEL::InferTypeFromRefAndValue( const std::string& aRef, const std::st
|
|||
{
|
||||
}
|
||||
|
||||
DEVICE_TYPE_ deviceType = DEVICE_TYPE_::NONE;
|
||||
|
||||
if( boost::starts_with( aRef, "R" ) )
|
||||
deviceType = DEVICE_TYPE_::R;
|
||||
else if( boost::starts_with( aRef, "C" ) )
|
||||
deviceType = DEVICE_TYPE_::C;
|
||||
else if( boost::starts_with( aRef, "L" ) )
|
||||
deviceType = DEVICE_TYPE_::L;
|
||||
else if( boost::starts_with( aRef, "V" ) )
|
||||
deviceType = DEVICE_TYPE_::V;
|
||||
else if( boost::starts_with( aRef, "I" ) )
|
||||
deviceType = DEVICE_TYPE_::I;
|
||||
else if( boost::starts_with( aRef, "TL" ) )
|
||||
deviceType = DEVICE_TYPE_::TLINE;
|
||||
else
|
||||
return TYPE::NONE;
|
||||
DEVICE_TYPE deviceType = InferDeviceTypeFromRef( aRef );
|
||||
|
||||
for( TYPE type : TYPE_ITERATOR() )
|
||||
{
|
||||
|
|
|
@ -484,6 +484,8 @@ public:
|
|||
template <typename T>
|
||||
static TYPE ReadTypeFromFields( const std::vector<T>& aFields );
|
||||
|
||||
static DEVICE_TYPE_ InferDeviceTypeFromRef( const std::string& aRef );
|
||||
|
||||
static TYPE InferTypeFromRefAndValue( const std::string& aRef, const std::string& aValue );
|
||||
|
||||
template <typename T>
|
||||
|
@ -603,6 +605,9 @@ public:
|
|||
void SetIsEnabled( bool aIsEnabled ) { m_isEnabled = aIsEnabled; }
|
||||
bool IsEnabled() const { return m_isEnabled; }
|
||||
|
||||
void SetIsInferred( bool aIsInferred ) { m_isInferred = aIsInferred; }
|
||||
bool IsInferred() const { return m_isInferred; }
|
||||
|
||||
protected:
|
||||
static std::unique_ptr<SIM_MODEL> Create( TYPE aType );
|
||||
|
||||
|
|
|
@ -46,8 +46,7 @@ std::string SPICE_GENERATOR_IDEAL::ItemLine( const SPICE_ITEM& aItem ) const
|
|||
|
||||
|
||||
SIM_MODEL_IDEAL::SIM_MODEL_IDEAL( TYPE aType ) :
|
||||
SIM_MODEL( aType, std::make_unique<SPICE_GENERATOR_IDEAL>( *this ) ),
|
||||
m_isInferred( false )
|
||||
SIM_MODEL( aType, std::make_unique<SPICE_GENERATOR_IDEAL>( *this ) )
|
||||
{
|
||||
static PARAM::INFO resistor = makeParamInfo( "r", "Resistance", "Ω" );
|
||||
static PARAM::INFO capacitor = makeParamInfo( "c", "Capacitance", "F" );
|
||||
|
@ -68,7 +67,7 @@ void SIM_MODEL_IDEAL::WriteDataSchFields( std::vector<SCH_FIELD>& aFields ) cons
|
|||
{
|
||||
SIM_MODEL::WriteDataSchFields( aFields );
|
||||
|
||||
if( m_isInferred )
|
||||
if( IsInferred() )
|
||||
inferredWriteDataFields( aFields );
|
||||
}
|
||||
|
||||
|
@ -77,7 +76,7 @@ void SIM_MODEL_IDEAL::WriteDataLibFields( std::vector<LIB_FIELD>& aFields ) cons
|
|||
{
|
||||
SIM_MODEL::WriteDataLibFields( aFields );
|
||||
|
||||
if( m_isInferred )
|
||||
if( IsInferred() )
|
||||
inferredWriteDataFields( aFields );
|
||||
}
|
||||
|
||||
|
|
|
@ -54,8 +54,6 @@ private:
|
|||
std::vector<std::string> getPinNames() const override { return { "+", "-" }; }
|
||||
|
||||
static PARAM::INFO makeParamInfo( std::string aName, std::string aDescription, std::string aUnit );
|
||||
|
||||
bool m_isInferred;
|
||||
};
|
||||
|
||||
#endif // SIM_MODEL_IDEAL_H
|
||||
|
|
|
@ -199,8 +199,7 @@ std::string SPICE_GENERATOR_SOURCE::getParamValueString( const std::string& aPar
|
|||
|
||||
|
||||
SIM_MODEL_SOURCE::SIM_MODEL_SOURCE( TYPE aType )
|
||||
: SIM_MODEL( aType, std::make_unique<SPICE_GENERATOR_SOURCE>( *this ) ),
|
||||
m_isInferred( false )
|
||||
: SIM_MODEL( aType, std::make_unique<SPICE_GENERATOR_SOURCE>( *this ) )
|
||||
{
|
||||
for( const SIM_MODEL::PARAM::INFO& paramInfo : makeParamInfos( aType ) )
|
||||
AddParam( paramInfo );
|
||||
|
@ -211,7 +210,7 @@ void SIM_MODEL_SOURCE::WriteDataSchFields( std::vector<SCH_FIELD>& aFields ) con
|
|||
{
|
||||
SIM_MODEL::WriteDataSchFields( aFields );
|
||||
|
||||
if( m_isInferred )
|
||||
if( IsInferred() )
|
||||
inferredWriteDataFields( aFields );
|
||||
}
|
||||
|
||||
|
@ -220,7 +219,7 @@ void SIM_MODEL_SOURCE::WriteDataLibFields( std::vector<LIB_FIELD>& aFields ) con
|
|||
{
|
||||
SIM_MODEL::WriteDataLibFields( aFields );
|
||||
|
||||
if( m_isInferred )
|
||||
if( IsInferred() )
|
||||
inferredWriteDataFields( aFields );
|
||||
}
|
||||
|
||||
|
@ -266,7 +265,14 @@ std::string SIM_MODEL_SOURCE::GenerateParamValuePair( const PARAM& aParam, bool&
|
|||
template <typename T>
|
||||
void SIM_MODEL_SOURCE::inferredWriteDataFields( std::vector<T>& aFields ) const
|
||||
{
|
||||
std::string value = GetFieldValue( &aFields, PARAMS_FIELD );
|
||||
std::string value;
|
||||
|
||||
if( GetTypeInfo().fieldValue != "" )
|
||||
value = fmt::format( "{} {}",
|
||||
GetTypeInfo().fieldValue,
|
||||
GetFieldValue( &aFields, PARAMS_FIELD ) );
|
||||
else
|
||||
value = fmt::format( "{}", GetFieldValue( &aFields, PARAMS_FIELD ) );
|
||||
|
||||
if( value == "" )
|
||||
value = GetDeviceTypeInfo().fieldValue;
|
||||
|
|
|
@ -98,9 +98,6 @@ private:
|
|||
static std::vector<PARAM::INFO> makeRandomPoissonParamInfos( std::string aPrefix, std::string aUnit );
|
||||
|
||||
static void appendAcParamInfos( std::vector<PARAM::INFO>& aParamInfos, std::string aUnit );
|
||||
|
||||
|
||||
bool m_isInferred;
|
||||
};
|
||||
|
||||
#endif // SIM_MODEL_SOURCE_H
|
||||
|
|
Loading…
Reference in New Issue