1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-12 11:26:11 -05:00

use MsgConfigureSpectrumVis in place of corresponding GLSpectrum set methods. Fixes #1624

This commit is contained in:
f4exb 2023-04-09 11:47:50 +02:00
parent 018fa27b02
commit e384c06739
15 changed files with 157 additions and 88 deletions

View File

@ -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();

View File

@ -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);

View File

@ -406,11 +406,18 @@ BFMDemodGUI::BFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
m_bfmDemod->setMessageQueueToGUI(getInputMessageQueue());
m_bfmDemod->setBasebandMessageQueueToGUI(getInputMessageQueue());
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);

View File

@ -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));

View File

@ -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);
}

View File

@ -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));

View File

@ -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);

View File

@ -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);

View File

@ -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->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);

View File

@ -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();

View File

@ -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);

View File

@ -382,11 +382,17 @@ FreeDVModGUI::FreeDVModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb
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 = 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);
}

View File

@ -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();

View File

@ -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));

View File

@ -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);