27 #ifndef SPICE_SIMULATOR_H 28 #define SPICE_SIMULATOR_H 38 #include <wx/string.h> 42 typedef std::complex<double>
COMPLEX;
56 static std::shared_ptr<SPICE_SIMULATOR>
CreateInstance(
const std::string& aName );
71 virtual bool LoadNetlist(
const std::string& aNetlist ) = 0;
78 virtual bool Run() = 0;
85 virtual bool Stop() = 0;
99 virtual bool Command(
const std::string& aCmd ) = 0;
115 virtual std::vector<std::string>
AllPlots()
const = 0;
126 virtual std::vector<COMPLEX>
GetPlot(
const std::string& aName,
int aMaxLen = -1 ) = 0;
137 virtual std::vector<double>
GetRealPlot(
const std::string& aName,
int aMaxLen = -1 ) = 0;
148 virtual std::vector<double>
GetImagPlot(
const std::string& aName,
int aMaxLen = -1 ) = 0;
158 virtual std::vector<double>
GetMagPlot(
const std::string& aName,
int aMaxLen = -1 ) = 0;
168 virtual std::vector<double>
GetPhasePlot(
const std::string& aName,
int aMaxLen = -1 ) = 0;
175 virtual const std::string
GetNetlist()
const = 0;
virtual std::string GetXAxis(SIM_TYPE aType) const =0
Set a SPICE_REPORTER object to receive the simulation log.
virtual bool IsRunning()=0
Check if simulation is running at the moment.
virtual std::vector< double > GetPhasePlot(const std::string &aName, int aMaxLen=-1)=0
Return a requested vector with phase values.
virtual void SetReporter(SPICE_REPORTER *aReporter)
virtual std::vector< COMPLEX > GetPlot(const std::string &aName, int aMaxLen=-1)=0
Return a requested vector with complex values.
virtual std::vector< double > GetRealPlot(const std::string &aName, int aMaxLen=-1)=0
Return a requested vector with real values.
virtual std::vector< std::string > AllPlots() const =0
Return a list with all vectors generated in current simulation.
std::complex< double > COMPLEX
virtual const std::string GetNetlist() const =0
Return current SPICE netlist used by the simulator.
SPICE_REPORTER * m_reporter
< Reporter object to receive simulation log.
std::shared_ptr< SPICE_SIMULATOR_SETTINGS > & Settings()
Return the simulator configuration settings.
static wxString TypeToName(SIM_TYPE aType, bool aShortName)
Return a string with simulation name based on enum.
const std::shared_ptr< SPICE_SIMULATOR_SETTINGS > & Settings() const
SIM_TYPE
< Possible simulation types
std::shared_ptr< SPICE_SIMULATOR_SETTINGS > m_settings
Interface to receive simulation updates from SPICE_SIMULATOR class.
virtual bool Command(const std::string &aCmd)=0
Execute a Spice command as if it was typed into console.
static std::shared_ptr< SPICE_SIMULATOR > CreateInstance(const std::string &aName)
virtual bool LoadNetlist(const std::string &aNetlist)=0
Load a netlist for the simulation.
virtual bool Run()=0
Execute the simulation with currently loaded netlist.
virtual std::vector< std::string > GetSettingCommands() const =0
virtual void Init(const SPICE_SIMULATOR_SETTINGS *aSettings=nullptr)=0
virtual std::vector< double > GetImagPlot(const std::string &aName, int aMaxLen=-1)=0
Return a requested vector with imaginary values.
virtual bool Stop()=0
Halt the simulation.
virtual ~SPICE_SIMULATOR()
Create a simulator instance of particular type (currently only ngspice is handled)
virtual std::vector< double > GetMagPlot(const std::string &aName, int aMaxLen=-1)=0
Return a requested vector with magnitude values.
Storage for simulator specific settings.