Merge branch 'tristate' into multi-usb

qcpfix
Phil Taylor 2023-04-03 14:31:48 +01:00
commit 1da3696ba2
4 zmienionych plików z 38 dodań i 9 usunięć

Wyświetl plik

@ -17,6 +17,7 @@ struct preferences {
// Interface:
bool useFullScreen;
bool useSystemTheme;
int wfEnable;
bool drawPeaks;
underlay_t underlayMode = underlayNone;
int underlayBufferSize = 64;

Wyświetl plik

@ -1927,6 +1927,7 @@ void wfmain::setDefPrefs()
defPrefs.currentColorPresetNumber = 0;
defPrefs.underlayMode = underlayNone;
defPrefs.underlayBufferSize = 64;
defPrefs.wfEnable = 2;
defPrefs.wfAntiAlias = false;
defPrefs.wfInterpolate = true;
defPrefs.stylesheetPath = QString("qdarkstyle/style.qss");
@ -1990,6 +1991,8 @@ void wfmain::loadSettings()
settings->beginGroup("Interface");
prefs.useFullScreen = settings->value("UseFullScreen", defPrefs.useFullScreen).toBool();
prefs.useSystemTheme = settings->value("UseSystemTheme", defPrefs.useSystemTheme).toBool();
prefs.wfEnable = settings->value("WFEnable", defPrefs.wfEnable).toInt();
ui->scopeEnableWFBtn->setCheckState(Qt::CheckState(prefs.wfEnable));
prefs.wftheme = settings->value("WFTheme", defPrefs.wftheme).toInt();
prefs.plotFloor = settings->value("plotFloor", defPrefs.plotFloor).toInt();
prefs.plotCeiling = settings->value("plotCeiling", defPrefs.plotCeiling).toInt();
@ -2825,6 +2828,7 @@ void wfmain::saveSettings()
settings->beginGroup("Interface");
settings->setValue("UseFullScreen", prefs.useFullScreen);
settings->setValue("UseSystemTheme", prefs.useSystemTheme);
settings->setValue("WFEnable", prefs.wfEnable);
settings->setValue("DrawPeaks", prefs.drawPeaks);
settings->setValue("underlayMode", prefs.underlayMode);
settings->setValue("underlayBufferSize", prefs.underlayBufferSize);
@ -3136,6 +3140,7 @@ void wfmain::showHideSpectrum(bool show)
ui->scopeBWCombo->setVisible(show);
ui->scopeEdgeCombo->setVisible(show);
ui->scopeEnableWFBtn->setVisible(show);
ui->scopeEnableWFBtn->setTristate(true);
ui->scopeRefLevelSlider->setEnabled(show);
ui->wfLengthSlider->setEnabled(show);
ui->wfthemeCombo->setVisible(show);
@ -3678,6 +3683,13 @@ void wfmain:: getInitialRigState()
issueDelayedCommand(cmdGetSpectrumMode);
issueDelayedCommand(cmdGetSpectrumSpan);
issueDelayedCommand(cmdGetPassband);
if(ui->scopeEnableWFBtn->checkState() != Qt::Unchecked)
{
issueDelayedCommand(cmdSpecOn);
} else {
issueDelayedCommand(cmdSpecOff);
}
}
issueDelayedCommand(cmdNone);
@ -5174,6 +5186,12 @@ void wfmain::changeTxBtn()
void wfmain::receiveSpectrumData(QByteArray spectrum, double startFreq, double endFreq)
{
if (ui->scopeEnableWFBtn->checkState()== Qt::PartiallyChecked)
{
return;
}
if(!haveRigCaps)
{
qDebug(logSystem()) << "Spectrum received, but RigID incomplete.";
@ -5852,14 +5870,17 @@ void wfmain::handlePlotScroll(QWheelEvent *we)
handleWFScroll(we);
}
void wfmain::on_scopeEnableWFBtn_clicked(bool checked)
void wfmain::on_scopeEnableWFBtn_stateChanged(int state)
{
if(checked)
if (state == Qt::Unchecked)
{
emit spectOutputEnable();
} else {
emit spectOutputDisable();
issueDelayedCommand(cmdSpecOff);
}
else
{
issueDelayedCommand(cmdSpecOn);
}
prefs.wfEnable = state;
}
@ -7710,7 +7731,7 @@ void wfmain::powerRigOn()
emit sendPowerOn();
delayedCommand->setInterval(3000); // 3 seconds
if(ui->scopeEnableWFBtn->isChecked())
if(ui->scopeEnableWFBtn->checkState() != Qt::Unchecked)
{
issueDelayedCommand(cmdDispEnable);
issueDelayedCommand(cmdQueNormalSpeed);
@ -7718,6 +7739,7 @@ void wfmain::powerRigOn()
issueDelayedCommand(cmdStartRegularPolling); // s-meter, etc
} else {
issueDelayedCommand(cmdQueNormalSpeed);
issueDelayedCommand(cmdSpecOff);
issueDelayedCommand(cmdStartRegularPolling); // s-meter, etc
}
delayedCommand->start();

Wyświetl plik

@ -542,7 +542,7 @@ private slots:
void on_vspCombo_currentIndexChanged(int value);
void on_scopeEnableWFBtn_clicked(bool checked);
void on_scopeEnableWFBtn_stateChanged(int state);
void on_sqlSlider_valueChanged(int value);

Wyświetl plik

@ -18,7 +18,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>3</number>
<number>0</number>
</property>
<widget class="QWidget" name="mainTab">
<attribute name="title">
@ -159,12 +159,18 @@
</item>
<item>
<widget class="QCheckBox" name="scopeEnableWFBtn">
<property name="toolTip">
<string>Checked=WF enable, Unchecked=WF disable, Partial=Enable WF but no local display</string>
</property>
<property name="text">
<string>Enable WF</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="tristate">
<bool>true</bool>
</property>
</widget>
</item>
<item>
@ -5530,8 +5536,8 @@
<resources/>
<connections/>
<buttongroups>
<buttongroup name="buttonGroup"/>
<buttongroup name="pollingButtonGroup"/>
<buttongroup name="underlayButtonGroup"/>
<buttongroup name="buttonGroup"/>
</buttongroups>
</ui>