mirror of
https://github.com/ra3xdh/qucs_s
synced 2025-03-28 21:13:26 +00:00
Hide microstrip filters when Ngspice is set as default #96
This commit is contained in:
parent
098228edc6
commit
20d3207c8b
@ -48,6 +48,9 @@ bool loadSettings()
|
||||
if(settings.contains("y"))QucsSettings.y=settings.value("y").toInt();
|
||||
settings.endGroup();
|
||||
if(settings.contains("Language"))QucsSettings.Language=settings.value("Language").toString();
|
||||
if(settings.contains("DefaultSimulator"))
|
||||
QucsSettings.DefaultSimulator = settings.value("DefaultSimulator").toInt();
|
||||
else QucsSettings.DefaultSimulator = spicecompat::simNotSpecified;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -112,6 +112,17 @@ QucsFilter::QucsFilter()
|
||||
ComboRealize->addItem("Quarter wave microstrip");
|
||||
ComboRealize->addItem("Equation-defined");
|
||||
|
||||
// microstrip filters cannot be implemented with SPICE
|
||||
if (QucsSettings.DefaultSimulator != spicecompat::simQucsator) {
|
||||
QStandardItemModel *model =
|
||||
qobject_cast<QStandardItemModel *>(ComboRealize->model());
|
||||
Q_ASSERT(model != nullptr);
|
||||
for (int i = 2; i < 10; i++) {
|
||||
QStandardItem *itm = model->item(i);
|
||||
itm->setFlags(itm->flags() & ~Qt::ItemIsEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
gbox1->addWidget(ComboRealize, 0,1);
|
||||
connect(ComboRealize, SIGNAL(activated(int)), SLOT(slotRealizationChanged(int)));
|
||||
|
||||
|
@ -30,12 +30,16 @@ class QLabel;
|
||||
class QIntValidator;
|
||||
class QDoubleValidator;
|
||||
|
||||
namespace spicecompat {
|
||||
enum Simulator {simNgspice = 0, simXyceSer = 1, simXycePar = 2, simSpiceOpus = 3, simQucsator = 4, simNotSpecified=10};
|
||||
}
|
||||
|
||||
struct tQucsSettings {
|
||||
int x, y; // position of main window
|
||||
QFont font;
|
||||
QString LangDir;
|
||||
QString Language;
|
||||
int DefaultSimulator;
|
||||
};
|
||||
|
||||
extern struct tQucsSettings QucsSettings;
|
||||
|
Loading…
x
Reference in New Issue
Block a user