Compact Reference widgets
This commit is contained in:
parent
753dd3d261
commit
4545efaf7a
@ -277,30 +277,21 @@ void AppWindow::CreateToolbars()
|
|||||||
{
|
{
|
||||||
// Reference toolbar
|
// Reference toolbar
|
||||||
auto tb_reference = new QToolBar("Reference", this);
|
auto tb_reference = new QToolBar("Reference", this);
|
||||||
tb_reference->addWidget(new QLabel("Ref:"));
|
tb_reference->addWidget(new QLabel("Ref in:"));
|
||||||
toolbars.reference.type = new QComboBox();
|
toolbars.reference.type = new QComboBox();
|
||||||
toolbars.reference.type->addItem("Int");
|
toolbars.reference.type->addItem("Int");
|
||||||
toolbars.reference.type->addItem("Ext");
|
toolbars.reference.type->addItem("Ext");
|
||||||
toolbars.reference.automatic = new QCheckBox("Auto");
|
toolbars.reference.type->addItem("Auto");
|
||||||
connect(toolbars.reference.automatic, &QCheckBox::clicked, [this](bool checked) {
|
|
||||||
toolbars.reference.type->setEnabled(!checked);
|
|
||||||
UpdateReference();
|
|
||||||
});
|
|
||||||
// toolbars.reference.automatic->setChecked(true);
|
|
||||||
tb_reference->addWidget(toolbars.reference.type);
|
tb_reference->addWidget(toolbars.reference.type);
|
||||||
tb_reference->addWidget(toolbars.reference.automatic);
|
|
||||||
tb_reference->addSeparator();
|
tb_reference->addSeparator();
|
||||||
tb_reference->addWidget(new QLabel("Ref out:"));
|
tb_reference->addWidget(new QLabel("Ref out:"));
|
||||||
toolbars.reference.outputEnabled = new QCheckBox();
|
|
||||||
toolbars.reference.outFreq = new QComboBox();
|
toolbars.reference.outFreq = new QComboBox();
|
||||||
|
toolbars.reference.outFreq->addItem("Off");
|
||||||
toolbars.reference.outFreq->addItem("10 MHz");
|
toolbars.reference.outFreq->addItem("10 MHz");
|
||||||
toolbars.reference.outFreq->addItem("100 MHz");
|
toolbars.reference.outFreq->addItem("100 MHz");
|
||||||
tb_reference->addWidget(toolbars.reference.outputEnabled);
|
|
||||||
tb_reference->addWidget(toolbars.reference.outFreq);
|
tb_reference->addWidget(toolbars.reference.outFreq);
|
||||||
connect(toolbars.reference.type, qOverload<int>(&QComboBox::currentIndexChanged), this, &AppWindow::UpdateReference);
|
connect(toolbars.reference.type, qOverload<int>(&QComboBox::currentIndexChanged), this, &AppWindow::UpdateReference);
|
||||||
connect(toolbars.reference.outFreq, qOverload<int>(&QComboBox::currentIndexChanged), this, &AppWindow::UpdateReference);
|
connect(toolbars.reference.outFreq, qOverload<int>(&QComboBox::currentIndexChanged), this, &AppWindow::UpdateReference);
|
||||||
connect(toolbars.reference.outputEnabled, &QCheckBox::clicked, this, &AppWindow::UpdateReference);
|
|
||||||
|
|
||||||
addToolBar(tb_reference);
|
addToolBar(tb_reference);
|
||||||
tb_reference->setObjectName("Reference Toolbar");
|
tb_reference->setObjectName("Reference Toolbar");
|
||||||
}
|
}
|
||||||
@ -352,22 +343,23 @@ void AppWindow::UpdateReference()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Protocol::ReferenceSettings s = {};
|
Protocol::ReferenceSettings s = {};
|
||||||
if(toolbars.reference.automatic->isChecked()) {
|
|
||||||
s.AutomaticSwitch = 1;
|
QString txt1 = toolbars.reference.type->currentText();
|
||||||
}
|
if( (txt1=="Ext") || (txt1=="External") ) {
|
||||||
if(toolbars.reference.type->currentText()=="Ext") {
|
|
||||||
s.UseExternalRef = 1;
|
s.UseExternalRef = 1;
|
||||||
}
|
}
|
||||||
if(toolbars.reference.outputEnabled->isChecked()) {
|
if( (txt1=="Auto") || (txt1=="Automatic") ) {
|
||||||
switch(toolbars.reference.outFreq->currentIndex()) {
|
s.AutomaticSwitch = 1;
|
||||||
case 0:
|
|
||||||
s.ExtRefOuputFreq = 10000000;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
s.ExtRefOuputFreq = 100000000;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString txt2 = toolbars.reference.outFreq->currentText();
|
||||||
|
if(txt2=="10 MHz"){
|
||||||
|
s.ExtRefOuputFreq = 10000000;
|
||||||
|
}
|
||||||
|
if(txt2=="100 MHz"){
|
||||||
|
s.ExtRefOuputFreq = 100000000;
|
||||||
|
}
|
||||||
|
|
||||||
Protocol::PacketInfo p;
|
Protocol::PacketInfo p;
|
||||||
p.type = Protocol::PacketType::Reference;
|
p.type = Protocol::PacketType::Reference;
|
||||||
p.reference = s;
|
p.reference = s;
|
||||||
|
@ -61,8 +61,6 @@ private:
|
|||||||
struct {
|
struct {
|
||||||
struct {
|
struct {
|
||||||
QComboBox *type;
|
QComboBox *type;
|
||||||
QCheckBox *automatic;
|
|
||||||
QCheckBox *outputEnabled;
|
|
||||||
QComboBox *outFreq;
|
QComboBox *outFreq;
|
||||||
} reference;
|
} reference;
|
||||||
} toolbars;
|
} toolbars;
|
||||||
|
Loading…
Reference in New Issue
Block a user