diff --git a/plugins/channelrx/demodatv/atvdemod.cpp b/plugins/channelrx/demodatv/atvdemod.cpp index 07ca22e2b..f96a025e3 100644 --- a/plugins/channelrx/demodatv/atvdemod.cpp +++ b/plugins/channelrx/demodatv/atvdemod.cpp @@ -32,8 +32,9 @@ MESSAGE_CLASS_DEFINITION(ATVDemod::MsgReportEffectiveSampleRate, Message) const float ATVDemod::m_fltSecondToUs = 1000000.0f; const int ATVDemod::m_ssbFftLen = 1024; -ATVDemod::ATVDemod() : - m_objSettingsMutex(QMutex::NonRecursive), +ATVDemod::ATVDemod(BasebandSampleSink* objScopeSink) : + m_objScopeSink(objScopeSink), + m_objSettingsMutex(QMutex::Recursive), m_objRegisteredATVScreen(NULL), m_intImageIndex(0), m_intColIndex(0), @@ -218,6 +219,13 @@ void ATVDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto } } + if(m_objScopeSink != 0) + { + m_objScopeSink->feed(m_objScopeSampleBuffer.begin(), m_objScopeSampleBuffer.end(), false); // m_ssb = positive only + } + + m_objScopeSampleBuffer.clear(); + if (ptrBufferToRelease != 0) { delete ptrBufferToRelease; @@ -377,6 +385,8 @@ void ATVDemod::demod(Complex& c) fltVal = 0.0f; } + m_objScopeSampleBuffer.push_back(Sample(fltVal*32768.0f, 0.0f)); + fltVal = m_objRunning.m_blnInvertVideo ? 1.0f - fltVal : fltVal; m_fltAmpLineAverage += fltVal; @@ -638,7 +648,14 @@ bool ATVDemod::handleMessage(const Message& cmd) } else { - return false; + if (m_objScopeSink != 0) + { + return m_objScopeSink->handleMessage(cmd); + } + else + { + return false; + } } } diff --git a/plugins/channelrx/demodatv/atvdemod.h b/plugins/channelrx/demodatv/atvdemod.h index c38d135cb..9a2a04016 100644 --- a/plugins/channelrx/demodatv/atvdemod.h +++ b/plugins/channelrx/demodatv/atvdemod.h @@ -123,7 +123,7 @@ public: { } }; - ATVDemod(); + ATVDemod(BasebandSampleSink* objScopeSink); ~ATVDemod(); void configure(MessageQueue* objMessageQueue, @@ -264,6 +264,11 @@ private: } }; + //*************** SCOPE *************** + + BasebandSampleSink* m_objScopeSink; + SampleVector m_objScopeSampleBuffer; + //*************** ATV PARAMETERS *************** ATVScreen * m_objRegisteredATVScreen; diff --git a/plugins/channelrx/demodatv/atvdemodgui.cpp b/plugins/channelrx/demodatv/atvdemodgui.cpp index 58704ab82..91a3dc939 100644 --- a/plugins/channelrx/demodatv/atvdemodgui.cpp +++ b/plugins/channelrx/demodatv/atvdemodgui.cpp @@ -24,6 +24,7 @@ #include "dsp/downchannelizer.h" #include "dsp/threadedbasebandsamplesink.h" +#include "dsp/scopevisng.h" #include "ui_atvdemodgui.h" #include "plugin/pluginapi.h" #include "util/simpleserializer.h" @@ -262,13 +263,15 @@ ATVDemodGUI::ATVDemodGUI(PluginAPI* objPluginAPI, DeviceSourceAPI *objDeviceAPI, connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); connect(this, SIGNAL(menuDoubleClickEvent()), this, SLOT(onMenuDoubleClicked())); - m_objATVDemod = new ATVDemod(); + m_objScopeVis = new ScopeVisNG(ui->glScope); + m_objATVDemod = new ATVDemod(m_objScopeVis); m_objATVDemod->setATVScreen(ui->screenTV); m_objChannelizer = new DownChannelizer(m_objATVDemod); m_objThreadedChannelizer = new ThreadedBasebandSampleSink(m_objChannelizer, this); m_objDeviceAPI->addThreadedSink(m_objThreadedChannelizer); + ui->glScope->connectTimer(m_objPluginAPI->getMainWindow()->getMasterTimer()); connect(&m_objPluginAPI->getMainWindow()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); // 50 ms ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold)); @@ -294,6 +297,8 @@ ATVDemodGUI::ATVDemodGUI(PluginAPI* objPluginAPI, DeviceSourceAPI *objDeviceAPI, m_objMagSqAverage.resize(4, 1.0); + ui->scopeGUI->setBuddies(m_objScopeVis->getInputMessageQueue(), m_objScopeVis, ui->glScope); + resetToDefaults(); // does applySettings() connect(m_objATVDemod->getOutputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages())); @@ -306,6 +311,7 @@ ATVDemodGUI::~ATVDemodGUI() delete m_objThreadedChannelizer; delete m_objChannelizer; delete m_objATVDemod; + delete m_objScopeVis; delete ui; } diff --git a/plugins/channelrx/demodatv/atvdemodgui.h b/plugins/channelrx/demodatv/atvdemodgui.h index 5d7b833a2..8562fc14e 100644 --- a/plugins/channelrx/demodatv/atvdemodgui.h +++ b/plugins/channelrx/demodatv/atvdemodgui.h @@ -29,6 +29,7 @@ class DeviceSourceAPI; class ThreadedBasebandSampleSink; class DownChannelizer; class ATVDemod; +class ScopeVisNG; namespace Ui { @@ -97,6 +98,8 @@ private: MovingAverage m_objMagSqAverage; int m_intTickCount; + ScopeVisNG* m_objScopeVis; + explicit ATVDemodGUI(PluginAPI* objPluginAPI, DeviceSourceAPI *objDeviceAPI, QWidget* objParent = NULL); virtual ~ATVDemodGUI(); diff --git a/plugins/channelrx/demodatv/atvdemodgui.ui b/plugins/channelrx/demodatv/atvdemodgui.ui index 7bfe9e8b1..8b1f701be 100644 --- a/plugins/channelrx/demodatv/atvdemodgui.ui +++ b/plugins/channelrx/demodatv/atvdemodgui.ui @@ -6,8 +6,8 @@ 0 0 - 520 - 539 + 700 + 668 @@ -18,7 +18,7 @@ - 520 + 700 480 @@ -39,7 +39,7 @@ 10 10 - 501 + 681 81 @@ -396,55 +396,12 @@ - - - - 10 - 80 - 501 - 348 - - - - Video - - - - QLayout::SetMinimumSize - - - - - - 0 - 0 - - - - - 495 - 346 - - - - - 495 - 346 - - - - - - - - - 10 - 430 - 501 + 570 + 681 81 @@ -726,6 +683,99 @@ + + + + 10 + 100 + 680 + 461 + + + + + 680 + 400 + + + + Video + + + QTabWidget::West + + + 0 + + + + Monitor + + + + + 10 + 0 + 632 + 442 + + + + + 2 + + + QLayout::SetMinimumSize + + + + + + 0 + 0 + + + + + 600 + 420 + + + + + 600 + 420 + + + + + + + + + + + + + Scope + + + + + + + 0 + 300 + + + + + + + + + + @@ -751,6 +801,18 @@ QToolButton
gui/buttonswitch.h
+ + GLScopeNG + QWidget +
gui/glscopeng.h
+ 1 +
+ + GLScopeNGGUI + QWidget +
gui/glscopenggui.h
+ 1 +