Skip to content

Commit

Permalink
Clean commneted code
Browse files Browse the repository at this point in the history
  • Loading branch information
ra3xdh committed Jan 6, 2025
1 parent 008895c commit 3c5e71a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 69 deletions.
63 changes: 1 addition & 62 deletions qucs/extsimkernels/simsettingsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,16 @@ SimSettingsDialog::SimSettingsDialog(QWidget *parent) :
a_lblXyce(new QLabel(tr("Xyce executable location"))),
a_lblNgspice(new QLabel(tr("Ngspice executable location"))),
a_lblSpiceOpus(new QLabel(tr("SpiceOpus executable location"))),
//a_lblXycePar(new QLabel(tr("Xyce Parallel executable location (openMPI installed required)"))),
//a_lblNprocs(new QLabel(tr("Number of processors in a system:"))),
a_lblQucsator(new QLabel(tr("Qucsator executable location"))),
//a_lblSimulator(new QLabel(tr("Default simulator"))),
a_lblNgspiceSimParam(new QLabel(tr("Ngspice CLI parameters"))),
a_lblXyceSimParam(new QLabel(tr("Xyce CLI parameters"))),
a_lblSpopusSimParam(new QLabel(tr("SpiceOpus CLI parameters"))),
a_lblCompatMode(new QLabel(tr("Ngspice compatibility mode"))),
a_cbxCompatMode(new QComboBox),
//a_cbxSimulator(new QComboBox(this)),
a_edtNgspice(new QLineEdit(QucsSettings.NgspiceExecutable)),
a_edtSpiceOpus(new QLineEdit(QucsSettings.SpiceOpusExecutable)),
a_edtXyce(new QLineEdit(QucsSettings.XyceExecutable)),
//a_edtXycePar(new QLineEdit(QucsSettings.XyceParExecutable),
a_edtQucsator(new QLineEdit(QucsSettings.Qucsator)),
//a_spbNprocs(new QSpinBox(this)),
a_edtNgspiceSimParam(new QLineEdit()),
a_edtXyceSimParam(new QLineEdit()),
a_edtSpopusSimParam(new QLineEdit()),
Expand All @@ -53,25 +47,9 @@ SimSettingsDialog::SimSettingsDialog(QWidget *parent) :
a_btnSetNgspice(new QPushButton(tr("Select ..."))),
a_btnSetSpOpus(new QPushButton(tr("Select ..."))),
a_btnSetXyce(new QPushButton(tr("Select ..."))),
//a_btnSetXycePar(new QPushButton(tr("Select ..."))),
a_btnSetQucsator(new QPushButton(tr("Select ...")))
{
// a_cbxSimulator->addItem("Ngspice", 1);
// a_cbxSimulator->addItem("Xyce", 2);
// a_cbxSimulator->addItem("SpiceOpus", 4);
// a_cbxSimulator->addItem("Qucsator", 8);
//QStringList items;
//items<<"Ngspice"<<"Xyce (Serial)"<<"Xyce (Parallel)"<<"SpiceOpus"<<"Qucsator";
//a_cbxSimulator->addItems(items);
qDebug()<<QucsSettings.DefaultSimulator;
// a_cbxSimulator->setCurrentIndex(QucsSettings.DefaultSimulator);
// if (QucsSettings.DefaultSimulator==spicecompat::simNotSpecified)
// a_cbxSimulator->setCurrentIndex(spicecompat::simNgspice);

// a_spbNprocs->setMinimum(1);
// a_spbNprocs->setMaximum(256);
// a_spbNprocs->setValue(1);
// a_spbNprocs->setValue(QucsSettings.NProcs);

a_edtNgspiceSimParam->setText(_settings::Get().item<QString>("NgspiceParams"));
a_edtXyceSimParam->setText(_settings::Get().item<QString>("XyceParams"));
Expand All @@ -83,7 +61,6 @@ SimSettingsDialog::SimSettingsDialog(QWidget *parent) :

connect(a_btnSetNgspice,SIGNAL(clicked()),this,SLOT(slotSetNgspice()));
connect(a_btnSetXyce,SIGNAL(clicked()),this,SLOT(slotSetXyce()));
//connect(a_btnSetXycePar,SIGNAL(clicked()),this,SLOT(slotSetXycePar()));
connect(a_btnSetSpOpus,SIGNAL(clicked()),this,SLOT(slotSetSpiceOpus()));
connect(a_btnSetQucsator,SIGNAL(clicked()),this,SLOT(slotSetQucsator()));

Expand All @@ -95,11 +72,6 @@ SimSettingsDialog::SimSettingsDialog(QWidget *parent) :

QVBoxLayout *top = new QVBoxLayout;

// QHBoxLayout *h8 = new QHBoxLayout;
// h8->addWidget(a_lblSimulator,1);
// h8->addWidget(a_cbxSimulator,3);
// top->addLayout(h8);

QGroupBox *gbp1 = new QGroupBox(this);
gbp1->setTitle(tr("SPICE settings"));
QVBoxLayout *top2 = new QVBoxLayout;
Expand All @@ -124,17 +96,6 @@ SimSettingsDialog::SimSettingsDialog(QWidget *parent) :
top2->addWidget(a_lblXyceSimParam);
top2->addWidget(a_edtXyceSimParam);

// top2->addWidget(a_lblXycePar);
// QHBoxLayout *h4 = new QHBoxLayout;
// h4->addWidget(a_edtXycePar,3);
// h4->addWidget(a_btnSetXycePar,1);
// top2->addLayout(h4);
//
// QHBoxLayout *h5 = new QHBoxLayout;
// h5->addWidget(a_lblNprocs);
// h5->addWidget(a_spbNprocs);
// top2->addLayout(h5);

top2->addWidget(a_lblSpiceOpus);
QHBoxLayout *h7 = new QHBoxLayout;
h7->addWidget(a_edtSpiceOpus,3);
Expand Down Expand Up @@ -168,31 +129,15 @@ SimSettingsDialog::SimSettingsDialog(QWidget *parent) :
this->setFixedWidth(500);
this->setWindowTitle(tr("Setup simulators executable location"));

#ifndef Q_OS_UNIX
// Only Unix supports Xyce-parallel
// a_edtXycePar->setDisabled(true);
// a_lblXycePar->setDisabled(true);
// a_lblNprocs->setDisabled(true);
// a_spbNprocs->setDisabled(true);
#endif

}


