From d6154eb0eb1c949280261643619d6f85e6b05c18 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 21 Jun 2015 13:03:12 +0200 Subject: [PATCH] Fixed Channel Analyzer LSB display and save its SSB checkbox state --- Readme.md | 2 ++ plugins/channel/chanalyzer/chanalyzer.cpp | 6 +++++- plugins/channel/chanalyzer/chanalyzergui.cpp | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index b4af90cec..7ef20c1d7 100644 --- a/Readme.md +++ b/Readme.md @@ -107,6 +107,8 @@ Done since the fork - As a consequence of the above added more interesting values for the available sampling rates of the BladeRF plugin - Variable span for the SSB demod down to 1.5 kHz - Filter out CTCSS tones for audio and full CTCSS support in NFMDemod + - Enhancement of the NFM squelch + - Added a channel analyzer plugin focusing on measurement (DSA/DSO functionnality). Basic functions. ===== To Do diff --git a/plugins/channel/chanalyzer/chanalyzer.cpp b/plugins/channel/chanalyzer/chanalyzer.cpp index 2ed51a60d..83be68389 100644 --- a/plugins/channel/chanalyzer/chanalyzer.cpp +++ b/plugins/channel/chanalyzer/chanalyzer.cpp @@ -115,7 +115,11 @@ void ChannelAnalyzer::feed(SampleVector::const_iterator begin, SampleVector::con if (!(m_undersampleCount++ & decim_mask)) { sum /= decim; - m_sampleBuffer.push_back(Sample(sum.real() * 32768.0, sum.imag() * 32768.0)); + if (m_ssb & !m_usb) { // invert spectrum for LSB + m_sampleBuffer.push_back(Sample(sum.imag() * 32768.0, sum.real() * 32768.0)); + } else { + m_sampleBuffer.push_back(Sample(sum.real() * 32768.0, sum.imag() * 32768.0)); + } sum = 0; } diff --git a/plugins/channel/chanalyzer/chanalyzergui.cpp b/plugins/channel/chanalyzer/chanalyzergui.cpp index 49fb9fa34..d5357bf39 100644 --- a/plugins/channel/chanalyzer/chanalyzergui.cpp +++ b/plugins/channel/chanalyzer/chanalyzergui.cpp @@ -51,6 +51,7 @@ QByteArray ChannelAnalyzerGUI::serialize() const s.writeU32(4, m_channelMarker->getColor().rgb()); s.writeS32(5, ui->lowCut->value()); s.writeS32(6, ui->spanLog2->value()); + s.writeBool(7, ui->ssb->isChecked()); return s.final(); } @@ -67,6 +68,7 @@ bool ChannelAnalyzerGUI::deserialize(const QByteArray& data) QByteArray bytetmp; quint32 u32tmp; qint32 tmp; + bool tmpBool; d.readS32(1, &tmp, 0); m_channelMarker->setCenterFrequency(tmp); d.readS32(2, &tmp, 30); @@ -80,6 +82,8 @@ bool ChannelAnalyzerGUI::deserialize(const QByteArray& data) d.readS32(6, &tmp, 20); ui->spanLog2->setValue(tmp); setNewRate(tmp); + d.readBool(7, &tmpBool, false); + ui->ssb->setChecked(tmpBool); applySettings(); return true; } else {