diff --git a/plugins/channelmimo/interferometer/interferometerwebapiadapter.cpp b/plugins/channelmimo/interferometer/interferometerwebapiadapter.cpp index e1a4531af..7bad76738 100644 --- a/plugins/channelmimo/interferometer/interferometerwebapiadapter.cpp +++ b/plugins/channelmimo/interferometer/interferometerwebapiadapter.cpp @@ -200,6 +200,9 @@ void InterferometerWebAPIAdapter::webapiUpdateChannelSettings( SWGSDRangel::SWGTraceData *traceData = tracesData->at(i); scopeSettings.m_tracesData.push_back(GLScopeSettings::TraceData()); + if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].streamIndex").arg(i))) { + scopeSettings.m_tracesData.back().m_streamIndex = traceData->getStreamIndex(); + } if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].amp").arg(i))) { scopeSettings.m_tracesData.back().m_amp = traceData->getAmp(); } @@ -271,6 +274,9 @@ void InterferometerWebAPIAdapter::webapiUpdateChannelSettings( SWGSDRangel::SWGTriggerData *triggerData = triggersData->at(i); scopeSettings.m_triggersData.push_back(GLScopeSettings::TriggerData()); + if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].streamIndex").arg(i))) { + scopeSettings.m_triggersData.back().m_streamIndex = triggerData->getStreamIndex(); + } if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].inputIndex").arg(i))) { scopeSettings.m_triggersData.back().m_inputIndex = triggerData->getInputIndex(); } diff --git a/plugins/channelrx/chanalyzer/chanalyzerwebapiadapter.cpp b/plugins/channelrx/chanalyzer/chanalyzerwebapiadapter.cpp index 53f10a738..e5c936d30 100644 --- a/plugins/channelrx/chanalyzer/chanalyzerwebapiadapter.cpp +++ b/plugins/channelrx/chanalyzer/chanalyzerwebapiadapter.cpp @@ -85,6 +85,7 @@ void ChannelAnalyzerWebAPIAdapter::webapiFormatChannelSettings( for (; traceIt != scopeSettings.m_tracesData.end(); ++traceIt) { swgScope->getTracesData()->append(new SWGSDRangel::SWGTraceData); + swgScope->getTracesData()->back()->setStreamIndex(traceIt->m_streamIndex); swgScope->getTracesData()->back()->setAmp(traceIt->m_amp); swgScope->getTracesData()->back()->setAmpIndex(traceIt->m_ampIndex); swgScope->getTracesData()->back()->setHasTextOverlay(traceIt->m_hasTextOverlay ? 1 : 0); @@ -112,6 +113,7 @@ void ChannelAnalyzerWebAPIAdapter::webapiFormatChannelSettings( for (; triggerIt != scopeSettings.m_triggersData.end(); ++triggerIt) { swgScope->getTriggersData()->append(new SWGSDRangel::SWGTriggerData); + swgScope->getTriggersData()->back()->setStreamIndex(triggerIt->m_streamIndex); swgScope->getTriggersData()->back()->setInputIndex(triggerIt->m_inputIndex); swgScope->getTriggersData()->back()->setProjectionType((int) triggerIt->m_projectionType); swgScope->getTriggersData()->back()->setTriggerBothEdges(triggerIt->m_triggerBothEdges ? 1 : 0); @@ -264,6 +266,9 @@ void ChannelAnalyzerWebAPIAdapter::webapiUpdateChannelSettings( SWGSDRangel::SWGTraceData *traceData = tracesData->at(i); scopeSettings.m_tracesData.push_back(GLScopeSettings::TraceData()); + if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].streamIndex").arg(i))) { + scopeSettings.m_tracesData.back().m_streamIndex = traceData->getStreamIndex(); + } if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].amp").arg(i))) { scopeSettings.m_tracesData.back().m_amp = traceData->getAmp(); } @@ -335,6 +340,9 @@ void ChannelAnalyzerWebAPIAdapter::webapiUpdateChannelSettings( SWGSDRangel::SWGTriggerData *triggerData = triggersData->at(i); scopeSettings.m_triggersData.push_back(GLScopeSettings::TriggerData()); + if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].streamIndex").arg(i))) { + scopeSettings.m_triggersData.back().m_streamIndex = triggerData->getStreamIndex(); + } if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].inputIndex").arg(i))) { scopeSettings.m_triggersData.back().m_inputIndex = triggerData->getInputIndex(); } diff --git a/plugins/channelrx/demodais/aisdemodgui.cpp b/plugins/channelrx/demodais/aisdemodgui.cpp index c9fb22ead..a6cb7d171 100644 --- a/plugins/channelrx/demodais/aisdemodgui.cpp +++ b/plugins/channelrx/demodais/aisdemodgui.cpp @@ -40,6 +40,7 @@ #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" #include "dsp/dspengine.h" +#include "dsp/glscopesettings.h" #include "gui/crightclickenabler.h" #include "channel/channelwebapiutils.h" #include "maincore.h" @@ -421,7 +422,7 @@ AISDemodGUI::AISDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban // Scope settings to display the IQ waveforms ui->scopeGUI->setPreTrigger(1); - ScopeVis::TraceData traceDataI, traceDataQ; + GLScopeSettings::TraceData traceDataI, traceDataQ; traceDataI.m_projectionType = Projector::ProjectionReal; traceDataI.m_amp = 1.0; // for -1 to +1 traceDataI.m_ampIndex = 0; diff --git a/plugins/channelrx/demodatv/atvdemodgui.cpp b/plugins/channelrx/demodatv/atvdemodgui.cpp index 2c2e72c46..57a6cd71a 100644 --- a/plugins/channelrx/demodatv/atvdemodgui.cpp +++ b/plugins/channelrx/demodatv/atvdemodgui.cpp @@ -23,6 +23,7 @@ #include "device/deviceuiset.h" #include "dsp/scopevis.h" +#include "dsp/glscopesettings.h" #include "ui_atvdemodgui.h" #include "plugin/pluginapi.h" #include "util/simpleserializer.h" @@ -251,7 +252,7 @@ ATVDemodGUI::ATVDemodGUI(PluginAPI* objPluginAPI, DeviceUISet *deviceUISet, Base resetToDefaults(); // does applySettings() ui->scopeGUI->setPreTrigger(1); - ScopeVis::TraceData traceData; + GLScopeSettings::TraceData traceData; traceData.m_amp = 2.0; // amplification factor traceData.m_ampIndex = 1; // this is second step traceData.m_ofs = 0.5; // direct offset diff --git a/plugins/channeltx/mod802.15.4/ieee_802_15_4_modgui.cpp b/plugins/channeltx/mod802.15.4/ieee_802_15_4_modgui.cpp index 83a8f528b..0d0383dcc 100644 --- a/plugins/channeltx/mod802.15.4/ieee_802_15_4_modgui.cpp +++ b/plugins/channeltx/mod802.15.4/ieee_802_15_4_modgui.cpp @@ -30,6 +30,7 @@ #include "dsp/scopevis.h" #include "dsp/dspcommands.h" #include "dsp/dspengine.h" +#include "dsp/glscopesettings.h" #include "gui/glspectrum.h" #include "gui/crightclickenabler.h" #include "gui/basicchannelsettingsdialog.h" @@ -366,7 +367,7 @@ IEEE_802_15_4_ModGUI::IEEE_802_15_4_ModGUI(PluginAPI* pluginAPI, DeviceUISet *de // Scope settings to display the IQ waveforms ui->scopeGUI->setPreTrigger(1); - ScopeVis::TraceData traceDataI, traceDataQ; + GLScopeSettings::TraceData traceDataI, traceDataQ; traceDataI.m_projectionType = Projector::ProjectionReal; traceDataI.m_amp = 1.0; // for -1 to +1 traceDataI.m_ampIndex = 0; diff --git a/plugins/channeltx/modais/aismodgui.cpp b/plugins/channeltx/modais/aismodgui.cpp index d408ee2c0..b4ee9a925 100644 --- a/plugins/channeltx/modais/aismodgui.cpp +++ b/plugins/channeltx/modais/aismodgui.cpp @@ -24,6 +24,7 @@ #include "dsp/spectrumvis.h" #include "dsp/scopevis.h" +#include "dsp/glscopesettings.h" #include "device/deviceuiset.h" #include "plugin/pluginapi.h" #include "util/simpleserializer.h" @@ -496,7 +497,7 @@ AISModGUI::AISModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam // Scope settings to display the IQ waveforms ui->scopeGUI->setPreTrigger(1); - ScopeVis::TraceData traceDataI, traceDataQ; + GLScopeSettings::TraceData traceDataI, traceDataQ; traceDataI.m_projectionType = Projector::ProjectionReal; traceDataI.m_amp = 1.0; // for -1 to +1 traceDataI.m_ampIndex = 0; diff --git a/sdrbase/dsp/glscopeinterface.h b/sdrbase/dsp/glscopeinterface.h new file mode 100644 index 000000000..840765727 --- /dev/null +++ b/sdrbase/dsp/glscopeinterface.h @@ -0,0 +1,34 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2021 Edouard Griffiths, F4EXB. // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef SDRBASE_DSP_GLSCOPEINTERFACE_H_ +#define SDRBASE_DSP_GLSCOPEINTERFACE_H_ + +#include "dsptypes.h" +#include "physicalunit.h" +#include "glscopesettings.h" + +class GLScopeInterface +{ +public: + GLScopeInterface() {} + virtual ~GLScopeInterface() {} + virtual void setTraces(std::vector* tracesData, std::vector* traces) = 0; + virtual void newTraces(std::vector* traces, int traceIndex, std::vector* projectionTypes) = 0; +}; + +#endif // SDRBASE_DSP_GLSCOPEINTERFACE_H_ diff --git a/sdrbase/dsp/glscopesettings.cpp b/sdrbase/dsp/glscopesettings.cpp index cd1a51988..843475ee3 100644 --- a/sdrbase/dsp/glscopesettings.cpp +++ b/sdrbase/dsp/glscopesettings.cpp @@ -79,6 +79,7 @@ QByteArray GLScopeSettings::serialize() const s.writeFloat(26 + 16*i, traceDataIt->m_traceColorR); s.writeFloat(27 + 16*i, traceDataIt->m_traceColorG); s.writeFloat(28 + 16*i, traceDataIt->m_traceColorB); + s.writeU32(29 + 16*i, traceDataIt->m_streamIndex); } s.writeU32(10, i); @@ -101,6 +102,7 @@ QByteArray GLScopeSettings::serialize() const s.writeFloat(219 + 16*i, triggerDataIt->m_triggerColorG); s.writeFloat(220 + 16*i, triggerDataIt->m_triggerColorB); s.writeU32(221 + 16*i, triggerDataIt->m_triggerHoldoff); + s.writeU32(222 + 16*i, triggerDataIt->m_streamIndex); } return s.final(); @@ -165,6 +167,8 @@ bool GLScopeSettings::deserialize(const QByteArray& data) m_tracesData.back().m_traceColor.setRedF(r); m_tracesData.back().m_traceColor.setGreenF(g); m_tracesData.back().m_traceColor.setBlueF(b); + d.readU32(29 + 16*iTrace, &uintValue, 0); + m_tracesData.back().m_streamIndex = uintValue; } uint32_t nbTriggersSaved; @@ -202,6 +206,8 @@ bool GLScopeSettings::deserialize(const QByteArray& data) m_triggersData.back().m_triggerColor.setBlueF(b); d.readU32(221 + 16*iTrigger, &uintValue, 1); m_triggersData.back().m_triggerHoldoff = uintValue; + d.readU32(222 + 16*iTrigger, &uintValue, 0); + m_triggersData.back().m_streamIndex = uintValue; } return true; diff --git a/sdrbase/dsp/glscopesettings.h b/sdrbase/dsp/glscopesettings.h index 0d4087c8a..c4055ff74 100644 --- a/sdrbase/dsp/glscopesettings.h +++ b/sdrbase/dsp/glscopesettings.h @@ -15,6 +15,9 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// +#ifndef SDRBASE_DSP_GLSCOPESETTINGS_H +#define SDRBASE_DSP_GLSCOPESETTINGS_H + #include #include @@ -39,6 +42,7 @@ public: struct TraceData // TODO: copy of ScopeVis::TraceData => unify { + uint32_t m_streamIndex; //!< I/Q stream index Projector::ProjectionType m_projectionType; //!< Complex to real projection type uint32_t m_inputIndex; //!< Input or feed index this trace is associated with float m_amp; //!< Amplification factor @@ -75,6 +79,7 @@ public: void resetToDefaults() { + m_streamIndex = 0; m_projectionType = Projector::ProjectionReal; m_inputIndex = 0; m_amp = 1.0f; @@ -95,6 +100,7 @@ public: struct TriggerData // TODO: copy of ScopeVis::TriggerData => unify { + uint32_t m_streamIndex; //!< I/Q stream index Projector::ProjectionType m_projectionType; //!< Complex to real projection type uint32_t m_inputIndex; //!< Input or feed index this trigger is associated with Real m_triggerLevel; //!< Level in real units @@ -130,6 +136,7 @@ public: void resetToDefaults() { + m_streamIndex = 0; m_projectionType = Projector::ProjectionReal; m_inputIndex = 0; m_triggerLevel = 0.0f; @@ -167,4 +174,6 @@ public: virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); -}; \ No newline at end of file +}; + +#endif // SDRBASE_DSP_GLSCOPESETTINGS_H diff --git a/sdrgui/gui/physicalunit.h b/sdrbase/dsp/physicalunit.h similarity index 100% rename from sdrgui/gui/physicalunit.h rename to sdrbase/dsp/physicalunit.h diff --git a/sdrbase/dsp/projector.h b/sdrbase/dsp/projector.h index 647cc60ed..b5568a6f2 100644 --- a/sdrbase/dsp/projector.h +++ b/sdrbase/dsp/projector.h @@ -16,6 +16,9 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// +#ifndef SDRBASE_DSP_PROJECTOR_H +#define SDRBASE_DSP_PROJECTOR_H + #include "export.h" #include "dsptypes.h" @@ -57,3 +60,5 @@ private: Real *m_cache; bool m_cacheMaster; }; + +#endif // SDRBASE_DSP_PROJECTOR_H diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index 55820cad1..002008fa0 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -1900,6 +1900,56 @@ margin-bottom: 20px; } }, "description" : "Airspy" +}; + defs.AntennaToolsSettings = { + "properties" : { + "dipoleFrequencyMHz" : { + "type" : "number", + "format" : "float" + }, + "dipoleEndEffectFactor" : { + "type" : "number", + "format" : "float" + }, + "dishFrequencyMHz" : { + "type" : "number", + "format" : "float" + }, + "dishDiameter" : { + "type" : "number", + "format" : "float" + }, + "dishDepth" : { + "type" : "number", + "format" : "float" + }, + "dishEfficiency" : { + "type" : "integer" + }, + "title" : { + "type" : "string" + }, + "rgbColor" : { + "type" : "integer" + }, + "useReverseAPI" : { + "type" : "integer", + "description" : "Synchronize with reverse API (1 for yes, 0 for no)" + }, + "reverseAPIAddress" : { + "type" : "string" + }, + "reverseAPIPort" : { + "type" : "integer" + }, + "reverseAPIDeviceIndex" : { + "type" : "integer" + }, + "reverseAPIChannelIndex" : { + "type" : "integer" + } + }, + "description" : "Antenna Tools" }; defs.ArgInfo = { "properties" : { @@ -4830,6 +4880,9 @@ margin-bottom: 20px; "AISSettings" : { "$ref" : "#/definitions/AISSettings" }, + "AntennaToolsSettings" : { + "$ref" : "#/definitions/AntennaToolsSettings" + }, "APRSSettings" : { "$ref" : "#/definitions/APRSSettings" }, @@ -10628,6 +10681,10 @@ margin-bottom: 20px; }; defs.TraceData = { "properties" : { + "streamIndex" : { + "type" : "integer", + "description" : "Source I/Q stream index" + }, "projectionType" : { "type" : "integer", "description" : "Complex to real projection type. See Projector::ProjectionType" @@ -10711,6 +10768,10 @@ margin-bottom: 20px; }; defs.TriggerData = { "properties" : { + "streamIndex" : { + "type" : "integer", + "description" : "Source I/Q stream index" + }, "projectionType" : { "type" : "integer", "description" : "Complex to real projection type. See Projector::ProjectionType" @@ -46605,7 +46666,7 @@ except ApiException as e:
- Generated 2021-05-18T01:26:07.311+02:00 + Generated 2021-05-29T00:16:39.973+02:00
diff --git a/sdrbase/resources/webapi/doc/swagger/include/AntennaTools.yaml b/sdrbase/resources/webapi/doc/swagger/include/AntennaTools.yaml new file mode 100644 index 000000000..ba5e62d3d --- /dev/null +++ b/sdrbase/resources/webapi/doc/swagger/include/AntennaTools.yaml @@ -0,0 +1,35 @@ +AntennaToolsSettings: + description: Antenna Tools + properties: + dipoleFrequencyMHz: + type: number + format: float + dipoleEndEffectFactor: + type: number + format: float + dishFrequencyMHz: + type: number + format: float + dishDiameter: + type: number + format: float + dishDepth: + type: number + format: float + dishEfficiency: + type: integer + title: + type: string + rgbColor: + type: integer + useReverseAPI: + description: Synchronize with reverse API (1 for yes, 0 for no) + type: integer + reverseAPIAddress: + type: string + reverseAPIPort: + type: integer + reverseAPIDeviceIndex: + type: integer + reverseAPIChannelIndex: + type: integer diff --git a/sdrbase/resources/webapi/doc/swagger/include/FeatureSettings.yaml b/sdrbase/resources/webapi/doc/swagger/include/FeatureSettings.yaml index 2ea298703..c466e2259 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/FeatureSettings.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/FeatureSettings.yaml @@ -17,6 +17,8 @@ FeatureSettings: $ref: "/doc/swagger/include/AFC.yaml#/AFCSettings" AISSettings: $ref: "/doc/swagger/include/AIS.yaml#/AISSettings" + AntennaToolsSettings: + $ref: "/doc/swagger/include/AntennaTools.yaml#/AntennaToolsSettings" APRSSettings: $ref: "/doc/swagger/include/APRS.yaml#/APRSSettings" DemodAnalyzerSettings: diff --git a/sdrbase/resources/webapi/doc/swagger/include/GLScope.yaml b/sdrbase/resources/webapi/doc/swagger/include/GLScope.yaml index 21ca03bc5..953a8a071 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/GLScope.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/GLScope.yaml @@ -1,6 +1,9 @@ TraceData: description: see GLScopeSettings::TraceData properties: + streamIndex: + description: Source I/Q stream index + type: integer projectionType: description: Complex to real projection type. See Projector::ProjectionType type: integer @@ -65,6 +68,9 @@ TraceData: TriggerData: description: see GLScopeSettings::TriggerData properties: + streamIndex: + description: Source I/Q stream index + type: integer projectionType: description: Complex to real projection type. See Projector::ProjectionType type: integer diff --git a/sdrgui/dsp/scopevis.cpp b/sdrgui/dsp/scopevis.cpp index a39e2f66c..97d3cabf8 100644 --- a/sdrgui/dsp/scopevis.cpp +++ b/sdrgui/dsp/scopevis.cpp @@ -127,7 +127,7 @@ void ScopeVis::configure(uint32_t traceSize, uint32_t timeBase, uint32_t timeOfs getInputMessageQueue()->push(cmd); } -void ScopeVis::addTrace(const TraceData& traceData) +void ScopeVis::addTrace(const GLScopeSettings::TraceData& traceData) { qDebug() << "ScopeVis::addTrace:" << " m_amp: " << traceData.m_amp @@ -137,7 +137,7 @@ void ScopeVis::addTrace(const TraceData& traceData) getInputMessageQueue()->push(cmd); } -void ScopeVis::changeTrace(const TraceData& traceData, uint32_t traceIndex) +void ScopeVis::changeTrace(const GLScopeSettings::TraceData& traceData, uint32_t traceIndex) { qDebug() << "ScopeVis::changeTrace:" << " trace: " << traceIndex @@ -495,7 +495,7 @@ int ScopeVis::processTraces(const SampleVector::const_iterator& cbegin, const Sa while ((begin < end) && (m_nbSamples > 0)) { std::vector::iterator itCtl = m_traces.m_tracesControl.begin(); - std::vector::iterator itData = m_traces.m_tracesData.begin(); + std::vector::iterator itData = m_traces.m_tracesData.begin(); std::vector::iterator itTrace = m_traces.m_traces[m_traces.currentBufferIndex()].begin(); for (; itCtl != m_traces.m_tracesControl.end(); ++itCtl, ++itData, ++itTrace) @@ -930,7 +930,7 @@ void ScopeVis::updateMaxTraceDelay() bool allocateCache = false; uint32_t projectorCounts[(int) Projector::nbProjectionTypes]; memset(projectorCounts, 0, ((int) Projector::nbProjectionTypes)*sizeof(uint32_t)); - std::vector::iterator itData = m_traces.m_tracesData.begin(); + std::vector::iterator itData = m_traces.m_tracesData.begin(); std::vector::iterator itCtrl = m_traces.m_tracesControl.begin(); for (; itData != m_traces.m_tracesData.end(); ++itData, ++itCtrl) @@ -992,7 +992,7 @@ void ScopeVis::initTraceBuffers() void ScopeVis::computeDisplayTriggerLevels() { - std::vector::iterator itData = m_traces.m_tracesData.begin(); + std::vector::iterator itData = m_traces.m_tracesData.begin(); for (; itData != m_traces.m_tracesData.end(); ++itData) { diff --git a/sdrgui/dsp/scopevis.h b/sdrgui/dsp/scopevis.h index 2efff28cf..d766a2c88 100644 --- a/sdrgui/dsp/scopevis.h +++ b/sdrgui/dsp/scopevis.h @@ -32,6 +32,7 @@ #include "dsp/dsptypes.h" #include "dsp/basebandsamplesink.h" #include "dsp/projector.h" +#include "dsp/glscopesettings.h" #include "export.h" #include "util/message.h" #include "util/doublebuffer.h" @@ -42,60 +43,9 @@ class GLScope; class SDRGUI_API ScopeVis : public BasebandSampleSink { public: - struct TraceData - { - Projector::ProjectionType m_projectionType; //!< Complex to real projection type - uint32_t m_inputIndex; //!< Input or feed index this trace is associated with - float m_amp; //!< Amplification factor - uint32_t m_ampIndex; //!< Index in list of amplification factors - float m_ofs; //!< Offset factor - int m_ofsCoarse; //!< Coarse offset slider value - int m_ofsFine; //!< Fine offset slider value - int m_traceDelay; //!< Trace delay in number of samples - int m_traceDelayCoarse; //!< Coarse delay slider value - int m_traceDelayFine; //!< Fine delay slider value - float m_triggerDisplayLevel; //!< Displayable trigger display level in -1:+1 scale. Off scale if not displayable. - QColor m_traceColor; //!< Trace display color - float m_traceColorR; //!< Trace display color - red shortcut - float m_traceColorG; //!< Trace display color - green shortcut - float m_traceColorB; //!< Trace display color - blue shortcut - bool m_hasTextOverlay; //!< True if a text overlay has to be displayed - QString m_textOverlay; //!< Text overlay to display - bool m_viewTrace; //!< Trace visibility - - TraceData() : - m_projectionType(Projector::ProjectionReal), - m_inputIndex(0), - m_amp(1.0f), - m_ampIndex(0), - m_ofs(0.0f), - m_ofsCoarse(0), - m_ofsFine(0), - m_traceDelay(0), - m_traceDelayCoarse(0), - m_traceDelayFine(0), - m_triggerDisplayLevel(2.0), // OVer scale by default (2.0) - m_traceColor(255,255,64), - m_hasTextOverlay(false), - m_viewTrace(true) - { - setColor(m_traceColor); - } - - void setColor(QColor color) - { - m_traceColor = color; - qreal r,g,b,a; - m_traceColor.getRgbF(&r, &g, &b, &a); - m_traceColorR = r; - m_traceColorG = g; - m_traceColorB = b; - } - }; - - struct TriggerData { + uint32_t m_streamIndex; //!< I/Q stream index Projector::ProjectionType m_projectionType; //!< Complex to real projection type uint32_t m_inputIndex; //!< Input or feed index this trigger is associated with Real m_triggerLevel; //!< Level in real units @@ -115,6 +65,7 @@ public: float m_triggerColorB; //!< Trigger line display color - blue shortcut TriggerData() : + m_streamIndex(0), m_projectionType(Projector::ProjectionReal), m_inputIndex(0), m_triggerLevel(0.0f), @@ -154,8 +105,8 @@ public: 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); + void addTrace(const GLScopeSettings::TraceData& traceData); + void changeTrace(const GLScopeSettings::TraceData& traceData, uint32_t traceIndex); void removeTrace(uint32_t traceIndex); void moveTrace(uint32_t traceIndex, bool upElseDown); void focusOnTrace(uint32_t traceIndex); @@ -220,22 +171,20 @@ public: void getTriggerData(TriggerData& triggerData, uint32_t triggerIndex) { - if (triggerIndex < m_triggerConditions.size()) - { + if (triggerIndex < m_triggerConditions.size()) { triggerData = m_triggerConditions[triggerIndex]->m_triggerData; } } - void getTraceData(TraceData& traceData, uint32_t traceIndex) + void getTraceData(GLScopeSettings::TraceData& traceData, uint32_t traceIndex) { - if (traceIndex < m_traces.m_tracesData.size()) - { + if (traceIndex < m_traces.m_tracesData.size()) { traceData = m_traces.m_tracesData[traceIndex]; } } const TriggerData& getTriggerData(uint32_t triggerIndex) const { return m_triggerConditions[triggerIndex]->m_triggerData; } - const std::vector& getTracesData() const { return m_traces.m_tracesData; } + const std::vector& getTracesData() const { return m_traces.m_tracesData; } uint32_t getNbTriggers() const { return m_triggerConditions.size(); } using BasebandSampleSink::feed; @@ -407,17 +356,17 @@ private: public: static MsgScopeVisNGAddTrace* create( - const TraceData& traceData) + const GLScopeSettings::TraceData& traceData) { return new MsgScopeVisNGAddTrace(traceData); } - const TraceData& getTraceData() const { return m_traceData; } + const GLScopeSettings::TraceData& getTraceData() const { return m_traceData; } private: - TraceData m_traceData; + GLScopeSettings::TraceData m_traceData; - MsgScopeVisNGAddTrace(const TraceData& traceData) : + MsgScopeVisNGAddTrace(const GLScopeSettings::TraceData& traceData) : m_traceData(traceData) {} }; @@ -428,19 +377,19 @@ private: public: static MsgScopeVisNGChangeTrace* create( - const TraceData& traceData, uint32_t traceIndex) + const GLScopeSettings::TraceData& traceData, uint32_t traceIndex) { return new MsgScopeVisNGChangeTrace(traceData, traceIndex); } - const TraceData& getTraceData() const { return m_traceData; } + const GLScopeSettings::TraceData& getTraceData() const { return m_traceData; } uint32_t getTraceIndex() const { return m_traceIndex; } private: - TraceData m_traceData; + GLScopeSettings::TraceData m_traceData; uint32_t m_traceIndex; - MsgScopeVisNGChangeTrace(TraceData traceData, uint32_t traceIndex) : + MsgScopeVisNGChangeTrace(GLScopeSettings::TraceData traceData, uint32_t traceIndex) : m_traceData(traceData), m_traceIndex(traceIndex) {} @@ -874,7 +823,7 @@ private: struct Traces { std::vector m_tracesControl; //!< Corresponding traces control data - std::vector m_tracesData; //!< Corresponding traces data + std::vector m_tracesData; //!< Corresponding traces data std::vector m_traces[2]; //!< Double buffer of traces processed by glScope std::vector m_projectionTypes; int m_traceSize; //!< Current size of a trace in buffer @@ -907,7 +856,7 @@ private: m_maxTraceSize = 0; } - bool isVerticalDisplayChange(const TraceData& traceData, uint32_t traceIndex) + bool isVerticalDisplayChange(const GLScopeSettings::TraceData& traceData, uint32_t traceIndex) { return (m_tracesData[traceIndex].m_projectionType != traceData.m_projectionType) || (m_tracesData[traceIndex].m_amp != traceData.m_amp) @@ -915,7 +864,7 @@ private: || (m_tracesData[traceIndex].m_traceColor != traceData.m_traceColor)); } - void addTrace(const TraceData& traceData, int traceSize) + void addTrace(const GLScopeSettings::TraceData& traceData, int traceSize) { if (m_traces[0].size() < m_maxNbTraces) { @@ -932,7 +881,7 @@ private: } } - void changeTrace(const TraceData& traceData, uint32_t traceIndex) + void changeTrace(const GLScopeSettings::TraceData& traceData, uint32_t traceIndex) { if (traceIndex < m_tracesControl.size()) { TraceControl *traceControl = m_tracesControl[traceIndex]; @@ -984,7 +933,7 @@ private: m_tracesControl[nextControlIndex] = traceControl; m_tracesControl[traceIndex] = nextTraceControl; - TraceData nextData = m_tracesData[nextDataIndex]; + GLScopeSettings::TraceData nextData = m_tracesData[nextDataIndex]; m_tracesData[nextDataIndex] = m_tracesData[traceIndex]; m_tracesData[traceIndex] = nextData; diff --git a/sdrgui/gui/glscope.cpp b/sdrgui/gui/glscope.cpp index 9d1aa27e9..0d078e0be 100644 --- a/sdrgui/gui/glscope.cpp +++ b/sdrgui/gui/glscope.cpp @@ -120,7 +120,7 @@ void GLScope::setDisplayTraceIntensity(int intensity) update(); } -void GLScope::setTraces(std::vector *tracesData, std::vector *traces) +void GLScope::setTraces(std::vector *tracesData, std::vector *traces) { m_tracesData = tracesData; m_traces = traces; @@ -345,7 +345,7 @@ void GLScope::paintGL() if (m_traceSize > 0) { const float *trace = (*m_traces)[0]; - const ScopeVis::TraceData &traceData = (*m_tracesData)[0]; + const GLScopeSettings::TraceData &traceData = (*m_tracesData)[0]; if (traceData.m_viewTrace) { @@ -438,7 +438,7 @@ void GLScope::paintGL() for (unsigned int i = 1; i < m_traces->size(); i++) { const float *trace = (*m_traces)[i]; - const ScopeVis::TraceData &traceData = (*m_tracesData)[i]; + const GLScopeSettings::TraceData &traceData = (*m_tracesData)[i]; if (!traceData.m_viewTrace) { continue; @@ -657,7 +657,7 @@ void GLScope::paintGL() for (unsigned int i = 0; i < m_traces->size(); i++) { const float *trace = (*m_traces)[i]; - const ScopeVis::TraceData &traceData = (*m_tracesData)[i]; + const GLScopeSettings::TraceData &traceData = (*m_tracesData)[i]; if (!traceData.m_viewTrace) { continue; @@ -771,7 +771,7 @@ void GLScope::paintGL() for (unsigned int i = 1; i < m_traces->size(); i++) { const float *trace = (*m_traces)[i]; - const ScopeVis::TraceData &traceData = (*m_tracesData)[i]; + const GLScopeSettings::TraceData &traceData = (*m_tracesData)[i]; if (!traceData.m_viewTrace) { continue; @@ -1863,7 +1863,7 @@ void GLScope::setPolarDisplays() void GLScope::setYScale(ScaleEngine &scale, uint32_t highlightedTraceIndex) { - ScopeVis::TraceData &traceData = (*m_tracesData)[highlightedTraceIndex]; + GLScopeSettings::TraceData &traceData = (*m_tracesData)[highlightedTraceIndex]; double amp_range = 2.0 / traceData.m_amp; double amp_ofs = traceData.m_ofs; double pow_floor = -100.0 + traceData.m_ofs * 100.0; diff --git a/sdrgui/gui/glscope.h b/sdrgui/gui/glscope.h index 598419f44..2683750fa 100644 --- a/sdrgui/gui/glscope.h +++ b/sdrgui/gui/glscope.h @@ -27,6 +27,7 @@ #include #include +#include "dsp/glscopeinterface.h" #include "dsp/dsptypes.h" #include "dsp/scopevis.h" #include "gui/scaleengine.h" @@ -39,7 +40,8 @@ class QPainter; -class SDRGUI_API GLScope: public QGLWidget { +class SDRGUI_API GLScope: public QGLWidget, public GLScopeInterface +{ Q_OBJECT public: @@ -57,8 +59,8 @@ public: void connectTimer(const QTimer& timer); void disconnectTimer(); - void setTraces(std::vector* tracesData, std::vector* traces); - void newTraces(std::vector* traces, int traceIndex, std::vector* projectionTypes); + virtual void setTraces(std::vector* tracesData, std::vector* traces); + virtual void newTraces(std::vector* traces, int traceIndex, std::vector* projectionTypes); int getSampleRate() const { return m_sampleRate; } int getTraceSize() const { return m_traceSize; } @@ -136,7 +138,7 @@ private: QList m_markers1; QList m_markers2; - std::vector *m_tracesData; + std::vector *m_tracesData; std::vector *m_traces; std::vector *m_projectionTypes; QAtomicInt m_processingTraceIndex; diff --git a/sdrgui/gui/glscopegui.cpp b/sdrgui/gui/glscopegui.cpp index df52e760a..d51d791f8 100644 --- a/sdrgui/gui/glscopegui.cpp +++ b/sdrgui/gui/glscopegui.cpp @@ -99,7 +99,7 @@ void GLScopeGUI::setBuddies(MessageQueue* messageQueue, ScopeVis* scopeVis, GLSc m_scopeVis->addTrigger(triggerData); // Add a trace - ScopeVis::TraceData traceData; + GLScopeSettings::TraceData traceData; fillTraceData(traceData); m_scopeVis->addTrace(traceData); @@ -185,8 +185,8 @@ QByteArray GLScopeGUI::serialize() const s.writeS32(6, ui->traceLen->value()); // second row - by trace - const std::vector& tracesData = m_scopeVis->getTracesData(); - std::vector::const_iterator traceDataIt = tracesData.begin(); + const std::vector& tracesData = m_scopeVis->getTracesData(); + std::vector::const_iterator traceDataIt = tracesData.begin(); s.writeU32(10, (uint32_t) tracesData.size()); int i = 0; @@ -201,6 +201,7 @@ QByteArray GLScopeGUI::serialize() const s.writeFloat(26 + 16*i, traceDataIt->m_traceColorR); s.writeFloat(27 + 16*i, traceDataIt->m_traceColorG); s.writeFloat(28 + 16*i, traceDataIt->m_traceColorB); + s.writeU32(29 + 16*i, traceDataIt->m_streamIndex); } // third row - by trigger @@ -295,7 +296,7 @@ bool GLScopeGUI::deserialize(const QByteArray& data) uint32_t nbTracesSaved; d.readU32(10, &nbTracesSaved, 1); - const std::vector& tracesData = m_scopeVis->getTracesData(); + const std::vector& tracesData = m_scopeVis->getTracesData(); uint32_t iTrace = tracesData.size(); qDebug("GLScopeGUI::deserialize: nbTracesSaved: %u tracesData.size(): %lu", nbTracesSaved, tracesData.size()); @@ -308,7 +309,7 @@ bool GLScopeGUI::deserialize(const QByteArray& data) for (iTrace = 0; iTrace < nbTracesSaved; iTrace++) { - ScopeVis::TraceData traceData; + GLScopeSettings::TraceData traceData; float r, g, b; d.readS32(20 + 16*iTrace, &intValue, 0); @@ -327,6 +328,8 @@ bool GLScopeGUI::deserialize(const QByteArray& data) d.readFloat(27 + 16*iTrace, &g, 1.0f); d.readFloat(28 + 16*iTrace, &b, 1.0f); m_focusedTraceColor.setRgbF(r, g, b); + d.readU32(29 + 16*iTrace, &uintValue, 0); + ui->traceStream->setCurrentIndex(uintValue); fillTraceData(traceData); @@ -607,7 +610,7 @@ void GLScopeGUI::on_trace_valueChanged(int value) { ui->traceText->setText(value == 0 ? "X" : QString("Y%1").arg(ui->trace->value())); - ScopeVis::TraceData traceData; + GLScopeSettings::TraceData traceData; m_scopeVis->getTraceData(traceData, value); qDebug() << "GLScopeGUI::on_trace_valueChanged:" @@ -624,7 +627,7 @@ void GLScopeGUI::on_trace_valueChanged(int value) void GLScopeGUI::on_traceAdd_clicked(bool checked) { (void) checked; - ScopeVis::TraceData traceData; + GLScopeSettings::TraceData traceData; fillTraceData(traceData); addTrace(traceData); } @@ -659,7 +662,7 @@ void GLScopeGUI::on_traceUp_clicked(bool checked) int newTraceIndex = (ui->trace->value() + 1) % (ui->trace->maximum()+1); m_scopeVis->moveTrace(ui->trace->value(), true); ui->trace->setValue(newTraceIndex); // follow trace - ScopeVis::TraceData traceData; + GLScopeSettings::TraceData traceData; m_scopeVis->getTraceData(traceData, ui->trace->value()); setTraceUI(traceData); m_scopeVis->focusOnTrace(ui->trace->value()); @@ -674,7 +677,7 @@ void GLScopeGUI::on_traceDown_clicked(bool checked) int newTraceIndex = (ui->trace->value() - 1) % (ui->trace->maximum()+1); m_scopeVis->moveTrace(ui->trace->value(), false); ui->trace->setValue(newTraceIndex); // follow trace - ScopeVis::TraceData traceData; + GLScopeSettings::TraceData traceData; m_scopeVis->getTraceData(traceData, ui->trace->value()); setTraceUI(traceData); m_scopeVis->focusOnTrace(ui->trace->value()); @@ -1290,7 +1293,7 @@ void GLScopeGUI::setTrigPreDisplay() void GLScopeGUI::changeCurrentTrace() { - ScopeVis::TraceData traceData; + GLScopeSettings::TraceData traceData; fillTraceData(traceData); uint32_t currentTraceIndex = ui->trace->value(); m_scopeVis->changeTrace(traceData, currentTraceIndex); @@ -1343,8 +1346,9 @@ void GLScopeGUI::disableLiveMode(bool disable) ui->memoryLoad->setEnabled(disable); } -void GLScopeGUI::fillTraceData(ScopeVis::TraceData& traceData) +void GLScopeGUI::fillTraceData(GLScopeSettings::TraceData& traceData) { + traceData.m_streamIndex = ui->traceStream->currentIndex(); traceData.m_projectionType = (Projector::ProjectionType) ui->traceMode->currentIndex(); traceData.m_hasTextOverlay = (traceData.m_projectionType == Projector::ProjectionMagDB) || (traceData.m_projectionType == Projector::ProjectionMagSq); traceData.m_textOverlay.clear(); @@ -1386,10 +1390,11 @@ void GLScopeGUI::fillTriggerData(ScopeVis::TriggerData& triggerData) triggerData.setColor(m_focusedTriggerColor); } -void GLScopeGUI::setTraceUI(const ScopeVis::TraceData& traceData) +void GLScopeGUI::setTraceUI(const GLScopeSettings::TraceData& traceData) { TraceUIBlocker traceUIBlocker(ui); + ui->traceStream->setCurrentIndex(traceData.m_streamIndex); ui->traceMode->setCurrentIndex((int) traceData.m_projectionType); ui->amp->setValue(traceData.m_ampIndex); setAmpScaleDisplay(); @@ -1653,12 +1658,12 @@ void GLScopeGUI::setPreTrigger(int step) ui->trigPre->setValue(step); } -void GLScopeGUI::changeTrace(int traceIndex, const ScopeVis::TraceData& traceData) +void GLScopeGUI::changeTrace(int traceIndex, const GLScopeSettings::TraceData& traceData) { m_scopeVis->changeTrace(traceData, traceIndex); } -void GLScopeGUI::addTrace(const ScopeVis::TraceData& traceData) +void GLScopeGUI::addTrace(const GLScopeSettings::TraceData& traceData) { if (ui->trace->maximum() < 3) { diff --git a/sdrgui/gui/glscopegui.h b/sdrgui/gui/glscopegui.h index db26b5916..465dddd74 100644 --- a/sdrgui/gui/glscopegui.h +++ b/sdrgui/gui/glscopegui.h @@ -69,8 +69,8 @@ public: void setTraceLength(int step); void setPreTrigger(int step); // trace (second line): - void changeTrace(int traceIndex, const ScopeVis::TraceData& traceData); - void addTrace(const ScopeVis::TraceData& traceData); + void changeTrace(int traceIndex, const GLScopeSettings::TraceData& traceData); + void addTrace(const GLScopeSettings::TraceData& traceData); void focusOnTrace(int traceIndex); // trigger (third line): void changeTrigger(int triggerIndex, const ScopeVis::TriggerData& triggerData); @@ -177,10 +177,10 @@ private: void changeCurrentTrace(); void changeCurrentTrigger(); - void fillTraceData(ScopeVis::TraceData& traceData); + void fillTraceData(GLScopeSettings::TraceData& traceData); void fillTriggerData(ScopeVis::TriggerData& triggerData); void setTriggerUI(const ScopeVis::TriggerData& triggerData); - void setTraceUI(const ScopeVis::TraceData& traceData); + void setTraceUI(const GLScopeSettings::TraceData& traceData); void fillProjectionCombo(QComboBox* comboBox); void disableLiveMode(bool disable); diff --git a/sdrgui/gui/glscopegui.ui b/sdrgui/gui/glscopegui.ui index fa21b2416..0b605ca5d 100644 --- a/sdrgui/gui/glscopegui.ui +++ b/sdrgui/gui/glscopegui.ui @@ -7,7 +7,7 @@ 0 0 758 - 121 + 138 @@ -773,64 +773,47 @@ kS/s - - - Qt::Vertical - - - - - - - - 65 - 16777215 - - - - Trace mode - - - - TBD - - - - - - - - - 24 - 24 - - - - Source port selection - - + + 0 - - 1 - - - - - - - - 12 - 0 - - - - Source port number - - - 0 - - + + + + + 65 + 16777215 + + + + Trace stream source + + + + 0 + + + + + + + + + 65 + 16777215 + + + + Trace mode + + + + TBD + + + + + @@ -1462,6 +1445,49 @@ kS/s + + + + 0 + + + + + + 65 + 16777215 + + + + Trigger stream source + + + + 0 + + + + + + + + + 65 + 16777215 + + + + Trigger mode + + + + TBD + + + + + + @@ -1469,24 +1495,6 @@ kS/s - - - - - 65 - 16777215 - - - - Trigger mode - - - - TBD - - - - diff --git a/sdrgui/gui/scaleengine.h b/sdrgui/gui/scaleengine.h index 39454f54e..904b561fe 100644 --- a/sdrgui/gui/scaleengine.h +++ b/sdrgui/gui/scaleengine.h @@ -22,7 +22,7 @@ #include #include #include -#include "physicalunit.h" +#include "dsp/physicalunit.h" #include "export.h" class SDRGUI_API ScaleEngine { diff --git a/swagger/sdrangel/api/swagger/include/GLScope.yaml b/swagger/sdrangel/api/swagger/include/GLScope.yaml index a8dcc7d4b..1e677c009 100644 --- a/swagger/sdrangel/api/swagger/include/GLScope.yaml +++ b/swagger/sdrangel/api/swagger/include/GLScope.yaml @@ -1,6 +1,9 @@ TraceData: description: see GLScopeSettings::TraceData properties: + streamIndex: + description: Source I/Q stream index + type: integer projectionType: description: Complex to real projection type. See Projector::ProjectionType type: integer @@ -65,6 +68,9 @@ TraceData: TriggerData: description: see GLScopeSettings::TriggerData properties: + streamIndex: + description: Source I/Q stream index + type: integer projectionType: description: Complex to real projection type. See Projector::ProjectionType type: integer diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index 55820cad1..002008fa0 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -1900,6 +1900,56 @@ margin-bottom: 20px; } }, "description" : "Airspy" +}; + defs.AntennaToolsSettings = { + "properties" : { + "dipoleFrequencyMHz" : { + "type" : "number", + "format" : "float" + }, + "dipoleEndEffectFactor" : { + "type" : "number", + "format" : "float" + }, + "dishFrequencyMHz" : { + "type" : "number", + "format" : "float" + }, + "dishDiameter" : { + "type" : "number", + "format" : "float" + }, + "dishDepth" : { + "type" : "number", + "format" : "float" + }, + "dishEfficiency" : { + "type" : "integer" + }, + "title" : { + "type" : "string" + }, + "rgbColor" : { + "type" : "integer" + }, + "useReverseAPI" : { + "type" : "integer", + "description" : "Synchronize with reverse API (1 for yes, 0 for no)" + }, + "reverseAPIAddress" : { + "type" : "string" + }, + "reverseAPIPort" : { + "type" : "integer" + }, + "reverseAPIDeviceIndex" : { + "type" : "integer" + }, + "reverseAPIChannelIndex" : { + "type" : "integer" + } + }, + "description" : "Antenna Tools" }; defs.ArgInfo = { "properties" : { @@ -4830,6 +4880,9 @@ margin-bottom: 20px; "AISSettings" : { "$ref" : "#/definitions/AISSettings" }, + "AntennaToolsSettings" : { + "$ref" : "#/definitions/AntennaToolsSettings" + }, "APRSSettings" : { "$ref" : "#/definitions/APRSSettings" }, @@ -10628,6 +10681,10 @@ margin-bottom: 20px; }; defs.TraceData = { "properties" : { + "streamIndex" : { + "type" : "integer", + "description" : "Source I/Q stream index" + }, "projectionType" : { "type" : "integer", "description" : "Complex to real projection type. See Projector::ProjectionType" @@ -10711,6 +10768,10 @@ margin-bottom: 20px; }; defs.TriggerData = { "properties" : { + "streamIndex" : { + "type" : "integer", + "description" : "Source I/Q stream index" + }, "projectionType" : { "type" : "integer", "description" : "Complex to real projection type. See Projector::ProjectionType" @@ -46605,7 +46666,7 @@ except ApiException as e:
- Generated 2021-05-18T01:26:07.311+02:00 + Generated 2021-05-29T00:16:39.973+02:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGTraceData.cpp b/swagger/sdrangel/code/qt5/client/SWGTraceData.cpp index 66b3f1999..dba453d50 100644 --- a/swagger/sdrangel/code/qt5/client/SWGTraceData.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGTraceData.cpp @@ -28,6 +28,8 @@ SWGTraceData::SWGTraceData(QString* json) { } SWGTraceData::SWGTraceData() { + stream_index = 0; + m_stream_index_isSet = false; projection_type = 0; m_projection_type_isSet = false; input_index = 0; @@ -72,6 +74,8 @@ SWGTraceData::~SWGTraceData() { void SWGTraceData::init() { + stream_index = 0; + m_stream_index_isSet = false; projection_type = 0; m_projection_type_isSet = false; input_index = 0; @@ -128,6 +132,7 @@ SWGTraceData::cleanup() { + if(text_overlay != nullptr) { delete text_overlay; } @@ -145,6 +150,8 @@ SWGTraceData::fromJson(QString &json) { void SWGTraceData::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&stream_index, pJson["streamIndex"], "qint32", ""); + ::SWGSDRangel::setValue(&projection_type, pJson["projectionType"], "qint32", ""); ::SWGSDRangel::setValue(&input_index, pJson["inputIndex"], "qint32", ""); @@ -197,6 +204,9 @@ SWGTraceData::asJson () QJsonObject* SWGTraceData::asJsonObject() { QJsonObject* obj = new QJsonObject(); + if(m_stream_index_isSet){ + obj->insert("streamIndex", QJsonValue(stream_index)); + } if(m_projection_type_isSet){ obj->insert("projectionType", QJsonValue(projection_type)); } @@ -255,6 +265,16 @@ SWGTraceData::asJsonObject() { return obj; } +qint32 +SWGTraceData::getStreamIndex() { + return stream_index; +} +void +SWGTraceData::setStreamIndex(qint32 stream_index) { + this->stream_index = stream_index; + this->m_stream_index_isSet = true; +} + qint32 SWGTraceData::getProjectionType() { return projection_type; @@ -440,6 +460,9 @@ bool SWGTraceData::isSet(){ bool isObjectUpdated = false; do{ + if(m_stream_index_isSet){ + isObjectUpdated = true; break; + } if(m_projection_type_isSet){ isObjectUpdated = true; break; } diff --git a/swagger/sdrangel/code/qt5/client/SWGTraceData.h b/swagger/sdrangel/code/qt5/client/SWGTraceData.h index 11a364aa6..b2117610c 100644 --- a/swagger/sdrangel/code/qt5/client/SWGTraceData.h +++ b/swagger/sdrangel/code/qt5/client/SWGTraceData.h @@ -42,6 +42,9 @@ public: virtual void fromJsonObject(QJsonObject &json) override; virtual SWGTraceData* fromJson(QString &jsonString) override; + qint32 getStreamIndex(); + void setStreamIndex(qint32 stream_index); + qint32 getProjectionType(); void setProjectionType(qint32 projection_type); @@ -100,6 +103,9 @@ public: virtual bool isSet() override; private: + qint32 stream_index; + bool m_stream_index_isSet; + qint32 projection_type; bool m_projection_type_isSet; diff --git a/swagger/sdrangel/code/qt5/client/SWGTriggerData.cpp b/swagger/sdrangel/code/qt5/client/SWGTriggerData.cpp index e24d73f55..8e7ef4c0d 100644 --- a/swagger/sdrangel/code/qt5/client/SWGTriggerData.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGTriggerData.cpp @@ -28,6 +28,8 @@ SWGTriggerData::SWGTriggerData(QString* json) { } SWGTriggerData::SWGTriggerData() { + stream_index = 0; + m_stream_index_isSet = false; projection_type = 0; m_projection_type_isSet = false; input_index = 0; @@ -70,6 +72,8 @@ SWGTriggerData::~SWGTriggerData() { void SWGTriggerData::init() { + stream_index = 0; + m_stream_index_isSet = false; projection_type = 0; m_projection_type_isSet = false; input_index = 0; @@ -125,6 +129,7 @@ SWGTriggerData::cleanup() { + } SWGTriggerData* @@ -138,6 +143,8 @@ SWGTriggerData::fromJson(QString &json) { void SWGTriggerData::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&stream_index, pJson["streamIndex"], "qint32", ""); + ::SWGSDRangel::setValue(&projection_type, pJson["projectionType"], "qint32", ""); ::SWGSDRangel::setValue(&input_index, pJson["inputIndex"], "qint32", ""); @@ -188,6 +195,9 @@ SWGTriggerData::asJson () QJsonObject* SWGTriggerData::asJsonObject() { QJsonObject* obj = new QJsonObject(); + if(m_stream_index_isSet){ + obj->insert("streamIndex", QJsonValue(stream_index)); + } if(m_projection_type_isSet){ obj->insert("projectionType", QJsonValue(projection_type)); } @@ -243,6 +253,16 @@ SWGTriggerData::asJsonObject() { return obj; } +qint32 +SWGTriggerData::getStreamIndex() { + return stream_index; +} +void +SWGTriggerData::setStreamIndex(qint32 stream_index) { + this->stream_index = stream_index; + this->m_stream_index_isSet = true; +} + qint32 SWGTriggerData::getProjectionType() { return projection_type; @@ -418,6 +438,9 @@ bool SWGTriggerData::isSet(){ bool isObjectUpdated = false; do{ + if(m_stream_index_isSet){ + isObjectUpdated = true; break; + } if(m_projection_type_isSet){ isObjectUpdated = true; break; } diff --git a/swagger/sdrangel/code/qt5/client/SWGTriggerData.h b/swagger/sdrangel/code/qt5/client/SWGTriggerData.h index 9d900bd61..568a7a0fe 100644 --- a/swagger/sdrangel/code/qt5/client/SWGTriggerData.h +++ b/swagger/sdrangel/code/qt5/client/SWGTriggerData.h @@ -41,6 +41,9 @@ public: virtual void fromJsonObject(QJsonObject &json) override; virtual SWGTriggerData* fromJson(QString &jsonString) override; + qint32 getStreamIndex(); + void setStreamIndex(qint32 stream_index); + qint32 getProjectionType(); void setProjectionType(qint32 projection_type); @@ -96,6 +99,9 @@ public: virtual bool isSet() override; private: + qint32 stream_index; + bool m_stream_index_isSet; + qint32 projection_type; bool m_projection_type_isSet;