void SimSettingsDialog::slotApply()
{
QucsSettings.NgspiceExecutable = a_edtNgspice->text();
QucsSettings.XyceExecutable = a_edtXyce->text();
//QucsSettings.XyceParExecutable = a_edtXycePar->text();
QucsSettings.SpiceOpusExecutable = a_edtSpiceOpus->text();
QucsSettings.Qucsator = a_edtQucsator->text();
//QucsSettings.NProcs = a_spbNprocs->value();
// if ((QucsSettings.DefaultSimulator != a_cbxSimulator->currentIndex())&&
// (QucsSettings.DefaultSimulator != spicecompat::simNotSpecified)) {
// QMessageBox::warning(this,tr("Simulator settings"),tr("Default simulator engine was changed!\n"
// "Please restart Qucs to affect changes!"));
// }
// QucsSettings.DefaultSimulator = a_cbxSimulator->currentIndex();
settingsManager& qs = _settings::Get();
qs.setItem<int>("NgspiceCompatMode", a_cbxCompatMode->currentIndex());
qs.setItem<QString>("NgspiceParams", a_edtNgspiceSimParam->text());
Expand All @@ -204,8 +149,6 @@ void SimSettingsDialog::slotApply()

void SimSettingsDialog::slotCancel()
{
//if (QucsSettings.DefaultSimulator == spicecompat::simNotSpecified)
//QucsSettings.DefaultSimulator = spicecompat::simQucsator;
reject();
}

Expand All @@ -227,11 +170,7 @@ void SimSettingsDialog::slotSetXyce()

void SimSettingsDialog::slotSetXycePar() // TODO ZERGUD
{
// QString s = QFileDialog::getOpenFileName(this,tr("Select Xyce Parallel executable location"),a_edtXycePar->text(),"All files (*)");
// if (!s.isEmpty()) {
// if (s.endsWith("xmpirun")) s += " -np %p";
// a_edtXycePar->setText(s);
// }

}

void SimSettingsDialog::slotSetSpiceOpus()
Expand Down
7 changes: 0 additions & 7 deletions qucs/extsimkernels/simsettingsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,18 @@ class SimSettingsDialog : public QDialog
QLabel *a_lblXyce;
QLabel *a_lblNgspice;
QLabel *a_lblSpiceOpus;
//QLabel *a_lblXycePar;
//QLabel *a_lblNprocs;
QLabel *a_lblQucsator;
//QLabel *a_lblSimulator;
QLabel *a_lblNgspiceSimParam;
QLabel *a_lblXyceSimParam;
QLabel *a_lblSpopusSimParam;
QLabel *a_lblCompatMode;

QComboBox *a_cbxCompatMode;
//QComboBox *a_cbxSimulator;

QLineEdit *a_edtNgspice;
QLineEdit *a_edtSpiceOpus;
QLineEdit *a_edtXyce;
//QLineEdit *a_edtXycePar;
QLineEdit *a_edtQucsator;
//QSpinBox *a_spbNprocs;
QLineEdit *a_edtNgspiceSimParam;
QLineEdit *a_edtXyceSimParam;
QLineEdit *a_edtSpopusSimParam;
Expand All @@ -58,7 +52,6 @@ class SimSettingsDialog : public QDialog
QPushButton *a_btnSetNgspice;
QPushButton *a_btnSetSpOpus;
QPushButton *a_btnSetXyce;
//QPushButton *a_btnSetXycePar;
QPushButton *a_btnSetQucsator;

public:
Expand Down

0 comments on commit 3c5e71a

Please sign in to comment.