From 3db655fe613b7b4f657e318d5f6bf6c8cc418c18 Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 14 Nov 2017 22:58:35 +0100 Subject: [PATCH] Highlight demod frame when the marker is highlighted on the spectrum --- plugins/channelrx/chanalyzer/chanalyzergui.cpp | 6 ++++++ plugins/channelrx/chanalyzer/chanalyzergui.h | 1 + plugins/channelrx/chanalyzerng/chanalyzernggui.cpp | 6 ++++++ plugins/channelrx/chanalyzerng/chanalyzernggui.h | 1 + plugins/channelrx/demodam/amdemodgui.cpp | 6 ++++++ plugins/channelrx/demodam/amdemodgui.h | 1 + plugins/channelrx/demodatv/atvdemodgui.cpp | 6 ++++++ plugins/channelrx/demodatv/atvdemodgui.h | 1 + plugins/channelrx/demodbfm/bfmdemodgui.cpp | 6 ++++++ plugins/channelrx/demodbfm/bfmdemodgui.h | 1 + plugins/channelrx/demoddsd/dsddemodgui.cpp | 5 +++++ plugins/channelrx/demoddsd/dsddemodgui.h | 1 + plugins/channelrx/demodnfm/nfmdemodgui.cpp | 6 ++++++ plugins/channelrx/demodnfm/nfmdemodgui.h | 1 + plugins/channelrx/demodssb/ssbdemodgui.cpp | 6 ++++++ plugins/channelrx/demodssb/ssbdemodgui.h | 1 + plugins/channelrx/demodwfm/wfmdemodgui.cpp | 6 ++++++ plugins/channelrx/demodwfm/wfmdemodgui.h | 1 + plugins/channelrx/tcpsrc/tcpsrcgui.cpp | 6 ++++++ plugins/channelrx/tcpsrc/tcpsrcgui.h | 1 + plugins/channelrx/udpsrc/udpsrcgui.cpp | 6 ++++++ plugins/channelrx/udpsrc/udpsrcgui.h | 1 + sdrgui/gui/rollupwidget.cpp | 14 ++++++++++++-- sdrgui/gui/rollupwidget.h | 2 ++ 24 files changed, 90 insertions(+), 2 deletions(-) diff --git a/plugins/channelrx/chanalyzer/chanalyzergui.cpp b/plugins/channelrx/chanalyzer/chanalyzergui.cpp index 075778217..8ff968e0e 100644 --- a/plugins/channelrx/chanalyzer/chanalyzergui.cpp +++ b/plugins/channelrx/chanalyzer/chanalyzergui.cpp @@ -188,6 +188,11 @@ void ChannelAnalyzerGUI::channelMarkerChangedByCursor() applySettings(); } +void ChannelAnalyzerGUI::channelMarkerHighlightedByCursor() +{ + setHighlighted(m_channelMarker.getHighlighted()); +} + void ChannelAnalyzerGUI::tick() { Real powDb = CalcDb::dbPower(m_channelAnalyzer->getMagSq()); @@ -368,6 +373,7 @@ ChannelAnalyzerGUI::ChannelAnalyzerGUI(PluginAPI* pluginAPI, DeviceUISet *device ui->scopeGUI->setBuddies(m_scopeVis->getInputMessageQueue(), m_scopeVis, ui->glScope); connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor())); + connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor())); connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); applySettings(); diff --git a/plugins/channelrx/chanalyzer/chanalyzergui.h b/plugins/channelrx/chanalyzer/chanalyzergui.h index b42254799..793da1c19 100644 --- a/plugins/channelrx/chanalyzer/chanalyzergui.h +++ b/plugins/channelrx/chanalyzer/chanalyzergui.h @@ -55,6 +55,7 @@ public: public slots: void channelMarkerChangedByCursor(); + void channelMarkerHighlightedByCursor(); private: Ui::ChannelAnalyzerGUI* ui; diff --git a/plugins/channelrx/chanalyzerng/chanalyzernggui.cpp b/plugins/channelrx/chanalyzerng/chanalyzernggui.cpp index a8c6f8809..db3d07b7f 100644 --- a/plugins/channelrx/chanalyzerng/chanalyzernggui.cpp +++ b/plugins/channelrx/chanalyzerng/chanalyzernggui.cpp @@ -227,6 +227,11 @@ void ChannelAnalyzerNGGUI::channelMarkerChangedByCursor() applySettings(); } +void ChannelAnalyzerNGGUI::channelMarkerHighlightedByCursor() +{ + setHighlighted(m_channelMarker.getHighlighted()); +} + void ChannelAnalyzerNGGUI::tick() { double powDb = CalcDb::dbPower(m_channelAnalyzer->getMagSq()); @@ -432,6 +437,7 @@ ChannelAnalyzerNGGUI::ChannelAnalyzerNGGUI(PluginAPI* pluginAPI, DeviceUISet *de ui->scopeGUI->setBuddies(m_scopeVis->getInputMessageQueue(), m_scopeVis, ui->glScope); connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor())); + connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor())); connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); applySettings(); diff --git a/plugins/channelrx/chanalyzerng/chanalyzernggui.h b/plugins/channelrx/chanalyzerng/chanalyzernggui.h index c50d9cf0b..f0baff683 100644 --- a/plugins/channelrx/chanalyzerng/chanalyzernggui.h +++ b/plugins/channelrx/chanalyzerng/chanalyzernggui.h @@ -55,6 +55,7 @@ public: public slots: void channelMarkerChangedByCursor(); + void channelMarkerHighlightedByCursor(); private: Ui::ChannelAnalyzerNGGUI* ui; diff --git a/plugins/channelrx/demodam/amdemodgui.cpp b/plugins/channelrx/demodam/amdemodgui.cpp index 9b7d2692b..c0f243bbf 100644 --- a/plugins/channelrx/demodam/amdemodgui.cpp +++ b/plugins/channelrx/demodam/amdemodgui.cpp @@ -101,6 +101,11 @@ void AMDemodGUI::channelMarkerChangedByCursor() applySettings(); } +void AMDemodGUI::channelMarkerHighlightedByCursor() +{ + setHighlighted(m_channelMarker.getHighlighted()); +} + void AMDemodGUI::on_deltaFrequency_changed(qint64 value) { m_channelMarker.setCenterFrequency(value); @@ -216,6 +221,7 @@ AMDemodGUI::AMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandS m_deviceUISet->addRollupWidget(this); connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor())); + connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor())); displaySettings(); applySettings(true); diff --git a/plugins/channelrx/demodam/amdemodgui.h b/plugins/channelrx/demodam/amdemodgui.h index 9379b70fe..f853cc220 100644 --- a/plugins/channelrx/demodam/amdemodgui.h +++ b/plugins/channelrx/demodam/amdemodgui.h @@ -38,6 +38,7 @@ public: public slots: void channelMarkerChangedByCursor(); + void channelMarkerHighlightedByCursor(); private: Ui::AMDemodGUI* ui; diff --git a/plugins/channelrx/demodatv/atvdemodgui.cpp b/plugins/channelrx/demodatv/atvdemodgui.cpp index 47b6ffde7..072a0ad7f 100644 --- a/plugins/channelrx/demodatv/atvdemodgui.cpp +++ b/plugins/channelrx/demodatv/atvdemodgui.cpp @@ -245,6 +245,11 @@ void ATVDemodGUI::channelMarkerChangedByCursor() applyRFSettings(); } +void ATVDemodGUI::channelMarkerHighlightedByCursor() +{ + setHighlighted(m_channelMarker.getHighlighted()); +} + void ATVDemodGUI::handleSourceMessages() { Message* message; @@ -325,6 +330,7 @@ ATVDemodGUI::ATVDemodGUI(PluginAPI* objPluginAPI, DeviceUISet *deviceUISet, Base ui->scopeGUI->focusOnTrigger(0); // re-focus to take changes into account in the GUI connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor())); + connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor())); connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages())); QChar delta = QChar(0x94, 0x03); diff --git a/plugins/channelrx/demodatv/atvdemodgui.h b/plugins/channelrx/demodatv/atvdemodgui.h index 2be67d4eb..6c8a19bfa 100644 --- a/plugins/channelrx/demodatv/atvdemodgui.h +++ b/plugins/channelrx/demodatv/atvdemodgui.h @@ -56,6 +56,7 @@ public: public slots: void channelMarkerChangedByCursor(); + void channelMarkerHighlightedByCursor(); private: Ui::ATVDemodGUI* ui; diff --git a/plugins/channelrx/demodbfm/bfmdemodgui.cpp b/plugins/channelrx/demodbfm/bfmdemodgui.cpp index 2e939e0b7..9d921bb8d 100644 --- a/plugins/channelrx/demodbfm/bfmdemodgui.cpp +++ b/plugins/channelrx/demodbfm/bfmdemodgui.cpp @@ -143,6 +143,11 @@ void BFMDemodGUI::channelMarkerChangedByCursor() applySettings(); } +void BFMDemodGUI::channelMarkerHighlightedByCursor() +{ + setHighlighted(m_channelMarker.getHighlighted()); +} + void BFMDemodGUI::on_deltaFrequency_changed(qint64 value) { m_channelMarker.setCenterFrequency(value); @@ -371,6 +376,7 @@ BFMDemodGUI::BFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban m_deviceUISet->addRollupWidget(this); connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor())); + connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor())); ui->spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, ui->glSpectrum); diff --git a/plugins/channelrx/demodbfm/bfmdemodgui.h b/plugins/channelrx/demodbfm/bfmdemodgui.h index adb2695ad..34cf6baf6 100644 --- a/plugins/channelrx/demodbfm/bfmdemodgui.h +++ b/plugins/channelrx/demodbfm/bfmdemodgui.h @@ -57,6 +57,7 @@ public: public slots: void channelMarkerChangedByCursor(); + void channelMarkerHighlightedByCursor(); private: Ui::BFMDemodGUI* ui; diff --git a/plugins/channelrx/demoddsd/dsddemodgui.cpp b/plugins/channelrx/demoddsd/dsddemodgui.cpp index fca256d49..0d4f5685c 100644 --- a/plugins/channelrx/demoddsd/dsddemodgui.cpp +++ b/plugins/channelrx/demoddsd/dsddemodgui.cpp @@ -296,6 +296,7 @@ DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban m_deviceUISet->addRollupWidget(this); connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor())); + connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor())); ui->scopeGUI->setBuddies(m_scopeVis->getInputMessageQueue(), m_scopeVis, ui->glScope); @@ -556,6 +557,10 @@ void DSDDemodGUI::channelMarkerChangedByCursor() applySettings(); } +void DSDDemodGUI::channelMarkerHighlightedByCursor() +{ + setHighlighted(m_channelMarker.getHighlighted()); +} void DSDDemodGUI::tick() { diff --git a/plugins/channelrx/demoddsd/dsddemodgui.h b/plugins/channelrx/demoddsd/dsddemodgui.h index 7eea120a2..cede0f549 100644 --- a/plugins/channelrx/demoddsd/dsddemodgui.h +++ b/plugins/channelrx/demoddsd/dsddemodgui.h @@ -59,6 +59,7 @@ public: public slots: void channelMarkerChangedByCursor(); + void channelMarkerHighlightedByCursor(); private: typedef enum diff --git a/plugins/channelrx/demodnfm/nfmdemodgui.cpp b/plugins/channelrx/demodnfm/nfmdemodgui.cpp index 247acb22f..973c2e588 100644 --- a/plugins/channelrx/demodnfm/nfmdemodgui.cpp +++ b/plugins/channelrx/demodnfm/nfmdemodgui.cpp @@ -105,6 +105,11 @@ void NFMDemodGUI::channelMarkerChangedByCursor() applySettings(); } +void NFMDemodGUI::channelMarkerHighlightedByCursor() +{ + setHighlighted(m_channelMarker.getHighlighted()); +} + void NFMDemodGUI::on_deltaFrequency_changed(qint64 value) { m_channelMarker.setCenterFrequency(value); @@ -293,6 +298,7 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban m_deviceUISet->addRollupWidget(this); connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor())); + connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor())); QChar delta = QChar(0x94, 0x03); ui->deltaSquelch->setText(delta); diff --git a/plugins/channelrx/demodnfm/nfmdemodgui.h b/plugins/channelrx/demodnfm/nfmdemodgui.h index 4b1afe4aa..4920c7b54 100644 --- a/plugins/channelrx/demodnfm/nfmdemodgui.h +++ b/plugins/channelrx/demodnfm/nfmdemodgui.h @@ -40,6 +40,7 @@ public: public slots: void channelMarkerChangedByCursor(); + void channelMarkerHighlightedByCursor(); private: Ui::NFMDemodGUI* ui; diff --git a/plugins/channelrx/demodssb/ssbdemodgui.cpp b/plugins/channelrx/demodssb/ssbdemodgui.cpp index 72f5e3551..7545311a2 100644 --- a/plugins/channelrx/demodssb/ssbdemodgui.cpp +++ b/plugins/channelrx/demodssb/ssbdemodgui.cpp @@ -88,6 +88,11 @@ void SSBDemodGUI::channelMarkerChangedByCursor() applySettings(); } +void SSBDemodGUI::channelMarkerHighlightedByCursor() +{ + setHighlighted(m_channelMarker.getHighlighted()); +} + void SSBDemodGUI::on_audioBinaural_toggled(bool binaural) { m_audioBinaural = binaural; @@ -242,6 +247,7 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban m_deviceUISet->addRollupWidget(this); connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor())); + connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor())); ui->spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, ui->glSpectrum); diff --git a/plugins/channelrx/demodssb/ssbdemodgui.h b/plugins/channelrx/demodssb/ssbdemodgui.h index 51ac02d84..a54e99088 100644 --- a/plugins/channelrx/demodssb/ssbdemodgui.h +++ b/plugins/channelrx/demodssb/ssbdemodgui.h @@ -40,6 +40,7 @@ public: public slots: void channelMarkerChangedByCursor(); + void channelMarkerHighlightedByCursor(); private: Ui::SSBDemodGUI* ui; diff --git a/plugins/channelrx/demodwfm/wfmdemodgui.cpp b/plugins/channelrx/demodwfm/wfmdemodgui.cpp index 4a937094c..5ca41c3c1 100644 --- a/plugins/channelrx/demodwfm/wfmdemodgui.cpp +++ b/plugins/channelrx/demodwfm/wfmdemodgui.cpp @@ -85,6 +85,11 @@ void WFMDemodGUI::channelMarkerChangedByCursor() applySettings(); } +void WFMDemodGUI::channelMarkerHighlightedByCursor() +{ + setHighlighted(m_channelMarker.getHighlighted()); +} + void WFMDemodGUI::on_deltaFrequency_changed(qint64 value) { m_channelMarker.setCenterFrequency(value); @@ -197,6 +202,7 @@ WFMDemodGUI::WFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban m_deviceUISet->addRollupWidget(this); connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor())); + connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor())); displaySettings(); applySettings(true); diff --git a/plugins/channelrx/demodwfm/wfmdemodgui.h b/plugins/channelrx/demodwfm/wfmdemodgui.h index 6598d6499..78d8bb9be 100644 --- a/plugins/channelrx/demodwfm/wfmdemodgui.h +++ b/plugins/channelrx/demodwfm/wfmdemodgui.h @@ -38,6 +38,7 @@ public: public slots: void channelMarkerChangedByCursor(); + void channelMarkerHighlightedByCursor(); private: Ui::WFMDemodGUI* ui; diff --git a/plugins/channelrx/tcpsrc/tcpsrcgui.cpp b/plugins/channelrx/tcpsrc/tcpsrcgui.cpp index db13a0fd7..29e8e6b82 100644 --- a/plugins/channelrx/tcpsrc/tcpsrcgui.cpp +++ b/plugins/channelrx/tcpsrc/tcpsrcgui.cpp @@ -114,6 +114,11 @@ void TCPSrcGUI::channelMarkerChangedByCursor() applySettings(); } +void TCPSrcGUI::channelMarkerHighlightedByCursor() +{ + setHighlighted(m_channelMarker.getHighlighted()); +} + void TCPSrcGUI::tick() { double powDb = CalcDb::dbPower(m_tcpSrc->getMagSq()); @@ -168,6 +173,7 @@ TCPSrcGUI::TCPSrcGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam m_deviceUISet->addRollupWidget(this); connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor())); + connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor())); ui->spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, ui->glSpectrum); diff --git a/plugins/channelrx/tcpsrc/tcpsrcgui.h b/plugins/channelrx/tcpsrc/tcpsrcgui.h index 79630a45f..ca1dded43 100644 --- a/plugins/channelrx/tcpsrc/tcpsrcgui.h +++ b/plugins/channelrx/tcpsrc/tcpsrcgui.h @@ -41,6 +41,7 @@ public: public slots: void channelMarkerChangedByCursor(); + void channelMarkerHighlightedByCursor(); private: Ui::TCPSrcGUI* ui; diff --git a/plugins/channelrx/udpsrc/udpsrcgui.cpp b/plugins/channelrx/udpsrc/udpsrcgui.cpp index 3726cd0cf..76bd5152e 100644 --- a/plugins/channelrx/udpsrc/udpsrcgui.cpp +++ b/plugins/channelrx/udpsrc/udpsrcgui.cpp @@ -102,6 +102,11 @@ void UDPSrcGUI::channelMarkerChangedByCursor() applySettingsImmediate(); } +void UDPSrcGUI::channelMarkerHighlightedByCursor() +{ + setHighlighted(m_channelMarker.getHighlighted()); +} + void UDPSrcGUI::tick() { if (m_tickCount % 4 == 0) @@ -183,6 +188,7 @@ UDPSrcGUI::UDPSrcGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam m_deviceUISet->addRollupWidget(this); connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor())); + connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor())); ui->spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, ui->glSpectrum); diff --git a/plugins/channelrx/udpsrc/udpsrcgui.h b/plugins/channelrx/udpsrc/udpsrcgui.h index cb03a59b8..3827c676d 100644 --- a/plugins/channelrx/udpsrc/udpsrcgui.h +++ b/plugins/channelrx/udpsrc/udpsrcgui.h @@ -57,6 +57,7 @@ public: public slots: void channelMarkerChangedByCursor(); + void channelMarkerHighlightedByCursor(); private: Ui::UDPSrcGUI* ui; diff --git a/sdrgui/gui/rollupwidget.cpp b/sdrgui/gui/rollupwidget.cpp index 1e0bf388a..782ba0927 100644 --- a/sdrgui/gui/rollupwidget.cpp +++ b/sdrgui/gui/rollupwidget.cpp @@ -5,7 +5,8 @@ #include "ui_glspectrumgui.h" RollupWidget::RollupWidget(QWidget* parent) : - QWidget(parent) + QWidget(parent), + m_highlighted(false) { setMinimumSize(250, 150); setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); @@ -99,6 +100,15 @@ void RollupWidget::setTitleColor(const QColor& c) update(); } +void RollupWidget::setHighlighted(bool highlighted) +{ + if (m_highlighted != highlighted) + { + m_highlighted = highlighted; + update(); + } +} + int RollupWidget::arrangeRollups() { QFontMetrics fm(font()); @@ -153,7 +163,7 @@ void RollupWidget::paintEvent(QPaintEvent*) p.drawRect(width() - 5, height() - 5, 5, 5); // Rahmen - p.setPen(frame); + p.setPen(m_highlighted ? Qt::white : frame); p.setBrush(palette().window()); QRectF r(rect()); r.adjust(0.5, 0.5, -0.5, -0.5); diff --git a/sdrgui/gui/rollupwidget.h b/sdrgui/gui/rollupwidget.h index fae1b2c00..4a6514a53 100644 --- a/sdrgui/gui/rollupwidget.h +++ b/sdrgui/gui/rollupwidget.h @@ -10,6 +10,7 @@ class SDRANGEL_API RollupWidget : public QWidget { public: RollupWidget(QWidget* parent = NULL); void setTitleColor(const QColor& c); + void setHighlighted(bool highlighted); signals: void widgetRolled(QWidget* widget, bool rollDown); @@ -21,6 +22,7 @@ protected: QColor m_titleColor; QColor m_titleTextColor; + bool m_highlighted; int arrangeRollups();