From 966d957f895d428ab57ffbb3ce2e719ff9a68ede Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 16 Oct 2018 00:31:45 +0200 Subject: [PATCH] Scope: fixed channel rate affecting scope rate in memory mode --- app/main.cpp | 2 +- appbench/main.cpp | 2 +- appsrv/main.cpp | 2 +- debian/changelog | 6 +++++ .../channelrx/chanalyzer/chanalyzergui.cpp | 2 +- plugins/channelrx/demodatv/atvdemodgui.cpp | 2 +- plugins/channelrx/demodatv/atvdemodplugin.cpp | 2 +- sdrgui/dsp/scopevis.cpp | 22 +++++++++++++++++-- sdrgui/dsp/scopevis.h | 11 ++++++++-- 9 files changed, 41 insertions(+), 10 deletions(-) diff --git a/app/main.cpp b/app/main.cpp index c9938efd6..56057b262 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -35,7 +35,7 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo */ QCoreApplication::setOrganizationName("f4exb"); QCoreApplication::setApplicationName("SDRangel"); - QCoreApplication::setApplicationVersion("4.2.2"); + QCoreApplication::setApplicationVersion("4.2.3"); #if 1 qApp->setStyle(QStyleFactory::create("fusion")); diff --git a/appbench/main.cpp b/appbench/main.cpp index 6dba5b70d..d6c45498f 100644 --- a/appbench/main.cpp +++ b/appbench/main.cpp @@ -57,7 +57,7 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo QCoreApplication::setOrganizationName("f4exb"); QCoreApplication::setApplicationName("SDRangelBench"); - QCoreApplication::setApplicationVersion("4.2.2"); + QCoreApplication::setApplicationVersion("4.2.3"); int catchSignals[] = {SIGQUIT, SIGINT, SIGTERM, SIGHUP}; std::vector vsig(catchSignals, catchSignals + sizeof(catchSignals) / sizeof(int)); diff --git a/appsrv/main.cpp b/appsrv/main.cpp index 89643ee0d..79591e924 100644 --- a/appsrv/main.cpp +++ b/appsrv/main.cpp @@ -56,7 +56,7 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo QCoreApplication::setOrganizationName("f4exb"); QCoreApplication::setApplicationName("SDRangelSrv"); - QCoreApplication::setApplicationVersion("4.2.2"); + QCoreApplication::setApplicationVersion("4.2.3"); int catchSignals[] = {SIGQUIT, SIGINT, SIGTERM, SIGHUP}; std::vector vsig(catchSignals, catchSignals + sizeof(catchSignals) / sizeof(int)); diff --git a/debian/changelog b/debian/changelog index 69b1522f2..899edc393 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +sdrangel (4.2.3-1) unstable; urgency=medium + + * Scope: fixed channel rate affecting scope in memory mode. Issue #227 + + -- Edouard Griffiths, F4EXB Sun, 21 Oct 2018 21:14:18 +0200 + sdrangel (4.2.2-1) unstable; urgency=medium * Spectrum: option to get max over a number of FFTs. Implements issue #207 diff --git a/plugins/channelrx/chanalyzer/chanalyzergui.cpp b/plugins/channelrx/chanalyzer/chanalyzergui.cpp index 428b171cc..18e1c9b25 100644 --- a/plugins/channelrx/chanalyzer/chanalyzergui.cpp +++ b/plugins/channelrx/chanalyzer/chanalyzergui.cpp @@ -462,7 +462,7 @@ void ChannelAnalyzerGUI::setNewFinalRate() QString s = QString::number(m_rate/1000.0, 'f', 1); ui->spanText->setText(tr("%1 kS/s").arg(s)); - m_scopeVis->setSampleRate(m_rate); + m_scopeVis->setLiveRate(m_rate); } void ChannelAnalyzerGUI::setFiltersUIBoundaries() diff --git a/plugins/channelrx/demodatv/atvdemodgui.cpp b/plugins/channelrx/demodatv/atvdemodgui.cpp index 09ed50f86..4fadfd9b6 100644 --- a/plugins/channelrx/demodatv/atvdemodgui.cpp +++ b/plugins/channelrx/demodatv/atvdemodgui.cpp @@ -211,7 +211,7 @@ bool ATVDemodGUI::handleMessage(const Message& objMessage) int nbPointsPerLine = ((ATVDemod::MsgReportEffectiveSampleRate&)objMessage).getNbPointsPerLine(); ui->channelSampleRateText->setText(tr("%1k").arg(sampleRate/1000.0f, 0, 'f', 2)); ui->nbPointsPerLineText->setText(tr("%1p").arg(nbPointsPerLine)); - m_scopeVis->setSampleRate(sampleRate); + m_scopeVis->setLiveRate(sampleRate); setRFFiltersSlidersRange(sampleRate); lineTimeUpdate(); topTimeUpdate(); diff --git a/plugins/channelrx/demodatv/atvdemodplugin.cpp b/plugins/channelrx/demodatv/atvdemodplugin.cpp index 2a3852120..66b78641a 100644 --- a/plugins/channelrx/demodatv/atvdemodplugin.cpp +++ b/plugins/channelrx/demodatv/atvdemodplugin.cpp @@ -27,7 +27,7 @@ const PluginDescriptor ATVDemodPlugin::m_ptrPluginDescriptor = { QString("ATV Demodulator"), - QString("3.14.5"), + QString("4.2.3"), QString("(c) F4HKW for F4EXB / SDRAngel"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/sdrgui/dsp/scopevis.cpp b/sdrgui/dsp/scopevis.cpp index 31cb4ba65..3751edf4d 100644 --- a/sdrgui/dsp/scopevis.cpp +++ b/sdrgui/dsp/scopevis.cpp @@ -52,6 +52,8 @@ ScopeVis::ScopeVis(GLScope* glScope) : m_timeOfsProMill(0), m_traceStart(true), m_sampleRate(0), + m_liveRate(0), + m_memoryRate(0), m_traceDiscreteMemory(m_nbTraceMemories), m_freeRun(true), m_maxTraceDelay(0), @@ -74,6 +76,15 @@ ScopeVis::~ScopeVis() } } +void ScopeVis::setLiveRate(int sampleRate) +{ + m_liveRate = sampleRate; + + if (m_currentTraceMemoryIndex == 0) { // update only in live mode + setSampleRate(m_liveRate); + } +} + void ScopeVis::setSampleRate(int sampleRate) { m_sampleRate = sampleRate; @@ -589,7 +600,7 @@ bool ScopeVis::handleMessage(const Message& message) if (DSPSignalNotification::match(message)) { DSPSignalNotification& notif = (DSPSignalNotification&) message; - setSampleRate(notif.getSampleRate()); + setLiveRate(notif.getSampleRate()); qDebug() << "ScopeVis::handleMessage: DSPSignalNotification: m_sampleRate: " << m_sampleRate; return true; } @@ -827,9 +838,16 @@ bool ScopeVis::handleMessage(const Message& message) if (memoryIndex != m_currentTraceMemoryIndex) { + // on transition from live rate initialize memory rate to live rate + if (memoryIndex == 0) { + m_memoryRate = m_liveRate; + } + m_currentTraceMemoryIndex = memoryIndex; - if (m_currentTraceMemoryIndex > 0) { + if (m_currentTraceMemoryIndex == 0) { // transition to live mode + setSampleRate(m_liveRate); // reset to live rate + } else { processMemoryTrace(); } } diff --git a/sdrgui/dsp/scopevis.h b/sdrgui/dsp/scopevis.h index 222c2c6f2..a7a90aabf 100644 --- a/sdrgui/dsp/scopevis.h +++ b/sdrgui/dsp/scopevis.h @@ -152,7 +152,7 @@ public: ScopeVis(GLScope* glScope = 0); virtual ~ScopeVis(); - void setSampleRate(int sampleRate); + void setLiveRate(int sampleRate); void configure(uint32_t traceSize, uint32_t timeBase, uint32_t timeOfsProMill, uint32_t triggerPre, bool freeRun); void addTrace(const TraceData& traceData); void changeTrace(const TraceData& traceData, uint32_t traceIndex); @@ -1049,7 +1049,9 @@ private: uint32_t m_timeOfsProMill; //!< Start trace shift in 1/1000 trace size bool m_traceStart; //!< Trace is at start point SampleVector::const_iterator m_triggerPoint; //!< Trigger start location in the samples vector - int m_sampleRate; + int m_sampleRate; //!< Actual sample rate being used + int m_liveRate; //!< Sample rate in live mode + int m_memoryRate; //!< Sample rate in memory mode TraceBackDiscreteMemory m_traceDiscreteMemory; //!< Complex trace memory for triggered states TODO: vectorize when more than on input is allowed bool m_freeRun; //!< True if free running (trigger globally disabled) int m_maxTraceDelay; //!< Maximum trace delay @@ -1109,6 +1111,11 @@ private: * - Trace in memory: call process memory trace */ void updateGLScopeDisplay(); + + /** + * Set the actual sample rate + */ + void setSampleRate(int sampleRate); };