From 4894c8d3ba43c9d7908e70c27006c8b82e172207 Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 21 Feb 2017 05:58:11 +0100 Subject: [PATCH] Channel Analyzer NG: restored previous revision --- .../channelrx/chanalyzerng/chanalyzerng.cpp | 21 ++++++------ .../chanalyzerng/chanalyzernggui.cpp | 34 ++++++++----------- 2 files changed, 25 insertions(+), 30 deletions(-) diff --git a/plugins/channelrx/chanalyzerng/chanalyzerng.cpp b/plugins/channelrx/chanalyzerng/chanalyzerng.cpp index 4f5aa0e8c..aa5a4cc76 100644 --- a/plugins/channelrx/chanalyzerng/chanalyzerng.cpp +++ b/plugins/channelrx/chanalyzerng/chanalyzerng.cpp @@ -132,7 +132,9 @@ void ChannelAnalyzerNG::stop() bool ChannelAnalyzerNG::handleMessage(const Message& cmd) { - float bandwidth, lowCutoff; + float band, lowCutoff; + + qDebug() << "ChannelAnalyzerNG::handleMessage"; if (DownChannelizer::MsgChannelizerNotification::match(cmd)) { @@ -140,8 +142,6 @@ bool ChannelAnalyzerNG::handleMessage(const Message& cmd) m_sampleRate = notif.getSampleRate(); m_nco.setFreq(-notif.getFrequencyOffset(), m_sampleRate); - SSBFilter->create_filter(m_LowCutoff / m_sampleRate, m_Bandwidth / m_sampleRate); - DSBFilter->create_dsb_filter(m_Bandwidth / m_sampleRate); qDebug() << "ChannelAnalyzerNG::handleMessage: MsgChannelizerNotification: m_sampleRate: " << m_sampleRate << " frequencyOffset: " << notif.getFrequencyOffset(); @@ -152,12 +152,12 @@ bool ChannelAnalyzerNG::handleMessage(const Message& cmd) { MsgConfigureChannelAnalyzer& cfg = (MsgConfigureChannelAnalyzer&) cmd; - bandwidth = cfg.getBandwidth(); + band = cfg.getBandwidth(); lowCutoff = cfg.getLoCutoff(); - if (bandwidth < 0) + if (band < 0) { - bandwidth = -bandwidth; + band = -band; lowCutoff = -lowCutoff; m_usb = false; } @@ -166,15 +166,15 @@ bool ChannelAnalyzerNG::handleMessage(const Message& cmd) m_usb = true; } - if (bandwidth < 100.0f) + if (band < 100.0f) { - bandwidth = 100.0f; + band = 100.0f; lowCutoff = 0; } m_settingsMutex.lock(); - m_Bandwidth = bandwidth; + m_Bandwidth = band; m_LowCutoff = lowCutoff; SSBFilter->create_filter(m_LowCutoff / m_sampleRate, m_Bandwidth / m_sampleRate); @@ -185,8 +185,7 @@ bool ChannelAnalyzerNG::handleMessage(const Message& cmd) m_settingsMutex.unlock(); - qDebug() << "ChannelAnalyzerNG::handleMessage: MsgConfigureChannelAnalyzer:" - << " m_Bandwidth: " << m_Bandwidth + qDebug() << " - MsgConfigureChannelAnalyzer: m_Bandwidth: " << m_Bandwidth << " m_LowCutoff: " << m_LowCutoff << " m_spanLog2: " << m_spanLog2 << " m_ssb: " << m_ssb; diff --git a/plugins/channelrx/chanalyzerng/chanalyzernggui.cpp b/plugins/channelrx/chanalyzerng/chanalyzernggui.cpp index eb6fee514..bd357c545 100644 --- a/plugins/channelrx/chanalyzerng/chanalyzernggui.cpp +++ b/plugins/channelrx/chanalyzerng/chanalyzernggui.cpp @@ -111,16 +111,16 @@ bool ChannelAnalyzerNGGUI::deserialize(const QByteArray& data) { QByteArray bytetmp; quint32 u32tmp; - qint32 tmp, spanLog2, bw, lowCut; + qint32 tmp, bw, lowCut; bool tmpBool; - blockApplySettings(true); + blockApplySettings(true); m_channelMarker.blockSignals(true); d.readS32(1, &tmp, 0); m_channelMarker.setCenterFrequency(tmp); - d.readS32(2, &bw, 30); - ui->BW->setValue(bw); + d.readS32(2, &bw, 30); + ui->BW->setValue(bw); d.readBlob(3, &bytetmp); ui->spectrumGUI->deserialize(bytetmp); @@ -129,28 +129,23 @@ bool ChannelAnalyzerNGGUI::deserialize(const QByteArray& data) m_channelMarker.setColor(u32tmp); } - d.readS32(5, &lowCut, 3); - ui->lowCut->setValue(lowCut); - d.readS32(6, &spanLog2, 3); - ui->spanLog2->setValue(spanLog2); - d.readBool(7, &tmpBool, false); - ui->ssb->setChecked(tmpBool); + d.readS32(5, &lowCut, 3); + ui->lowCut->setValue(lowCut); + d.readS32(6, &tmp, 20); + ui->spanLog2->setValue(tmp); + setNewRate(tmp); + d.readBool(7, &tmpBool, false); + ui->ssb->setChecked(tmpBool); d.readBlob(8, &bytetmp); ui->scopeGUI->deserialize(bytetmp); blockApplySettings(false); m_channelMarker.blockSignals(false); -// qDebug() << "ChannelAnalyzerNGGUI::deserialize:" -// << " spanLog2: " << spanLog2 -// << " bw: " << bw -// << " lowCut: " << lowCut; + ui->BW->setValue(bw); + ui->lowCut->setValue(lowCut); // does applySettings(); - setNewRate(spanLog2); - ui->BW->setValue(bw); - ui->lowCut->setValue(lowCut); - - return true; + return true; } else { @@ -263,6 +258,7 @@ void ChannelAnalyzerNGGUI::on_spanLog2_valueChanged(int value) if (setNewRate(value)) { applySettings(); } + } void ChannelAnalyzerNGGUI::on_ssb_toggled(bool checked)