Skip to content

Commit

Permalink
Some fixes concerning the GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
andresmmera committed Feb 19, 2017
1 parent 4fca33d commit 8cb795a
Showing 1 changed file with 39 additions and 48 deletions.
87 changes: 39 additions & 48 deletions qucs/qucs/dialogs/matchdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,79 +66,65 @@ MatchDialog::MatchDialog(QWidget *parent)
MethodLayout = new QVBoxLayout();

SubstrateBox = new QGroupBox(tr("Microstrip Substrate"));
QVBoxLayout *hsubs = new QVBoxLayout();
QGridLayout *hsubs = new QGridLayout();

SubstrateBox->setVisible(false);
micro_layout->addWidget(SubstrateBox);
SubstrateBox->setLayout(hsubs);
QHBoxLayout * Erlayout = new QHBoxLayout();
RelPermLabel = new QLabel(tr("Relative Permitivity"));
RelPermCombo = new QComboBox();
RelPermCombo->setEditable(true);
const char **p = List_er;
while(*(++p)) RelPermCombo->addItem(*p); // The dielectric coeff combobox is filled with the materials taken from "../../qucs-filter/material_props.h"
RelPermCombo->lineEdit()->setText("9.8");
Erlayout->addWidget(RelPermLabel);
Erlayout->addWidget(RelPermCombo);
hsubs->addLayout(Erlayout);
hsubs->addWidget(RelPermLabel, 0, 0);
hsubs->addWidget(RelPermCombo, 0, 1, 1, 2);

QHBoxLayout *SubsLayout = new QHBoxLayout();
subsHLabel = new QLabel(tr("Substrate height"));
SubHeightEdit = new QLineEdit("1.0");
SubHeightEdit->setFixedWidth(60);
SubsHScale = new QLabel("mm");
SubsLayout->addWidget(subsHLabel);
SubsLayout->addWidget(SubHeightEdit);
SubsLayout->addWidget(SubsHScale);
hsubs->addLayout(SubsLayout);
hsubs->addWidget(subsHLabel, 1, 0);
hsubs->addWidget(SubHeightEdit, 1, 1);
hsubs->addWidget(SubsHScale, 1, 2);

//Thickness
QHBoxLayout *ThicknessLayout = new QHBoxLayout();
thicknessLabel = new QLabel(tr("Metal thickness"));
thicknessEdit = new QLineEdit("12.5");
ThicknessScale = new QLabel("um");
ThicknessLayout->addWidget(thicknessLabel);
ThicknessLayout->addWidget(thicknessEdit);
ThicknessLayout->addWidget(ThicknessScale);
hsubs->addLayout(ThicknessLayout);
hsubs->addWidget(thicknessLabel, 2, 0);
hsubs->addWidget(thicknessEdit, 2, 1);
hsubs->addWidget(ThicknessScale, 2, 2);

//Minimum width
QHBoxLayout *minWLayout = new QHBoxLayout();
minWLabel = new QLabel(tr("Minimum width"));
minWEdit = new QLineEdit("0.4");
minWScale = new QLabel("mm");
minWLayout->addWidget(minWLabel);
minWLayout->addWidget(minWEdit);
minWLayout->addWidget(minWScale);
hsubs->addLayout(minWLayout);
hsubs->addWidget(minWLabel, 3, 0);
hsubs->addWidget(minWEdit, 3, 1);
hsubs->addWidget(minWScale, 3, 2);


//Maximum width
QHBoxLayout *maxWLayout = new QHBoxLayout();
maxWLabel = new QLabel(tr("Maximum width"));
maxWEdit = new QLineEdit("5.0");
maxWScale = new QLabel("mm");
maxWLayout->addWidget(maxWLabel);
maxWLayout->addWidget(maxWEdit);
maxWLayout->addWidget(maxWScale);
hsubs->addLayout(maxWLayout);
hsubs->addWidget(maxWLabel, 4, 0);
hsubs->addWidget(maxWEdit, 4, 1);
hsubs->addWidget(maxWScale, 4, 2);

// tan(delta)
QHBoxLayout *tanDLayout = new QHBoxLayout();
tanDLabel = new QLabel(tr("tanD"));
tanDEdit = new QLineEdit("0.0125");
tanDLayout->addWidget(tanDLabel);
tanDLayout->addWidget(tanDEdit);
hsubs->addLayout(tanDLayout);
hsubs->addWidget(tanDLabel, 5, 0);
hsubs->addWidget(tanDEdit, 5, 1);

// Resistivity
QHBoxLayout *ResistivityLayout = new QHBoxLayout();
ResistivityLabel = new QLabel(tr("Resistivity"));
ResistivityEdit = new QLineEdit("2.43902e-08");
ResistivityLayout->addWidget(ResistivityLabel);
ResistivityLayout->addWidget(ResistivityEdit);
hsubs->addLayout(ResistivityLayout);
hsubs->addWidget(ResistivityLabel, 6, 0);
hsubs->addWidget(ResistivityEdit, 6, 1);

