eeschema: rename m_exporter to m_circuitModel

This commit is contained in:
Sylwester Kocjan 2022-03-29 00:02:49 +02:00 committed by Mikolaj Wielgus
parent f5dedd77c6
commit 4719fdc9bf
6 changed files with 48 additions and 48 deletions

View File

@ -32,10 +32,10 @@
DIALOG_SIGNAL_LIST::DIALOG_SIGNAL_LIST( SIM_PLOT_FRAME* aParent,
NGSPICE_CIRCUIT_MODEL* aExporter ) :
NGSPICE_CIRCUIT_MODEL* aCircuitModel ) :
DIALOG_SIGNAL_LIST_BASE( aParent ),
m_plotFrame( aParent ),
m_exporter( aExporter )
m_circuitModel( aCircuitModel )
{
}
@ -56,10 +56,10 @@ bool DIALOG_SIGNAL_LIST::TransferDataToWindow()
{
// Create a list of possible signals
/// @todo it could include separated mag & phase for AC analysis
if( m_exporter )
if( m_circuitModel )
{
// Voltage list
for( const auto& net : m_exporter->GetNetIndexMap() )
for( const auto& net : m_circuitModel->GetNetIndexMap() )
{
// netnames are escaped (can contain "{slash}" for '/') Unscape them:
wxString netname = UnescapeString( net.first );
@ -68,11 +68,11 @@ bool DIALOG_SIGNAL_LIST::TransferDataToWindow()
m_signals->Append( wxString::Format( "V(%s)", netname ) );
}
auto simType = m_exporter->GetSimType();
auto simType = m_circuitModel->GetSimType();
if( simType == ST_TRANSIENT || simType == ST_DC )
{
for( const auto& item : m_exporter->GetSpiceItems() )
for( const auto& item : m_circuitModel->GetSpiceItems() )
{
// Add all possible currents for the primitive
for( const auto& current :

View File

@ -33,7 +33,7 @@ class NGSPICE_CIRCUIT_MODEL;
class DIALOG_SIGNAL_LIST : public DIALOG_SIGNAL_LIST_BASE
{
public:
DIALOG_SIGNAL_LIST( SIM_PLOT_FRAME* aParent, NGSPICE_CIRCUIT_MODEL* aExporter );
DIALOG_SIGNAL_LIST( SIM_PLOT_FRAME* aParent, NGSPICE_CIRCUIT_MODEL* aCircuitModel );
bool TransferDataFromWindow() override;
bool TransferDataToWindow() override;
@ -48,7 +48,7 @@ private:
bool addSignalToPlotFrame( const wxString& aPlotName );
SIM_PLOT_FRAME* m_plotFrame;
NGSPICE_CIRCUIT_MODEL* m_exporter;
NGSPICE_CIRCUIT_MODEL* m_circuitModel;
};
#endif /* DIALOG_SIGNAL_LIST_H */

View File

@ -57,10 +57,10 @@ static wxString getStringSelection( const wxChoice* aCtrl )
DIALOG_SIM_SETTINGS::DIALOG_SIM_SETTINGS( wxWindow* aParent,
std::shared_ptr<NGSPICE_CIRCUIT_MODEL> aExporter,
std::shared_ptr<NGSPICE_CIRCUIT_MODEL> aCircuitModel,
std::shared_ptr<SPICE_SIMULATOR_SETTINGS>& aSettings ) :
DIALOG_SIM_SETTINGS_BASE( aParent ),
m_exporter( aExporter ),
m_circuitModel( aCircuitModel ),
m_settings( aSettings ),
m_spiceEmptyValidator( true )
{
@ -133,7 +133,7 @@ wxString DIALOG_SIM_SETTINGS::evaluateDCControls( wxChoice* aDcSource, wxTextCtr
{
// pick device name from exporter when something different than temperature is selected
if( dcSource.Cmp( "TEMP" ) )
dcSource = m_exporter->GetSpiceDevice( dcSource );
dcSource = m_circuitModel->GetSpiceDevice( dcSource );
return wxString::Format( "%s %s %s %s", dcSource,
SPICE_VALUE( aDcStart->GetValue() ).ToSpiceString(),
@ -224,7 +224,7 @@ bool DIALOG_SIM_SETTINGS::TransferDataFromWindow()
}
else if( page == m_pgNoise ) // Noise analysis
{
const std::map<wxString, int>& netMap = m_exporter->GetNetIndexMap();
const std::map<wxString, int>& netMap = m_circuitModel->GetNetIndexMap();
if( empty( m_noiseMeas ) || empty( m_noiseSrc ) || empty( m_noisePointsNumber )
|| empty( m_noiseFreqStart ) || empty( m_noiseFreqStop ) )
@ -237,7 +237,7 @@ bool DIALOG_SIM_SETTINGS::TransferDataFromWindow()
if( !empty( m_noiseRef ) )
ref = wxString::Format( ", %d", netMap.at( m_noiseRef->GetValue() ) );
wxString noiseSource = m_exporter->GetSpiceDevice( m_noiseSrc->GetValue() );
wxString noiseSource = m_circuitModel->GetSpiceDevice( m_noiseSrc->GetValue() );
// Add voltage source prefix if needed
if( noiseSource[0] != 'v' && noiseSource[0] != 'V' )
@ -370,7 +370,7 @@ int DIALOG_SIM_SETTINGS::ShowModal()
for( auto c : cmbNet )
c.first->Clear();
for( const auto& net : m_exporter->GetNetIndexMap() )
for( const auto& net : m_circuitModel->GetNetIndexMap() )
{
for( auto c : cmbNet )
c.first->Append( net.first );
@ -401,7 +401,7 @@ void DIALOG_SIM_SETTINGS::updateDCSources( wxChar aType, wxChoice* aSource )
if( aType != 'T' )
{
for( const auto& item : m_exporter->GetSpiceItems() )
for( const auto& item : m_circuitModel->GetSpiceItems() )
{
if( item.m_primitive == aType && !item.m_refName.IsEmpty() )
sourcesList.insert( item.m_refName );
@ -464,7 +464,7 @@ bool DIALOG_SIM_SETTINGS::parseCommand( const wxString& aCommand )
SPICE_DC_PARAMS src1, src2;
src2.m_vincrement = SPICE_VALUE( -1 );
if( !m_exporter->ParseDCCommand( aCommand, &src1, &src2 ) )
if( !m_circuitModel->ParseDCCommand( aCommand, &src1, &src2 ) )
return false;
m_simPages->SetSelection( m_simPages->FindPage( m_pgDC ) );
@ -601,8 +601,8 @@ void DIALOG_SIM_SETTINGS::updateDCUnits( wxChar aType, wxChoice* aSource,
void DIALOG_SIM_SETTINGS::loadDirectives()
{
if( m_exporter )
m_customTxt->SetValue( m_exporter->GetSheetSimCommand() );
if( m_circuitModel )
m_customTxt->SetValue( m_circuitModel->GetSheetSimCommand() );
}

View File

@ -39,7 +39,7 @@ class SPICE_SIMULATOR_SETTINGS;
class DIALOG_SIM_SETTINGS : public DIALOG_SIM_SETTINGS_BASE
{
public:
DIALOG_SIM_SETTINGS( wxWindow* aParent, std::shared_ptr<NGSPICE_CIRCUIT_MODEL> aExporter,
DIALOG_SIM_SETTINGS( wxWindow* aParent, std::shared_ptr<NGSPICE_CIRCUIT_MODEL> aCircuitModel,
std::shared_ptr<SPICE_SIMULATOR_SETTINGS>& aSettings );
const wxString& GetSimCommand() const
@ -178,7 +178,7 @@ private:
wxString m_simCommand;
int m_netlistOpts;
std::shared_ptr<NGSPICE_CIRCUIT_MODEL> m_exporter;
std::shared_ptr<NGSPICE_CIRCUIT_MODEL> m_circuitModel;
std::shared_ptr<SPICE_SIMULATOR_SETTINGS> m_settings;
SPICE_VALIDATOR m_spiceValidator;
SPICE_VALIDATOR m_spiceEmptyValidator;

View File

@ -157,7 +157,7 @@ SIM_PLOT_FRAME::SIM_PLOT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
// instead of being behind the dialog frame (as it does)
m_settingsDlg = nullptr;
m_exporter.reset( new NGSPICE_CIRCUIT_MODEL( &m_schematicFrame->Schematic() ) );
m_circuitModel.reset( new NGSPICE_CIRCUIT_MODEL( &m_schematicFrame->Schematic() ) );
Bind( EVT_SIM_UPDATE, &SIM_PLOT_FRAME::onSimUpdate, this );
Bind( EVT_SIM_REPORT, &SIM_PLOT_FRAME::onSimReport, this );
@ -454,22 +454,22 @@ void SIM_PLOT_FRAME::setSubWindowsSashSize()
void SIM_PLOT_FRAME::StartSimulation( const wxString& aSimCommand )
{
wxCHECK_RET( m_exporter->CommandToSimType( getCurrentSimCommand() ) != ST_UNKNOWN,
wxCHECK_RET( m_circuitModel->CommandToSimType( getCurrentSimCommand() ) != ST_UNKNOWN,
"Unknown simulation type" );
if( !m_settingsDlg )
m_settingsDlg = new DIALOG_SIM_SETTINGS( this, m_exporter, m_simulator->Settings() );
m_settingsDlg = new DIALOG_SIM_SETTINGS( this, m_circuitModel, m_simulator->Settings() );
m_simConsole->Clear();
if( aSimCommand.IsEmpty() )
m_exporter->SetSimCommand( getCurrentSimCommand() );
m_circuitModel->SetSimCommand( getCurrentSimCommand() );
else
m_exporter->SetSimCommand( aSimCommand );
m_circuitModel->SetSimCommand( aSimCommand );
m_exporter->SetOptions( m_settingsDlg->GetNetlistOptions() );
m_circuitModel->SetOptions( m_settingsDlg->GetNetlistOptions() );
if( !m_simulator->Attach( m_exporter ) )
if( !m_simulator->Attach( m_circuitModel ) )
{
DisplayErrorMessage( this, _( "There were errors during netlist export, aborted." ) );
return;
@ -615,7 +615,7 @@ SIM_PLOT_PANEL* SIM_PLOT_FRAME::GetCurrentPlot() const
const NGSPICE_CIRCUIT_MODEL* SIM_PLOT_FRAME::GetExporter() const
{
return m_exporter.get();
return m_circuitModel.get();
}
@ -629,7 +629,7 @@ std::shared_ptr<SPICE_SIMULATOR_SETTINGS>& SIM_PLOT_FRAME::GetSimulatorSettings(
void SIM_PLOT_FRAME::addPlot( const wxString& aName, SIM_PLOT_TYPE aType, const wxString& aParam )
{
SIM_TYPE simType = m_exporter->GetSimType();
SIM_TYPE simType = m_circuitModel->GetSimType();
if( simType == ST_UNKNOWN )
{
@ -650,7 +650,7 @@ void SIM_PLOT_FRAME::addPlot( const wxString& aName, SIM_PLOT_TYPE aType, const
if( !plotPanel || plotPanel->GetType() != simType )
{
plotPanel =
dynamic_cast<SIM_PLOT_PANEL*>( NewPlotPanel( m_exporter->GetUsedSimCommand() ) );
dynamic_cast<SIM_PLOT_PANEL*>( NewPlotPanel( m_circuitModel->GetUsedSimCommand() ) );
}
wxASSERT( plotPanel );
@ -703,8 +703,8 @@ void SIM_PLOT_FRAME::removePlot( const wxString& aPlotName )
bool SIM_PLOT_FRAME::updatePlot( const wxString& aName, SIM_PLOT_TYPE aType, const wxString& aParam,
SIM_PLOT_PANEL* aPlotPanel )
{
SIM_TYPE simType = m_exporter->GetSimType();
wxString spiceVector = m_exporter->ComponentToVector( aName, aType, aParam );
SIM_TYPE simType = m_circuitModel->GetSimType();
wxString spiceVector = m_circuitModel->ComponentToVector( aName, aType, aParam );
wxString plotTitle = wxString::Format( "%s(%s)", aParam, aName );
if( aType & SPT_AC_MAG )
@ -735,7 +735,7 @@ bool SIM_PLOT_FRAME::updatePlot( const wxString& aName, SIM_PLOT_TYPE aType, con
std::vector<double> data_y;
// Now, Y axis data
switch( m_exporter->GetSimType() )
switch( m_circuitModel->GetSimType() )
{
case ST_AC:
wxASSERT_MSG( !( ( aType & SPT_AC_MAG ) && ( aType & SPT_AC_PHASE ) ),
@ -768,8 +768,8 @@ bool SIM_PLOT_FRAME::updatePlot( const wxString& aName, SIM_PLOT_TYPE aType, con
// for each input step
SPICE_DC_PARAMS source1, source2;
if( m_exporter->GetSimType() == ST_DC &&
m_exporter->ParseDCCommand( m_exporter->GetUsedSimCommand(), &source1, &source2 ) )
if( m_circuitModel->GetSimType() == ST_DC &&
m_circuitModel->ParseDCCommand( m_circuitModel->GetUsedSimCommand(), &source1, &source2 ) )
{
if( !source2.m_source.IsEmpty() )
{
@ -879,7 +879,7 @@ void SIM_PLOT_FRAME::updateSignalList()
void SIM_PLOT_FRAME::updateTuners()
{
const auto& spiceItems = m_exporter->GetSpiceItems();
const auto& spiceItems = m_circuitModel->GetSpiceItems();
for( auto it = m_tuners.begin(); it != m_tuners.end(); /* iteration inside the loop */ )
{
@ -1139,10 +1139,10 @@ SIM_PLOT_TYPE SIM_PLOT_FRAME::getXAxisType( SIM_TYPE aType ) const
void SIM_PLOT_FRAME::menuNewPlot( wxCommandEvent& aEvent )
{
SIM_TYPE type = m_exporter->GetSimType();
SIM_TYPE type = m_circuitModel->GetSimType();
if( SIM_PANEL_BASE::IsPlottable( type ) )
NewPlotPanel( m_exporter->GetUsedSimCommand() );
NewPlotPanel( m_circuitModel->GetUsedSimCommand() );
}
@ -1341,7 +1341,7 @@ void SIM_PLOT_FRAME::menuWhiteBackground( wxCommandEvent& event )
void SIM_PLOT_FRAME::menuSimulateUpdate( wxUpdateUIEvent& event )
{
event.Enable( m_exporter->CommandToSimType( getCurrentSimCommand() ) != ST_UNKNOWN );
event.Enable( m_circuitModel->CommandToSimType( getCurrentSimCommand() ) != ST_UNKNOWN );
}
@ -1451,9 +1451,9 @@ void SIM_PLOT_FRAME::onSettings( wxCommandEvent& event )
SIM_PANEL_BASE* plotPanelWindow = getCurrentPlotWindow();
if( !m_settingsDlg )
m_settingsDlg = new DIALOG_SIM_SETTINGS( this, m_exporter, m_simulator->Settings() );
m_settingsDlg = new DIALOG_SIM_SETTINGS( this, m_circuitModel, m_simulator->Settings() );
if( !m_exporter->ProcessNetlist( NET_ALL_FLAGS ) )
if( !m_circuitModel->ProcessNetlist( NET_ALL_FLAGS ) )
{
DisplayErrorMessage( this, _( "There were errors during netlist export, aborted." ) );
return;
@ -1501,13 +1501,13 @@ void SIM_PLOT_FRAME::onAddSignal( wxCommandEvent& event )
SIM_PLOT_PANEL* plotPanel = GetCurrentPlot();
if( !plotPanel || !m_exporter || plotPanel->GetType() != m_exporter->GetSimType() )
if( !plotPanel || !m_circuitModel || plotPanel->GetType() != m_circuitModel->GetSimType() )
{
DisplayInfoMessage( this, _( "You need to run plot-providing simulation first." ) );
return;
}
DIALOG_SIGNAL_LIST dialog( this, m_exporter.get() );
DIALOG_SIGNAL_LIST dialog( this, m_circuitModel.get() );
dialog.ShowModal();
}
@ -1697,7 +1697,7 @@ void SIM_PLOT_FRAME::onSimFinished( wxCommandEvent& aEvent )
m_toolBar->SetToolNormalBitmap( ID_SIM_RUN, KiBitmap( BITMAPS::sim_run ) );
SetCursor( wxCURSOR_ARROW );
SIM_TYPE simType = m_exporter->GetSimType();
SIM_TYPE simType = m_circuitModel->GetSimType();
if( simType == ST_UNKNOWN )
return;
@ -1705,7 +1705,7 @@ void SIM_PLOT_FRAME::onSimFinished( wxCommandEvent& aEvent )
SIM_PANEL_BASE* plotPanelWindow = getCurrentPlotWindow();
if( !plotPanelWindow || plotPanelWindow->GetType() != simType )
plotPanelWindow = NewPlotPanel( m_exporter->GetUsedSimCommand() );
plotPanelWindow = NewPlotPanel( m_circuitModel->GetUsedSimCommand() );
if( m_simulator->IsRunning() )
return;
@ -1760,7 +1760,7 @@ void SIM_PLOT_FRAME::onSimFinished( wxCommandEvent& aEvent )
double val = val_list.at( 0 );
wxString outLine, signal;
SIM_PLOT_TYPE type = m_exporter->VectorToSignal( vec, signal );
SIM_PLOT_TYPE type = m_circuitModel->VectorToSignal( vec, signal );
const size_t tab = 25; //characters
size_t padding = ( signal.length() < tab ) ? ( tab - signal.length() ) : 1;

View File

@ -248,7 +248,7 @@ private:
wxString getCurrentSimCommand() const
{
if( getCurrentPlotWindow() == nullptr )
return m_exporter->GetSheetSimCommand();
return m_circuitModel->GetSheetSimCommand();
else
return m_workbook->GetSimCommand( getCurrentPlotWindow() );
}
@ -333,7 +333,7 @@ private:
wxToolBarToolBase* m_toolSettings;
SCH_EDIT_FRAME* m_schematicFrame;
std::shared_ptr<NGSPICE_CIRCUIT_MODEL> m_exporter;
std::shared_ptr<NGSPICE_CIRCUIT_MODEL> m_circuitModel;
std::shared_ptr<SPICE_SIMULATOR> m_simulator;
SIM_THREAD_REPORTER* m_reporter;