diff --git a/doc/img/BasicChannelSettings.png b/doc/img/BasicChannelSettings.png index ec2065606..99c2c01d3 100644 Binary files a/doc/img/BasicChannelSettings.png and b/doc/img/BasicChannelSettings.png differ diff --git a/doc/img/BasicChannelSettings.xcf b/doc/img/BasicChannelSettings.xcf index 5fafecc35..a68769e83 100644 Binary files a/doc/img/BasicChannelSettings.xcf and b/doc/img/BasicChannelSettings.xcf differ diff --git a/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmodgui.cpp b/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmodgui.cpp index f3587d03e..5c35e4b8c 100644 --- a/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmodgui.cpp +++ b/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmodgui.cpp @@ -99,7 +99,6 @@ BeamSteeringCWModGUI::BeamSteeringCWModGUI(PluginAPI* pluginAPI, DeviceUISet *de ui->setupUi(getRollupContents()); getRollupContents()->arrangeRollups(); setAttribute(Qt::WA_DeleteOnClose, true); - setStreamIndicator("M"); connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &))); @@ -114,7 +113,7 @@ BeamSteeringCWModGUI::BeamSteeringCWModGUI(PluginAPI* pluginAPI, DeviceUISet *de m_channelMarker.addStreamIndex(1); m_channelMarker.setColor(m_settings.m_rgbColor); m_channelMarker.setCenterFrequency(0); - m_channelMarker.setTitle("Beam Steering CW Source"); + m_channelMarker.setTitle("BeamSteeringCWMod"); m_channelMarker.setSourceOrSinkStream(false); m_channelMarker.blockSignals(false); m_channelMarker.setVisible(true); // activate signal on the last setting only @@ -228,6 +227,7 @@ void BeamSteeringCWModGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); dialog.move(p); dialog.exec(); diff --git a/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmodgui.h b/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmodgui.h index 093b9f245..984eb4dd4 100644 --- a/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmodgui.h +++ b/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmodgui.h @@ -57,6 +57,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return -1; } + virtual void setStreamIndex(int streamIndex) { (void) streamIndex; } private: Ui::BeamSteeringCWModGUI* ui; diff --git a/plugins/channelmimo/interferometer/interferometergui.cpp b/plugins/channelmimo/interferometer/interferometergui.cpp index 6d57ff9da..8ab582f62 100644 --- a/plugins/channelmimo/interferometer/interferometergui.cpp +++ b/plugins/channelmimo/interferometer/interferometergui.cpp @@ -109,7 +109,6 @@ InterferometerGUI::InterferometerGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUI ui->setupUi(getRollupContents()); getRollupContents()->arrangeRollups(); setAttribute(Qt::WA_DeleteOnClose, true); - setStreamIndicator("M"); connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &))); @@ -263,6 +262,7 @@ void InterferometerGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); dialog.move(p); dialog.exec(); diff --git a/plugins/channelmimo/interferometer/interferometergui.h b/plugins/channelmimo/interferometer/interferometergui.h index 47919d1e0..b4b2d6fa2 100644 --- a/plugins/channelmimo/interferometer/interferometergui.h +++ b/plugins/channelmimo/interferometer/interferometergui.h @@ -56,6 +56,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return -1; } + virtual void setStreamIndex(int streamIndex) { (void) streamIndex; } private: Ui::InterferometerGUI* ui; diff --git a/plugins/channelrx/chanalyzer/chanalyzer.cpp b/plugins/channelrx/chanalyzer/chanalyzer.cpp index 9a00de8aa..985ae81f7 100644 --- a/plugins/channelrx/chanalyzer/chanalyzer.cpp +++ b/plugins/channelrx/chanalyzer/chanalyzer.cpp @@ -104,6 +104,11 @@ void ChannelAnalyzer::setDeviceAPI(DeviceAPI *deviceAPI) } } +uint32_t ChannelAnalyzer::getNumberOfDeviceStreams() const +{ + return m_deviceAPI->getNbSourceStreams(); +} + int ChannelAnalyzer::getChannelSampleRate() { DeviceSampleSource *source = m_deviceAPI->getSampleSource(); diff --git a/plugins/channelrx/chanalyzer/chanalyzer.h b/plugins/channelrx/chanalyzer/chanalyzer.h index 7bbb36f98..806594ca3 100644 --- a/plugins/channelrx/chanalyzer/chanalyzer.h +++ b/plugins/channelrx/chanalyzer/chanalyzer.h @@ -96,6 +96,7 @@ public: virtual int getNbSinkStreams() const { return 1; } virtual int getNbSourceStreams() const { return 0; } + uint32_t getNumberOfDeviceStreams() const; virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const { diff --git a/plugins/channelrx/chanalyzer/chanalyzergui.cpp b/plugins/channelrx/chanalyzer/chanalyzergui.cpp index 1e7cd0253..4be9991f5 100644 --- a/plugins/channelrx/chanalyzer/chanalyzergui.cpp +++ b/plugins/channelrx/chanalyzer/chanalyzergui.cpp @@ -472,6 +472,14 @@ void ChannelAnalyzerGUI::onMenuDialogCalled(const QPoint& p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_channelAnalyzer->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } + dialog.move(p); dialog.exec(); @@ -487,6 +495,14 @@ void ChannelAnalyzerGUI::onMenuDialogCalled(const QPoint& p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } + applySettings(); } diff --git a/plugins/channelrx/chanalyzer/chanalyzergui.h b/plugins/channelrx/chanalyzer/chanalyzergui.h index c44a9f8a9..1744544b6 100644 --- a/plugins/channelrx/chanalyzer/chanalyzergui.h +++ b/plugins/channelrx/chanalyzer/chanalyzergui.h @@ -58,6 +58,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); diff --git a/plugins/channelrx/demodadsb/adsbdemodgui.cpp b/plugins/channelrx/demodadsb/adsbdemodgui.cpp index 67c260912..e8dca5747 100644 --- a/plugins/channelrx/demodadsb/adsbdemodgui.cpp +++ b/plugins/channelrx/demodadsb/adsbdemodgui.cpp @@ -2779,6 +2779,14 @@ void ADSBDemodGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_adsbDemod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } + dialog.move(p); dialog.exec(); @@ -2794,20 +2802,14 @@ void ADSBDemodGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_adsbDemod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -3950,7 +3952,7 @@ void ADSBDemodGUI::displaySettings() ui->logFilename->setToolTip(QString(".csv log filename: %1").arg(m_settings.m_logFilename)); ui->logEnable->setChecked(m_settings.m_logEnabled); - displayStreamIndex(); + updateIndexLabel(); QFont font(m_settings.m_tableFontName, m_settings.m_tableFontSize); ui->adsbData->setFont(font); @@ -4003,15 +4005,6 @@ void ADSBDemodGUI::displaySettings() blockApplySettings(false); } -void ADSBDemodGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void ADSBDemodGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channelrx/demodadsb/adsbdemodgui.h b/plugins/channelrx/demodadsb/adsbdemodgui.h index 95553329f..f582e02b9 100644 --- a/plugins/channelrx/demodadsb/adsbdemodgui.h +++ b/plugins/channelrx/demodadsb/adsbdemodgui.h @@ -761,6 +761,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } void highlightAircraft(Aircraft *aircraft); void targetAircraft(Aircraft *aircraft); @@ -848,7 +850,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); bool handleMessage(const Message& message); void makeUIConnections(); void updateAbsoluteCenterFrequency(); diff --git a/plugins/channelrx/demodais/aisdemodgui.cpp b/plugins/channelrx/demodais/aisdemodgui.cpp index cc81405a2..2a70598f8 100644 --- a/plugins/channelrx/demodais/aisdemodgui.cpp +++ b/plugins/channelrx/demodais/aisdemodgui.cpp @@ -396,6 +396,14 @@ void AISDemodGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_aisDemod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } + dialog.move(p); dialog.exec(); @@ -411,20 +419,14 @@ void AISDemodGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_aisDemod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -599,7 +601,7 @@ void AISDemodGUI::displaySettings() ui->thresholdText->setText(QString("%1").arg(m_settings.m_correlationThreshold)); ui->threshold->setValue(m_settings.m_correlationThreshold); - displayStreamIndex(); + updateIndexLabel(); ui->filterMMSI->setText(m_settings.m_filterMMSI); @@ -633,15 +635,6 @@ void AISDemodGUI::displaySettings() blockApplySettings(false); } -void AISDemodGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void AISDemodGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channelrx/demodais/aisdemodgui.h b/plugins/channelrx/demodais/aisdemodgui.h index 5856f1852..7209daaf1 100644 --- a/plugins/channelrx/demodais/aisdemodgui.h +++ b/plugins/channelrx/demodais/aisdemodgui.h @@ -66,6 +66,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -96,7 +98,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); void messageReceived(const QByteArray& message, const QDateTime& dateTime); bool handleMessage(const Message& message); void makeUIConnections(); diff --git a/plugins/channelrx/demodam/amdemodgui.cpp b/plugins/channelrx/demodam/amdemodgui.cpp index 8a4020f6a..35641d3e9 100644 --- a/plugins/channelrx/demodam/amdemodgui.cpp +++ b/plugins/channelrx/demodam/amdemodgui.cpp @@ -208,6 +208,14 @@ void AMDemodGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_amDemod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } + dialog.move(p); dialog.exec(); @@ -223,20 +231,14 @@ void AMDemodGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_amDemod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -387,22 +389,13 @@ void AMDemodGUI::displaySettings() ui->ssb->setIcon(m_iconDSBUSB); } - displayStreamIndex(); + updateIndexLabel(); getRollupContents()->restoreState(m_rollupState); updateAbsoluteCenterFrequency(); blockApplySettings(false); } -void AMDemodGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void AMDemodGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channelrx/demodam/amdemodgui.h b/plugins/channelrx/demodam/amdemodgui.h index 7d2440134..cedcf4b0c 100644 --- a/plugins/channelrx/demodam/amdemodgui.h +++ b/plugins/channelrx/demodam/amdemodgui.h @@ -40,6 +40,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -72,7 +74,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); bool handleMessage(const Message& message); void makeUIConnections(); void updateAbsoluteCenterFrequency(); diff --git a/plugins/channelrx/demodapt/aptdemodgui.cpp b/plugins/channelrx/demodapt/aptdemodgui.cpp index bb1e42acb..19e0b08c7 100644 --- a/plugins/channelrx/demodapt/aptdemodgui.cpp +++ b/plugins/channelrx/demodapt/aptdemodgui.cpp @@ -556,6 +556,14 @@ void APTDemodGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_aptDemod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } + dialog.move(p); dialog.exec(); @@ -571,20 +579,14 @@ void APTDemodGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_aptDemod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -781,7 +783,7 @@ void APTDemodGUI::displaySettings() displayPalettes(); displayLabels(); - displayStreamIndex(); + updateIndexLabel(); getRollupContents()->restoreState(m_rollupState); updateAbsoluteCenterFrequency(); @@ -812,15 +814,6 @@ void APTDemodGUI::displayPalettes() ui->channels->blockSignals(false); } -void APTDemodGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void APTDemodGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channelrx/demodapt/aptdemodgui.h b/plugins/channelrx/demodapt/aptdemodgui.h index 1cb07b223..71fc5b2cf 100644 --- a/plugins/channelrx/demodapt/aptdemodgui.h +++ b/plugins/channelrx/demodapt/aptdemodgui.h @@ -84,6 +84,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -123,7 +125,6 @@ private: void displaySettings(); void displayPalettes(); void displayLabels(); - void displayStreamIndex(); bool handleMessage(const Message& message); void makeUIConnections(); void updateAbsoluteCenterFrequency(); diff --git a/plugins/channelrx/demodatv/atvdemod.cpp b/plugins/channelrx/demodatv/atvdemod.cpp index 0eeb224db..28bb15d7c 100644 --- a/plugins/channelrx/demodatv/atvdemod.cpp +++ b/plugins/channelrx/demodatv/atvdemod.cpp @@ -87,6 +87,11 @@ void ATVDemod::setDeviceAPI(DeviceAPI *deviceAPI) } } +uint32_t ATVDemod::getNumberOfDeviceStreams() const +{ + return m_deviceAPI->getNbSourceStreams(); +} + void ATVDemod::start() { qDebug("ATVDemod::start"); diff --git a/plugins/channelrx/demodatv/atvdemod.h b/plugins/channelrx/demodatv/atvdemod.h index f70342a17..cafcd7722 100644 --- a/plugins/channelrx/demodatv/atvdemod.h +++ b/plugins/channelrx/demodatv/atvdemod.h @@ -97,6 +97,7 @@ public: double getMagSq() const { return m_basebandSink->getMagSq(); } //!< Beware this is scaled to 2^30 bool getBFOLocked() { return m_basebandSink->getBFOLocked(); } void setVideoTabIndex(int videoTabIndex) { m_basebandSink->setVideoTabIndex(videoTabIndex); } + uint32_t getNumberOfDeviceStreams() const; static const char* const m_channelIdURI; static const char* const m_channelId; diff --git a/plugins/channelrx/demodatv/atvdemodgui.cpp b/plugins/channelrx/demodatv/atvdemodgui.cpp index a11a48317..21cda893d 100644 --- a/plugins/channelrx/demodatv/atvdemodgui.cpp +++ b/plugins/channelrx/demodatv/atvdemodgui.cpp @@ -24,6 +24,7 @@ #include "device/deviceuiset.h" #include "dsp/scopevis.h" #include "dsp/glscopesettings.h" +#include "gui/basicchannelsettingsdialog.h" #include "ui_atvdemodgui.h" #include "plugin/pluginapi.h" #include "util/simpleserializer.h" @@ -87,7 +88,7 @@ void ATVDemodGUI::displaySettings() setTitleColor(m_settings.m_rgbColor); setWindowTitle(m_channelMarker.getTitle()); setTitle(m_channelMarker.getTitle()); - displayStreamIndex(); + updateIndexLabel(); m_doApplySettings = false; @@ -126,15 +127,6 @@ void ATVDemodGUI::displaySettings() m_doApplySettings = true; } -void ATVDemodGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void ATVDemodGUI::displayRFBandwidths() { int sliderPosition = m_settings.m_fftBandwidth / m_rfSliderDivisor; @@ -209,6 +201,53 @@ void ATVDemodGUI::handleSourceMessages() } } +void ATVDemodGUI::onMenuDialogCalled(const QPoint &p) +{ + if (m_contextMenuType == ContextMenuChannelSettings) + { + BasicChannelSettingsDialog dialog(&m_channelMarker, this); + dialog.setUseReverseAPI(m_settings.m_useReverseAPI); + dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress); + dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); + dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); + dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_atvDemod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } + + dialog.move(p); + dialog.exec(); + + m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); + m_settings.m_title = m_channelMarker.getTitle(); + m_settings.m_useReverseAPI = dialog.useReverseAPI(); + m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress(); + m_settings.m_reverseAPIPort = dialog.getReverseAPIPort(); + m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex(); + m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex(); + + setWindowTitle(m_settings.m_title); + setTitle(m_channelMarker.getTitle()); + setTitleColor(m_settings.m_rgbColor); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } + + applySettings(); + } + + resetContextMenuType(); +} + void ATVDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown) { (void) widget; @@ -234,6 +273,7 @@ ATVDemodGUI::ATVDemodGUI(PluginAPI* objPluginAPI, DeviceUISet *deviceUISet, Base m_helpURL = "plugins/channelrx/demodatv/readme.md"; setAttribute(Qt::WA_DeleteOnClose, true); connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &))); m_atvDemod = (ATVDemod*) rxChannel; m_atvDemod->setMessageQueueToGUI(getInputMessageQueue()); diff --git a/plugins/channelrx/demodatv/atvdemodgui.h b/plugins/channelrx/demodatv/atvdemodgui.h index 123bf011e..663d565a9 100644 --- a/plugins/channelrx/demodatv/atvdemodgui.h +++ b/plugins/channelrx/demodatv/atvdemodgui.h @@ -59,6 +59,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -90,7 +92,6 @@ private: void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); void displayRFBandwidths(); void applySampleRate(); void setChannelMarkerBandwidth(); @@ -107,6 +108,7 @@ private: private slots: void handleSourceMessages(); void onWidgetRolled(QWidget* widget, bool rollDown); + void onMenuDialogCalled(const QPoint& p); void tick(); void on_synchLevel_valueChanged(int value); void on_blackLevel_valueChanged(int value); diff --git a/plugins/channelrx/demodbfm/bfmdemodgui.cpp b/plugins/channelrx/demodbfm/bfmdemodgui.cpp index 921a35a0d..02fc49f35 100644 --- a/plugins/channelrx/demodbfm/bfmdemodgui.cpp +++ b/plugins/channelrx/demodbfm/bfmdemodgui.cpp @@ -330,6 +330,13 @@ void BFMDemodGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_bfmDemod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } dialog.move(p); dialog.exec(); @@ -346,20 +353,14 @@ void BFMDemodGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_bfmDemod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -492,22 +493,13 @@ void BFMDemodGUI::displaySettings() ui->showPilot->setChecked(m_settings.m_showPilot); ui->rds->setChecked(m_settings.m_rdsActive); - displayStreamIndex(); + updateIndexLabel(); getRollupContents()->restoreState(m_rollupState); updateAbsoluteCenterFrequency(); blockApplySettings(false); } -void BFMDemodGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void BFMDemodGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channelrx/demodbfm/bfmdemodgui.h b/plugins/channelrx/demodbfm/bfmdemodgui.h index e89dabe31..7b3f441a3 100644 --- a/plugins/channelrx/demodbfm/bfmdemodgui.h +++ b/plugins/channelrx/demodbfm/bfmdemodgui.h @@ -57,6 +57,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -88,7 +90,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); void rdsUpdate(bool force); void rdsUpdateFixedFields(); bool handleMessage(const Message& message); diff --git a/plugins/channelrx/demodchirpchat/chirpchatdemodgui.cpp b/plugins/channelrx/demodchirpchat/chirpchatdemodgui.cpp index e7eefe4c9..1226ebbae 100644 --- a/plugins/channelrx/demodchirpchat/chirpchatdemodgui.cpp +++ b/plugins/channelrx/demodchirpchat/chirpchatdemodgui.cpp @@ -343,6 +343,14 @@ void ChirpChatDemodGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_chirpChatDemod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } + dialog.move(p); dialog.exec(); @@ -358,20 +366,14 @@ void ChirpChatDemodGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_chirpChatDemod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -507,21 +509,13 @@ void ChirpChatDemodGUI::displaySettings() ui->messageLengthAuto->setChecked(m_settings.m_autoNbSymbolsMax); displaySquelch(); + updateIndexLabel(); getRollupContents()->restoreState(m_rollupState); updateAbsoluteCenterFrequency(); blockApplySettings(false); } -void ChirpChatDemodGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void ChirpChatDemodGUI::displaySquelch() { ui->eomSquelch->setValue(m_settings.m_eomSquelchTenths); diff --git a/plugins/channelrx/demodchirpchat/chirpchatdemodgui.h b/plugins/channelrx/demodchirpchat/chirpchatdemodgui.h index 123c613d8..4678e0868 100644 --- a/plugins/channelrx/demodchirpchat/chirpchatdemodgui.h +++ b/plugins/channelrx/demodchirpchat/chirpchatdemodgui.h @@ -55,6 +55,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } private slots: void channelMarkerChangedByCursor(); @@ -113,7 +115,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); void displaySquelch(); void setBandwidths(); void showLoRaMessage(const Message& message); diff --git a/plugins/channelrx/demoddab/dabdemodgui.cpp b/plugins/channelrx/demoddab/dabdemodgui.cpp index 8e1729f12..cee8f38a5 100644 --- a/plugins/channelrx/demoddab/dabdemodgui.cpp +++ b/plugins/channelrx/demoddab/dabdemodgui.cpp @@ -406,6 +406,14 @@ void DABDemodGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_dabDemod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } + dialog.move(p); dialog.exec(); @@ -421,20 +429,14 @@ void DABDemodGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_dabDemod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -563,7 +565,7 @@ void DABDemodGUI::displaySettings() ui->rfBWText->setText(QString("%1k").arg(m_settings.m_rfBandwidth / 1000.0, 0, 'f', 1)); ui->rfBW->setValue(m_settings.m_rfBandwidth / 100.0); - displayStreamIndex(); + updateIndexLabel(); ui->filter->setText(m_settings.m_filter); @@ -586,15 +588,6 @@ void DABDemodGUI::displaySettings() blockApplySettings(false); } -void DABDemodGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void DABDemodGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channelrx/demoddab/dabdemodgui.h b/plugins/channelrx/demoddab/dabdemodgui.h index 9ed800f16..b5b4e9681 100644 --- a/plugins/channelrx/demoddab/dabdemodgui.h +++ b/plugins/channelrx/demoddab/dabdemodgui.h @@ -62,6 +62,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -91,7 +93,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); void addProgramName(const DABDemod::MsgDABProgramName& program); bool handleMessage(const Message& message); void makeUIConnections(); diff --git a/plugins/channelrx/demoddatv/datvdemodgui.cpp b/plugins/channelrx/demoddatv/datvdemodgui.cpp index 73515445c..c2ed28dae 100644 --- a/plugins/channelrx/demoddatv/datvdemodgui.cpp +++ b/plugins/channelrx/demoddatv/datvdemodgui.cpp @@ -162,6 +162,14 @@ void DATVDemodGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_datvDemod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } + dialog.move(p); dialog.exec(); @@ -177,20 +185,14 @@ void DATVDemodGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_datvDemod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -413,6 +415,7 @@ void DATVDemodGUI::displaySettings() getRollupContents()->restoreState(m_rollupState); updateAbsoluteCenterFrequency(); + updateIndexLabel(); blockApplySettings(false); } @@ -460,15 +463,6 @@ void DATVDemodGUI::displaySystemConfiguration() ui->cmbFEC->blockSignals(false); } -void DATVDemodGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void DATVDemodGUI::applySettings(bool force) { if (m_blnDoApplySettings) diff --git a/plugins/channelrx/demoddatv/datvdemodgui.h b/plugins/channelrx/demoddatv/datvdemodgui.h index 1b2511983..34b987c10 100644 --- a/plugins/channelrx/demoddatv/datvdemodgui.h +++ b/plugins/channelrx/demoddatv/datvdemodgui.h @@ -59,8 +59,9 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } - virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } static const char* const m_strChannelID; @@ -140,7 +141,6 @@ private: void applySettings(bool force = false); void displaySettings(); void displaySystemConfiguration(); - void displayStreamIndex(); QString formatBytes(qint64 intBytes); void displayRRCParameters(bool blnVisible); diff --git a/plugins/channelrx/demoddsd/dsddemodgui.cpp b/plugins/channelrx/demoddsd/dsddemodgui.cpp index 83fd0db09..201d95bd0 100644 --- a/plugins/channelrx/demoddsd/dsddemodgui.cpp +++ b/plugins/channelrx/demoddsd/dsddemodgui.cpp @@ -274,6 +274,13 @@ void DSDDemodGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_dsdDemod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } dialog.move(p); dialog.exec(); @@ -290,20 +297,14 @@ void DSDDemodGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_dsdDemod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -478,22 +479,13 @@ void DSDDemodGUI::displaySettings() ui->traceDecayText->setText(QString("%1").arg(m_settings.m_traceDecay)); m_scopeVisXY->setDecay(m_settings.m_traceDecay); - displayStreamIndex(); + updateIndexLabel(); getRollupContents()->restoreState(m_rollupState); updateAbsoluteCenterFrequency(); blockApplySettings(false); } -void DSDDemodGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void DSDDemodGUI::applySettings(bool force) { if (m_doApplySettings) diff --git a/plugins/channelrx/demoddsd/dsddemodgui.h b/plugins/channelrx/demoddsd/dsddemodgui.h index 618a853fc..27589f019 100644 --- a/plugins/channelrx/demoddsd/dsddemodgui.h +++ b/plugins/channelrx/demoddsd/dsddemodgui.h @@ -61,6 +61,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -112,7 +114,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); void updateMyPosition(); bool handleMessage(const Message& message); void makeUIConnections(); diff --git a/plugins/channelrx/demodfreedv/freedvdemodgui.cpp b/plugins/channelrx/demodfreedv/freedvdemodgui.cpp index a1fed8784..0e46817b6 100644 --- a/plugins/channelrx/demodfreedv/freedvdemodgui.cpp +++ b/plugins/channelrx/demodfreedv/freedvdemodgui.cpp @@ -206,6 +206,13 @@ void FreeDVDemodGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_freeDVDemod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } dialog.move(p); dialog.exec(); @@ -222,20 +229,14 @@ void FreeDVDemodGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_freeDVDemod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -406,22 +407,13 @@ void FreeDVDemodGUI::displaySettings() ui->volumeIn->setValue(m_settings.m_volumeIn * 10.0); ui->volumeInText->setText(QString("%1").arg(m_settings.m_volumeIn, 0, 'f', 1)); - displayStreamIndex(); + updateIndexLabel(); getRollupContents()->restoreState(m_rollupState); updateAbsoluteCenterFrequency(); blockApplySettings(false); } -void FreeDVDemodGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void FreeDVDemodGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channelrx/demodfreedv/freedvdemodgui.h b/plugins/channelrx/demodfreedv/freedvdemodgui.h index 4edb7d8fd..8d9be693d 100644 --- a/plugins/channelrx/demodfreedv/freedvdemodgui.h +++ b/plugins/channelrx/demodfreedv/freedvdemodgui.h @@ -59,6 +59,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -97,7 +99,6 @@ private: void applyBandwidths(int spanLog2, bool force = false); void displayBandwidths(int spanLog2); void displaySettings(); - void displayStreamIndex(); bool handleMessage(const Message& message); void makeUIConnections(); void updateAbsoluteCenterFrequency(); diff --git a/plugins/channelrx/demodnfm/nfmdemodgui.cpp b/plugins/channelrx/demodnfm/nfmdemodgui.cpp index e975c1b3d..a6e670963 100644 --- a/plugins/channelrx/demodnfm/nfmdemodgui.cpp +++ b/plugins/channelrx/demodnfm/nfmdemodgui.cpp @@ -306,6 +306,14 @@ void NFMDemodGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_nfmDemod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } + dialog.move(p); dialog.exec(); @@ -321,20 +329,14 @@ void NFMDemodGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_nfmDemod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -523,22 +525,13 @@ void NFMDemodGUI::displaySettings() } setDcsCode(m_reportedDcsCode); - displayStreamIndex(); + updateIndexLabel(); getRollupContents()->restoreState(m_rollupState); updateAbsoluteCenterFrequency(); blockApplySettings(false); } -void NFMDemodGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void NFMDemodGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channelrx/demodnfm/nfmdemodgui.h b/plugins/channelrx/demodnfm/nfmdemodgui.h index e1681c039..e320900d6 100644 --- a/plugins/channelrx/demodnfm/nfmdemodgui.h +++ b/plugins/channelrx/demodnfm/nfmdemodgui.h @@ -39,6 +39,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -70,7 +72,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); void setCtcssFreq(Real ctcssFreq); void setDcsCode(unsigned int dcsCode); bool handleMessage(const Message& message); diff --git a/plugins/channelrx/demodpacket/packetdemodgui.cpp b/plugins/channelrx/demodpacket/packetdemodgui.cpp index 3490a5dc3..afae8ef80 100644 --- a/plugins/channelrx/demodpacket/packetdemodgui.cpp +++ b/plugins/channelrx/demodpacket/packetdemodgui.cpp @@ -388,6 +388,14 @@ void PacketDemodGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_packetDemod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } + dialog.move(p); dialog.exec(); @@ -403,20 +411,14 @@ void PacketDemodGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_packetDemod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -535,7 +537,7 @@ void PacketDemodGUI::displaySettings() ui->fmDevText->setText(QString("%1k").arg(m_settings.m_fmDeviation / 1000.0, 0, 'f', 1)); ui->fmDev->setValue(m_settings.m_fmDeviation / 100.0); - displayStreamIndex(); + updateIndexLabel(); ui->filterFrom->setText(m_settings.m_filterFrom); ui->filterTo->setText(m_settings.m_filterTo); @@ -567,15 +569,6 @@ void PacketDemodGUI::displaySettings() blockApplySettings(false); } -void PacketDemodGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void PacketDemodGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channelrx/demodpacket/packetdemodgui.h b/plugins/channelrx/demodpacket/packetdemodgui.h index 80f860986..613692a8b 100644 --- a/plugins/channelrx/demodpacket/packetdemodgui.h +++ b/plugins/channelrx/demodpacket/packetdemodgui.h @@ -67,6 +67,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -95,7 +97,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); void packetReceived(QByteArray packet); bool handleMessage(const Message& message); void makeUIConnections(); diff --git a/plugins/channelrx/demodpager/pagerdemodgui.cpp b/plugins/channelrx/demodpager/pagerdemodgui.cpp index 97ca224dd..9989ba94b 100644 --- a/plugins/channelrx/demodpager/pagerdemodgui.cpp +++ b/plugins/channelrx/demodpager/pagerdemodgui.cpp @@ -445,6 +445,14 @@ void PagerDemodGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_pagerDemod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } + dialog.move(p); dialog.exec(); @@ -460,20 +468,14 @@ void PagerDemodGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_pagerDemod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -632,7 +634,7 @@ void PagerDemodGUI::displaySettings() ui->fmDevText->setText(QString("%1k").arg(m_settings.m_fmDeviation / 1000.0, 0, 'f', 1)); ui->fmDev->setValue(m_settings.m_fmDeviation / 100.0); - displayStreamIndex(); + updateIndexLabel(); ui->filterAddress->setText(m_settings.m_filterAddress); @@ -666,15 +668,6 @@ void PagerDemodGUI::displaySettings() blockApplySettings(false); } -void PagerDemodGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void PagerDemodGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channelrx/demodpager/pagerdemodgui.h b/plugins/channelrx/demodpager/pagerdemodgui.h index b4b3b82e4..f42f136be 100644 --- a/plugins/channelrx/demodpager/pagerdemodgui.h +++ b/plugins/channelrx/demodpager/pagerdemodgui.h @@ -61,6 +61,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -90,7 +92,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); void messageReceived(const QDateTime dateTime, int address, int functionBits, const QString &numericMessage, const QString &alphaMessage, int evenParityErrors, int bchParityErrors); diff --git a/plugins/channelrx/demodradiosonde/radiosondedemodgui.cpp b/plugins/channelrx/demodradiosonde/radiosondedemodgui.cpp index 14c093e8f..1a76963fb 100644 --- a/plugins/channelrx/demodradiosonde/radiosondedemodgui.cpp +++ b/plugins/channelrx/demodradiosonde/radiosondedemodgui.cpp @@ -502,6 +502,14 @@ void RadiosondeDemodGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_radiosondeDemod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } + dialog.move(p); dialog.exec(); @@ -517,20 +525,14 @@ void RadiosondeDemodGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_radiosondeDemod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -737,7 +739,7 @@ void RadiosondeDemodGUI::displaySettings() ui->thresholdText->setText(QString("%1").arg(m_settings.m_correlationThreshold)); ui->threshold->setValue(m_settings.m_correlationThreshold); - displayStreamIndex(); + updateIndexLabel(); ui->filterSerial->setText(m_settings.m_filterSerial); @@ -770,15 +772,6 @@ void RadiosondeDemodGUI::displaySettings() blockApplySettings(false); } -void RadiosondeDemodGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void RadiosondeDemodGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channelrx/demodradiosonde/radiosondedemodgui.h b/plugins/channelrx/demodradiosonde/radiosondedemodgui.h index 1958c2503..ca3879c8b 100644 --- a/plugins/channelrx/demodradiosonde/radiosondedemodgui.h +++ b/plugins/channelrx/demodradiosonde/radiosondedemodgui.h @@ -62,6 +62,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -94,7 +96,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); void frameReceived(const QByteArray& frame, const QDateTime& dateTime, int errorsCorrected, int threshold); bool handleMessage(const Message& message); void makeUIConnections(); diff --git a/plugins/channelrx/demodssb/ssbdemodgui.cpp b/plugins/channelrx/demodssb/ssbdemodgui.cpp index f4b4392a9..05eba5be5 100644 --- a/plugins/channelrx/demodssb/ssbdemodgui.cpp +++ b/plugins/channelrx/demodssb/ssbdemodgui.cpp @@ -246,6 +246,13 @@ void SSBDemodGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_ssbDemod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } dialog.move(p); dialog.exec(); @@ -262,20 +269,14 @@ void SSBDemodGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_ssbDemod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -588,22 +589,13 @@ void SSBDemodGUI::displaySettings() displayAGCPowerThreshold(ui->agcPowerThreshold->value()); displayAGCThresholdGate(m_settings.m_agcThresholdGate); - displayStreamIndex(); + updateIndexLabel(); getRollupContents()->restoreState(m_rollupState); updateAbsoluteCenterFrequency(); blockApplySettings(false); } -void SSBDemodGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void SSBDemodGUI::displayAGCPowerThreshold(int value) { if (value == SSBDemodSettings::m_minPowerThresholdDB) diff --git a/plugins/channelrx/demodssb/ssbdemodgui.h b/plugins/channelrx/demodssb/ssbdemodgui.h index 3134732f5..6a193f09e 100644 --- a/plugins/channelrx/demodssb/ssbdemodgui.h +++ b/plugins/channelrx/demodssb/ssbdemodgui.h @@ -42,6 +42,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -80,7 +82,6 @@ private: void applyBandwidths(unsigned int spanLog2, bool force = false); unsigned int spanLog2Max(); void displaySettings(); - void displayStreamIndex(); void displayAGCPowerThreshold(int value); void displayAGCThresholdGate(int value); bool handleMessage(const Message& message); diff --git a/plugins/channelrx/demodvor/vordemodgui.cpp b/plugins/channelrx/demodvor/vordemodgui.cpp index b91b77238..5c96af2d6 100644 --- a/plugins/channelrx/demodvor/vordemodgui.cpp +++ b/plugins/channelrx/demodvor/vordemodgui.cpp @@ -1121,6 +1121,14 @@ void VORDemodGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_vorDemod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } + dialog.move(p); dialog.exec(); @@ -1136,20 +1144,14 @@ void VORDemodGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_vorDemod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -1325,7 +1327,7 @@ void VORDemodGUI::displaySettings() ui->audioMute->setChecked(m_settings.m_audioMute); - displayStreamIndex(); + updateIndexLabel(); // Order and size columns QHeaderView *header = ui->vorData->horizontalHeader(); @@ -1343,15 +1345,6 @@ void VORDemodGUI::displaySettings() blockApplySettings(false); } -void VORDemodGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void VORDemodGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channelrx/demodvor/vordemodgui.h b/plugins/channelrx/demodvor/vordemodgui.h index f368a7b54..e1ee119da 100644 --- a/plugins/channelrx/demodvor/vordemodgui.h +++ b/plugins/channelrx/demodvor/vordemodgui.h @@ -220,6 +220,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } void selectVOR(VORGUI *vorGUI, bool selected); @@ -262,7 +264,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); bool handleMessage(const Message& message); void makeUIConnections(); void updateAbsoluteCenterFrequency(); diff --git a/plugins/channelrx/demodvorsc/vordemodscgui.cpp b/plugins/channelrx/demodvorsc/vordemodscgui.cpp index 9e741f7da..d0e7c0e0a 100644 --- a/plugins/channelrx/demodvorsc/vordemodscgui.cpp +++ b/plugins/channelrx/demodvorsc/vordemodscgui.cpp @@ -242,6 +242,14 @@ void VORDemodSCGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_vorDemod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } + dialog.move(p); dialog.exec(); @@ -257,20 +265,14 @@ void VORDemodSCGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_vorDemod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -379,22 +381,13 @@ void VORDemodSCGUI::displaySettings() ui->audioMute->setChecked(m_settings.m_audioMute); - displayStreamIndex(); + updateIndexLabel(); getRollupContents()->restoreState(m_rollupState); updateAbsoluteCenterFrequency(); blockApplySettings(false); } -void VORDemodSCGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void VORDemodSCGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channelrx/demodvorsc/vordemodscgui.h b/plugins/channelrx/demodvorsc/vordemodscgui.h index 557a2775d..058d36c20 100644 --- a/plugins/channelrx/demodvorsc/vordemodscgui.h +++ b/plugins/channelrx/demodvorsc/vordemodscgui.h @@ -57,6 +57,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -84,7 +86,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); bool handleMessage(const Message& message); void makeUIConnections(); void updateAbsoluteCenterFrequency(); diff --git a/plugins/channelrx/demodwfm/wfmdemodgui.cpp b/plugins/channelrx/demodwfm/wfmdemodgui.cpp index 56264e6ad..50a5b723f 100644 --- a/plugins/channelrx/demodwfm/wfmdemodgui.cpp +++ b/plugins/channelrx/demodwfm/wfmdemodgui.cpp @@ -169,6 +169,13 @@ void WFMDemodGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_wfmDemod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } dialog.move(p); dialog.exec(); @@ -185,20 +192,14 @@ void WFMDemodGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_wfmDemod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -307,22 +308,13 @@ void WFMDemodGUI::displaySettings() ui->squelchText->setText(QString("%1 dB").arg(m_settings.m_squelch)); ui->audioMute->setChecked(m_settings.m_audioMute); - displayStreamIndex(); + updateIndexLabel(); getRollupContents()->restoreState(m_rollupState); updateAbsoluteCenterFrequency(); blockApplySettings(false); } -void WFMDemodGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void WFMDemodGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channelrx/demodwfm/wfmdemodgui.h b/plugins/channelrx/demodwfm/wfmdemodgui.h index 772b4d6f0..e456cd5fc 100644 --- a/plugins/channelrx/demodwfm/wfmdemodgui.h +++ b/plugins/channelrx/demodwfm/wfmdemodgui.h @@ -37,6 +37,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -66,7 +68,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); bool handleMessage(const Message& message); void makeUIConnections(); void updateAbsoluteCenterFrequency(); diff --git a/plugins/channelrx/filesink/filesinkgui.cpp b/plugins/channelrx/filesink/filesinkgui.cpp index 42c0e0baa..04f51aa65 100644 --- a/plugins/channelrx/filesink/filesinkgui.cpp +++ b/plugins/channelrx/filesink/filesinkgui.cpp @@ -284,7 +284,7 @@ void FileSinkGUI::displaySettings() ui->squelchLevel->setStyleSheet("QDial { background:rgb(79,79,79); }"); } - displayStreamIndex(); + updateIndexLabel(); setPosFromFrequency(); getRollupContents()->restoreState(m_rollupState); @@ -292,15 +292,6 @@ void FileSinkGUI::displaySettings() blockApplySettings(false); } -void FileSinkGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void FileSinkGUI::displayRate() { double channelSampleRate = ((double) m_basebandSampleRate) / (1<m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_fileSink->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } dialog.move(p); dialog.exec(); @@ -389,20 +387,14 @@ void FileSinkGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_fileSink->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } diff --git a/plugins/channelrx/filesink/filesinkgui.h b/plugins/channelrx/filesink/filesinkgui.h index d16d37e0f..f38d0cbda 100644 --- a/plugins/channelrx/filesink/filesinkgui.h +++ b/plugins/channelrx/filesink/filesinkgui.h @@ -58,6 +58,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -91,7 +93,6 @@ private: void applySettings(bool force = false); void applyDecimation(); void displaySettings(); - void displayStreamIndex(); void displayRate(); void displayPos(); void setFrequencyFromPos(); diff --git a/plugins/channelrx/freqtracker/freqtrackergui.cpp b/plugins/channelrx/freqtracker/freqtrackergui.cpp index 378c1c426..7aa2512c6 100644 --- a/plugins/channelrx/freqtracker/freqtrackergui.cpp +++ b/plugins/channelrx/freqtracker/freqtrackergui.cpp @@ -270,6 +270,14 @@ void FreqTrackerGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_freqTracker->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } + dialog.move(p); dialog.exec(); @@ -285,20 +293,14 @@ void FreqTrackerGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_freqTracker->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -439,7 +441,7 @@ void FreqTrackerGUI::displaySettings() ui->squelchGate->setValue(m_settings.m_squelchGate); displaySpectrumBandwidth(m_settings.m_spanLog2); - displayStreamIndex(); + updateIndexLabel(); getRollupContents()->restoreState(m_rollupState); updateAbsoluteCenterFrequency(); @@ -463,15 +465,6 @@ void FreqTrackerGUI::displaySpectrumBandwidth(int spanLog2) ui->glSpectrum->setSampleRate(spectrumRate); } -void FreqTrackerGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void FreqTrackerGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channelrx/freqtracker/freqtrackergui.h b/plugins/channelrx/freqtracker/freqtrackergui.h index 702b61c25..5f590ac81 100644 --- a/plugins/channelrx/freqtracker/freqtrackergui.h +++ b/plugins/channelrx/freqtracker/freqtrackergui.h @@ -58,6 +58,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -89,7 +91,6 @@ private: void applySpectrumBandwidth(int spanLog2, bool force = false); void displaySettings(); void displaySpectrumBandwidth(int spanLog2); - void displayStreamIndex(); bool handleMessage(const Message& message); void makeUIConnections(); void updateAbsoluteCenterFrequency(); diff --git a/plugins/channelrx/localsink/localsinkgui.cpp b/plugins/channelrx/localsink/localsinkgui.cpp index 33dcea644..89d85d450 100644 --- a/plugins/channelrx/localsink/localsinkgui.cpp +++ b/plugins/channelrx/localsink/localsinkgui.cpp @@ -180,21 +180,12 @@ void LocalSinkGUI::displaySettings() ui->localDevicePlay->setChecked(m_settings.m_play); ui->decimationFactor->setCurrentIndex(m_settings.m_log2Decim); applyDecimation(); - displayStreamIndex(); + updateIndexLabel(); getRollupContents()->restoreState(m_rollupState); blockApplySettings(false); } -void LocalSinkGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void LocalSinkGUI::displayRateAndShift() { int shift = m_shiftFrequencyFactor * m_basebandSampleRate; @@ -274,6 +265,13 @@ void LocalSinkGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_localSink->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } dialog.move(p); dialog.exec(); @@ -290,20 +288,14 @@ void LocalSinkGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_localSink->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } diff --git a/plugins/channelrx/localsink/localsinkgui.h b/plugins/channelrx/localsink/localsinkgui.h index 55a7344cd..6d678d563 100644 --- a/plugins/channelrx/localsink/localsinkgui.h +++ b/plugins/channelrx/localsink/localsinkgui.h @@ -57,6 +57,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } private: Ui::LocalSinkGUI* ui; @@ -81,7 +83,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); void displayRateAndShift(); void updateLocalDevices(); int getLocalDeviceIndexInCombo(int localDeviceIndex); diff --git a/plugins/channelrx/noisefigure/noisefiguregui.cpp b/plugins/channelrx/noisefigure/noisefiguregui.cpp index 2728c2605..c2bc9a0db 100644 --- a/plugins/channelrx/noisefigure/noisefiguregui.cpp +++ b/plugins/channelrx/noisefigure/noisefiguregui.cpp @@ -551,6 +551,14 @@ void NoiseFigureGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_noiseFigure->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } + dialog.move(p); dialog.exec(); @@ -566,20 +574,14 @@ void NoiseFigureGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_noiseFigure->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -736,7 +738,7 @@ void NoiseFigureGUI::displaySettings() ui->fftSize->setCurrentIndex(log2(m_settings.m_fftSize) - 6); updateBW(); - displayStreamIndex(); + updateIndexLabel(); // Order and size columns QHeaderView *header = ui->results->horizontalHeader(); @@ -756,15 +758,6 @@ void NoiseFigureGUI::displaySettings() blockApplySettings(false); } -void NoiseFigureGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void NoiseFigureGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channelrx/noisefigure/noisefiguregui.h b/plugins/channelrx/noisefigure/noisefiguregui.h index 249697592..100350faa 100644 --- a/plugins/channelrx/noisefigure/noisefiguregui.h +++ b/plugins/channelrx/noisefigure/noisefiguregui.h @@ -64,6 +64,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -100,7 +102,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); bool handleMessage(const Message& message); void makeUIConnections(); void updateAbsoluteCenterFrequency(); diff --git a/plugins/channelrx/radioastronomy/radioastronomygui.cpp b/plugins/channelrx/radioastronomy/radioastronomygui.cpp index 7e74542e2..8a3996162 100644 --- a/plugins/channelrx/radioastronomy/radioastronomygui.cpp +++ b/plugins/channelrx/radioastronomy/radioastronomygui.cpp @@ -1963,6 +1963,14 @@ void RadioAstronomyGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_radioAstronomy->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } + dialog.move(p); dialog.exec(); @@ -1978,20 +1986,14 @@ void RadioAstronomyGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_radioAstronomy->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -2547,7 +2549,7 @@ void RadioAstronomyGUI::displaySettings() ui->sweep2Delay->setValue(m_settings.m_sweep2Delay); displayRunModeSettings(); - displayStreamIndex(); + updateIndexLabel(); // Order and size columns QHeaderView *header = ui->powerTable->horizontalHeader(); @@ -2567,15 +2569,6 @@ void RadioAstronomyGUI::displaySettings() getRollupContents()->arrangeRollups(); } -void RadioAstronomyGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void RadioAstronomyGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channelrx/radioastronomy/radioastronomygui.h b/plugins/channelrx/radioastronomy/radioastronomygui.h index 2ae11b487..b4a736ade 100644 --- a/plugins/channelrx/radioastronomy/radioastronomygui.h +++ b/plugins/channelrx/radioastronomy/radioastronomygui.h @@ -207,6 +207,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -328,7 +330,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); void displaySpectrumLineFrequency(); void displayRunModeSettings(); void updateAvailableFeatures(); diff --git a/plugins/channelrx/radioclock/radioclockgui.cpp b/plugins/channelrx/radioclock/radioclockgui.cpp index 7f92628a2..675463e1e 100644 --- a/plugins/channelrx/radioclock/radioclockgui.cpp +++ b/plugins/channelrx/radioclock/radioclockgui.cpp @@ -236,6 +236,14 @@ void RadioClockGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_radioClock->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } + dialog.move(p); dialog.exec(); @@ -251,20 +259,14 @@ void RadioClockGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_radioClock->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -381,22 +383,13 @@ void RadioClockGUI::displaySettings() ui->modulation->setCurrentIndex((int)m_settings.m_modulation); ui->timezone->setCurrentIndex((int)m_settings.m_timezone); - displayStreamIndex(); + updateIndexLabel(); getRollupContents()->restoreState(m_rollupState); updateAbsoluteCenterFrequency(); blockApplySettings(false); } -void RadioClockGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void RadioClockGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channelrx/radioclock/radioclockgui.h b/plugins/channelrx/radioclock/radioclockgui.h index 73b04177a..2d855e054 100644 --- a/plugins/channelrx/radioclock/radioclockgui.h +++ b/plugins/channelrx/radioclock/radioclockgui.h @@ -59,6 +59,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -88,7 +90,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); bool handleMessage(const Message& message); void makeUIConnections(); void updateAbsoluteCenterFrequency(); diff --git a/plugins/channelrx/remotesink/remotesinkgui.cpp b/plugins/channelrx/remotesink/remotesinkgui.cpp index 886d2248a..50f4cf9ad 100644 --- a/plugins/channelrx/remotesink/remotesinkgui.cpp +++ b/plugins/channelrx/remotesink/remotesinkgui.cpp @@ -175,21 +175,12 @@ void RemoteSinkGUI::displaySettings() ui->nominalNbBlocksText->setText(tr("%1/%2").arg(s).arg(s1)); ui->nbTxBytes->setCurrentIndex(log2(m_settings.m_nbTxBytes)); applyDecimation(); - displayStreamIndex(); + updateIndexLabel(); getRollupContents()->restoreState(m_rollupState); updateAbsoluteCenterFrequency(); blockApplySettings(false); } -void RemoteSinkGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void RemoteSinkGUI::displayRateAndShift() { int shift = m_shiftFrequencyFactor * m_basebandSampleRate; @@ -243,6 +234,13 @@ void RemoteSinkGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_remoteSink->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } dialog.move(p); dialog.exec(); @@ -259,20 +257,14 @@ void RemoteSinkGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_remoteSink->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } diff --git a/plugins/channelrx/remotesink/remotesinkgui.h b/plugins/channelrx/remotesink/remotesinkgui.h index 60354c528..441ae61ec 100644 --- a/plugins/channelrx/remotesink/remotesinkgui.h +++ b/plugins/channelrx/remotesink/remotesinkgui.h @@ -57,6 +57,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } private: Ui::RemoteSinkGUI* ui; @@ -81,7 +83,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); void displayRateAndShift(); bool handleMessage(const Message& message); void makeUIConnections(); diff --git a/plugins/channelrx/sigmffilesink/sigmffilesinkgui.cpp b/plugins/channelrx/sigmffilesink/sigmffilesinkgui.cpp index 52113da64..28606ff7a 100644 --- a/plugins/channelrx/sigmffilesink/sigmffilesinkgui.cpp +++ b/plugins/channelrx/sigmffilesink/sigmffilesinkgui.cpp @@ -276,7 +276,7 @@ void SigMFFileSinkGUI::displaySettings() ui->squelchedRecording->blockSignals(false); } - displayStreamIndex(); + updateIndexLabel(); setPosFromFrequency(); getRollupContents()->restoreState(m_rollupState); @@ -284,15 +284,6 @@ void SigMFFileSinkGUI::displaySettings() blockApplySettings(false); } -void SigMFFileSinkGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void SigMFFileSinkGUI::displayRate() { double channelSampleRate = ((double) m_basebandSampleRate) / (1<m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_sigMFFileSink->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } dialog.move(p); dialog.exec(); @@ -381,20 +379,14 @@ void SigMFFileSinkGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_sigMFFileSink->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } diff --git a/plugins/channelrx/sigmffilesink/sigmffilesinkgui.h b/plugins/channelrx/sigmffilesink/sigmffilesinkgui.h index e97e4d006..eb18bc049 100644 --- a/plugins/channelrx/sigmffilesink/sigmffilesinkgui.h +++ b/plugins/channelrx/sigmffilesink/sigmffilesinkgui.h @@ -58,6 +58,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -91,7 +93,6 @@ private: void applySettings(bool force = false); void applyDecimation(); void displaySettings(); - void displayStreamIndex(); void displayRate(); void displayPos(); void setFrequencyFromPos(); diff --git a/plugins/channelrx/udpsink/udpsinkgui.cpp b/plugins/channelrx/udpsink/udpsinkgui.cpp index 939cb5a5f..855c7751d 100644 --- a/plugins/channelrx/udpsink/udpsinkgui.cpp +++ b/plugins/channelrx/udpsink/udpsinkgui.cpp @@ -271,7 +271,7 @@ void UDPSinkGUI::displaySettings() ui->applyBtn->setEnabled(false); ui->applyBtn->setStyleSheet("QPushButton { background:rgb(79,79,79); }"); - displayStreamIndex(); + updateIndexLabel(); getRollupContents()->restoreState(m_rollupState); updateAbsoluteCenterFrequency(); @@ -280,15 +280,6 @@ void UDPSinkGUI::displaySettings() ui->glSpectrum->setSampleRate(m_settings.m_outputSampleRate); } -void UDPSinkGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void UDPSinkGUI::setSampleFormatIndex(const UDPSinkSettings::SampleFormat& sampleFormat) { switch(sampleFormat) @@ -621,6 +612,13 @@ void UDPSinkGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_udpSink->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } dialog.move(p); dialog.exec(); @@ -637,21 +635,15 @@ void UDPSinkGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettingsImmediate(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_udpSink->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); - applySettings(); + applySettingsImmediate(); } resetContextMenuType(); diff --git a/plugins/channelrx/udpsink/udpsinkgui.h b/plugins/channelrx/udpsink/udpsinkgui.h index fe476b533..d08e5dd4a 100644 --- a/plugins/channelrx/udpsink/udpsinkgui.h +++ b/plugins/channelrx/udpsink/udpsinkgui.h @@ -58,6 +58,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -92,7 +94,6 @@ private: void applySettings(bool force = false); void applySettingsImmediate(bool force = false); void displaySettings(); - void displayStreamIndex(); void setSampleFormat(int index); void setSampleFormatIndex(const UDPSinkSettings::SampleFormat& sampleFormat); bool handleMessage(const Message& message); diff --git a/plugins/channeltx/filesource/filesourcegui.cpp b/plugins/channeltx/filesource/filesourcegui.cpp index 63c2a3a3e..f0e0bdda7 100644 --- a/plugins/channeltx/filesource/filesourcegui.cpp +++ b/plugins/channeltx/filesource/filesourcegui.cpp @@ -309,7 +309,7 @@ void FileSourceGUI::displaySettings() setWindowTitle(m_channelMarker.getTitle()); setTitle(m_channelMarker.getTitle()); - displayStreamIndex(); + updateIndexLabel(); blockApplySettings(true); ui->fileNameText->setText(m_settings.m_fileName); @@ -333,15 +333,6 @@ void FileSourceGUI::displayRateAndShift() m_channelMarker.setBandwidth(channelSampleRate); } -void FileSourceGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void FileSourceGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); @@ -384,6 +375,13 @@ void FileSourceGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_fileSource->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } dialog.move(p); dialog.exec(); @@ -399,20 +397,14 @@ void FileSourceGUI::onMenuDialogCalled(const QPoint &p) setWindowTitle(m_settings.m_title); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_fileSource->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } diff --git a/plugins/channeltx/filesource/filesourcegui.h b/plugins/channeltx/filesource/filesourcegui.h index 8eec2f10f..92c86ec7f 100644 --- a/plugins/channeltx/filesource/filesourcegui.h +++ b/plugins/channeltx/filesource/filesourcegui.h @@ -54,6 +54,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -93,7 +95,6 @@ private: void updateWithStreamTime(); void displaySettings(); void displayRateAndShift(); - void displayStreamIndex(); bool handleMessage(const Message& message); void makeUIConnections(); void updateAbsoluteCenterFrequency(); diff --git a/plugins/channeltx/localsource/localsourcegui.cpp b/plugins/channeltx/localsource/localsourcegui.cpp index 316894394..1a1e346c1 100644 --- a/plugins/channeltx/localsource/localsourcegui.cpp +++ b/plugins/channeltx/localsource/localsourcegui.cpp @@ -164,7 +164,7 @@ void LocalSourceGUI::displaySettings() setTitleColor(m_settings.m_rgbColor); setWindowTitle(m_channelMarker.getTitle()); setTitle(m_channelMarker.getTitle()); - displayStreamIndex(); + updateIndexLabel(); blockApplySettings(true); ui->interpolationFactor->setCurrentIndex(m_settings.m_log2Interp); @@ -186,15 +186,6 @@ void LocalSourceGUI::displayRateAndShift() m_channelMarker.setBandwidth(channelSampleRate); } -void LocalSourceGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void LocalSourceGUI::updateLocalDevices() { std::vector localDevicesIndexes; @@ -249,6 +240,13 @@ void LocalSourceGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_localSource->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } dialog.move(p); dialog.exec(); @@ -265,20 +263,14 @@ void LocalSourceGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_localSource->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } diff --git a/plugins/channeltx/localsource/localsourcegui.h b/plugins/channeltx/localsource/localsourcegui.h index 52f358eed..c7a58498e 100644 --- a/plugins/channeltx/localsource/localsourcegui.h +++ b/plugins/channeltx/localsource/localsourcegui.h @@ -57,6 +57,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } private: Ui::LocalSourceGUI* ui; @@ -82,7 +84,6 @@ private: void applySettings(bool force = false); void displaySettings(); void displayRateAndShift(); - void displayStreamIndex(); void updateLocalDevices(); bool handleMessage(const Message& message); void makeUIConnections(); diff --git a/plugins/channeltx/mod802.15.4/ieee_802_15_4_modgui.cpp b/plugins/channeltx/mod802.15.4/ieee_802_15_4_modgui.cpp index e9dfc2485..c5cbe8e36 100644 --- a/plugins/channeltx/mod802.15.4/ieee_802_15_4_modgui.cpp +++ b/plugins/channeltx/mod802.15.4/ieee_802_15_4_modgui.cpp @@ -334,6 +334,14 @@ void IEEE_802_15_4_ModGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_IEEE_802_15_4_Mod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } + dialog.move(p); dialog.exec(); @@ -349,20 +357,14 @@ void IEEE_802_15_4_ModGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_IEEE_802_15_4_Mod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -509,7 +511,7 @@ void IEEE_802_15_4_ModGUI::displaySettings() setTitleColor(m_settings.m_rgbColor); setWindowTitle(m_channelMarker.getTitle()); setTitle(m_channelMarker.getTitle()); - displayStreamIndex(); + updateIndexLabel(); blockApplySettings(true); @@ -603,15 +605,6 @@ QString IEEE_802_15_4_ModGUI::getDisplayValueWithMultiplier(int value) } } -void IEEE_802_15_4_ModGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void IEEE_802_15_4_ModGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channeltx/mod802.15.4/ieee_802_15_4_modgui.h b/plugins/channeltx/mod802.15.4/ieee_802_15_4_modgui.h index b8f7ac261..48ccf3d8c 100644 --- a/plugins/channeltx/mod802.15.4/ieee_802_15_4_modgui.h +++ b/plugins/channeltx/mod802.15.4/ieee_802_15_4_modgui.h @@ -63,6 +63,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -93,7 +95,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); void displayRFBandwidth(int bandwidth); void displayChipRate(const IEEE_802_15_4_ModSettings& settings); QString getDisplayValueWithMultiplier(int value); diff --git a/plugins/channeltx/modais/aismodgui.cpp b/plugins/channeltx/modais/aismodgui.cpp index cb4a2db98..2348d50c1 100644 --- a/plugins/channeltx/modais/aismodgui.cpp +++ b/plugins/channeltx/modais/aismodgui.cpp @@ -357,6 +357,14 @@ void AISModGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_aisMod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } + dialog.move(p); dialog.exec(); @@ -372,20 +380,14 @@ void AISModGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_aisMod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -534,7 +536,7 @@ void AISModGUI::displaySettings() setTitleColor(m_settings.m_rgbColor); setWindowTitle(m_channelMarker.getTitle()); setTitle(m_channelMarker.getTitle()); - displayStreamIndex(); + updateIndexLabel(); blockApplySettings(true); @@ -573,15 +575,6 @@ void AISModGUI::displaySettings() blockApplySettings(false); } -void AISModGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void AISModGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channeltx/modais/aismodgui.h b/plugins/channeltx/modais/aismodgui.h index c327f5cbb..7deb50c85 100644 --- a/plugins/channeltx/modais/aismodgui.h +++ b/plugins/channeltx/modais/aismodgui.h @@ -58,6 +58,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -87,7 +89,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); bool handleMessage(const Message& message); void makeUIConnections(); void updateAbsoluteCenterFrequency(); diff --git a/plugins/channeltx/modam/ammodgui.cpp b/plugins/channeltx/modam/ammodgui.cpp index 1c0b4003b..ba71b516c 100644 --- a/plugins/channeltx/modam/ammodgui.cpp +++ b/plugins/channeltx/modam/ammodgui.cpp @@ -297,6 +297,14 @@ void AMModGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_amMod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } + dialog.move(p); dialog.exec(); @@ -312,20 +320,14 @@ void AMModGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_amMod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -471,22 +473,13 @@ void AMModGUI::displaySettings() ui->feedbackVolume->setValue(roundf(m_settings.m_feedbackVolumeFactor * 100.0)); ui->feedbackVolumeText->setText(QString("%1").arg(m_settings.m_feedbackVolumeFactor, 0, 'f', 2)); - displayStreamIndex(); + updateIndexLabel(); getRollupContents()->restoreState(m_rollupState); updateAbsoluteCenterFrequency(); blockApplySettings(false); } -void AMModGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void AMModGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channeltx/modam/ammodgui.h b/plugins/channeltx/modam/ammodgui.h index 7e4c9595f..07985e85c 100644 --- a/plugins/channeltx/modam/ammodgui.h +++ b/plugins/channeltx/modam/ammodgui.h @@ -57,6 +57,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -91,7 +93,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); void updateWithStreamData(); void updateWithStreamTime(); bool handleMessage(const Message& message); diff --git a/plugins/channeltx/modatv/atvmodgui.cpp b/plugins/channeltx/modatv/atvmodgui.cpp index e9046d924..c3dc7d76e 100644 --- a/plugins/channeltx/modatv/atvmodgui.cpp +++ b/plugins/channeltx/modatv/atvmodgui.cpp @@ -700,6 +700,13 @@ void ATVModGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_atvMod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } dialog.move(p); dialog.exec(); @@ -716,20 +723,14 @@ void ATVModGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_atvMod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -766,7 +767,7 @@ void ATVModGUI::displaySettings() setTitleColor(m_settings.m_rgbColor); setWindowTitle(m_channelMarker.getTitle()); setTitle(m_channelMarker.getTitle()); - displayStreamIndex(); + updateIndexLabel(); blockApplySettings(true); @@ -817,15 +818,6 @@ void ATVModGUI::displaySettings() blockApplySettings(false); } -void ATVModGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void ATVModGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channeltx/modatv/atvmodgui.h b/plugins/channeltx/modatv/atvmodgui.h index a146ff4b4..cfbf04961 100644 --- a/plugins/channeltx/modatv/atvmodgui.h +++ b/plugins/channeltx/modatv/atvmodgui.h @@ -56,6 +56,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -91,7 +93,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); void updateWithStreamData(); void updateWithStreamTime(); void setRFFiltersSlidersRange(int sampleRate); diff --git a/plugins/channeltx/modchirpchat/chirpchatmodgui.cpp b/plugins/channeltx/modchirpchat/chirpchatmodgui.cpp index 289c4ba21..b8af4b4ec 100644 --- a/plugins/channeltx/modchirpchat/chirpchatmodgui.cpp +++ b/plugins/channeltx/modchirpchat/chirpchatmodgui.cpp @@ -377,6 +377,14 @@ void ChirpChatModGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_chirpChatMod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } + dialog.move(p); dialog.exec(); @@ -392,20 +400,14 @@ void ChirpChatModGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_chirpChatMod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -497,7 +499,7 @@ void ChirpChatModGUI::displaySettings() setWindowTitle(m_channelMarker.getTitle()); setTitle(m_channelMarker.getTitle()); - displayStreamIndex(); + updateIndexLabel(); displayCurrentPayloadMessage(); displayBinaryMessage(); @@ -539,15 +541,6 @@ void ChirpChatModGUI::displaySettings() blockApplySettings(false); } -void ChirpChatModGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void ChirpChatModGUI::displayCurrentPayloadMessage() { ui->messageText->blockSignals(true); diff --git a/plugins/channeltx/modchirpchat/chirpchatmodgui.h b/plugins/channeltx/modchirpchat/chirpchatmodgui.h index bfb017afb..98d3affb7 100644 --- a/plugins/channeltx/modchirpchat/chirpchatmodgui.h +++ b/plugins/channeltx/modchirpchat/chirpchatmodgui.h @@ -55,6 +55,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -82,7 +84,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); void displayCurrentPayloadMessage(); void displayBinaryMessage(); void setBandwidths(); diff --git a/plugins/channeltx/moddatv/datvmodgui.cpp b/plugins/channeltx/moddatv/datvmodgui.cpp index 6443d7779..370c2945d 100644 --- a/plugins/channeltx/moddatv/datvmodgui.cpp +++ b/plugins/channeltx/moddatv/datvmodgui.cpp @@ -503,6 +503,13 @@ void DATVModGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_datvMod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } dialog.move(p); dialog.exec(); @@ -519,20 +526,14 @@ void DATVModGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_datvMod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -569,7 +570,7 @@ void DATVModGUI::displaySettings() setTitleColor(m_settings.m_rgbColor); setWindowTitle(m_channelMarker.getTitle()); setTitle(m_channelMarker.getTitle()); - displayStreamIndex(); + updateIndexLabel(); blockApplySettings(true); @@ -603,15 +604,6 @@ void DATVModGUI::displaySettings() blockApplySettings(false); } -void DATVModGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void DATVModGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channeltx/moddatv/datvmodgui.h b/plugins/channeltx/moddatv/datvmodgui.h index 4982fa555..561f44f44 100644 --- a/plugins/channeltx/moddatv/datvmodgui.h +++ b/plugins/channeltx/moddatv/datvmodgui.h @@ -57,6 +57,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -92,7 +94,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); void updateWithStreamData(); void updateWithStreamTime(); void setChannelMarkerBandwidth(); diff --git a/plugins/channeltx/modfreedv/freedvmodgui.cpp b/plugins/channeltx/modfreedv/freedvmodgui.cpp index 789cd8a59..406f65e2e 100644 --- a/plugins/channeltx/modfreedv/freedvmodgui.cpp +++ b/plugins/channeltx/modfreedv/freedvmodgui.cpp @@ -309,6 +309,13 @@ void FreeDVModGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_freeDVMod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } dialog.move(p); dialog.exec(); @@ -325,20 +332,14 @@ void FreeDVModGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_freeDVMod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -475,7 +476,7 @@ void FreeDVModGUI::displaySettings() setTitleColor(m_settings.m_rgbColor); setWindowTitle(m_channelMarker.getTitle()); setTitle(m_channelMarker.getTitle()); - displayStreamIndex(); + updateIndexLabel(); blockApplySettings(true); @@ -521,15 +522,6 @@ void FreeDVModGUI::displaySettings() blockApplySettings(false); } -void FreeDVModGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void FreeDVModGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channeltx/modfreedv/freedvmodgui.h b/plugins/channeltx/modfreedv/freedvmodgui.h index 0275e17ef..6bd48fc5d 100644 --- a/plugins/channeltx/modfreedv/freedvmodgui.h +++ b/plugins/channeltx/modfreedv/freedvmodgui.h @@ -58,6 +58,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -95,7 +97,6 @@ private: void applyBandwidths(int spanLog2, bool force = false); void displayBandwidths(int spanLog2); void displaySettings(); - void displayStreamIndex(); void updateWithStreamData(); void updateWithStreamTime(); void channelMarkerUpdate(); diff --git a/plugins/channeltx/modnfm/nfmmodgui.cpp b/plugins/channeltx/modnfm/nfmmodgui.cpp index 899a7878c..e1023b923 100644 --- a/plugins/channeltx/modnfm/nfmmodgui.cpp +++ b/plugins/channeltx/modnfm/nfmmodgui.cpp @@ -369,6 +369,14 @@ void NFMModGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_nfmMod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } + dialog.move(p); dialog.exec(); @@ -384,20 +392,14 @@ void NFMModGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_nfmMod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -522,7 +524,7 @@ void NFMModGUI::displaySettings() setTitleColor(m_settings.m_rgbColor); setWindowTitle(m_channelMarker.getTitle()); setTitle(m_channelMarker.getTitle()); - displayStreamIndex(); + updateIndexLabel(); blockApplySettings(true); @@ -577,15 +579,6 @@ void NFMModGUI::displaySettings() blockApplySettings(false); } -void NFMModGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void NFMModGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channeltx/modnfm/nfmmodgui.h b/plugins/channeltx/modnfm/nfmmodgui.h index e4dbd25a0..030ab68ae 100644 --- a/plugins/channeltx/modnfm/nfmmodgui.h +++ b/plugins/channeltx/modnfm/nfmmodgui.h @@ -57,6 +57,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -93,7 +95,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); void updateWithStreamData(); void updateWithStreamTime(); bool handleMessage(const Message& message); diff --git a/plugins/channeltx/modpacket/packetmodgui.cpp b/plugins/channeltx/modpacket/packetmodgui.cpp index bd98f95d9..a1bd5ac8e 100644 --- a/plugins/channeltx/modpacket/packetmodgui.cpp +++ b/plugins/channeltx/modpacket/packetmodgui.cpp @@ -394,6 +394,14 @@ void PacketModGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_packetMod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } + dialog.move(p); dialog.exec(); @@ -409,20 +417,14 @@ void PacketModGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_packetMod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -549,7 +551,7 @@ void PacketModGUI::displaySettings() setTitleColor(m_settings.m_rgbColor); setWindowTitle(m_channelMarker.getTitle()); setTitle(m_channelMarker.getTitle()); - displayStreamIndex(); + updateIndexLabel(); blockApplySettings(true); @@ -593,15 +595,6 @@ void PacketModGUI::displaySettings() blockApplySettings(false); } -void PacketModGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void PacketModGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channeltx/modpacket/packetmodgui.h b/plugins/channeltx/modpacket/packetmodgui.h index 644cbdea6..1ff5837f7 100644 --- a/plugins/channeltx/modpacket/packetmodgui.h +++ b/plugins/channeltx/modpacket/packetmodgui.h @@ -57,6 +57,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -85,7 +87,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); bool handleMessage(const Message& message); void makeUIConnections(); void updateAbsoluteCenterFrequency(); diff --git a/plugins/channeltx/modssb/ssbmodgui.cpp b/plugins/channeltx/modssb/ssbmodgui.cpp index cb7c99b91..b55f10b46 100644 --- a/plugins/channeltx/modssb/ssbmodgui.cpp +++ b/plugins/channeltx/modssb/ssbmodgui.cpp @@ -373,6 +373,13 @@ void SSBModGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_ssbMod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } dialog.move(p); dialog.exec(); @@ -389,20 +396,14 @@ void SSBModGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_ssbMod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -663,7 +664,7 @@ void SSBModGUI::displaySettings() setTitleColor(m_settings.m_rgbColor); setWindowTitle(m_channelMarker.getTitle()); setTitle(m_channelMarker.getTitle()); - displayStreamIndex(); + updateIndexLabel(); blockApplySettings(true); @@ -735,15 +736,6 @@ void SSBModGUI::displaySettings() blockApplySettings(false); } -void SSBModGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void SSBModGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channeltx/modssb/ssbmodgui.h b/plugins/channeltx/modssb/ssbmodgui.h index 5a132e8e6..dd793e1bc 100644 --- a/plugins/channeltx/modssb/ssbmodgui.h +++ b/plugins/channeltx/modssb/ssbmodgui.h @@ -58,6 +58,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -98,7 +100,6 @@ private: void applySettings(bool force = false); void applyBandwidths(int spanLog2, bool force = false); void displaySettings(); - void displayStreamIndex(); void updateWithStreamData(); void updateWithStreamTime(); void channelMarkerUpdate(); diff --git a/plugins/channeltx/modwfm/wfmmodgui.cpp b/plugins/channeltx/modwfm/wfmmodgui.cpp index 473922fc5..1da374cfd 100644 --- a/plugins/channeltx/modwfm/wfmmodgui.cpp +++ b/plugins/channeltx/modwfm/wfmmodgui.cpp @@ -303,6 +303,13 @@ void WFMModGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_wfmMod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } dialog.move(p); dialog.exec(); @@ -319,20 +326,14 @@ void WFMModGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_wfmMod->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } @@ -454,7 +455,7 @@ void WFMModGUI::displaySettings() setTitleColor(m_settings.m_rgbColor); setWindowTitle(m_channelMarker.getTitle()); setTitle(m_channelMarker.getTitle()); - displayStreamIndex(); + updateIndexLabel(); blockApplySettings(true); @@ -496,15 +497,6 @@ void WFMModGUI::displaySettings() blockApplySettings(false); } -void WFMModGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void WFMModGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channeltx/modwfm/wfmmodgui.h b/plugins/channeltx/modwfm/wfmmodgui.h index 26ef490c7..19e72eae9 100644 --- a/plugins/channeltx/modwfm/wfmmodgui.h +++ b/plugins/channeltx/modwfm/wfmmodgui.h @@ -55,6 +55,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -89,7 +91,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); void updateWithStreamData(); void updateWithStreamTime(); bool handleMessage(const Message& message); diff --git a/plugins/channeltx/remotesource/remotesourcegui.cpp b/plugins/channeltx/remotesource/remotesourcegui.cpp index c1d3fea70..7bf6f5198 100644 --- a/plugins/channeltx/remotesource/remotesourcegui.cpp +++ b/plugins/channeltx/remotesource/remotesourcegui.cpp @@ -242,7 +242,7 @@ void RemoteSourceGUI::displaySettings() setTitleColor(m_settings.m_rgbColor); setWindowTitle(m_channelMarker.getTitle()); setTitle(m_channelMarker.getTitle()); - displayStreamIndex(); + updateIndexLabel(); blockApplySettings(true); ui->dataAddress->setText(m_settings.m_dataAddress); @@ -271,15 +271,6 @@ void RemoteSourceGUI::displayPosition() ui->filterChainText->setText(s); } -void RemoteSourceGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void RemoteSourceGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); @@ -322,6 +313,13 @@ void RemoteSourceGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_remoteSrc->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } dialog.move(p); dialog.exec(); @@ -338,20 +336,14 @@ void RemoteSourceGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_remoteSrc->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } diff --git a/plugins/channeltx/remotesource/remotesourcegui.h b/plugins/channeltx/remotesource/remotesourcegui.h index 6f8cd729e..0035875b1 100644 --- a/plugins/channeltx/remotesource/remotesourcegui.h +++ b/plugins/channeltx/remotesource/remotesourcegui.h @@ -56,6 +56,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -94,7 +96,6 @@ private: void displaySettings(); void displayRateAndShift(); void displayPosition(); - void displayStreamIndex(); bool handleMessage(const Message& message); void makeUIConnections(); void updateAbsoluteCenterFrequency(); diff --git a/plugins/channeltx/udpsource/udpsourcegui.cpp b/plugins/channeltx/udpsource/udpsourcegui.cpp index 5ac765630..da0f41275 100644 --- a/plugins/channeltx/udpsource/udpsourcegui.cpp +++ b/plugins/channeltx/udpsource/udpsourcegui.cpp @@ -209,7 +209,7 @@ void UDPSourceGUI::displaySettings() setTitleColor(m_settings.m_rgbColor); setWindowTitle(m_channelMarker.getTitle()); setTitle(m_channelMarker.getTitle()); - displayStreamIndex(); + updateIndexLabel(); blockApplySettings(true); @@ -256,15 +256,6 @@ void UDPSourceGUI::displaySettings() blockApplySettings(false); } -void UDPSourceGUI::displayStreamIndex() -{ - if (m_deviceUISet->m_deviceMIMOEngine) { - setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); - } else { - setStreamIndicator("S"); // single channel indicator - } -} - void UDPSourceGUI::channelMarkerChangedByCursor() { ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency()); @@ -503,6 +494,13 @@ void UDPSourceGUI::onMenuDialogCalled(const QPoint &p) dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.setDefaultTitle(m_displayedName); + + if (m_deviceUISet->m_deviceMIMOEngine) + { + dialog.setNumberOfStreams(m_udpSource->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + } dialog.move(p); dialog.exec(); @@ -518,20 +516,14 @@ void UDPSourceGUI::onMenuDialogCalled(const QPoint &p) setTitle(m_channelMarker.getTitle()); setTitleColor(m_settings.m_rgbColor); - applySettings(); - } - else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) - { - DeviceStreamSelectionDialog dialog(this); - dialog.setNumberOfStreams(m_udpSource->getNumberOfDeviceStreams()); - dialog.setStreamIndex(m_settings.m_streamIndex); - dialog.move(p); - dialog.exec(); + if (m_deviceUISet->m_deviceMIMOEngine) + { + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + updateIndexLabel(); + } - m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); - m_channelMarker.clearStreamIndexes(); - m_channelMarker.addStreamIndex(m_settings.m_streamIndex); - displayStreamIndex(); applySettings(); } diff --git a/plugins/channeltx/udpsource/udpsourcegui.h b/plugins/channeltx/udpsource/udpsourcegui.h index aa8afa1d8..68afee72d 100644 --- a/plugins/channeltx/udpsource/udpsourcegui.h +++ b/plugins/channeltx/udpsource/udpsourcegui.h @@ -58,6 +58,8 @@ public: virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } virtual bool getHidden() const { return m_settings.m_hidden; } virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } + virtual int getStreamIndex() const { return m_settings.m_streamIndex; } + virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } public slots: void channelMarkerChangedByCursor(); @@ -88,7 +90,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayStreamIndex(); void setSampleFormat(int index); void setSampleFormatIndex(const UDPSourceSettings::SampleFormat& sampleFormat); bool handleMessage(const Message& message); diff --git a/sdrgui/channel/channelgui.cpp b/sdrgui/channel/channelgui.cpp index 50a83d37e..f04055bcc 100644 --- a/sdrgui/channel/channelgui.cpp +++ b/sdrgui/channel/channelgui.cpp @@ -233,11 +233,6 @@ void ChannelGUI::mouseMoveEvent(QMouseEvent* event) } } -void ChannelGUI::setStreamIndicator(const QString& indicator) -{ - (void) indicator; // TODO -} - void ChannelGUI::activateSettingsDialog() { QPoint p = QCursor::pos(); @@ -363,7 +358,12 @@ void ChannelGUI::setStatusText(const QString& text) void ChannelGUI::updateIndexLabel() { - m_indexLabel->setText(tr("%1%2:%3").arg(getDeviceTypeTag()).arg(m_deviceSetIndex).arg(m_channelIndex)); + if ((m_deviceType == DeviceMIMO) && (getStreamIndex() >= 0)) { + m_indexLabel->setText(tr("%1%2:%3.%4").arg(getDeviceTypeTag()).arg(m_deviceSetIndex).arg(m_channelIndex).arg(getStreamIndex())); + } + else { + m_indexLabel->setText(tr("%1%2:%3").arg(getDeviceTypeTag()).arg(m_deviceSetIndex).arg(m_channelIndex)); + } } bool ChannelGUI::isOnMovingPad() diff --git a/sdrgui/channel/channelgui.h b/sdrgui/channel/channelgui.h index 6a78c8734..049bd21d3 100644 --- a/sdrgui/channel/channelgui.h +++ b/sdrgui/channel/channelgui.h @@ -47,8 +47,7 @@ public: enum ContextMenuType { ContextMenuNone, - ContextMenuChannelSettings, - ContextMenuStreamSettings + ContextMenuChannelSettings }; ChannelGUI(QWidget *parent = nullptr); @@ -68,6 +67,8 @@ public: virtual void zetHidden(bool hidden) = 0; virtual bool getHidden() const = 0; virtual ChannelMarker& getChannelMarker() = 0; + virtual int getStreamIndex() const = 0; + virtual void setStreamIndex(int streamIndex) = 0; virtual MessageQueue* getInputMessageQueue() = 0; @@ -90,7 +91,7 @@ protected: void mousePressEvent(QMouseEvent* event); void mouseMoveEvent(QMouseEvent* event); void resetContextMenuType() { m_contextMenuType = ContextMenuNone; } - void setStreamIndicator(const QString& indicator); // TODO + void updateIndexLabel(); DeviceType m_deviceType; int m_deviceSetIndex; @@ -104,7 +105,6 @@ protected slots: void shrinkWindow(); private: - void updateIndexLabel(); bool isOnMovingPad(); QString getDeviceTypeTag(); static QColor getTitleColor(const QColor& backgroundColor); diff --git a/sdrgui/channel/readme.md b/sdrgui/channel/readme.md index 339b2c71c..6ed955ce1 100644 --- a/sdrgui/channel/readme.md +++ b/sdrgui/channel/readme.md @@ -35,11 +35,15 @@ Opens a dialog to update the common channel settings Changes the channel window title -

A.2.2: Channel color

+

A.2.2: Reset title to default

+ +Resets the title to the channel type name. + +

A.2.3: Channel color

Changes the color of the window title bar and spectrum overlay. To change the color click on the color square to open a color chooser dialog. The hex rgb value is displayed next to the color square. -

A.2.3: Frequency scale display type

+

A.2.4: Frequency scale display type

When the mouse is over the channel window or over the central line in the spectrum a channel parameter is displayed on the frequency scale. This parameter can be: @@ -48,7 +52,11 @@ When the mouse is over the channel window or over the central line in the spectr - AdSnd: UDP address and send port - AdRcv: UDP address and receive port -

A.2.4: Toggle reverse API feature

+

A.2.5: Device stream assignment

+ +If the device is a MIMO device and the channel is single stream based i.e. not MIMO as well this sets the MIMO stream the channel will take its I/Q input from. It is disabled in other cases. + +

A.2.6: Toggle reverse API feature

Use this checkbox to toggle on/off the reverse API feature. With reverse API engaged the changes in the channel settings are forwarded to an API endpoint given by address (5.1.5), port (5.1.6), device index (5.1.7) and channel index (5.1.8) in the same format as the SDRangel REST API channel settings endpoint. With the values of the screenshot the API URL is: `http://127.0.0.1:8888/sdrangel/deviceset/0/channel/0/settings` The JSON payload follows the same format as the SDRangel REST API channel settings. Using the same example this would be: @@ -81,27 +89,27 @@ Note that the PATCH method is used. The full set of parameters is sent only when More details on this feature can be found on the corresponding Wiki page. -

A.2.5: API address

+

A.2.7: API address

This is the IP address of the API endpoint -

A.2.6: API port

+

A.2.8: API port

This is the IP port of the API endpoint -

A.2.7: Device index

+

A.2.9: Device index

This is the targeted device index -

A.2.8: Channel index

+

A.2.10: Channel index

This is the targeted channel index -

A.2.9: Cancel changes and exit dialog

+

A.2.11: Cancel changes and exit dialog

Do not make any changes and exit dialog -

A.2.10: Validate and exit dialog

+

A.2.12: Validate and exit dialog

Validates the data (saves it in the channel marker object) and exits the dialog diff --git a/sdrgui/gui/basicchannelsettingsdialog.cpp b/sdrgui/gui/basicchannelsettingsdialog.cpp index f80345289..f252b5094 100644 --- a/sdrgui/gui/basicchannelsettingsdialog.cpp +++ b/sdrgui/gui/basicchannelsettingsdialog.cpp @@ -63,6 +63,18 @@ void BasicChannelSettingsDialog::setReverseAPIChannelIndex(uint16_t channelIndex ui->reverseAPIChannelIndex->setText(tr("%1").arg(m_reverseAPIChannelIndex)); } +void BasicChannelSettingsDialog::setNumberOfStreams(int numberOfStreams) +{ + ui->streamIndex->setMaximum(numberOfStreams - 1); + ui->streamIndex->setEnabled(true); +} + +void BasicChannelSettingsDialog::setStreamIndex(int index) +{ + m_streamIndex = index; + ui->streamIndex->setValue(index); +} + void BasicChannelSettingsDialog::paintColor() { QPixmap pm(24, 24); @@ -132,6 +144,16 @@ void BasicChannelSettingsDialog::on_reverseAPIChannelIndex_editingFinished() } } +void BasicChannelSettingsDialog::on_streamIndex_valueChanged(int value) +{ + m_streamIndex = value; +} + +void BasicChannelSettingsDialog::on_titleReset_clicked() +{ + ui->title->setText(m_defaultTitle); +} + void BasicChannelSettingsDialog::accept() { m_channelMarker->blockSignals(true); diff --git a/sdrgui/gui/basicchannelsettingsdialog.h b/sdrgui/gui/basicchannelsettingsdialog.h index ffe8c7d36..c7274ad1f 100644 --- a/sdrgui/gui/basicchannelsettingsdialog.h +++ b/sdrgui/gui/basicchannelsettingsdialog.h @@ -24,19 +24,25 @@ public: uint16_t getReverseAPIPort() const { return m_reverseAPIPort; } uint16_t getReverseAPIDeviceIndex() const { return m_reverseAPIDeviceIndex; } uint16_t getReverseAPIChannelIndex() const { return m_reverseAPIChannelIndex; } + int getSelectedStreamIndex() const { return m_streamIndex; } void setUseReverseAPI(bool useReverseAPI); void setReverseAPIAddress(const QString& address); void setReverseAPIPort(uint16_t port); void setReverseAPIDeviceIndex(uint16_t deviceIndex); void setReverseAPIChannelIndex(uint16_t channelIndex); + void setNumberOfStreams(int numberOfStreams); + void setStreamIndex(int index); + void setDefaultTitle(const QString& title) { m_defaultTitle = title; } private slots: + void on_titleReset_clicked(); void on_colorBtn_clicked(); void on_reverseAPI_toggled(bool checked); void on_reverseAPIAddress_editingFinished(); void on_reverseAPIPort_editingFinished(); void on_reverseAPIDeviceIndex_editingFinished(); void on_reverseAPIChannelIndex_editingFinished(); + void on_streamIndex_valueChanged(int value); void accept(); private: @@ -48,6 +54,8 @@ private: uint16_t m_reverseAPIPort; uint16_t m_reverseAPIDeviceIndex; uint16_t m_reverseAPIChannelIndex; + QString m_defaultTitle; + int m_streamIndex; bool m_hasChanged; void paintColor(); diff --git a/sdrgui/gui/basicchannelsettingsdialog.ui b/sdrgui/gui/basicchannelsettingsdialog.ui index 51d5e6116..90f4418f1 100644 --- a/sdrgui/gui/basicchannelsettingsdialog.ui +++ b/sdrgui/gui/basicchannelsettingsdialog.ui @@ -7,7 +7,7 @@ 0 0 400 - 135 + 158 @@ -42,6 +42,26 @@ + + + + + 24 + 24 + + + + Reset title to channel type name + + + + + + + :/recycle.png:/recycle.png + + + @@ -97,6 +117,26 @@ + + + + Stream + + + + + + + false + + + Stream index for MIMO device and single stream channel + + + 0 + + + @@ -272,7 +312,9 @@ - + + + buttonBox diff --git a/sdrgui/mainwindow.cpp b/sdrgui/mainwindow.cpp index 2f663149b..a6c504b53 100644 --- a/sdrgui/mainwindow.cpp +++ b/sdrgui/mainwindow.cpp @@ -872,8 +872,12 @@ void MainWindow::sampleMIMOCreate( deviceGUI->setToolTip(samplingDevice->displayedName); deviceGUI->setTitle(samplingDevice->displayedName.split(" ")[0]); deviceGUI->setCurrentDeviceIndex(selectedDeviceIndex); - QStringList channelNames; + QStringList channelNames, tmpChannelNames; m_pluginManager->listMIMOChannels(channelNames); + m_pluginManager->listRxChannels(tmpChannelNames); + channelNames.append(tmpChannelNames); + m_pluginManager->listTxChannels(tmpChannelNames); + channelNames.append(tmpChannelNames); deviceGUI->setChannelNames(channelNames); MainSpectrumGUI *spectrumGUI = deviceUISet->m_mainSpectrumGUI; spectrumGUI->setDeviceType(MainSpectrumGUI::DeviceMIMO);