From cc106b3775dd89d3d00f6d5e450b960c1e8ad324 Mon Sep 17 00:00:00 2001 From: Phil Taylor Date: Sun, 21 Apr 2024 17:50:42 +0100 Subject: [PATCH] Hide scope/wf for non-scope rigs --- spectrumscope.cpp | 24 ++++++++++++++++++++---- spectrumscope.h | 3 ++- wfmain.cpp | 2 +- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/spectrumscope.cpp b/spectrumscope.cpp index 0217df0..60950d8 100644 --- a/spectrumscope.cpp +++ b/spectrumscope.cpp @@ -2,8 +2,8 @@ #include "logcategories.h" #include "rigidentities.h" -spectrumScope::spectrumScope(uchar receiver, uchar vfo, QWidget *parent) - : QGroupBox{parent}, receiver(receiver), numVFO(vfo) +spectrumScope::spectrumScope(bool scope, uchar receiver, uchar vfo, QWidget *parent) + : QGroupBox{parent}, receiver(receiver), numVFO(vfo),hasScope(scope) { QMutexLocker locker(&mutex); @@ -12,7 +12,7 @@ spectrumScope::spectrumScope(uchar receiver, uchar vfo, QWidget *parent) this->setTitle("Band"); this->defaultStyleSheet = this->styleSheet(); queue = cachingQueue::getInstance(); - spectrum = new QCustomPlot(); + //spectrum = new QCustomPlot(); mainLayout = new QHBoxLayout(this); layout = new QVBoxLayout(); mainLayout->addLayout(layout); @@ -396,7 +396,6 @@ spectrumScope::spectrumScope(uchar receiver, uchar vfo, QWidget *parent) connect(waterfall, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(scroll(QWheelEvent*))); connect(spectrum, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(scroll(QWheelEvent*))); - showHideControls(spectrumMode_t::spectModeCenter); } @@ -883,6 +882,23 @@ void spectrumScope::computePlasma() void spectrumScope::showHideControls(spectrumMode_t mode) { + qInfo("ShowHideControls() called"); + if (!hasScope) { + spectrum->hide(); + waterfall->hide(); + splitter->hide(); + detachButton->hide(); + scopeModeCombo->hide(); + edgeCombo->hide(); + edgeButton->hide(); + holdButton->hide(); + toFixedButton->hide(); + spanCombo->hide(); + clearPeaksButton->hide(); + confButton->hide(); + return; + } + if((mode==spectModeCenter) || (mode==spectModeScrollC)) { edgeCombo->hide(); diff --git a/spectrumscope.h b/spectrumscope.h index d7f46bc..e11968d 100644 --- a/spectrumscope.h +++ b/spectrumscope.h @@ -30,7 +30,7 @@ class spectrumScope : public QGroupBox { Q_OBJECT public: - explicit spectrumScope(uchar receiver = 0, uchar vfo = 1, QWidget *parent = nullptr); + explicit spectrumScope(bool scope, uchar receiver = 0, uchar vfo = 1, QWidget *parent = nullptr); bool prepareWf(uint wfLength); void prepareScope(uint ampMap, uint spectWidth); @@ -276,6 +276,7 @@ private: bool clickDragTuning=false; bool isActive; uchar numVFO=1; + bool hasScope=false; }; #endif // SPECTRUMSCOPE_H diff --git a/wfmain.cpp b/wfmain.cpp index 8c43e8b..1a79e64 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -1025,7 +1025,7 @@ void wfmain::configureVFOs() for(uchar i=0;inumReceiver;i++) { - spectrumScope* receiver = new spectrumScope(i,rigCaps->numVFO,this); + spectrumScope* receiver = new spectrumScope(rigCaps->hasSpectrum,i,rigCaps->numVFO,this); receiver->setUnderlayMode(prefs.underlayMode); receiver->wfAntiAliased(prefs.wfAntiAlias);