diff --git a/plugins/feature/morsedecoder/morsedecoder.cpp b/plugins/feature/morsedecoder/morsedecoder.cpp index 5573f0464..1a165caff 100644 --- a/plugins/feature/morsedecoder/morsedecoder.cpp +++ b/plugins/feature/morsedecoder/morsedecoder.cpp @@ -122,6 +122,7 @@ void MorseDecoder::start() &QThread::deleteLater ); + m_worker->setScopeVis(&m_scopeVis); m_worker->setMessageQueueToFeature(getInputMessageQueue()); m_worker->startWork(); m_state = StRunning; diff --git a/plugins/feature/morsedecoder/morsedecoder.h b/plugins/feature/morsedecoder/morsedecoder.h index 31e76c5c4..0151ce1e7 100644 --- a/plugins/feature/morsedecoder/morsedecoder.h +++ b/plugins/feature/morsedecoder/morsedecoder.h @@ -27,6 +27,7 @@ #include "feature/feature.h" #include "util/message.h" #include "availablechannelorfeaturehandler.h" +#include "dsp/scopevis.h" #include "morsedecodersettings.h" @@ -213,6 +214,8 @@ public: const QStringList& featureSettingsKeys, SWGSDRangel::SWGFeatureSettings& response); + ScopeVis *getScopeVis() { return &m_scopeVis; } + static const char* const m_featureIdURI; static const char* const m_featureId; @@ -222,6 +225,7 @@ private: bool m_running; MorseDecoderWorker *m_worker; MorseDecoderSettings m_settings; + ScopeVis m_scopeVis; AvailableChannelOrFeatureList m_availableChannels; AvailableChannelOrFeatureHandler m_availableChannelOrFeatureHandler; ChannelAPI *m_selectedChannel; diff --git a/plugins/feature/morsedecoder/morsedecodergui.cpp b/plugins/feature/morsedecoder/morsedecodergui.cpp index 894a6230b..d893673a1 100644 --- a/plugins/feature/morsedecoder/morsedecodergui.cpp +++ b/plugins/feature/morsedecoder/morsedecodergui.cpp @@ -86,6 +86,7 @@ bool MorseDecoderGUI::handleMessage(const Message& message) } blockApplySettings(true); + ui->scopeGUI->updateSettings(); displaySettings(); blockApplySettings(false); @@ -192,7 +193,10 @@ MorseDecoderGUI::MorseDecoderGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISe m_morseDecoder = reinterpret_cast(feature); m_morseDecoder->setMessageQueueToGUI(&m_inputMessageQueue); - + m_scopeVis = m_morseDecoder->getScopeVis(); + m_scopeVis->setGLScope(ui->glScope); + ui->scopeGUI->setBuddies(m_scopeVis->getInputMessageQueue(), m_scopeVis, ui->glScope); + m_scopeVis->setLiveRate(4000); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &))); connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); @@ -204,6 +208,7 @@ MorseDecoderGUI::MorseDecoderGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISe connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); + m_settings.setScopeGUI(ui->scopeGUI); m_settings.setRollupState(&m_rollupState); displaySettings(); diff --git a/plugins/feature/morsedecoder/morsedecodergui.h b/plugins/feature/morsedecoder/morsedecodergui.h index b09144c8f..a5035c43b 100644 --- a/plugins/feature/morsedecoder/morsedecodergui.h +++ b/plugins/feature/morsedecoder/morsedecodergui.h @@ -32,6 +32,7 @@ class PluginAPI; class FeatureUISet; class MorseDecoder; class Feature; +class ScopeVis; namespace Ui { class MorseDecoderGUI; @@ -63,6 +64,7 @@ private: bool m_doApplySettings; MorseDecoder* m_morseDecoder; + ScopeVis* m_scopeVis; MessageQueue m_inputMessageQueue; QTimer m_statusTimer; int m_lastFeatureState; diff --git a/plugins/feature/morsedecoder/morsedecodergui.ui b/plugins/feature/morsedecoder/morsedecodergui.ui index 257081815..cf470f2ed 100644 --- a/plugins/feature/morsedecoder/morsedecodergui.ui +++ b/plugins/feature/morsedecoder/morsedecodergui.ui @@ -7,7 +7,7 @@ 0 0 422 - 810 + 754 @@ -443,6 +443,335 @@ + + + + 10 + 400 + 420 + 341 + + + + + 420 + 0 + + + + Waveforms + + + + 2 + + + 3 + + + 3 + + + 3 + + + 3 + + + + + + + Real + + + + + + + + 0 + 0 + + + + + I + + + + + Q + + + + + Mag Sq + + + + + Sample Idx + + + + + abs(Sum1) + + + + + abs(Sum2) + + + + + Bit + + + + + Bit Cnt + + + + + Got SOP + + + + + Real(exp) + + + + + Imag(exp) + + + + + abs(sum1)Filt + + + + + abs(sum2)Filt + + + + + Diff + + + + + DiffFilt + + + + + data + + + + + clock + + + + + Env1 + + + + + Env2 + + + + + Bias1 + + + + + Bias2 + + + + + Unbiased data + + + + + Biased data + + + + + + + + + 0 + 0 + + + + Imag + + + + + + + + 0 + 0 + + + + + I + + + + + Q + + + + + Mag Sq + + + + + Sample Idx + + + + + abs(Sum1) + + + + + abs(Sum2) + + + + + Bit + + + + + Bit Cnt + + + + + Got SOP + + + + + Real(exp) + + + + + imag(exp) + + + + + abs(sum1)Filt + + + + + abs(sum2)Filt + + + + + Diff + + + + + DiffFilt + + + + + data + + + + + clock + + + + + Env1 + + + + + Env2 + + + + + Bias1 + + + + + Bias2 + + + + + Unbiased data + + + + + Biased data + + + + + + + + + + + 200 + 250 + + + + + Liberation Mono + 8 + + + + + + + + + @@ -456,6 +785,18 @@
gui/rollupcontents.h
1
+ + GLScope + QWidget +
gui/glscope.h
+ 1 +
+ + GLScopeGUI + QWidget +
gui/glscopegui.h
+ 1 +
diff --git a/plugins/feature/morsedecoder/morsedecodersettings.cpp b/plugins/feature/morsedecoder/morsedecodersettings.cpp index b91d6d55a..d703b9cf6 100644 --- a/plugins/feature/morsedecoder/morsedecodersettings.cpp +++ b/plugins/feature/morsedecoder/morsedecodersettings.cpp @@ -58,6 +58,10 @@ QByteArray MorseDecoderSettings::serialize() const { SimpleSerializer s(1); + if (m_scopeGUI) { + s.writeBlob(2, m_scopeGUI->serialize()); + } + s.writeString(5, m_title); s.writeU32(6, m_rgbColor); s.writeBool(7, m_useReverseAPI); @@ -99,6 +103,12 @@ bool MorseDecoderSettings::deserialize(const QByteArray& data) uint32_t utmp; QString strtmp; + if (m_scopeGUI) + { + d.readBlob(2, &bytetmp); + m_scopeGUI->deserialize(bytetmp); + } + d.readString(5, &m_title, "Demod Analyzer"); d.readU32(6, &m_rgbColor, QColor(0, 255, 0).rgb()); d.readBool(7, &m_useReverseAPI, false); diff --git a/plugins/feature/morsedecoder/morsedecodersettings.h b/plugins/feature/morsedecoder/morsedecodersettings.h index 8a63f0b8d..a6b39454a 100644 --- a/plugins/feature/morsedecoder/morsedecodersettings.h +++ b/plugins/feature/morsedecoder/morsedecodersettings.h @@ -32,6 +32,7 @@ struct MorseDecoderSettings uint16_t m_reverseAPIPort; uint16_t m_reverseAPIFeatureSetIndex; uint16_t m_reverseAPIFeatureIndex; + Serializable *m_scopeGUI; Serializable *m_rollupState; int m_workspaceIndex; QByteArray m_geometryBytes; @@ -47,6 +48,7 @@ struct MorseDecoderSettings QByteArray serialize() const; bool deserialize(const QByteArray& data); + void setScopeGUI(Serializable *scopeGUI) { m_scopeGUI = scopeGUI; } void setRollupState(Serializable *rollupState) { m_rollupState = rollupState; } void applySettings(const QStringList& settingsKeys, const MorseDecoderSettings& settings); QString getDebugString(const QStringList& settingsKeys, bool force=false) const; diff --git a/plugins/feature/morsedecoder/morsedecoderworker.h b/plugins/feature/morsedecoder/morsedecoderworker.h index 28cb0c4dd..3acc3fa7f 100644 --- a/plugins/feature/morsedecoder/morsedecoderworker.h +++ b/plugins/feature/morsedecoder/morsedecoderworker.h @@ -33,6 +33,8 @@ #include "morsedecodersettings.h" +class ScopeVis; + class MorseDecoderWorker : public QObject { Q_OBJECT public: @@ -89,6 +91,7 @@ public: void stopWork(); MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } void setMessageQueueToFeature(MessageQueue *messageQueue) { m_msgQueueToFeature = messageQueue; } + void setScopeVis(ScopeVis* scopeVis) { m_scopeVis = scopeVis; } void applySampleRate(int sampleRate); void applySettings(const MorseDecoderSettings& settings, const QList& settingsKeys, bool force = false); @@ -111,6 +114,7 @@ private: bool m_auto; float m_pitchHz; float m_speedWPM; + ScopeVis* m_scopeVis; void feedPart( const QByteArray::const_iterator& begin,