SPICE_SIMULATOR::GetXAxis()
This commit is contained in:
parent
27a7a9b1a5
commit
caef84d622
|
@ -248,6 +248,31 @@ bool NGSPICE::Command( const string& aCmd )
|
|||
}
|
||||
|
||||
|
||||
string NGSPICE::GetXAxis( SIM_TYPE aType ) const
|
||||
{
|
||||
switch( aType )
|
||||
{
|
||||
case ST_AC:
|
||||
case ST_NOISE:
|
||||
return string( "frequency" );
|
||||
break;
|
||||
|
||||
case ST_DC:
|
||||
return string( "v-sweep" );
|
||||
break;
|
||||
|
||||
case ST_TRANSIENT:
|
||||
return string( "time" );
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return string( "" );
|
||||
}
|
||||
|
||||
|
||||
void NGSPICE::dump()
|
||||
{
|
||||
// m_ngSpice_Command("run\n");
|
||||
|
|
|
@ -42,6 +42,7 @@ public:
|
|||
bool Stop() override;
|
||||
bool IsRunning() override;
|
||||
bool Command( const std::string& aCmd ) override;
|
||||
std::string GetXAxis( SIM_TYPE aType ) const override;
|
||||
|
||||
std::vector<COMPLEX> GetPlot( const std::string& aName, int aMaxLen = -1 ) override;
|
||||
std::vector<double> GetRealPlot( const std::string& aName, int aMaxLen = -1 ) override;
|
||||
|
|
|
@ -31,4 +31,17 @@ enum SIM_TYPE {
|
|||
ST_POLE_ZERO, ST_SENSITIVITY, ST_TRANS_FUNC, ST_TRANSIENT
|
||||
};
|
||||
|
||||
///> Possible plot types
|
||||
enum SIM_PLOT_TYPE {
|
||||
// Y axis
|
||||
SPT_VOLTAGE = 0x01,
|
||||
SPT_CURRENT = 0x02,
|
||||
SPT_AC_PHASE = 0x04,
|
||||
SPT_AC_MAG = 0x08,
|
||||
|
||||
SPT_TIME = 0x10,
|
||||
SPT_FREQUENCY = 0x20,
|
||||
SPT_SWEEP = 0x40
|
||||
};
|
||||
|
||||
#endif /* SIM_TYPES_H */
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
#ifndef SPICE_SIMULATOR_H
|
||||
#define SPICE_SIMULATOR_H
|
||||
|
||||
#include "sim_types.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <complex>
|
||||
|
@ -48,6 +50,9 @@ public:
|
|||
virtual bool IsRunning() = 0;
|
||||
virtual bool Command( const std::string& aCmd ) = 0;
|
||||
|
||||
///> Returns X axis name for a given simulation type
|
||||
virtual std::string GetXAxis( SIM_TYPE aType ) const = 0;
|
||||
|
||||
virtual void SetReporter( SPICE_REPORTER* aReporter )
|
||||
{
|
||||
m_reporter = aReporter;
|
||||
|
|
Loading…
Reference in New Issue