mirror of
https://github.com/ra3xdh/qucs_s
synced 2025-03-28 21:13:26 +00:00
Merge pull request #35 from yrrapt/master
Added Field to Pass Parameters to Simulator
This commit is contained in:
commit
6101bb703b
@ -1285,7 +1285,7 @@ QString AbstractSpiceKernel::getOutput()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief AbstractSpiceKernel::setSimulatorCmd Set simualtor executable location
|
* \brief AbstractSpiceKernel::setSimulatorCmd Set simulator executable location
|
||||||
* \param cmd Simulator executable absolute path. For example /usr/bin/ngspice
|
* \param cmd Simulator executable absolute path. For example /usr/bin/ngspice
|
||||||
*/
|
*/
|
||||||
void AbstractSpiceKernel::setSimulatorCmd(QString cmd)
|
void AbstractSpiceKernel::setSimulatorCmd(QString cmd)
|
||||||
@ -1293,6 +1293,16 @@ void AbstractSpiceKernel::setSimulatorCmd(QString cmd)
|
|||||||
simulator_cmd = cmd;
|
simulator_cmd = cmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief AbstractSpiceKernel::setSimulatorParameters Set simulator parameters
|
||||||
|
* \param cmd Simulator executable absolute path. For example -plugin lib/Xyce_ADMS_Plugin.so
|
||||||
|
*/
|
||||||
|
void AbstractSpiceKernel::setSimulatorParameters(QString parameters)
|
||||||
|
{
|
||||||
|
simulator_parameters = parameters;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief AbstractSpiceKernel::setWorkdir Set simulator working directory path
|
* \brief AbstractSpiceKernel::setWorkdir Set simulator working directory path
|
||||||
* to store netlist and temp data.
|
* to store netlist and temp data.
|
||||||
|
@ -100,6 +100,7 @@ public:
|
|||||||
QString getOutput();
|
QString getOutput();
|
||||||
|
|
||||||
virtual void setSimulatorCmd(QString cmd);
|
virtual void setSimulatorCmd(QString cmd);
|
||||||
|
virtual void setSimulatorParameters(QString parameters);
|
||||||
void setWorkdir(QString path);
|
void setWorkdir(QString path);
|
||||||
virtual void SaveNetlist(QString filename);
|
virtual void SaveNetlist(QString filename);
|
||||||
virtual bool waitEndOfSimulation();
|
virtual bool waitEndOfSimulation();
|
||||||
|
@ -123,6 +123,7 @@ void ExternSimDialog::slotSetSimulator()
|
|||||||
connect(ngspice,SIGNAL(errors(QProcess::ProcessError)),this,SLOT(slotNgspiceStartError(QProcess::ProcessError)));
|
connect(ngspice,SIGNAL(errors(QProcess::ProcessError)),this,SLOT(slotNgspiceStartError(QProcess::ProcessError)));
|
||||||
connect(buttonSimulate,SIGNAL(clicked()),ngspice,SLOT(slotSimulate()));
|
connect(buttonSimulate,SIGNAL(clicked()),ngspice,SLOT(slotSimulate()));
|
||||||
ngspice->setSimulatorCmd(QucsSettings.NgspiceExecutable);
|
ngspice->setSimulatorCmd(QucsSettings.NgspiceExecutable);
|
||||||
|
ngspice->setSimulatorParameters(QucsSettings.SimParameters);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case spicecompat::simXyceSer: {
|
case spicecompat::simXyceSer: {
|
||||||
@ -131,6 +132,7 @@ void ExternSimDialog::slotSetSimulator()
|
|||||||
connect(xyce,SIGNAL(finished()),this,SLOT(slotProcessOutput()));
|
connect(xyce,SIGNAL(finished()),this,SLOT(slotProcessOutput()));
|
||||||
connect(xyce,SIGNAL(errors(QProcess::ProcessError)),this,SLOT(slotNgspiceStartError(QProcess::ProcessError)));
|
connect(xyce,SIGNAL(errors(QProcess::ProcessError)),this,SLOT(slotNgspiceStartError(QProcess::ProcessError)));
|
||||||
connect(buttonSimulate,SIGNAL(clicked()),xyce,SLOT(slotSimulate()));
|
connect(buttonSimulate,SIGNAL(clicked()),xyce,SLOT(slotSimulate()));
|
||||||
|
xyce->setSimulatorParameters(QucsSettings.SimParameters);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case spicecompat::simXycePar: {
|
case spicecompat::simXycePar: {
|
||||||
@ -143,6 +145,7 @@ void ExternSimDialog::slotSetSimulator()
|
|||||||
connect(xyce,SIGNAL(finished()),this,SLOT(slotProcessOutput()));
|
connect(xyce,SIGNAL(finished()),this,SLOT(slotProcessOutput()));
|
||||||
connect(xyce,SIGNAL(errors(QProcess::ProcessError)),this,SLOT(slotNgspiceStartError(QProcess::ProcessError)));
|
connect(xyce,SIGNAL(errors(QProcess::ProcessError)),this,SLOT(slotNgspiceStartError(QProcess::ProcessError)));
|
||||||
connect(buttonSimulate,SIGNAL(clicked()),xyce,SLOT(slotSimulate()));
|
connect(buttonSimulate,SIGNAL(clicked()),xyce,SLOT(slotSimulate()));
|
||||||
|
xyce->setSimulatorParameters(QucsSettings.SimParameters);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case spicecompat::simSpiceOpus: {
|
case spicecompat::simSpiceOpus: {
|
||||||
@ -152,6 +155,7 @@ void ExternSimDialog::slotSetSimulator()
|
|||||||
connect(ngspice,SIGNAL(errors(QProcess::ProcessError)),this,SLOT(slotNgspiceStartError(QProcess::ProcessError)),Qt::UniqueConnection);
|
connect(ngspice,SIGNAL(errors(QProcess::ProcessError)),this,SLOT(slotNgspiceStartError(QProcess::ProcessError)),Qt::UniqueConnection);
|
||||||
connect(buttonSimulate,SIGNAL(clicked()),ngspice,SLOT(slotSimulate()),Qt::UniqueConnection);
|
connect(buttonSimulate,SIGNAL(clicked()),ngspice,SLOT(slotSimulate()),Qt::UniqueConnection);
|
||||||
ngspice->setSimulatorCmd(QucsSettings.SpiceOpusExecutable);
|
ngspice->setSimulatorCmd(QucsSettings.SpiceOpusExecutable);
|
||||||
|
ngspice->setSimulatorParameters(QucsSettings.SimParameters);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: break;
|
default: break;
|
||||||
|
@ -564,12 +564,16 @@ void Ngspice::setSimulatorCmd(QString cmd)
|
|||||||
env.remove("LANG");
|
env.remove("LANG");
|
||||||
env.insert("LANG","en_US");
|
env.insert("LANG","en_US");
|
||||||
SimProcess->setProcessEnvironment(env);
|
SimProcess->setProcessEnvironment(env);
|
||||||
simulator_parameters="-c";
|
simulator_parameters = simulator_parameters + "-c";
|
||||||
} else { // restore system environment
|
} else { // restore system environment
|
||||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||||
SimProcess->setProcessEnvironment(env);
|
SimProcess->setProcessEnvironment(env);
|
||||||
simulator_parameters="";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
simulator_cmd = cmd;
|
simulator_cmd = cmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Ngspice::setSimulatorParameters(QString parameters)
|
||||||
|
{
|
||||||
|
simulator_parameters = parameters;
|
||||||
|
}
|
||||||
|
@ -46,6 +46,7 @@ public:
|
|||||||
explicit Ngspice(Schematic *sch_, QObject *parent = 0);
|
explicit Ngspice(Schematic *sch_, QObject *parent = 0);
|
||||||
void SaveNetlist(QString filename);
|
void SaveNetlist(QString filename);
|
||||||
void setSimulatorCmd(QString cmd);
|
void setSimulatorCmd(QString cmd);
|
||||||
|
void setSimulatorParameters(QString parameters);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void createNetlist(QTextStream &stream, int NumPorts, QStringList &simulations,
|
void createNetlist(QTextStream &stream, int NumPorts, QStringList &simulations,
|
||||||
|
@ -34,6 +34,7 @@ SimSettingsDialog::SimSettingsDialog(QWidget *parent) :
|
|||||||
lblQucsator = new QLabel(tr("Qucsator executable location"));
|
lblQucsator = new QLabel(tr("Qucsator executable location"));
|
||||||
lblNprocs = new QLabel(tr("Number of processors in a system:"));
|
lblNprocs = new QLabel(tr("Number of processors in a system:"));
|
||||||
lblWorkdir = new QLabel(tr("Directory to store netlist and simulator output"));
|
lblWorkdir = new QLabel(tr("Directory to store netlist and simulator output"));
|
||||||
|
lblSimParam = new QLabel(tr("Extra simulator parameters"));
|
||||||
|
|
||||||
cbxSimulator = new QComboBox(this);
|
cbxSimulator = new QComboBox(this);
|
||||||
QStringList items;
|
QStringList items;
|
||||||
@ -52,6 +53,7 @@ SimSettingsDialog::SimSettingsDialog(QWidget *parent) :
|
|||||||
spbNprocs = new QSpinBox(1,256,1,this);
|
spbNprocs = new QSpinBox(1,256,1,this);
|
||||||
spbNprocs->setValue(QucsSettings.NProcs);
|
spbNprocs->setValue(QucsSettings.NProcs);
|
||||||
edtWorkdir = new QLineEdit(QucsSettings.S4Qworkdir);
|
edtWorkdir = new QLineEdit(QucsSettings.S4Qworkdir);
|
||||||
|
edtSimParam = new QLineEdit(QucsSettings.SimParameters);
|
||||||
|
|
||||||
btnOK = new QPushButton(tr("Apply changes"));
|
btnOK = new QPushButton(tr("Apply changes"));
|
||||||
connect(btnOK,SIGNAL(clicked()),this,SLOT(slotApply()));
|
connect(btnOK,SIGNAL(clicked()),this,SLOT(slotApply()));
|
||||||
@ -117,6 +119,11 @@ SimSettingsDialog::SimSettingsDialog(QWidget *parent) :
|
|||||||
h6->addWidget(btnSetWorkdir,1);
|
h6->addWidget(btnSetWorkdir,1);
|
||||||
top2->addLayout(h6);
|
top2->addLayout(h6);
|
||||||
|
|
||||||
|
top2->addWidget(lblSimParam);
|
||||||
|
QHBoxLayout *h10 = new QHBoxLayout;
|
||||||
|
h10->addWidget(edtSimParam,4);
|
||||||
|
top2->addLayout(h10);
|
||||||
|
|
||||||
gbp1->setLayout(top2);
|
gbp1->setLayout(top2);
|
||||||
top->addWidget(gbp1);
|
top->addWidget(gbp1);
|
||||||
|
|
||||||
@ -162,6 +169,7 @@ void SimSettingsDialog::slotApply()
|
|||||||
QucsSettings.Qucsator = edtQucsator->text();
|
QucsSettings.Qucsator = edtQucsator->text();
|
||||||
QucsSettings.NProcs = spbNprocs->value();
|
QucsSettings.NProcs = spbNprocs->value();
|
||||||
QucsSettings.S4Qworkdir = edtWorkdir->text();
|
QucsSettings.S4Qworkdir = edtWorkdir->text();
|
||||||
|
QucsSettings.SimParameters = edtSimParam->text();
|
||||||
if ((QucsSettings.DefaultSimulator != cbxSimulator->currentIndex())&&
|
if ((QucsSettings.DefaultSimulator != cbxSimulator->currentIndex())&&
|
||||||
(QucsSettings.DefaultSimulator != spicecompat::simNotSpecified)) {
|
(QucsSettings.DefaultSimulator != spicecompat::simNotSpecified)) {
|
||||||
QMessageBox::warning(this,tr("Simulator settings"),tr("Default simulator engine was changed!\n"
|
QMessageBox::warning(this,tr("Simulator settings"),tr("Default simulator engine was changed!\n"
|
||||||
|
@ -34,6 +34,7 @@ private:
|
|||||||
QLabel *lblQucsator;
|
QLabel *lblQucsator;
|
||||||
QLabel *lblWorkdir;
|
QLabel *lblWorkdir;
|
||||||
QLabel *lblSimulator;
|
QLabel *lblSimulator;
|
||||||
|
QLabel *lblSimParam;
|
||||||
|
|
||||||
QComboBox *cbxSimulator;
|
QComboBox *cbxSimulator;
|
||||||
|
|
||||||
@ -44,6 +45,7 @@ private:
|
|||||||
QLineEdit *edtQucsator;
|
QLineEdit *edtQucsator;
|
||||||
QSpinBox *spbNprocs;
|
QSpinBox *spbNprocs;
|
||||||
QLineEdit *edtWorkdir;
|
QLineEdit *edtWorkdir;
|
||||||
|
QLineEdit *edtSimParam;
|
||||||
|
|
||||||
QPushButton *btnOK;
|
QPushButton *btnOK;
|
||||||
QPushButton *btnCancel;
|
QPushButton *btnCancel;
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "components/equation.h"
|
#include "components/equation.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file xyce.cpp
|
\file xyce.cpp
|
||||||
\brief Implementation of the Xyce class
|
\brief Implementation of the Xyce class
|
||||||
@ -392,9 +393,9 @@ void Xyce::setParallel(bool par)
|
|||||||
QString xyce_par = QucsSettings.XyceParExecutable;
|
QString xyce_par = QucsSettings.XyceParExecutable;
|
||||||
xyce_par.replace("%p",QString::number(QucsSettings.NProcs));
|
xyce_par.replace("%p",QString::number(QucsSettings.NProcs));
|
||||||
simulator_cmd = xyce_par;
|
simulator_cmd = xyce_par;
|
||||||
simulator_parameters = QString(" -a ");
|
simulator_parameters = simulator_parameters + QString(" -a ");
|
||||||
} else {
|
} else {
|
||||||
simulator_cmd = "\"" + QucsSettings.XyceExecutable + "\"";
|
simulator_cmd = "\"" + QucsSettings.XyceExecutable + "\"";
|
||||||
simulator_parameters = "-a";
|
simulator_parameters = simulator_parameters + " -a ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -139,6 +139,8 @@ bool loadSettings()
|
|||||||
else QucsSettings.NProcs = 4;
|
else QucsSettings.NProcs = 4;
|
||||||
if(settings.contains("S4Q_workdir")) QucsSettings.S4Qworkdir = settings.value("S4Q_workdir").toString();
|
if(settings.contains("S4Q_workdir")) QucsSettings.S4Qworkdir = settings.value("S4Q_workdir").toString();
|
||||||
else QucsSettings.S4Qworkdir = QDir::convertSeparators(QDir::homePath()+"/.qucs/spice4qucs");
|
else QucsSettings.S4Qworkdir = QDir::convertSeparators(QDir::homePath()+"/.qucs/spice4qucs");
|
||||||
|
if(settings.contains("SimParameters")) QucsSettings.SimParameters = settings.value("SimParameters").toString();
|
||||||
|
else QucsSettings.SimParameters = "";
|
||||||
if(settings.contains("OctaveExecutable")) {
|
if(settings.contains("OctaveExecutable")) {
|
||||||
QucsSettings.OctaveExecutable = settings.value("OctaveExecutable").toString();
|
QucsSettings.OctaveExecutable = settings.value("OctaveExecutable").toString();
|
||||||
} else {
|
} else {
|
||||||
@ -232,6 +234,7 @@ bool saveApplSettings()
|
|||||||
settings.setValue("Qucsator",QucsSettings.Qucsator);
|
settings.setValue("Qucsator",QucsSettings.Qucsator);
|
||||||
settings.setValue("Nprocs",QucsSettings.NProcs);
|
settings.setValue("Nprocs",QucsSettings.NProcs);
|
||||||
settings.setValue("S4Q_workdir",QucsSettings.S4Qworkdir);
|
settings.setValue("S4Q_workdir",QucsSettings.S4Qworkdir);
|
||||||
|
settings.setValue("SimParameters",QucsSettings.SimParameters);
|
||||||
// settings.setValue("OctaveBinDir", QucsSettings.OctaveBinDir.canonicalPath());
|
// settings.setValue("OctaveBinDir", QucsSettings.OctaveBinDir.canonicalPath());
|
||||||
settings.setValue("OctaveExecutable",QucsSettings.OctaveExecutable);
|
settings.setValue("OctaveExecutable",QucsSettings.OctaveExecutable);
|
||||||
settings.setValue("QucsHomeDir", QucsSettings.QucsHomeDir.canonicalPath());
|
settings.setValue("QucsHomeDir", QucsSettings.QucsHomeDir.canonicalPath());
|
||||||
|
@ -74,6 +74,7 @@ struct tQucsSettings {
|
|||||||
QString XyceParExecutable;
|
QString XyceParExecutable;
|
||||||
QString SpiceOpusExecutable;
|
QString SpiceOpusExecutable;
|
||||||
QString S4Qworkdir;
|
QString S4Qworkdir;
|
||||||
|
QString SimParameters;
|
||||||
unsigned int NProcs; // Number of processors for Xyce
|
unsigned int NProcs; // Number of processors for Xyce
|
||||||
QString OctaveExecutable; // OctaveExecutable location
|
QString OctaveExecutable; // OctaveExecutable location
|
||||||
QString QucsOctave; // OUCS_OCTAVE variable
|
QString QucsOctave; // OUCS_OCTAVE variable
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
SET(SYMBOLS
|
SET(SYMBOLS
|
||||||
opamp5t.sym
|
opamp5t.sym
|
||||||
opamp3t.sym
|
opamp3t.sym
|
||||||
|
nmos4.sym
|
||||||
|
pmos4.sym
|
||||||
)
|
)
|
||||||
|
|
||||||
# installation of transmission lines
|
# installation of transmission lines
|
||||||
|
Loading…
x
Reference in New Issue
Block a user