From f6bdf35589ed9c971c9dd501ade70bd652b11dec Mon Sep 17 00:00:00 2001 From: f4exb Date: Thu, 27 Jul 2017 21:14:50 +0200 Subject: [PATCH] SSB demod: display initial values --- plugins/channelrx/demodssb/ssbdemodgui.cpp | 25 +++++++++++++++------- plugins/channelrx/demodssb/ssbdemodgui.h | 1 + 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/plugins/channelrx/demodssb/ssbdemodgui.cpp b/plugins/channelrx/demodssb/ssbdemodgui.cpp index 8a82d1c69..ee0baf9bb 100644 --- a/plugins/channelrx/demodssb/ssbdemodgui.cpp +++ b/plugins/channelrx/demodssb/ssbdemodgui.cpp @@ -58,7 +58,7 @@ void SSBDemodGUI::resetToDefaults() blockApplySettings(true); ui->BW->setValue(30); - ui->volume->setValue(40); + ui->volume->setValue(30); ui->deltaFrequency->setValue(0); ui->spanLog2->setValue(3); ui->agc->setChecked(false); @@ -67,7 +67,6 @@ void SSBDemodGUI::resetToDefaults() ui->agcThresholdGate->setValue(4); blockApplySettings(false); - applySettings(); } QByteArray SSBDemodGUI::serialize() const @@ -97,6 +96,7 @@ bool SSBDemodGUI::deserialize(const QByteArray& data) if (!d.isValid()) { resetToDefaults(); + applySettings(); return false; } @@ -114,7 +114,7 @@ bool SSBDemodGUI::deserialize(const QByteArray& data) m_channelMarker.setCenterFrequency(tmp); d.readS32(2, &tmp, 30); ui->BW->setValue(tmp); - d.readS32(3, &tmp, 20); + d.readS32(3, &tmp, 30); ui->volume->setValue(tmp); d.readBlob(4, &bytetmp); ui->spectrumGUI->deserialize(bytetmp); @@ -135,15 +135,12 @@ bool SSBDemodGUI::deserialize(const QByteArray& data) ui->agc->setChecked(booltmp); d.readS32(12, &tmp, 7); ui->agcTimeLog2->setValue(tmp); - QString s = QString::number((1<agcTimeText->setText(s); d.readS32(13, &tmp, -40); ui->agcPowerThreshold->setValue(tmp); - displayAGCPowerThreshold(tmp); d.readS32(14, &tmp, 4); ui->agcThresholdGate->setValue(tmp); - s = QString::number(tmp, 'f', 0); - ui->agcThresholdGateText->setText(s); + + displaySettings(); blockApplySettings(false); m_channelMarker.blockSignals(false); @@ -154,6 +151,7 @@ bool SSBDemodGUI::deserialize(const QByteArray& data) else { resetToDefaults(); + applySettings(); return false; } } @@ -399,6 +397,8 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidg ui->spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, ui->glSpectrum); + resetToDefaults(); + displaySettings(); applySettings(); setNewRate(m_spanLog2); } @@ -524,6 +524,15 @@ void SSBDemodGUI::applySettings() } } +void SSBDemodGUI::displaySettings() +{ + QString s = QString::number((1<agcTimeLog2->value()), 'f', 0); + ui->agcTimeText->setText(s); + displayAGCPowerThreshold(ui->agcPowerThreshold->value()); + s = QString::number(ui->agcThresholdGate->value(), 'f', 0); + ui->agcThresholdGateText->setText(s); +} + void SSBDemodGUI::displayAGCPowerThreshold(int value) { if (value == -99) diff --git a/plugins/channelrx/demodssb/ssbdemodgui.h b/plugins/channelrx/demodssb/ssbdemodgui.h index 22c406216..b38538668 100644 --- a/plugins/channelrx/demodssb/ssbdemodgui.h +++ b/plugins/channelrx/demodssb/ssbdemodgui.h @@ -87,6 +87,7 @@ private: void blockApplySettings(bool block); void applySettings(); + void displaySettings(); void displayAGCPowerThreshold(int value);