1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 17:28:50 -05:00

GLScope redesign (1)

This commit is contained in:
f4exb 2021-05-29 00:55:04 +02:00
parent ae11010b07
commit 70550f453f
29 changed files with 454 additions and 189 deletions

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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 <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#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<GLScopeSettings::TraceData>* tracesData, std::vector<float *>* traces) = 0;
virtual void newTraces(std::vector<float *>* traces, int traceIndex, std::vector<Projector::ProjectionType>* projectionTypes) = 0;
};
#endif // SDRBASE_DSP_GLSCOPEINTERFACE_H_

View File

@ -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;

View File

@ -15,6 +15,9 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#ifndef SDRBASE_DSP_GLSCOPESETTINGS_H
#define SDRBASE_DSP_GLSCOPESETTINGS_H
#include <vector>
#include <QByteArray>
@ -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);
};
};
#endif // SDRBASE_DSP_GLSCOPESETTINGS_H

View File

@ -16,6 +16,9 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#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

View File

@ -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:
</div>
<div id="generator">
<div class="content">
Generated 2021-05-18T01:26:07.311+02:00
Generated 2021-05-29T00:16:39.973+02:00
</div>
</div>
</div>

View File

@ -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

View File

@ -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:

View File

@ -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

View File

@ -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<TraceControl*>::iterator itCtl = m_traces.m_tracesControl.begin();
std::vector<TraceData>::iterator itData = m_traces.m_tracesData.begin();
std::vector<GLScopeSettings::TraceData>::iterator itData = m_traces.m_tracesData.begin();
std::vector<float *>::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<TraceData>::iterator itData = m_traces.m_tracesData.begin();
std::vector<GLScopeSettings::TraceData>::iterator itData = m_traces.m_tracesData.begin();
std::vector<TraceControl*>::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<TraceData>::iterator itData = m_traces.m_tracesData.begin();
std::vector<GLScopeSettings::TraceData>::iterator itData = m_traces.m_tracesData.begin();
for (; itData != m_traces.m_tracesData.end(); ++itData)
{

View File

@ -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<TraceData>& getTracesData() const { return m_traces.m_tracesData; }
const std::vector<GLScopeSettings::TraceData>& 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<TraceControl*> m_tracesControl; //!< Corresponding traces control data
std::vector<TraceData> m_tracesData; //!< Corresponding traces data
std::vector<GLScopeSettings::TraceData> m_tracesData; //!< Corresponding traces data
std::vector<float *> m_traces[2]; //!< Double buffer of traces processed by glScope
std::vector<Projector::ProjectionType> 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;

View File

@ -120,7 +120,7 @@ void GLScope::setDisplayTraceIntensity(int intensity)
update();
}
void GLScope::setTraces(std::vector<ScopeVis::TraceData> *tracesData, std::vector<float *> *traces)
void GLScope::setTraces(std::vector<GLScopeSettings::TraceData> *tracesData, std::vector<float *> *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;

View File

@ -27,6 +27,7 @@
#include <QMatrix4x4>
#include <QAtomicInt>
#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<ScopeVis::TraceData>* tracesData, std::vector<float *>* traces);
void newTraces(std::vector<float *>* traces, int traceIndex, std::vector<Projector::ProjectionType>* projectionTypes);
virtual void setTraces(std::vector<GLScopeSettings::TraceData>* tracesData, std::vector<float *>* traces);
virtual void newTraces(std::vector<float *>* traces, int traceIndex, std::vector<Projector::ProjectionType>* projectionTypes);
int getSampleRate() const { return m_sampleRate; }
int getTraceSize() const { return m_traceSize; }
@ -136,7 +138,7 @@ private:
QList<ScopeMarker> m_markers1;
QList<ScopeMarker> m_markers2;
std::vector<ScopeVis::TraceData> *m_tracesData;
std::vector<GLScopeSettings::TraceData> *m_tracesData;
std::vector<float *> *m_traces;
std::vector<Projector::ProjectionType> *m_projectionTypes;
QAtomicInt m_processingTraceIndex;

View File

@ -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<ScopeVis::TraceData>& tracesData = m_scopeVis->getTracesData();
std::vector<ScopeVis::TraceData>::const_iterator traceDataIt = tracesData.begin();
const std::vector<GLScopeSettings::TraceData>& tracesData = m_scopeVis->getTracesData();
std::vector<GLScopeSettings::TraceData>::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<ScopeVis::TraceData>& tracesData = m_scopeVis->getTracesData();
const std::vector<GLScopeSettings::TraceData>& 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)
{

View File

@ -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);

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>758</width>
<height>121</height>
<height>138</height>
</rect>
</property>
<property name="minimumSize">
@ -773,64 +773,47 @@ kS/s</string>
</layout>
</item>
<item>
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="traceMode">
<property name="maximumSize">
<size>
<width>65</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Trace mode</string>
</property>
<item>
<property name="text">
<string>TBD</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QDial" name="sourcePort">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolTip">
<string>Source port selection</string>
</property>
<property name="maximum">
<layout class="QVBoxLayout" name="traceModeLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="sourcePortText">
<property name="minimumSize">
<size>
<width>12</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Source port number</string>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
<item>
<widget class="QComboBox" name="traceStream">
<property name="maximumSize">
<size>
<width>65</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Trace stream source</string>
</property>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QComboBox" name="traceMode">
<property name="maximumSize">
<size>
<width>65</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Trace mode</string>
</property>
<item>
<property name="text">
<string>TBD</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_16">
@ -1462,6 +1445,49 @@ kS/s</string>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="trigModeLayout">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QComboBox" name="trigStream">
<property name="maximumSize">
<size>
<width>65</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Trigger stream source</string>
</property>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QComboBox" name="trigMode">
<property name="maximumSize">
<size>
<width>65</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Trigger mode</string>
</property>
<item>
<property name="text">
<string>TBD</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_10">
<property name="orientation">
@ -1469,24 +1495,6 @@ kS/s</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="trigMode">
<property name="maximumSize">
<size>
<width>65</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Trigger mode</string>
</property>
<item>
<property name="text">
<string>TBD</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QDial" name="trigCount">
<property name="maximumSize">

View File

@ -22,7 +22,7 @@
#include <QFont>
#include <QString>
#include <QList>
#include "physicalunit.h"
#include "dsp/physicalunit.h"
#include "export.h"
class SDRGUI_API ScaleEngine {

View File

@ -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

View File

@ -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:
</div>
<div id="generator">
<div class="content">
Generated 2021-05-18T01:26:07.311+02:00
Generated 2021-05-29T00:16:39.973+02:00
</div>
</div>
</div>

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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;