diff --git a/plugins/channelmimo/interferometer/interferometergui.cpp b/plugins/channelmimo/interferometer/interferometergui.cpp index 0be02a717..3bf6e61f1 100644 --- a/plugins/channelmimo/interferometer/interferometergui.cpp +++ b/plugins/channelmimo/interferometer/interferometergui.cpp @@ -125,12 +125,20 @@ InterferometerGUI::InterferometerGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUI m_interferometer->setMessageQueueToGUI(getInputMessageQueue()); m_sampleRate = m_interferometer->getDeviceSampleRate(); - ui->glSpectrum->setDisplayWaterfall(true); - ui->glSpectrum->setDisplayMaxHold(true); + ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); + ui->scopeGUI->setBuddies(m_scopeVis->getInputMessageQueue(), m_scopeVis, ui->glScope); + ui->glSpectrum->setCenterFrequency(0); ui->glSpectrum->setSampleRate(m_sampleRate); - ui->glSpectrum->setSsbSpectrum(false); ui->glSpectrum->setLsbDisplay(false); + + SpectrumSettings spectrumSettings = m_spectrumVis->getSettings(); + spectrumSettings.m_displayWaterfall = true; + spectrumSettings.m_displayMaxHold = true; + spectrumSettings.m_ssb = false; + SpectrumVis::MsgConfigureSpectrumVis *msg = SpectrumVis::MsgConfigureSpectrumVis::create(spectrumSettings, false); + m_spectrumVis->getInputMessageQueue()->push(msg); + ui->glScope->setTraceModulo(Interferometer::m_fftSize); ui->glScope->connectTimer(MainCore::instance()->getMasterTimer()); @@ -151,9 +159,6 @@ InterferometerGUI::InterferometerGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUI m_deviceUISet->addChannelMarker(&m_channelMarker); - ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); - ui->scopeGUI->setBuddies(m_scopeVis->getInputMessageQueue(), m_scopeVis, ui->glScope); - m_scopeVis->setTraceChunkSize(Interferometer::m_fftSize); // Set scope trace length unit to FFT size ui->scopeGUI->traceLengthChange(); diff --git a/plugins/channelrx/chanalyzer/chanalyzergui.cpp b/plugins/channelrx/chanalyzer/chanalyzergui.cpp index a379b40a2..deca7e316 100644 --- a/plugins/channelrx/chanalyzer/chanalyzergui.cpp +++ b/plugins/channelrx/chanalyzer/chanalyzergui.cpp @@ -192,18 +192,22 @@ void ChannelAnalyzerGUI::setSpectrumDisplay() { int sinkSampleRate = getSinkSampleRate(); qDebug("ChannelAnalyzerGUI::setSpectrumDisplay: m_sinkSampleRate: %d", sinkSampleRate); + + SpectrumSettings spectrumSettings = m_spectrumVis->getSettings(); + spectrumSettings.m_ssb = m_settings.m_ssb; + SpectrumVis::MsgConfigureSpectrumVis *msg = SpectrumVis::MsgConfigureSpectrumVis::create(spectrumSettings, false); + m_spectrumVis->getInputMessageQueue()->push(msg); + if (m_settings.m_ssb) { ui->glSpectrum->setCenterFrequency(sinkSampleRate/4); ui->glSpectrum->setSampleRate(sinkSampleRate/2); - ui->glSpectrum->setSsbSpectrum(true); ui->glSpectrum->setLsbDisplay(ui->BW->value() < 0); } else { ui->glSpectrum->setCenterFrequency(0); ui->glSpectrum->setSampleRate(sinkSampleRate); - ui->glSpectrum->setSsbSpectrum(false); ui->glSpectrum->setLsbDisplay(false); } } @@ -550,9 +554,6 @@ ChannelAnalyzerGUI::ChannelAnalyzerGUI(PluginAPI* pluginAPI, DeviceUISet *device ui->glSpectrum->setCenterFrequency(m_basebandSampleRate/2); ui->glSpectrum->setSampleRate(m_basebandSampleRate); - ui->glSpectrum->setDisplayWaterfall(true); - ui->glSpectrum->setDisplayMaxHold(true); - ui->glSpectrum->setSsbSpectrum(false); ui->glSpectrum->setLsbDisplay(false); ui->glScope->connectTimer(MainCore::instance()->getMasterTimer()); @@ -573,6 +574,13 @@ ChannelAnalyzerGUI::ChannelAnalyzerGUI(PluginAPI* pluginAPI, DeviceUISet *device ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); ui->scopeGUI->setBuddies(m_scopeVis->getInputMessageQueue(), m_scopeVis, ui->glScope); + SpectrumSettings spectrumSettings = m_spectrumVis->getSettings(); + spectrumSettings.m_displayWaterfall = true; + spectrumSettings.m_displayMaxHold = false; + spectrumSettings.m_ssb = false; + SpectrumVis::MsgConfigureSpectrumVis *msg = SpectrumVis::MsgConfigureSpectrumVis::create(spectrumSettings, false); + m_spectrumVis->getInputMessageQueue()->push(msg); + m_settings.setChannelMarker(&m_channelMarker); m_settings.setRollupState(&m_rollupState); m_settings.setSpectrumGUI(ui->spectrumGUI); diff --git a/plugins/channelrx/demodbfm/bfmdemodgui.cpp b/plugins/channelrx/demodbfm/bfmdemodgui.cpp index 09adfd1ee..60681009d 100644 --- a/plugins/channelrx/demodbfm/bfmdemodgui.cpp +++ b/plugins/channelrx/demodbfm/bfmdemodgui.cpp @@ -406,11 +406,18 @@ BFMDemodGUI::BFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban m_bfmDemod->setMessageQueueToGUI(getInputMessageQueue()); m_bfmDemod->setBasebandMessageQueueToGUI(getInputMessageQueue()); - ui->glSpectrum->setCenterFrequency(m_rate / 4); + ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); + + ui->glSpectrum->setCenterFrequency(m_rate / 4); ui->glSpectrum->setSampleRate(m_rate / 2); - ui->glSpectrum->setDisplayWaterfall(false); - ui->glSpectrum->setDisplayMaxHold(false); - ui->glSpectrum->setSsbSpectrum(true); + + SpectrumSettings spectrumSettings = m_spectrumVis->getSettings(); + spectrumSettings.m_displayWaterfall = false; + spectrumSettings.m_displayMaxHold = false; + spectrumSettings.m_ssb = true; + SpectrumVis::MsgConfigureSpectrumVis *msg = SpectrumVis::MsgConfigureSpectrumVis::create(spectrumSettings, false); + m_spectrumVis->getInputMessageQueue()->push(msg); + connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); m_channelMarker.blockSignals(true); @@ -432,8 +439,6 @@ BFMDemodGUI::BFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor())); connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor())); - ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); - ui->g00AltFrequenciesBox->setEnabled(false); ui->g14MappedFrequencies->setEnabled(false); ui->g14AltFrequencies->setEnabled(false); diff --git a/plugins/channelrx/demodchirpchat/chirpchatdemodgui.cpp b/plugins/channelrx/demodchirpchat/chirpchatdemodgui.cpp index 5251ac42e..257aa57a7 100644 --- a/plugins/channelrx/demodchirpchat/chirpchatdemodgui.cpp +++ b/plugins/channelrx/demodchirpchat/chirpchatdemodgui.cpp @@ -410,8 +410,11 @@ ChirpChatDemodGUI::ChirpChatDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUI connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); - ui->glSpectrum->setDisplayWaterfall(true); - ui->glSpectrum->setDisplayMaxHold(true); + SpectrumSettings spectrumSettings = m_spectrumVis->getSettings(); + spectrumSettings.m_displayWaterfall = true; + spectrumSettings.m_displayMaxHold = true; + SpectrumVis::MsgConfigureSpectrumVis *msg = SpectrumVis::MsgConfigureSpectrumVis::create(spectrumSettings, false); + m_spectrumVis->getInputMessageQueue()->push(msg); ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03))); ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); diff --git a/plugins/channelrx/demodfreedv/freedvdemodgui.cpp b/plugins/channelrx/demodfreedv/freedvdemodgui.cpp index c181a12ec..fc1800a0e 100644 --- a/plugins/channelrx/demodfreedv/freedvdemodgui.cpp +++ b/plugins/channelrx/demodfreedv/freedvdemodgui.cpp @@ -287,11 +287,17 @@ FreeDVDemodGUI::FreeDVDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, B resetToDefaults(); + ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); + ui->glSpectrum->setCenterFrequency(m_spectrumRate/2); ui->glSpectrum->setSampleRate(m_spectrumRate); - ui->glSpectrum->setDisplayWaterfall(true); - ui->glSpectrum->setDisplayMaxHold(true); - ui->glSpectrum->setSsbSpectrum(true); + + SpectrumSettings spectrumSettings = m_spectrumVis->getSettings(); + spectrumSettings.m_displayWaterfall = true; + spectrumSettings.m_displayMaxHold = false; + spectrumSettings.m_ssb = true; + SpectrumVis::MsgConfigureSpectrumVis *msg = SpectrumVis::MsgConfigureSpectrumVis::create(spectrumSettings, false); + m_spectrumVis->getInputMessageQueue()->push(msg); connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); @@ -319,8 +325,6 @@ FreeDVDemodGUI::FreeDVDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, B connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); m_freeDVDemod->setLevelMeter(ui->volumeInMeter); - ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); - m_iconDSBUSB.addPixmap(QPixmap("://dsb.png"), QIcon::Normal, QIcon::On); m_iconDSBUSB.addPixmap(QPixmap("://usb.png"), QIcon::Normal, QIcon::Off); m_iconDSBLSB.addPixmap(QPixmap("://dsb.png"), QIcon::Normal, QIcon::On); @@ -375,7 +379,6 @@ void FreeDVDemodGUI::displayBandwidths(int spanLog2) ui->spanText->setText(tr("%1k").arg(spanStr)); ui->glSpectrum->setCenterFrequency(m_spectrumRate/2); ui->glSpectrum->setSampleRate(m_spectrumRate); - ui->glSpectrum->setSsbSpectrum(true); ui->glSpectrum->setLsbDisplay(false); } diff --git a/plugins/channelrx/demodft8/ft8demodgui.cpp b/plugins/channelrx/demodft8/ft8demodgui.cpp index 227e5af43..5ff13dc21 100644 --- a/plugins/channelrx/demodft8/ft8demodgui.cpp +++ b/plugins/channelrx/demodft8/ft8demodgui.cpp @@ -613,11 +613,16 @@ FT8DemodGUI::FT8DemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999); ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue); + ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); + ui->glSpectrum->setCenterFrequency(m_spectrumRate/2); ui->glSpectrum->setSampleRate(m_spectrumRate); - ui->glSpectrum->setDisplayWaterfall(true); - ui->glSpectrum->setDisplayMaxHold(true); - ui->glSpectrum->setSsbSpectrum(true); + + SpectrumSettings spectrumSettings = m_spectrumVis->getSettings(); + spectrumSettings.m_displayWaterfall = true; + spectrumSettings.m_ssb = true; + SpectrumVis::MsgConfigureSpectrumVis *msg = SpectrumVis::MsgConfigureSpectrumVis::create(spectrumSettings, false); + m_spectrumVis->getInputMessageQueue()->push(msg); connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); @@ -640,7 +645,6 @@ FT8DemodGUI::FT8DemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor())); connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); - ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); m_ft8Demod->setLevelMeter(ui->volumeMeter); ui->BW->setMaximum(60); @@ -726,7 +730,6 @@ void FT8DemodGUI::applyBandwidths(unsigned int spanLog2, bool force) ui->spanText->setText(tr("%1k").arg(spanStr)); ui->glSpectrum->setCenterFrequency(m_spectrumRate/2); ui->glSpectrum->setSampleRate(m_spectrumRate); - ui->glSpectrum->setSsbSpectrum(true); ui->glSpectrum->setLsbDisplay(bw < 0); ui->lowCutText->setText(tr("%1k").arg(lwStr)); diff --git a/plugins/channelrx/demodils/ilsdemodgui.cpp b/plugins/channelrx/demodils/ilsdemodgui.cpp index 5ffd4b062..be8862f35 100644 --- a/plugins/channelrx/demodils/ilsdemodgui.cpp +++ b/plugins/channelrx/demodils/ilsdemodgui.cpp @@ -131,7 +131,7 @@ bool ILSDemodGUI::deserialize(const QByteArray& data) applySettings(true); return true; } - else + else { resetToDefaults(); return false; @@ -1070,18 +1070,12 @@ ILSDemodGUI::ILSDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban m_scopeVis->configure(500, 1, 0, 0, true); // not working! //m_scopeVis->setFreeRun(false); // FIXME: add method rather than call m_scopeVis->configure() - // FIXME: Don't do this - SpectrumSettings will be inconsistant.. + ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); + ui->glSpectrum->setCenterFrequency(0); ui->glSpectrum->setSampleRate(ILSDemodSettings::ILSDEMOD_SPECTRUM_SAMPLE_RATE); - ui->glSpectrum->setDisplayWaterfall(true); - ui->glSpectrum->setDisplayMaxHold(false); - ui->glSpectrum->setSsbSpectrum(false); - ui->glSpectrum->setDisplayHistogram(false); - ui->glSpectrum->setDisplayCurrent(true); - ui->glSpectrum->setSpectrumStyle(SpectrumSettings::Gradient); ui->glSpectrum->setMeasurementParams(SpectrumSettings::MeasurementPeaks, 0, 1000, 90, 150, 1, 5, true, 1); ui->glSpectrum->setMeasurementsVisible(true); - ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); m_channelMarker.setColor(Qt::yellow); m_channelMarker.setBandwidth(m_settings.m_rfBandwidth); @@ -1133,6 +1127,12 @@ ILSDemodGUI::ILSDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban spectrumSettings.m_fftSize = 2048; spectrumSettings.m_averagingMode = SpectrumSettings::AvgModeMoving; spectrumSettings.m_averagingValue = 1; + spectrumSettings.m_displayWaterfall = true; + spectrumSettings.m_displayMaxHold = false; + spectrumSettings.m_ssb = false; + spectrumSettings.m_displayHistogram = false; + spectrumSettings.m_displayCurrent = true; + spectrumSettings.m_spectrumStyle = SpectrumSettings::Gradient; // FLAT TOP? SpectrumVis::MsgConfigureSpectrumVis *msg = SpectrumVis::MsgConfigureSpectrumVis::create(spectrumSettings, false); m_spectrumVis->getInputMessageQueue()->push(msg); diff --git a/plugins/channelrx/demodssb/ssbdemodgui.cpp b/plugins/channelrx/demodssb/ssbdemodgui.cpp index aa60da587..225757c32 100644 --- a/plugins/channelrx/demodssb/ssbdemodgui.cpp +++ b/plugins/channelrx/demodssb/ssbdemodgui.cpp @@ -359,11 +359,16 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999); ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue); + ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); + ui->glSpectrum->setCenterFrequency(m_spectrumRate/2); ui->glSpectrum->setSampleRate(m_spectrumRate); - ui->glSpectrum->setDisplayWaterfall(true); - ui->glSpectrum->setDisplayMaxHold(true); - ui->glSpectrum->setSsbSpectrum(true); + + SpectrumSettings spectrumSettings = m_spectrumVis->getSettings(); + spectrumSettings.m_displayWaterfall = true; + spectrumSettings.m_ssb = true; + SpectrumVis::MsgConfigureSpectrumVis *msg = SpectrumVis::MsgConfigureSpectrumVis::create(spectrumSettings, false); + m_spectrumVis->getInputMessageQueue()->push(msg); connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); @@ -386,7 +391,6 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor())); connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); - ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); m_iconDSBUSB.addPixmap(QPixmap("://dsb.png"), QIcon::Normal, QIcon::On); m_iconDSBUSB.addPixmap(QPixmap("://usb.png"), QIcon::Normal, QIcon::Off); @@ -480,6 +484,8 @@ void SSBDemodGUI::applyBandwidths(unsigned int spanLog2, bool force) QString bwStr = QString::number(bw/10.0, 'f', 1); QString lwStr = QString::number(lw/10.0, 'f', 1); + SpectrumSettings spectrumSettings = m_spectrumVis->getSettings(); + if (dsb) { ui->BWText->setText(tr("%1%2k").arg(QChar(0xB1, 0x00)).arg(bwStr)); @@ -491,7 +497,7 @@ void SSBDemodGUI::applyBandwidths(unsigned int spanLog2, bool force) ui->usbLabel->setText(""); ui->glSpectrum->setCenterFrequency(0); ui->glSpectrum->setSampleRate(2*m_spectrumRate); - ui->glSpectrum->setSsbSpectrum(false); + spectrumSettings.m_ssb = false; ui->glSpectrum->setLsbDisplay(false); } else @@ -505,10 +511,13 @@ void SSBDemodGUI::applyBandwidths(unsigned int spanLog2, bool force) ui->usbLabel->setText("USB"); ui->glSpectrum->setCenterFrequency(m_spectrumRate/2); ui->glSpectrum->setSampleRate(m_spectrumRate); - ui->glSpectrum->setSsbSpectrum(true); + spectrumSettings.m_ssb = true; ui->glSpectrum->setLsbDisplay(bw < 0); } + SpectrumVis::MsgConfigureSpectrumVis *msg = SpectrumVis::MsgConfigureSpectrumVis::create(spectrumSettings, false); + m_spectrumVis->getInputMessageQueue()->push(msg); + ui->lowCutText->setText(tr("%1k").arg(lwStr)); ui->BW->blockSignals(true); diff --git a/plugins/channelrx/udpsink/udpsinkgui.cpp b/plugins/channelrx/udpsink/udpsinkgui.cpp index c84969bbf..c8a07d1f0 100644 --- a/plugins/channelrx/udpsink/udpsinkgui.cpp +++ b/plugins/channelrx/udpsink/udpsinkgui.cpp @@ -183,10 +183,16 @@ UDPSinkGUI::UDPSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandS ui->deltaFrequency->setValueRange(false, 8, -99999999, 99999999); ui->squelchLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }"); - ui->glSpectrum->setCenterFrequency(0); + ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); + + ui->glSpectrum->setCenterFrequency(0); ui->glSpectrum->setSampleRate(ui->sampleRate->text().toInt()); - ui->glSpectrum->setDisplayWaterfall(true); - ui->glSpectrum->setDisplayMaxHold(true); + + SpectrumSettings spectrumSettings = m_spectrumVis->getSettings(); + spectrumSettings.m_displayWaterfall = true; + spectrumSettings.m_displayMaxHold = true; + SpectrumVis::MsgConfigureSpectrumVis *msg = SpectrumVis::MsgConfigureSpectrumVis::create(spectrumSettings, false); + m_spectrumVis->getInputMessageQueue()->push(msg); connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); @@ -210,8 +216,6 @@ UDPSinkGUI::UDPSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandS connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor())); connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages())); - ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); - displaySettings(); makeUIConnections(); applySettingsImmediate(true); 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 2cb737b4b..1ca0b0ef5 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 @@ -436,14 +436,20 @@ IEEE_802_15_4_ModGUI::IEEE_802_15_4_ModGUI(PluginAPI* pluginAPI, DeviceUISet *de m_spectrumVis = m_IEEE_802_15_4_Mod->getSpectrumVis(); m_spectrumVis->setGLSpectrum(ui->glSpectrum); + ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); + ui->glSpectrum->setCenterFrequency(0); ui->glSpectrum->setSampleRate(m_settings.m_spectrumRate); - ui->glSpectrum->setSsbSpectrum(false); - ui->glSpectrum->setDisplayCurrent(true); ui->glSpectrum->setLsbDisplay(false); - ui->glSpectrum->setDisplayWaterfall(false); - ui->glSpectrum->setDisplayMaxHold(false); - ui->glSpectrum->setDisplayHistogram(false); + + SpectrumSettings spectrumSettings = m_spectrumVis->getSettings(); + spectrumSettings.m_ssb = false; + spectrumSettings.m_displayCurrent = true; + spectrumSettings.m_displayWaterfall = false; + spectrumSettings.m_displayMaxHold = false; + spectrumSettings.m_displayHistogram = false; + SpectrumVis::MsgConfigureSpectrumVis *msg = SpectrumVis::MsgConfigureSpectrumVis::create(spectrumSettings, false); + m_spectrumVis->getInputMessageQueue()->push(msg); CRightClickEnabler *repeatRightClickEnabler = new CRightClickEnabler(ui->repeat); connect(repeatRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(repeatSelect(const QPoint &))); @@ -474,8 +480,6 @@ IEEE_802_15_4_ModGUI::IEEE_802_15_4_ModGUI(PluginAPI* pluginAPI, DeviceUISet *de m_settings.setChannelMarker(&m_channelMarker); m_settings.setRollupState(&m_rollupState); - ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); - displaySettings(); makeUIConnections(); applySettings(); diff --git a/plugins/channeltx/modais/aismodgui.cpp b/plugins/channeltx/modais/aismodgui.cpp index 30ceb9f31..072a689d7 100644 --- a/plugins/channeltx/modais/aismodgui.cpp +++ b/plugins/channeltx/modais/aismodgui.cpp @@ -458,15 +458,21 @@ AISModGUI::AISModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam m_spectrumVis = m_aisMod->getSpectrumVis(); m_spectrumVis->setGLSpectrum(ui->glSpectrum); + ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); + // Extra /2 here because SSB? ui->glSpectrum->setCenterFrequency(0); ui->glSpectrum->setSampleRate(AISModSettings::AISMOD_SAMPLE_RATE); - ui->glSpectrum->setSsbSpectrum(true); - ui->glSpectrum->setDisplayCurrent(true); ui->glSpectrum->setLsbDisplay(false); - ui->glSpectrum->setDisplayWaterfall(false); - ui->glSpectrum->setDisplayMaxHold(false); - ui->glSpectrum->setDisplayHistogram(false); + + SpectrumSettings spectrumSettings = m_spectrumVis->getSettings(); + spectrumSettings.m_ssb = true; + spectrumSettings.m_displayCurrent = true; + spectrumSettings.m_displayWaterfall =false; + spectrumSettings.m_displayMaxHold = false; + spectrumSettings.m_displayHistogram = false; + SpectrumVis::MsgConfigureSpectrumVis *msg = SpectrumVis::MsgConfigureSpectrumVis::create(spectrumSettings, false); + m_spectrumVis->getInputMessageQueue()->push(msg); CRightClickEnabler *repeatRightClickEnabler = new CRightClickEnabler(ui->repeat); connect(repeatRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(repeatSelect(const QPoint &))); @@ -497,8 +503,6 @@ AISModGUI::AISModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam m_settings.setChannelMarker(&m_channelMarker); m_settings.setRollupState(&m_rollupState); - ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); - ui->scopeContainer->setVisible(false); ui->spectrumContainer->setVisible(false); diff --git a/plugins/channeltx/modfreedv/freedvmodgui.cpp b/plugins/channeltx/modfreedv/freedvmodgui.cpp index c30bfb0ed..949d60e5e 100644 --- a/plugins/channeltx/modfreedv/freedvmodgui.cpp +++ b/plugins/channeltx/modfreedv/freedvmodgui.cpp @@ -382,11 +382,17 @@ FreeDVModGUI::FreeDVModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb resetToDefaults(); - ui->glSpectrum->setCenterFrequency(m_spectrumRate/2); + ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); + + ui->glSpectrum->setCenterFrequency(m_spectrumRate/2); ui->glSpectrum->setSampleRate(m_spectrumRate); - ui->glSpectrum->setDisplayWaterfall(true); - ui->glSpectrum->setDisplayMaxHold(true); - ui->glSpectrum->setSsbSpectrum(true); + + SpectrumSettings spectrumSettings = m_spectrumVis->getSettings(); + spectrumSettings.m_displayWaterfall = true; + spectrumSettings.m_displayMaxHold = true; + spectrumSettings.m_ssb = true; + SpectrumVis::MsgConfigureSpectrumVis *msg = SpectrumVis::MsgConfigureSpectrumVis::create(spectrumSettings, false); + m_spectrumVis->getInputMessageQueue()->push(msg); connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); @@ -405,7 +411,6 @@ FreeDVModGUI::FreeDVModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor())); ui->cwKeyerGUI->setCWKeyer(m_freeDVMod->getCWKeyer()); - ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); m_settings.setChannelMarker(&m_channelMarker); m_settings.setSpectrumGUI(ui->spectrumGUI); @@ -464,7 +469,6 @@ void FreeDVModGUI::displayBandwidths(int spanLog2) ui->spanText->setText(tr("%1k").arg(spanStr)); ui->glSpectrum->setCenterFrequency(m_spectrumRate/2); ui->glSpectrum->setSampleRate(m_spectrumRate); - ui->glSpectrum->setSsbSpectrum(true); ui->glSpectrum->setLsbDisplay(false); } diff --git a/plugins/channeltx/modpacket/packetmodgui.cpp b/plugins/channeltx/modpacket/packetmodgui.cpp index 5518c4806..392083f1e 100644 --- a/plugins/channeltx/modpacket/packetmodgui.cpp +++ b/plugins/channeltx/modpacket/packetmodgui.cpp @@ -467,18 +467,24 @@ PacketModGUI::PacketModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); + ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); + m_spectrumVis = m_packetMod->getSpectrumVis(); m_spectrumVis->setGLSpectrum(ui->glSpectrum); // Extra /2 here because SSB? ui->glSpectrum->setCenterFrequency(m_settings.m_spectrumRate/4); ui->glSpectrum->setSampleRate(m_settings.m_spectrumRate/2); - ui->glSpectrum->setSsbSpectrum(true); - ui->glSpectrum->setDisplayCurrent(true); ui->glSpectrum->setLsbDisplay(false); - ui->glSpectrum->setDisplayWaterfall(false); - ui->glSpectrum->setDisplayMaxHold(false); - ui->glSpectrum->setDisplayHistogram(false); + + SpectrumSettings spectrumSettings = m_spectrumVis->getSettings(); + spectrumSettings.m_ssb = true; + spectrumSettings.m_displayCurrent = true; + spectrumSettings.m_displayWaterfall = false; + spectrumSettings.m_displayMaxHold = false; + spectrumSettings.m_displayHistogram = false; + SpectrumVis::MsgConfigureSpectrumVis *msg = SpectrumVis::MsgConfigureSpectrumVis::create(spectrumSettings, false); + m_spectrumVis->getInputMessageQueue()->push(msg); CRightClickEnabler *repeatRightClickEnabler = new CRightClickEnabler(ui->repeat); connect(repeatRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(repeatSelect(const QPoint &))); @@ -515,8 +521,6 @@ PacketModGUI::PacketModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb m_settings.setChannelMarker(&m_channelMarker); m_settings.setRollupState(&m_rollupState); - ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); - ui->spectrumContainer->setVisible(false); displaySettings(); diff --git a/plugins/channeltx/modssb/ssbmodgui.cpp b/plugins/channeltx/modssb/ssbmodgui.cpp index 738fcc1dc..a52da46aa 100644 --- a/plugins/channeltx/modssb/ssbmodgui.cpp +++ b/plugins/channeltx/modssb/ssbmodgui.cpp @@ -447,11 +447,17 @@ SSBModGUI::SSBModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam resetToDefaults(); + ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); + ui->glSpectrum->setCenterFrequency(m_spectrumRate/2); ui->glSpectrum->setSampleRate(m_spectrumRate); - ui->glSpectrum->setDisplayWaterfall(true); - ui->glSpectrum->setDisplayMaxHold(true); - ui->glSpectrum->setSsbSpectrum(true); + + SpectrumSettings spectrumSettings = m_spectrumVis->getSettings(); + spectrumSettings.m_displayWaterfall = true; + spectrumSettings.m_displayMaxHold = false; + spectrumSettings.m_ssb = true; + SpectrumVis::MsgConfigureSpectrumVis *msg = SpectrumVis::MsgConfigureSpectrumVis::create(spectrumSettings, false); + m_spectrumVis->getInputMessageQueue()->push(msg); connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); @@ -482,8 +488,6 @@ SSBModGUI::SSBModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor())); ui->cwKeyerGUI->setCWKeyer(m_ssbMod->getCWKeyer()); - ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); - m_settings.setChannelMarker(&m_channelMarker); m_settings.setSpectrumGUI(ui->spectrumGUI); m_settings.setCWKeyerGUI(ui->cwKeyerGUI); @@ -580,6 +584,8 @@ void SSBModGUI::applyBandwidths(int spanLog2, bool force) QString bwStr = QString::number(bw/10.0, 'f', 1); QString lwStr = QString::number(lw/10.0, 'f', 1); + SpectrumSettings spectrumSettings = m_spectrumVis->getSettings(); + if (dsb) { ui->BWText->setText(tr("%1%2k").arg(QChar(0xB1, 0x00)).arg(bwStr)); @@ -591,7 +597,7 @@ void SSBModGUI::applyBandwidths(int spanLog2, bool force) ui->usbLabel->setText(""); ui->glSpectrum->setCenterFrequency(0); ui->glSpectrum->setSampleRate(2*m_spectrumRate); - ui->glSpectrum->setSsbSpectrum(false); + spectrumSettings.m_ssb = false; ui->glSpectrum->setLsbDisplay(false); } else @@ -605,10 +611,13 @@ void SSBModGUI::applyBandwidths(int spanLog2, bool force) ui->usbLabel->setText("USB"); ui->glSpectrum->setCenterFrequency(m_spectrumRate/2); ui->glSpectrum->setSampleRate(m_spectrumRate); - ui->glSpectrum->setSsbSpectrum(true); + spectrumSettings.m_ssb = true; ui->glSpectrum->setLsbDisplay(bw < 0); } + SpectrumVis::MsgConfigureSpectrumVis *msg = SpectrumVis::MsgConfigureSpectrumVis::create(spectrumSettings, false); + m_spectrumVis->getInputMessageQueue()->push(msg); + ui->lowCutText->setText(tr("%1k").arg(lwStr)); diff --git a/plugins/channeltx/udpsource/udpsourcegui.cpp b/plugins/channeltx/udpsource/udpsourcegui.cpp index 6cd94f137..8649b667a 100644 --- a/plugins/channeltx/udpsource/udpsourcegui.cpp +++ b/plugins/channeltx/udpsource/udpsourcegui.cpp @@ -141,10 +141,16 @@ UDPSourceGUI::UDPSourceGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); ui->deltaFrequency->setValueRange(false, 8, -99999999, 99999999); + ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); + ui->glSpectrum->setCenterFrequency(0); ui->glSpectrum->setSampleRate(ui->sampleRate->text().toInt()); - ui->glSpectrum->setDisplayWaterfall(true); - ui->glSpectrum->setDisplayMaxHold(true); + + SpectrumSettings spectrumSettings = m_spectrumVis->getSettings(); + spectrumSettings.m_displayWaterfall = true; + spectrumSettings.m_displayMaxHold = true; + SpectrumVis::MsgConfigureSpectrumVis *msg = SpectrumVis::MsgConfigureSpectrumVis::create(spectrumSettings, false); + m_spectrumVis->getInputMessageQueue()->push(msg); connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); @@ -161,8 +167,6 @@ UDPSourceGUI::UDPSourceGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor())); - ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); - connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages())); m_udpSource->setLevelMeter(ui->volumeMeter);