diff --git a/Readme.md b/Readme.md index e90a71fc2..25fb0c325 100644 --- a/Readme.md +++ b/Readme.md @@ -13,6 +13,14 @@ Although it keeps the same look and feel as its parent application **SDRangelove - fix: production fixes that can't wait - legacy: the modified code from the parent application [hexameron rtl-sdrangelove](https://github.com/hexameron/rtl-sdrangelove) before a major redeisign of the code was carried out and sync was lost. +

Untested plugins

+ +These plugins come from the parent code base and have been maintained so that they compile but they are not being actively tested: + +- Channels: + - lora + - tcpsrc +

Unsupported plugins

These plugins come from the parent code base and are still present in the source tree but are not part of the build: @@ -25,14 +33,6 @@ These plugins come from the parent code base and are still present in the source - v4l-msi - v4l-rtl -

Untested plugins

- -These plugins come from the parent code base and have been maintained so that they compile but they are not being actively tested: - -- Channels: - - lora - - tcpsrc -

Gnuradio

The Gnuradio plugin source needs extra packages, including `liblog4cpp-dev libboost-system-dev gnuradio-dev libosmosdr-dev` @@ -176,6 +176,7 @@ For Debian Jessie or Stretch: - Coarse and fine trigger level sliders - Minimalist recording (no file choice) - File sample source plugin (recording reader) + - Trace history in the Channel Analyzer

Major redesign

