Skip to content

Commit

Permalink
Add swtich to supress digital model generation when creating library
Browse files Browse the repository at this point in the history
  • Loading branch information
ra3xdh committed Jan 19, 2025
1 parent 0d53e47 commit 82dd923
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
8 changes: 4 additions & 4 deletions qucs/components/libcomp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,10 @@ QString LibComp::getSpiceLibrary()
return QString();
}
for (const auto &file : attach) {
if (file.endsWith(".cir") ||
file.endsWith(".ckt") ||
file.endsWith(".lib") ||
file.endsWith(".sp")) {
if (file.endsWith(".cir", Qt::CaseInsensitive) ||
file.endsWith(".ckt", Qt::CaseInsensitive) ||
file.endsWith(".lib", Qt::CaseInsensitive) ||
file.endsWith(".sp", Qt::CaseInsensitive)) {
files.append(getSubcircuitFile()+'/'+file);
}
}
Expand Down
6 changes: 6 additions & 0 deletions qucs/dialogs/librarydialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ LibraryDialog::LibraryDialog(QWidget *parent)
hCheck->addStretch();
connect(checkDescr, SIGNAL(stateChanged(int)), this, SLOT(slotCheckDescrChanged(int)));

checkAnalogLib = new QCheckBox(tr("Analog models only"));
checkAnalogLib->setChecked(true);
selectSubcktLayout->addWidget(checkAnalogLib);

// ...........................................................
QGridLayout *gridButts = new QGridLayout();
selectSubcktLayout->addLayout(gridButts);
Expand Down Expand Up @@ -523,6 +527,7 @@ void LibraryDialog::slotSave()
QucsSettings.DefaultSimulator = sim;
//}

if (!checkAnalogLib->isChecked()) {
// save verilog model
tmp.truncate(0);
Doc->setIsVerilog(true);
Expand Down Expand Up @@ -597,6 +602,7 @@ void LibraryDialog::slotSave()
else {
ErrText->insertPlainText("\n");
}
}

Stream << " <Symbol>\n";
Doc->createSubcircuitSymbol();
Expand Down
1 change: 1 addition & 0 deletions qucs/dialogs/librarydialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ private slots:
QStringList SelectedNames;
QStringList Descriptions;
QCheckBox *checkDescr;
QCheckBox *checkAnalogLib;

QFile LibFile;
QDir LibDir;
Expand Down

0 comments on commit 82dd923

Please sign in to comment.