Added Component::getSpiceModel() method

This commit is contained in:
Vadim Kuznetzov 2015-10-01 18:11:28 +03:00
parent 4b2635e25f
commit ce58f63e9a
5 changed files with 20 additions and 4 deletions

View File

@ -747,6 +747,11 @@ QString Component::getProbeVariable(bool)
return QString("");
}
QString Component::getSpiceModel()
{
return QString("");
}
QString Component::getNgspiceBeforeSim(QString sim, int lvl)
{
Q_UNUSED(sim); // To supress warning

View File

@ -41,6 +41,7 @@ public:
virtual QString getExpression(bool isXyce = false);
virtual QString getEquations(QString sim, QStringList &dep_vars);
virtual QString getProbeVariable(bool isXyce = false);
virtual QString getSpiceModel();
virtual QString getNgspiceBeforeSim(QString sim, int lvl=0);
virtual QString getNgspiceAfterSim(QString sim, int lvl=0);
virtual QString getVAvariables() {return QString("");};

View File

@ -74,14 +74,16 @@ Element* S4Q_Model::info(QString& Name, char* &BitmapFile, bool getNewOne)
return 0;
}
QString S4Q_Model::getExpression(bool)
QString S4Q_Model::getSpiceModel()
{
if (isActive != COMP_IS_ACTIVE) return QString("");
QString s;
s.clear();
foreach (Property *pp, Props)
s += pp->Value;
foreach (Property *pp, Props) {
if (!pp->Value.isEmpty())
s += pp->Value + "\n";
}
return s;
}

View File

@ -28,7 +28,7 @@ public:
~S4Q_Model();
Component* newOne();
static Element* info(QString&, char* &, bool getNewOne=false);
QString getExpression(bool isXyce);
QString getSpiceModel();
protected:
QString vhdlCode(int) { return QString(""); }

View File

@ -127,6 +127,7 @@ bool AbstractSpiceKernel::checkSchematic(QStringList &incompat)
void AbstractSpiceKernel::startNetlist(QTextStream &stream, bool xyce)
{
QString s;
// Parameters, Initial conditions, Options
for(Component *pc = Sch->DocComps.first(); pc != 0; pc = Sch->DocComps.next()) {
if (pc->isEquation) {
s = pc->getExpression(xyce);
@ -134,6 +135,7 @@ void AbstractSpiceKernel::startNetlist(QTextStream &stream, bool xyce)
}
}
// Components
for(Component *pc = Sch->DocComps.first(); pc != 0; pc = Sch->DocComps.next()) {
if(Sch->isAnalog &&
!(pc->isSimulation) &&
@ -142,6 +144,12 @@ void AbstractSpiceKernel::startNetlist(QTextStream &stream, bool xyce)
stream<<s;
}
}
// Modelcards
for(Component *pc = Sch->DocComps.first(); pc != 0; pc = Sch->DocComps.next()) {
s = pc->getSpiceModel();
stream<<s;
}
}
/*!