@@ -198,8 +199,9 @@ For Debian Jessie or Stretch: - Tx channels - Possibility to connect channels for example Rx to Tx or single Rx channel to dual Rx channel supporting MI(MO) features like 360 degree polarization detection. - Specialize plugins into channel and sample source plugins since both have almost complete different requirements and only little in common + - Scope: trigger countdown + - Scope: multiple trigger chaining - 32 bit samples for the Channel Analyzer - - Trace history in the Channel Analyzer - Enhance presets management (Edit, Move, Import/Export from/to human readable format like JSON). - Headless mode based on a saved configuration in above human readable form - Allow arbitrary sample rate for channelizers and demodulators (not multiple of 48 kHz). Prerequisite for polyphase channelizer diff --git a/include/gui/glscope.h b/include/gui/glscope.h index c2f1ff8e9..9dafc96ad 100644 --- a/include/gui/glscope.h +++ b/include/gui/glscope.h @@ -27,6 +27,7 @@ #include "dsp/scopevis.h" #include "gui/scaleengine.h" #include "util/export.h" +#include "util/bitfieldindex.h" class DSPEngine; class ScopeVis; @@ -70,15 +71,18 @@ public: void setTriggerChannel(ScopeVis::TriggerChannel triggerChannel); void setTriggerLevel(Real triggerLevel); void setTriggerPre(Real triggerPre); + void setMemHistoryShift(int value); void newTrace(const std::vector& trace, int sampleRate); - int getTraceSize() const { return m_rawTrace.size(); } + int getTraceSize() const { return m_rawTrace[m_memTraceIndex - m_memTraceHistory].size(); } void setSampleRate(int sampleRate); int getSampleRate() const { return m_sampleRate; } Mode getDataMode() const { return m_mode; } void connectTimer(const QTimer& timer); + static const int m_memHistorySizeLog2 = 4; + signals: void traceSizeChanged(int); void sampleRateChanged(int); @@ -94,7 +98,11 @@ private: Qt::Orientation m_orientation; // traces - std::vector m_rawTrace; + std::vector m_rawTrace[1< m_memTraceIndex; //!< current index of trace being written + BitfieldIndex m_memTraceHistory; //!< trace index shift into history + bool m_memTraceRecall; std::vector m_mathTrace; std::vector* m_displayTrace; std::vector m_powTrace; diff --git a/include/gui/glscopegui.h b/include/gui/glscopegui.h index 04e957bdb..424802da8 100644 --- a/include/gui/glscopegui.h +++ b/include/gui/glscopegui.h @@ -93,6 +93,7 @@ private slots: void on_traceIntensity_valueChanged(int index); void on_trigPre_valueChanged(int value); void on_trigDelay_valueChanged(int value); + void on_memHistory_valueChanged(int value); void on_horizView_clicked(); void on_vertView_clicked(); diff --git a/sdrbase/gui/glscope.cpp b/sdrbase/gui/glscope.cpp index e709952f8..40101e64c 100644 --- a/sdrbase/gui/glscope.cpp +++ b/sdrbase/gui/glscope.cpp @@ -21,7 +21,10 @@ GLScope::GLScope(QWidget* parent) : m_mode(ModeIQ), m_displays(DisplayBoth), m_orientation(Qt::Horizontal), - m_displayTrace(&m_rawTrace), + m_memTraceIndex(0), + m_memTraceHistory(0), + m_memTraceRecall(false), + m_displayTrace(&m_rawTrace[0]), m_oldTraceSize(-1), m_sampleRate(0), m_amp1(1.0), @@ -82,10 +85,10 @@ void GLScope::setDSPEngine(DSPEngine* dspEngine) } void GLScope::setSampleRate(int sampleRate) { - m_sampleRate = sampleRate; + m_sampleRates[m_memTraceIndex-m_memTraceHistory] = sampleRate; m_configChanged = true; update(); - emit sampleRateChanged(m_sampleRate); + emit sampleRateChanged(m_sampleRates[m_memTraceIndex-m_memTraceHistory]); } void GLScope::setAmp1(Real amp) @@ -181,19 +184,24 @@ void GLScope::setDisplayTraceIntensity(int intensity) void GLScope::newTrace(const std::vector& trace, int sampleRate) { - if(!m_mutex.tryLock(2)) - return; - if(m_dataChanged) { + if (!m_memTraceRecall) + { + if(!m_mutex.tryLock(2)) + return; + if(m_dataChanged) { + m_mutex.unlock(); + return; + } + + m_memTraceIndex++; + m_rawTrace[m_memTraceIndex] = trace; + m_sampleRates[m_memTraceIndex] = sampleRate; + + //m_sampleRate = sampleRate; // sampleRate comes from scopeVis + m_dataChanged = true; + m_mutex.unlock(); - return; } - - m_rawTrace = trace; - - m_sampleRate = sampleRate; // sampleRate comes from scopeVis - m_dataChanged = true; - - m_mutex.unlock(); } void GLScope::initializeGL() @@ -345,7 +353,7 @@ void GLScope::paintGL() glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); //glEnable(GL_LINE_SMOOTH); glLineWidth(1.0f); - glColor4f(0, 1, 0, m_displayTraceIntensity / 100.0); + glColor4f(0, 1, 0, 0.4); glBegin(GL_LINE_LOOP); float posLimit = 1.0 / m_amp1; @@ -547,7 +555,7 @@ void GLScope::paintGL() glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); //glEnable(GL_LINE_SMOOTH); glLineWidth(1.0f); - glColor4f(0, 1, 0, m_displayTraceIntensity / 100.0); + glColor4f(0, 1, 0, 0.4); glBegin(GL_LINE_LOOP); float posLimit = 1.0 / m_amp2; @@ -658,14 +666,16 @@ void GLScope::mousePressEvent(QMouseEvent* event) void GLScope::handleMode() { + BitfieldIndex memIndex = m_memTraceIndex - m_memTraceHistory; + switch(m_mode) { case ModeIQ: { - m_mathTrace.resize(m_rawTrace.size()); + m_mathTrace.resize(m_rawTrace[memIndex].size()); std::vector::iterator dst = m_mathTrace.begin(); - m_displayTrace = &m_rawTrace; + m_displayTrace = &m_rawTrace[memIndex]; - for(std::vector::const_iterator src = m_rawTrace.begin(); src != m_rawTrace.end(); ++src) { + for(std::vector::const_iterator src = m_rawTrace[memIndex].begin(); src != m_rawTrace[memIndex].end(); ++src) { *dst++ = Complex(src->real() - m_ofs1, src->imag() - m_ofs2); } @@ -678,10 +688,10 @@ void GLScope::handleMode() } case ModeMagLinPha: { - m_mathTrace.resize(m_rawTrace.size()); + m_mathTrace.resize(m_rawTrace[memIndex].size()); std::vector::iterator dst = m_mathTrace.begin(); - for(std::vector::const_iterator src = m_rawTrace.begin(); src != m_rawTrace.end(); ++src) + for(std::vector::const_iterator src = m_rawTrace[memIndex].begin(); src != m_rawTrace[memIndex].end(); ++src) { *dst++ = Complex(abs(*src) - m_ofs1/2.0 - 1.0/m_amp1, (arg(*src) / M_PI) - m_ofs2); } @@ -695,12 +705,12 @@ void GLScope::handleMode() } case ModeMagdBPha: { - m_mathTrace.resize(m_rawTrace.size()); - m_powTrace.resize(m_rawTrace.size()); + m_mathTrace.resize(m_rawTrace[memIndex].size()); + m_powTrace.resize(m_rawTrace[memIndex].size()); std::vector::iterator dst = m_mathTrace.begin(); std::vector::iterator powDst = m_powTrace.begin(); - for(std::vector::const_iterator src = m_rawTrace.begin(); src != m_rawTrace.end(); ++src) { + for(std::vector::const_iterator src = m_rawTrace[memIndex].begin(); src != m_rawTrace[memIndex].end(); ++src) { Real v = src->real() * src->real() + src->imag() * src->imag(); *powDst++ = v; v = 1.0f + 2.0f*(((10.0f*log10f(v))/100.0f) - m_ofs1) + 1.0f - 1.0f/m_amp1; @@ -717,11 +727,11 @@ void GLScope::handleMode() } case ModeMagLinDPha: { - m_mathTrace.resize(m_rawTrace.size()); + m_mathTrace.resize(m_rawTrace[memIndex].size()); std::vector::iterator dst = m_mathTrace.begin(); Real curArg; - for(std::vector::const_iterator src = m_rawTrace.begin(); src != m_rawTrace.end(); ++src) + for(std::vector::const_iterator src = m_rawTrace[memIndex].begin(); src != m_rawTrace[memIndex].end(); ++src) { curArg = arg(*src) - m_prevArg; @@ -744,13 +754,13 @@ void GLScope::handleMode() } case ModeMagdBDPha: { - m_mathTrace.resize(m_rawTrace.size()); - m_powTrace.resize(m_rawTrace.size()); + m_mathTrace.resize(m_rawTrace[memIndex].size()); + m_powTrace.resize(m_rawTrace[memIndex].size()); std::vector::iterator dst = m_mathTrace.begin(); std::vector::iterator powDst = m_powTrace.begin(); Real curArg; - for(std::vector::const_iterator src = m_rawTrace.begin(); src != m_rawTrace.end(); ++src) + for(std::vector::const_iterator src = m_rawTrace[memIndex].begin(); src != m_rawTrace[memIndex].end(); ++src) { Real v = src->real() * src->real() + src->imag() * src->imag(); *powDst++ = v; @@ -777,16 +787,16 @@ void GLScope::handleMode() } case ModeDerived12: { - if(m_rawTrace.size() > 3) + if(m_rawTrace[memIndex].size() > 3) { - m_mathTrace.resize(m_rawTrace.size() - 3); + m_mathTrace.resize(m_rawTrace[memIndex].size() - 3); std::vector::iterator dst = m_mathTrace.begin(); - for(uint i = 3; i < m_rawTrace.size() ; i++) + for(uint i = 3; i < m_rawTrace[memIndex].size() ; i++) { *dst++ = Complex( - abs(m_rawTrace[i] - m_rawTrace[i - 1]), - abs(m_rawTrace[i] - m_rawTrace[i - 1]) - abs(m_rawTrace[i - 2] - m_rawTrace[i - 3])); + abs(m_rawTrace[memIndex][i] - m_rawTrace[memIndex][i - 1]), + abs(m_rawTrace[memIndex][i] - m_rawTrace[memIndex][i - 1]) - abs(m_rawTrace[memIndex][i - 2] - m_rawTrace[0][i - 3])); } m_displayTrace = &m_mathTrace; @@ -796,13 +806,13 @@ void GLScope::handleMode() } case ModeCyclostationary: { - if(m_rawTrace.size() > 2) + if(m_rawTrace[0].size() > 2) { - m_mathTrace.resize(m_rawTrace.size() - 2); + m_mathTrace.resize(m_rawTrace[memIndex].size() - 2); std::vector::iterator dst = m_mathTrace.begin(); - for(uint i = 2; i < m_rawTrace.size() ; i++) - *dst++ = Complex(abs(m_rawTrace[i] - conj(m_rawTrace[i - 1])), 0); + for(uint i = 2; i < m_rawTrace[memIndex].size() ; i++) + *dst++ = Complex(abs(m_rawTrace[memIndex][i] - conj(m_rawTrace[memIndex][i - 1])), 0); m_displayTrace = &m_mathTrace; } @@ -889,8 +899,8 @@ void GLScope::applyConfig() float amp1_ofs = m_ofs1; float amp2_range = 2.0 / m_amp2; float amp2_ofs = m_ofs2; - float t_start = ((m_timeOfsProMill / 1000.0) - m_triggerPre) * ((float) m_displayTrace->size() / m_sampleRate); - float t_len = ((float) m_displayTrace->size() / m_sampleRate) / (float) m_timeBase; + float t_start = ((m_timeOfsProMill / 1000.0) - m_triggerPre) * ((float) m_displayTrace->size() / m_sampleRates[m_memTraceIndex-m_memTraceHistory]); + float t_len = ((float) m_displayTrace->size() / m_sampleRates[m_memTraceIndex-m_memTraceHistory]) / (float) m_timeBase; m_x1Scale.setRange(Unit::Time, t_start, t_start + t_len); m_x2Scale.setRange(Unit::Time, t_start, t_start + t_len); @@ -1549,6 +1559,13 @@ void GLScope::setTriggerPre(Real triggerPre) update(); } +void GLScope::setMemHistoryShift(int value) +{ + m_memTraceHistory = value; + m_configChanged = true; + update(); +} + void GLScope::connectTimer(const QTimer& timer) { qDebug() << "GLScope::connectTimer"; diff --git a/sdrbase/gui/glscopegui.cpp b/sdrbase/gui/glscopegui.cpp index c411f4fa1..415e74d5d 100644 --- a/sdrbase/gui/glscopegui.cpp +++ b/sdrbase/gui/glscopegui.cpp @@ -51,6 +51,7 @@ void GLScopeGUI::setBuddies(MessageQueue* messageQueue, ScopeVis* scopeVis, GLSc m_messageQueue = messageQueue; m_scopeVis = scopeVis; m_glScope = glScope; + ui->memHistory->setMaximum((1<memIndexText->setText(text); + + if(m_glScope != NULL) + { + m_glScope->setMemHistoryShift(value % (1< 0 0 - 811 - 126 + 616 + 112 @@ -354,6 +354,132 @@ + + + + + 8 + + + + Len + + + + + + + Trace length + + + 1 + + + 100 + + + 1 + + + 20 + + + Qt::Horizontal + + + + + + + + 8 + + + + 0 + + + + + + + Qt::Vertical + + + + + + + + 24 + 24 + + + + Grid intensity + + + 100 + + + 1 + + + + + + + + + Qt::Horizontal + + + + + + + + + Mem + + + + + + + + 24 + 24 + + + + Move in trace history + + + 15 + + + 1 + + + + + + + Trace history index + + + 00 + + + + + + + Qt::Vertical + + + @@ -484,185 +610,6 @@ - - - - Qt::Vertical - - - - - - - - 24 - 24 - - - - Grid intensity - - - 100 - - - 1 - - - - - - - - - Qt::Horizontal - - - - - - - - - Mem - - - - - - - Trace memory - - - - - - - :/mem.png:/mem.png - - - true - - - true - - - - - - - Replay memorized trace - - - - - - - :/play.png:/play.png - - - - - - - Go back one trace in history (newer) - - - - - - - :/minusw.png:/minusw.png - - - - - - - 00 - - - - - - - Go one more trace in history (older) - - - - - - - :/plusw.png:/plusw.png - - - - - - - Qt::Horizontal - - - - 60 - 20 - - - - - - - - Qt::Vertical - - - - - - - - 8 - - - - Len - - - - - - - Trace length - - - 1 - - - 100 - - - 1 - - - 20 - - - Qt::Horizontal - - - - - - - - 8 - - - - 0 - - -