Dynamic show/hide spectrum for rigs without this feature.

merge-requests/5/head
Elliott Liggett 2021-06-15 11:27:45 -07:00
rodzic 2392bdd932
commit d3d59b2a94
3 zmienionych plików z 49 dodań i 9 usunięć

Wyświetl plik

@ -1494,6 +1494,40 @@ void wfmain::saveSettings()
} }
void wfmain::showHideSpectrum(bool show)
{
if(show)
{
wf->show();
plot->show();
} else {
wf->hide();
plot->hide();
}
// Controls:
ui->spectrumGroupBox->setVisible(show);
ui->spectrumModeCombo->setVisible(show);
ui->scopeBWCombo->setVisible(show);
ui->scopeEdgeCombo->setVisible(show);
ui->scopeEnableWFBtn->setVisible(show);
ui->scopeRefLevelSlider->setEnabled(show);
ui->wfLengthSlider->setEnabled(show);
ui->wfthemeCombo->setVisible(show);
ui->toFixedBtn->setVisible(show);
ui->clearPeakBtn->setVisible(show);
// And the labels:
ui->specEdgeLabel->setVisible(show);
ui->specModeLabel->setVisible(show);
ui->specSpanLabel->setVisible(show);
ui->specThemeLabel->setVisible(show);
ui->specControlsHorizLayout->setEnabled(show);
}
void wfmain::prepareWf() void wfmain::prepareWf()
{ {
prepareWf(160); prepareWf(160);
@ -1505,6 +1539,11 @@ void wfmain::prepareWf(unsigned int wfLength)
if(haveRigCaps) if(haveRigCaps)
{ {
showHideSpectrum(rigCaps.hasSpectrum);
if(!rigCaps.hasSpectrum)
{
return;
}
// TODO: Lock the function that draws on the spectrum while we are updating. // TODO: Lock the function that draws on the spectrum while we are updating.
spectrumDrawLock = true; spectrumDrawLock = true;
@ -4357,7 +4396,7 @@ void wfmain::calculateTimingParameters()
msMinTiming = 35; msMinTiming = 35;
delayedCommand->setInterval( msMinTiming * 2); // 20 byte message delayedCommand->setInterval( msMinTiming * 2); // 20 byte message
periodicPollingTimer->setInterval( msMinTiming ); // slower for s-meter poll periodicPollingTimer->setInterval( msMinTiming *5); // slower for s-meter poll
qInfo(logSystem()) << "Delay command interval timing: " << msMinTiming * 2 << "ms"; qInfo(logSystem()) << "Delay command interval timing: " << msMinTiming * 2 << "ms";
qInfo(logSystem()) << "Periodic polling timer: " << msMinTiming << "ms"; qInfo(logSystem()) << "Periodic polling timer: " << msMinTiming << "ms";
@ -4612,6 +4651,6 @@ void wfmain::on_wfLengthSlider_valueChanged(int value)
void wfmain::on_debugBtn_clicked() void wfmain::on_debugBtn_clicked()
{ {
qInfo(logSystem()) << "Debug button pressed."; qInfo(logSystem()) << "Debug button pressed.";
emit getTxPower(); emit getFrequency();
} }

Wyświetl plik

@ -462,6 +462,7 @@ private:
void setPlotTheme(QCustomPlot *plot, bool isDark); void setPlotTheme(QCustomPlot *plot, bool isDark);
void prepareWf(); void prepareWf();
void prepareWf(unsigned int wfLength); void prepareWf(unsigned int wfLength);
void showHideSpectrum(bool show);
void getInitialRigState(); void getInitialRigState();
void setBandButtons(); void setBandButtons();
void showButton(QPushButton *btn); void showButton(QPushButton *btn);

Wyświetl plik

@ -26,7 +26,7 @@
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="spectrumGroupBox">
<property name="title"> <property name="title">
<string>Spectrum</string> <string>Spectrum</string>
</property> </property>
@ -44,12 +44,12 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_13"> <layout class="QHBoxLayout" name="specControlsHorizLayout">
<property name="topMargin"> <property name="topMargin">
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QLabel" name="label_26"> <widget class="QLabel" name="specModeLabel">
<property name="text"> <property name="text">
<string>Spectrum Mode: </string> <string>Spectrum Mode: </string>
</property> </property>
@ -66,7 +66,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_6"> <widget class="QLabel" name="specSpanLabel">
<property name="text"> <property name="text">
<string>Span:</string> <string>Span:</string>
</property> </property>
@ -86,7 +86,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_7"> <widget class="QLabel" name="specEdgeLabel">
<property name="text"> <property name="text">
<string>Edge</string> <string>Edge</string>
</property> </property>
@ -133,7 +133,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_31"> <widget class="QLabel" name="specThemeLabel">
<property name="text"> <property name="text">
<string>Theme:</string> <string>Theme:</string>
</property> </property>
@ -150,7 +150,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer_2"> <spacer name="specHorizSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>