hsubs->insertStretch(-1, 1); // Remove spacing between layouts.
// hsubs->insertStretch(-1, 1); // Remove spacing between layouts.

QHBoxLayout *h4 = new QHBoxLayout();
h4->setSpacing(3);
Expand All @@ -147,7 +133,7 @@ MatchDialog::MatchDialog(QWidget *parent)

// Matching network topology
TopoCombo = new QComboBox();
TopoCombo->setFixedWidth(200);
TopoCombo->setFixedWidth(220);
TopoCombo->addItem(tr("LC matching"));
TopoCombo->addItem(tr("Single stub"));
TopoCombo->addItem(tr("Double stub"));
Expand Down Expand Up @@ -209,6 +195,8 @@ MatchDialog::MatchDialog(QWidget *parent)
MaxRippleEdit->setAlignment(Qt::AlignLeft);
h8->setAlignment(Qt::AlignLeft);


QGridLayout *OptLayout = new QGridLayout();
v7_box->addLayout(h7_box);
v7_box->addLayout(h8);
Weighting_groupBox->setLayout(v7_box);
Expand All @@ -218,19 +206,20 @@ MatchDialog::MatchDialog(QWidget *parent)
MethodLayout->addLayout(h6);
MethodBox->setLayout(MethodLayout);
BalancedCheck = new QCheckBox(tr("Use balanced stubs"));
BalancedCheck->setVisible(false);
BalancedCheck->setEnabled(false);
TwoCheck = new QCheckBox(tr("Calculate two-port matching"));
TwoCheck->setChecked(true);
AddSPBlock = new QCheckBox(tr("Add S-Parameter simulation"));// The user can choose whether add a S-param simulation or not
AddSPBlock->setChecked(false);
MicrostripCheck = new QCheckBox(tr("Synthesize microstrip lines"));
MicrostripCheck->setVisible(false);
MicrostripCheck->setEnabled(false);
MicrostripCheck->setChecked(false);

matchFrame->addWidget(BalancedCheck);
matchFrame->addWidget(TwoCheck);
matchFrame->addWidget(AddSPBlock);
matchFrame->addWidget(MicrostripCheck);
OptLayout->addWidget(BalancedCheck,0,0);
OptLayout->addWidget(TwoCheck,0,1);
OptLayout->addWidget(AddSPBlock,1,0);
OptLayout->addWidget(MicrostripCheck,1,1);
matchFrame->addLayout(OptLayout);

connect(TwoCheck, SIGNAL(toggled(bool)), SLOT(slotSetTwoPort(bool)));
connect(MicrostripCheck, SIGNAL(toggled(bool)), SLOT(slotSetMicrostripCheck()));
Expand Down Expand Up @@ -273,7 +262,8 @@ MatchDialog::MatchDialog(QWidget *parent)
h1->addWidget(FormatLabel);
FormatCombo = new QComboBox();
h1->addWidget(FormatCombo);
FormatCombo->addItem(tr("real/imag"));
FormatCombo->setFixedWidth(140);
FormatCombo->addItem(tr("Real/Imag"));
FormatCombo->addItem(tr("mag/deg"));
connect(FormatCombo, SIGNAL(activated(int)), SLOT(slotChangeMode(int)));
h1->addStretch(5);
Expand Down Expand Up @@ -392,6 +382,7 @@ MatchDialog::MatchDialog(QWidget *parent)
UnitCombo->addItem("kHz");
UnitCombo->addItem("MHz");
UnitCombo->addItem("GHz");
UnitCombo->setFixedWidth(100);
h2->addWidget(UnitCombo);
h2->addStretch(5);
SParLayout->addLayout(h2);
Expand Down Expand Up @@ -515,21 +506,21 @@ void MatchDialog::slotChangeMode_TopoCombo()
ShortRadioButton->setVisible(true);
OpenRadioButton->setVisible(true);
OpenRadioButton->setChecked(true);
BalancedCheck->setVisible(true);
BalancedCheck->setEnabled(true);
}
else
{
ShortRadioButton->setVisible(false);
OpenRadioButton->setVisible(false);
BalancedCheck->setVisible(false);
BalancedCheck->setEnabled(false);
}
if ((TopoCombo->currentIndex() != 0) && (TopoCombo->currentIndex() != 4))//Obviously, the microstrip implementation panel cannot be used when LC is selected
{
MicrostripCheck->setVisible(true);
MicrostripCheck->setEnabled(true);
}
else
{
MicrostripCheck->setVisible(false);
MicrostripCheck->setEnabled(false);
}

if (TopoCombo->currentIndex() == 3) Weighting_groupBox->setVisible(true);//Cascaded lambda/4 sections selected
Expand All @@ -545,7 +536,7 @@ void MatchDialog::slotChangeMode_TopoCombo()
OrderLabel->setVisible(false);
OrderEdit->setVisible(false);
}
this->adjustSize();
this->adjustSize();
}

// -----------------------------------------------------------------------
Expand Down

0 comments on commit 8cb795a

Please sign in to comment.