API: added histogram and waterfall markers to spectrum settings

pull/1108/head
f4exb 2022-01-15 19:19:47 +01:00
rodzic 37d08034b7
commit 9a16afd744
16 zmienionych plików z 1080 dodań i 229 usunięć

Wyświetl plik

@ -224,6 +224,38 @@ void SpectrumSettings::formatTo(SWGSDRangel::SWGObject *swgObject) const
swgSpectrum->setDisplayWaterfall(m_displayWaterfall ? 1 : 0);
swgSpectrum->setDisplayGrid(m_displayGrid ? 1 : 0);
swgSpectrum->setDisplayGridIntensity(m_displayGridIntensity);
swgSpectrum->setSsb(m_ssb ? 1 : 0);
swgSpectrum->setUsb(m_usb ? 1 : 0);
swgSpectrum->setWaterfallShare(m_waterfallShare);
if (m_histogramMarkers.size() > 0)
{
swgSpectrum->setHistogramMarkers(new QList<SWGSDRangel::SWGSpectrumHistogramMarker *>);
for (const auto &marker : m_histogramMarkers)
{
swgSpectrum->getHistogramMarkers()->append(new SWGSDRangel::SWGSpectrumHistogramMarker);
swgSpectrum->getHistogramMarkers()->back()->setFrequency(marker.m_frequency);
swgSpectrum->getHistogramMarkers()->back()->setPower(marker.m_power);
swgSpectrum->getHistogramMarkers()->back()->setMarkerType((int) marker.m_markerType);
swgSpectrum->getHistogramMarkers()->back()->setMarkerColor(qColorToInt(marker.m_markerColor));
swgSpectrum->getHistogramMarkers()->back()->setShow(marker.m_show ? 1 : 0);
}
}
if (m_waterfallMarkers.size() > 0)
{
swgSpectrum->setWaterfallMarkers(new QList<SWGSDRangel::SWGSpectrumWaterfallMarker *>);
for (const auto &marker : m_waterfallMarkers)
{
swgSpectrum->getWaterfallMarkers()->append(new SWGSDRangel::SWGSpectrumWaterfallMarker);
swgSpectrum->getWaterfallMarkers()->back()->setFrequency(marker.m_frequency);
swgSpectrum->getWaterfallMarkers()->back()->setTime(marker.m_time);
swgSpectrum->getWaterfallMarkers()->back()->setMarkerColor(qColorToInt(marker.m_markerColor));
swgSpectrum->getWaterfallMarkers()->back()->setShow(marker.m_show ? 1 : 0);
}
}
}
void SpectrumSettings::updateFrom(const QStringList& keys, const SWGSDRangel::SWGObject *swgObject)
@ -305,6 +337,46 @@ void SpectrumSettings::updateFrom(const QStringList& keys, const SWGSDRangel::SW
if (keys.contains("spectrumConfig.displayGridIntensity")) {
m_displayGridIntensity = swgSpectrum->getDisplayGridIntensity();
}
if (keys.contains("spectrumConfig.ssb")) {
m_ssb = swgSpectrum->getSsb() != 0;
}
if (keys.contains("spectrumConfig.usb")) {
m_usb = swgSpectrum->getUsb() != 0;
}
if (keys.contains("spectrumConfig.waterfallShare")) {
m_waterfallShare = swgSpectrum->getWaterfallShare();
}
if (keys.contains("spectrumConfig.histogramMarkers"))
{
QList<SWGSDRangel::SWGSpectrumHistogramMarker *> *swgHistogramMarkers = swgSpectrum->getHistogramMarkers();
m_histogramMarkers.clear();
for (const auto &swgHistogramMarker : *swgHistogramMarkers)
{
m_histogramMarkers.push_back(SpectrumHistogramMarker());
m_histogramMarkers.back().m_frequency = swgHistogramMarker->getFrequency();
m_histogramMarkers.back().m_power = swgHistogramMarker->getPower();
m_histogramMarkers.back().m_markerType = (SpectrumHistogramMarker::SpectrumMarkerType) swgHistogramMarker->getMarkerType();
m_histogramMarkers.back().m_markerColor = intToQColor(swgHistogramMarker->getMarkerColor());
m_histogramMarkers.back().m_show = swgHistogramMarker->getShow() != 0;
}
}
if (keys.contains("spectrumConfig.waterfallMarkers"))
{
QList<SWGSDRangel::SWGSpectrumWaterfallMarker *> *swgWaterfallMarkers = swgSpectrum->getWaterfallMarkers();
m_waterfallMarkers.clear();
for (const auto &swgWaterfallMarker : *swgWaterfallMarkers)
{
m_waterfallMarkers.push_back(SpectrumWaterfallMarker());
m_waterfallMarkers.back().m_frequency = swgWaterfallMarker->getFrequency();
m_waterfallMarkers.back().m_time = swgWaterfallMarker->getTime();
m_waterfallMarkers.back().m_markerColor = intToQColor(swgWaterfallMarker->getMarkerColor());
m_waterfallMarkers.back().m_show = swgWaterfallMarker->getShow() != 0;
}
}
}
int SpectrumSettings::getAveragingMaxScale(AveragingMode averagingMode)
@ -381,3 +453,17 @@ uint64_t SpectrumSettings::getMaxAveragingValue(int fftSize, AveragingMode avera
return (1<<20); // fixed 1 MS
}
}
int SpectrumSettings::qColorToInt(const QColor& color)
{
return 256*256*color.blue() + 256*color.green() + color.red();
}
QColor SpectrumSettings::intToQColor(int intColor)
{
int r = intColor % 256;
int bg = intColor / 256;
int g = bg % 256;
int b = bg / 256;
return QColor(r, g, b);
}

Wyświetl plik

@ -92,6 +92,10 @@ public:
static int getAveragingValue(int averagingIndex, AveragingMode averagingMode);
static int getAveragingIndex(int averagingValue, AveragingMode averagingMode);
static uint64_t getMaxAveragingValue(int fftSize, AveragingMode averagingMode);
private:
static int qColorToInt(const QColor& color);
static QColor intToQColor(int intColor);
};
#endif // SDRBASE_DSP_SPECTRUMSETTNGS_H

Wyświetl plik

@ -1040,36 +1040,7 @@ int SpectrumVis::webapiSpectrumServerDelete(SWGSDRangel::SWGSuccessResponse& res
void SpectrumVis::webapiFormatSpectrumSettings(SWGSDRangel::SWGGLSpectrum& response, const SpectrumSettings& settings)
{
response.setFftSize(settings.m_fftSize);
response.setFftOverlap(settings.m_fftOverlap);
response.setFftWindow((int) settings.m_fftWindow);
response.setRefLevel(settings.m_refLevel);
response.setPowerRange(settings.m_powerRange);
response.setFpsPeriodMs(settings.m_fpsPeriodMs);
response.setDecay(settings.m_decay);
response.setDecayDivisor(settings.m_decayDivisor);
response.setHistogramStroke(settings.m_histogramStroke);
response.setDisplayGridIntensity(settings.m_displayGridIntensity);
response.setDisplayTraceIntensity(settings.m_displayTraceIntensity);
response.setDisplayWaterfall(settings.m_displayWaterfall ? 1 : 0);
response.setInvertedWaterfall(settings.m_invertedWaterfall ? 1 : 0);
response.setWaterfallShare(settings.m_waterfallShare);
response.setDisplayMaxHold(settings.m_displayMaxHold ? 1 : 0);
response.setDisplayCurrent(settings.m_displayCurrent ? 1 : 0);
response.setDisplayHistogram(settings.m_displayHistogram ? 1 : 0);
response.setDisplayGrid(settings.m_displayGrid ? 1 : 0);
response.setAveragingMode((int) settings.m_averagingMode);
response.setAveragingValue(SpectrumSettings::getAveragingValue(settings.m_averagingIndex, settings.m_averagingMode));
response.setLinear(settings.m_linear ? 1 : 0);
response.setSsb(settings.m_ssb ? 1 : 0);
response.setUsb(settings.m_usb ? 1 : 0);
response.setWsSpectrumPort(settings.m_wsSpectrumPort);
if (response.getWsSpectrumAddress()) {
*response.getWsSpectrumAddress() = settings.m_wsSpectrumAddress;
} else {
response.setWsSpectrumAddress(new QString(settings.m_wsSpectrumAddress));
}
settings.formatTo(&response);
}
void SpectrumVis::webapiUpdateSpectrumSettings(
@ -1077,82 +1048,11 @@ void SpectrumVis::webapiUpdateSpectrumSettings(
const QStringList& spectrumSettingsKeys,
SWGSDRangel::SWGGLSpectrum& response)
{
if (spectrumSettingsKeys.contains("fftSize")) {
settings.m_fftSize = response.getFftSize();
}
if (spectrumSettingsKeys.contains("fftOverlap")) {
settings.m_fftOverlap = response.getFftOverlap();
}
if (spectrumSettingsKeys.contains("fftWindow")) {
settings.m_fftWindow = (FFTWindow::Function) response.getFftWindow();
}
if (spectrumSettingsKeys.contains("refLevel")) {
settings.m_refLevel = response.getRefLevel();
}
if (spectrumSettingsKeys.contains("powerRange")) {
settings.m_powerRange = response.getPowerRange();
}
if (spectrumSettingsKeys.contains("fpsPeriodMs")) {
settings.m_fpsPeriodMs = response.getFpsPeriodMs();
}
if (spectrumSettingsKeys.contains("decay")) {
settings.m_decay = response.getDecay();
}
if (spectrumSettingsKeys.contains("decayDivisor")) {
settings.m_decayDivisor = response.getDecayDivisor();
}
if (spectrumSettingsKeys.contains("histogramStroke")) {
settings.m_histogramStroke = response.getHistogramStroke();
}
if (spectrumSettingsKeys.contains("displayGridIntensity")) {
settings.m_displayGridIntensity = response.getDisplayGridIntensity();
}
if (spectrumSettingsKeys.contains("displayTraceIntensity")) {
settings.m_displayTraceIntensity = response.getDisplayTraceIntensity();
}
if (spectrumSettingsKeys.contains("displayWaterfall")) {
settings.m_displayWaterfall = response.getDisplayWaterfall() != 0;
}
if (spectrumSettingsKeys.contains("invertedWaterfall")) {
settings.m_invertedWaterfall = response.getInvertedWaterfall() != 0;
}
if (spectrumSettingsKeys.contains("waterfallShare")) {
settings.m_waterfallShare = response.getWaterfallShare();
}
if (spectrumSettingsKeys.contains("displayMaxHold")) {
settings.m_displayMaxHold = response.getDisplayMaxHold() != 0;
}
if (spectrumSettingsKeys.contains("displayCurrent")) {
settings.m_displayCurrent = response.getDisplayCurrent() != 0;
}
if (spectrumSettingsKeys.contains("displayHistogram")) {
settings.m_displayHistogram = response.getDisplayHistogram() != 0;
}
if (spectrumSettingsKeys.contains("displayGrid")) {
settings.m_displayGrid = response.getDisplayGrid() != 0;
}
if (spectrumSettingsKeys.contains("averagingMode")) {
settings.m_averagingMode = (SpectrumSettings::AveragingMode) response.getAveragingMode();
}
if (spectrumSettingsKeys.contains("averagingValue"))
{
qint32 tmp = response.getAveragingValue();
settings.m_averagingIndex = SpectrumSettings::getAveragingIndex(tmp, settings.m_averagingMode);
settings.m_averagingValue = SpectrumSettings::getAveragingValue(settings.m_averagingIndex, settings.m_averagingMode);
}
if (spectrumSettingsKeys.contains("linear")) {
settings.m_linear = response.getLinear() != 0;
}
if (spectrumSettingsKeys.contains("ssb")) {
settings.m_ssb = response.getSsb() != 0;
}
if (spectrumSettingsKeys.contains("usb")) {
settings.m_usb = response.getUsb() != 0;
}
if (spectrumSettingsKeys.contains("wsSpectrumAddress")) {
settings.m_wsSpectrumAddress = *response.getWsSpectrumAddress();
}
if (spectrumSettingsKeys.contains("wsSpectrumPort")) {
settings.m_wsSpectrumPort = response.getWsSpectrumPort();
QStringList prefixedKeys;
for (const auto &key : spectrumSettingsKeys) {
prefixedKeys.append(tr("spectrumConfig.%1").arg(key));
}
settings.updateFrom(prefixedKeys, &response);
}

Wyświetl plik

@ -6150,6 +6150,18 @@ margin-bottom: 20px;
"wsSpectrumPort" : {
"type" : "integer",
"description" : "port on which the websocket server is listening"
},
"histogramMarkers" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/SpectrumHistogramMarker"
}
},
"waterfallMarkers" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/SpectrumWaterfallMarker"
}
}
},
"description" : "GLSpectrumGUI settings"
@ -11770,6 +11782,32 @@ margin-bottom: 20px;
}
},
"description" : "SoapySDR"
};
defs.SpectrumHistogramMarker = {
"properties" : {
"frequency" : {
"type" : "number",
"format" : "float"
},
"power" : {
"type" : "number",
"format" : "float",
"description" : "Fixed power mark"
},
"markerType" : {
"type" : "integer",
"description" : "Marker type\n * 0 - Fixed power\n * 1 - Current power\n * 2 - Max power\n"
},
"markerColor" : {
"type" : "integer",
"description" : "Color in 8 bit RGB serie"
},
"show" : {
"type" : "integer",
"description" : "Boolean - Marker display state\n * 0 - Hidden\n * 1 - Visible\n"
}
},
"description" : "Spectrum histogram marker settings"
};
defs.SpectrumServer = {
"properties" : {
@ -11802,6 +11840,28 @@ margin-bottom: 20px;
"type" : "integer"
}
}
};
defs.SpectrumWaterfallMarker = {
"properties" : {
"frequency" : {
"type" : "number",
"format" : "float"
},
"time" : {
"type" : "number",
"format" : "float",
"description" : "Time shift in seconds"
},
"markerColor" : {
"type" : "integer",
"description" : "Color in 8 bit RGB serie"
},
"show" : {
"type" : "integer",
"description" : "Boolean - Marker display state\n * 0 - Hidden\n * 1 - Visible\n"
}
},
"description" : "Spectrum waterfall marker settings"
};
defs.StarTrackerActions = {
"properties" : {
@ -51883,7 +51943,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2022-01-09T04:50:11.883+01:00
Generated 2022-01-15T03:12:23.419+01:00
</div>
</div>
</div>

Wyświetl plik

@ -1,3 +1,50 @@
SpectrumHistogramMarker:
description: Spectrum histogram marker settings
properties:
frequency:
type: number
format: float
power:
type: number
format: float
description: Fixed power mark
markerType:
type: integer
description: >
Marker type
* 0 - Fixed power
* 1 - Current power
* 2 - Max power
markerColor:
type: integer
description: Color in 8 bit RGB serie
show:
type: integer
description: >
Boolean - Marker display state
* 0 - Hidden
* 1 - Visible
SpectrumWaterfallMarker:
description: Spectrum waterfall marker settings
properties:
frequency:
type: number
format: float
time:
type: number
format: float
description: Time shift in seconds
markerColor:
type: integer
description: Color in 8 bit RGB serie
show:
type: integer
description: >
Boolean - Marker display state
* 0 - Hidden
* 1 - Visible
GLSpectrum:
description: GLSpectrumGUI settings
properties:
@ -74,3 +121,11 @@ GLSpectrum:
wsSpectrumPort:
description: port on which the websocket server is listening
type: integer
histogramMarkers:
type: array
items:
$ref: "/doc/swagger/include/GLSpectrum.yaml#/SpectrumHistogramMarker"
waterfallMarkers:
type: array
items:
$ref: "/doc/swagger/include/GLSpectrum.yaml#/SpectrumWaterfallMarker"

Wyświetl plik

@ -3709,126 +3709,129 @@ bool WebAPIRequestMapper::validateLimeRFEConfig(SWGSDRangel::SWGLimeRFESettings&
bool WebAPIRequestMapper::validateSpectrumSettings(SWGSDRangel::SWGGLSpectrum& spectrumSettings, QJsonObject& jsonObject, QStringList& spectrumSettingsKeys)
{
if (jsonObject.contains("fftSize"))
{
spectrumSettings.setFftSize(jsonObject["fftSize"].toInt(1024));
spectrumSettingsKeys.append("fftSize");
}
if (jsonObject.contains("fftOverlap"))
{
spectrumSettings.setFftOverlap(jsonObject["fftOverlap"].toInt(0));
spectrumSettingsKeys.append("fftOverlap");
}
if (jsonObject.contains("fftWindow"))
{
spectrumSettings.setFftWindow(jsonObject["fftWindow"].toInt(0));
spectrumSettingsKeys.append("fftWindow");
}
if (jsonObject.contains("refLevel"))
{
spectrumSettings.setRefLevel(jsonObject["refLevel"].toDouble(0.0));
spectrumSettingsKeys.append("refLevel");
}
if (jsonObject.contains("powerRange"))
{
spectrumSettings.setPowerRange(jsonObject["powerRange"].toDouble(100.0));
spectrumSettingsKeys.append("powerRange");
}
if (jsonObject.contains("fpsPeriodMs"))
{
spectrumSettings.setFpsPeriodMs(jsonObject["fpsPeriodMs"].toInt(50));
spectrumSettingsKeys.append("fpsPeriodMs");
}
if (jsonObject.contains("displayWaterfall"))
{
spectrumSettings.setDisplayWaterfall(jsonObject["displayWaterfall"].toInt(0));
spectrumSettingsKeys.append("displayWaterfall");
}
if (jsonObject.contains("invertedWaterfall"))
{
spectrumSettings.setInvertedWaterfall(jsonObject["invertedWaterfall"].toInt(0));
spectrumSettingsKeys.append("invertedWaterfall");
}
if (jsonObject.contains("displayHistogram"))
{
spectrumSettings.setDisplayHistogram(jsonObject["displayHistogram"].toInt(0));
spectrumSettingsKeys.append("displayHistogram");
}
if (jsonObject.contains("decay"))
{
spectrumSettings.setDecay(jsonObject["decay"].toInt(1));
spectrumSettingsKeys.append("decay");
}
if (jsonObject.contains("displayGrid"))
{
spectrumSettings.setDisplayGrid(jsonObject["displayGrid"].toInt(0));
spectrumSettingsKeys.append("displayGrid");
}
if (jsonObject.contains("displayGridIntensity"))
{
spectrumSettings.setDisplayGridIntensity(jsonObject["displayGridIntensity"].toInt(30));
spectrumSettingsKeys.append("displayGridIntensity");
}
if (jsonObject.contains("decayDivisor"))
{
spectrumSettings.setDecayDivisor(jsonObject["decayDivisor"].toInt(1));
spectrumSettingsKeys.append("decayDivisor");
}
if (jsonObject.contains("histogramStroke"))
{
spectrumSettings.setHistogramStroke(jsonObject["histogramStroke"].toInt(10));
spectrumSettingsKeys.append("histogramStroke");
}
if (jsonObject.contains("displayCurrent"))
{
spectrumSettings.setDisplayCurrent(jsonObject["displayCurrent"].toInt(1));
spectrumSettingsKeys.append("displayCurrent");
}
if (jsonObject.contains("displayTraceIntensity"))
{
spectrumSettings.setDisplayTraceIntensity(jsonObject["displayTraceIntensity"].toInt(50));
spectrumSettingsKeys.append("displayTraceIntensity");
}
if (jsonObject.contains("waterfallShare"))
{
spectrumSettings.setWaterfallShare(jsonObject["waterfallShare"].toDouble(0.5));
spectrumSettingsKeys.append("waterfallShare");
}
if (jsonObject.contains("averagingMode"))
{
spectrumSettings.setAveragingMode(jsonObject["averagingMode"].toInt(0));
spectrumSettingsKeys.append("averagingMode");
}
if (jsonObject.contains("averagingValue"))
{
spectrumSettings.setAveragingValue(jsonObject["averagingValue"].toInt(0));
spectrumSettingsKeys.append("averagingValue");
}
if (jsonObject.contains("linear"))
{
spectrumSettings.setLinear(jsonObject["linear"].toInt(0));
spectrumSettingsKeys.append("linear");
}
if (jsonObject.contains("ssb"))
{
spectrumSettings.setSsb(jsonObject["ssb"].toInt(0));
spectrumSettingsKeys.append("ssb");
}
if (jsonObject.contains("usb"))
{
spectrumSettings.setUsb(jsonObject["usb"].toInt(1));
spectrumSettingsKeys.append("usb");
}
if (jsonObject.contains("wsSpectrumAddress") && jsonObject["wsSpectrumAddress"].isString())
{
spectrumSettings.setWsSpectrumAddress(new QString(jsonObject["wsSpectrumAddress"].toString()));
spectrumSettingsKeys.append("wsSpectrumAddress");
}
if (jsonObject.contains("wsSpectrumPort"))
{
spectrumSettings.setWsSpectrumPort(jsonObject["wsSpectrumPort"].toInt(8887));
spectrumSettingsKeys.append("wsSpectrumPort");
}
extractKeys(jsonObject, spectrumSettingsKeys);
spectrumSettings.init();
spectrumSettings.fromJsonObject(jsonObject);
// if (jsonObject.contains("fftSize"))
// {
// spectrumSettings.setFftSize(jsonObject["fftSize"].toInt(1024));
// spectrumSettingsKeys.append("fftSize");
// }
// if (jsonObject.contains("fftOverlap"))
// {
// spectrumSettings.setFftOverlap(jsonObject["fftOverlap"].toInt(0));
// spectrumSettingsKeys.append("fftOverlap");
// }
// if (jsonObject.contains("fftWindow"))
// {
// spectrumSettings.setFftWindow(jsonObject["fftWindow"].toInt(0));
// spectrumSettingsKeys.append("fftWindow");
// }
// if (jsonObject.contains("refLevel"))
// {
// spectrumSettings.setRefLevel(jsonObject["refLevel"].toDouble(0.0));
// spectrumSettingsKeys.append("refLevel");
// }
// if (jsonObject.contains("powerRange"))
// {
// spectrumSettings.setPowerRange(jsonObject["powerRange"].toDouble(100.0));
// spectrumSettingsKeys.append("powerRange");
// }
// if (jsonObject.contains("fpsPeriodMs"))
// {
// spectrumSettings.setFpsPeriodMs(jsonObject["fpsPeriodMs"].toInt(50));
// spectrumSettingsKeys.append("fpsPeriodMs");
// }
// if (jsonObject.contains("displayWaterfall"))
// {
// spectrumSettings.setDisplayWaterfall(jsonObject["displayWaterfall"].toInt(0));
// spectrumSettingsKeys.append("displayWaterfall");
// }
// if (jsonObject.contains("invertedWaterfall"))
// {
// spectrumSettings.setInvertedWaterfall(jsonObject["invertedWaterfall"].toInt(0));
// spectrumSettingsKeys.append("invertedWaterfall");
// }
// if (jsonObject.contains("displayHistogram"))
// {
// spectrumSettings.setDisplayHistogram(jsonObject["displayHistogram"].toInt(0));
// spectrumSettingsKeys.append("displayHistogram");
// }
// if (jsonObject.contains("decay"))
// {
// spectrumSettings.setDecay(jsonObject["decay"].toInt(1));
// spectrumSettingsKeys.append("decay");
// }
// if (jsonObject.contains("displayGrid"))
// {
// spectrumSettings.setDisplayGrid(jsonObject["displayGrid"].toInt(0));
// spectrumSettingsKeys.append("displayGrid");
// }
// if (jsonObject.contains("displayGridIntensity"))
// {
// spectrumSettings.setDisplayGridIntensity(jsonObject["displayGridIntensity"].toInt(30));
// spectrumSettingsKeys.append("displayGridIntensity");
// }
// if (jsonObject.contains("decayDivisor"))
// {
// spectrumSettings.setDecayDivisor(jsonObject["decayDivisor"].toInt(1));
// spectrumSettingsKeys.append("decayDivisor");
// }
// if (jsonObject.contains("histogramStroke"))
// {
// spectrumSettings.setHistogramStroke(jsonObject["histogramStroke"].toInt(10));
// spectrumSettingsKeys.append("histogramStroke");
// }
// if (jsonObject.contains("displayCurrent"))
// {
// spectrumSettings.setDisplayCurrent(jsonObject["displayCurrent"].toInt(1));
// spectrumSettingsKeys.append("displayCurrent");
// }
// if (jsonObject.contains("displayTraceIntensity"))
// {
// spectrumSettings.setDisplayTraceIntensity(jsonObject["displayTraceIntensity"].toInt(50));
// spectrumSettingsKeys.append("displayTraceIntensity");
// }
// if (jsonObject.contains("waterfallShare"))
// {
// spectrumSettings.setWaterfallShare(jsonObject["waterfallShare"].toDouble(0.5));
// spectrumSettingsKeys.append("waterfallShare");
// }
// if (jsonObject.contains("averagingMode"))
// {
// spectrumSettings.setAveragingMode(jsonObject["averagingMode"].toInt(0));
// spectrumSettingsKeys.append("averagingMode");
// }
// if (jsonObject.contains("averagingValue"))
// {
// spectrumSettings.setAveragingValue(jsonObject["averagingValue"].toInt(0));
// spectrumSettingsKeys.append("averagingValue");
// }
// if (jsonObject.contains("linear"))
// {
// spectrumSettings.setLinear(jsonObject["linear"].toInt(0));
// spectrumSettingsKeys.append("linear");
// }
// if (jsonObject.contains("ssb"))
// {
// spectrumSettings.setSsb(jsonObject["ssb"].toInt(0));
// spectrumSettingsKeys.append("ssb");
// }
// if (jsonObject.contains("usb"))
// {
// spectrumSettings.setUsb(jsonObject["usb"].toInt(1));
// spectrumSettingsKeys.append("usb");
// }
// if (jsonObject.contains("wsSpectrumAddress") && jsonObject["wsSpectrumAddress"].isString())
// {
// spectrumSettings.setWsSpectrumAddress(new QString(jsonObject["wsSpectrumAddress"].toString()));
// spectrumSettingsKeys.append("wsSpectrumAddress");
// }
// if (jsonObject.contains("wsSpectrumPort"))
// {
// spectrumSettings.setWsSpectrumPort(jsonObject["wsSpectrumPort"].toInt(8887));
// spectrumSettingsKeys.append("wsSpectrumPort");
// }
return true;
}

Wyświetl plik

@ -247,6 +247,9 @@ void GLSpectrumGUI::applySpectrumSettings()
m_glSpectrum->setPowerRange(powerRange);
m_glSpectrum->setFPSPeriodMs(m_settings.m_fpsPeriodMs);
m_glSpectrum->setLinear(m_settings.m_linear);
m_glSpectrum->setHistogramMarkers(m_settings.m_histogramMarkers);
m_glSpectrum->setWaterfallMarkers(m_settings.m_waterfallMarkers);
}
void GLSpectrumGUI::on_fftWindow_currentIndexChanged(int index)
@ -375,6 +378,11 @@ void GLSpectrumGUI::on_markers_clicked(bool checked)
connect(&markersDialog, SIGNAL(updateWaterfall()), this, SLOT(updateWaterfallMarkers()));
markersDialog.exec();
m_settings.m_histogramMarkers = m_glSpectrum->getHistogramMarkers();
m_settings.m_waterfallMarkers = m_glSpectrum->getWaterfallMarkers();
applySettings();
}
void GLSpectrumGUI::on_refLevel_valueChanged(int value)

Wyświetl plik

@ -1,3 +1,50 @@
SpectrumHistogramMarker:
description: Spectrum histogram marker settings
properties:
frequency:
type: number
format: float
power:
type: number
format: float
description: Fixed power mark
markerType:
type: integer
description: >
Marker type
* 0 - Fixed power
* 1 - Current power
* 2 - Max power
markerColor:
type: integer
description: Color in 8 bit RGB serie
show:
type: integer
description: >
Boolean - Marker display state
* 0 - Hidden
* 1 - Visible
SpectrumWaterfallMarker:
description: Spectrum waterfall marker settings
properties:
frequency:
type: number
format: float
time:
type: number
format: float
description: Time shift in seconds
markerColor:
type: integer
description: Color in 8 bit RGB serie
show:
type: integer
description: >
Boolean - Marker display state
* 0 - Hidden
* 1 - Visible
GLSpectrum:
description: GLSpectrumGUI settings
properties:
@ -74,3 +121,11 @@ GLSpectrum:
wsSpectrumPort:
description: port on which the websocket server is listening
type: integer
histogramMarkers:
type: array
items:
$ref: "http://swgserver:8081/api/swagger/include/GLSpectrum.yaml#/SpectrumHistogramMarker"
waterfallMarkers:
type: array
items:
$ref: "http://swgserver:8081/api/swagger/include/GLSpectrum.yaml#/SpectrumWaterfallMarker"

Wyświetl plik

@ -6150,6 +6150,18 @@ margin-bottom: 20px;
"wsSpectrumPort" : {
"type" : "integer",
"description" : "port on which the websocket server is listening"
},
"histogramMarkers" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/SpectrumHistogramMarker"
}
},
"waterfallMarkers" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/SpectrumWaterfallMarker"
}
}
},
"description" : "GLSpectrumGUI settings"
@ -11770,6 +11782,32 @@ margin-bottom: 20px;
}
},
"description" : "SoapySDR"
};
defs.SpectrumHistogramMarker = {
"properties" : {
"frequency" : {
"type" : "number",
"format" : "float"
},
"power" : {
"type" : "number",
"format" : "float",
"description" : "Fixed power mark"
},
"markerType" : {
"type" : "integer",
"description" : "Marker type\n * 0 - Fixed power\n * 1 - Current power\n * 2 - Max power\n"
},
"markerColor" : {
"type" : "integer",
"description" : "Color in 8 bit RGB serie"
},
"show" : {
"type" : "integer",
"description" : "Boolean - Marker display state\n * 0 - Hidden\n * 1 - Visible\n"
}
},
"description" : "Spectrum histogram marker settings"
};
defs.SpectrumServer = {
"properties" : {
@ -11802,6 +11840,28 @@ margin-bottom: 20px;
"type" : "integer"
}
}
};
defs.SpectrumWaterfallMarker = {
"properties" : {
"frequency" : {
"type" : "number",
"format" : "float"
},
"time" : {
"type" : "number",
"format" : "float",
"description" : "Time shift in seconds"
},
"markerColor" : {
"type" : "integer",
"description" : "Color in 8 bit RGB serie"
},
"show" : {
"type" : "integer",
"description" : "Boolean - Marker display state\n * 0 - Hidden\n * 1 - Visible\n"
}
},
"description" : "Spectrum waterfall marker settings"
};
defs.StarTrackerActions = {
"properties" : {
@ -51883,7 +51943,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2022-01-09T04:50:11.883+01:00
Generated 2022-01-15T03:12:23.419+01:00
</div>
</div>
</div>

Wyświetl plik

@ -80,6 +80,10 @@ SWGGLSpectrum::SWGGLSpectrum() {
m_ws_spectrum_address_isSet = false;
ws_spectrum_port = 0;
m_ws_spectrum_port_isSet = false;
histogram_markers = nullptr;
m_histogram_markers_isSet = false;
waterfall_markers = nullptr;
m_waterfall_markers_isSet = false;
}
SWGGLSpectrum::~SWGGLSpectrum() {
@ -140,6 +144,10 @@ SWGGLSpectrum::init() {
m_ws_spectrum_address_isSet = false;
ws_spectrum_port = 0;
m_ws_spectrum_port_isSet = false;
histogram_markers = new QList<SWGSpectrumHistogramMarker*>();
m_histogram_markers_isSet = false;
waterfall_markers = new QList<SWGSpectrumWaterfallMarker*>();
m_waterfall_markers_isSet = false;
}
void
@ -172,6 +180,20 @@ SWGGLSpectrum::cleanup() {
delete ws_spectrum_address;
}
if(histogram_markers != nullptr) {
auto arr = histogram_markers;
for(auto o: *arr) {
delete o;
}
delete histogram_markers;
}
if(waterfall_markers != nullptr) {
auto arr = waterfall_markers;
for(auto o: *arr) {
delete o;
}
delete waterfall_markers;
}
}
SWGGLSpectrum*
@ -237,6 +259,10 @@ SWGGLSpectrum::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&ws_spectrum_port, pJson["wsSpectrumPort"], "qint32", "");
::SWGSDRangel::setValue(&histogram_markers, pJson["histogramMarkers"], "QList", "SWGSpectrumHistogramMarker");
::SWGSDRangel::setValue(&waterfall_markers, pJson["waterfallMarkers"], "QList", "SWGSpectrumWaterfallMarker");
}
QString
@ -331,6 +357,12 @@ SWGGLSpectrum::asJsonObject() {
if(m_ws_spectrum_port_isSet){
obj->insert("wsSpectrumPort", QJsonValue(ws_spectrum_port));
}
if(histogram_markers && histogram_markers->size() > 0){
toJsonArray((QList<void*>*)histogram_markers, obj, "histogramMarkers", "SWGSpectrumHistogramMarker");
}
if(waterfall_markers && waterfall_markers->size() > 0){
toJsonArray((QList<void*>*)waterfall_markers, obj, "waterfallMarkers", "SWGSpectrumWaterfallMarker");
}
return obj;
}
@ -595,6 +627,26 @@ SWGGLSpectrum::setWsSpectrumPort(qint32 ws_spectrum_port) {
this->m_ws_spectrum_port_isSet = true;
}
QList<SWGSpectrumHistogramMarker*>*
SWGGLSpectrum::getHistogramMarkers() {
return histogram_markers;
}
void
SWGGLSpectrum::setHistogramMarkers(QList<SWGSpectrumHistogramMarker*>* histogram_markers) {
this->histogram_markers = histogram_markers;
this->m_histogram_markers_isSet = true;
}
QList<SWGSpectrumWaterfallMarker*>*
SWGGLSpectrum::getWaterfallMarkers() {
return waterfall_markers;
}
void
SWGGLSpectrum::setWaterfallMarkers(QList<SWGSpectrumWaterfallMarker*>* waterfall_markers) {
this->waterfall_markers = waterfall_markers;
this->m_waterfall_markers_isSet = true;
}
bool
SWGGLSpectrum::isSet(){
@ -678,6 +730,12 @@ SWGGLSpectrum::isSet(){
if(m_ws_spectrum_port_isSet){
isObjectUpdated = true; break;
}
if(histogram_markers && (histogram_markers->size() > 0)){
isObjectUpdated = true; break;
}
if(waterfall_markers && (waterfall_markers->size() > 0)){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}

Wyświetl plik

@ -22,6 +22,9 @@
#include <QJsonObject>
#include "SWGSpectrumHistogramMarker.h"
#include "SWGSpectrumWaterfallMarker.h"
#include <QList>
#include <QString>
#include "SWGObject.h"
@ -120,6 +123,12 @@ public:
qint32 getWsSpectrumPort();
void setWsSpectrumPort(qint32 ws_spectrum_port);
QList<SWGSpectrumHistogramMarker*>* getHistogramMarkers();
void setHistogramMarkers(QList<SWGSpectrumHistogramMarker*>* histogram_markers);
QList<SWGSpectrumWaterfallMarker*>* getWaterfallMarkers();
void setWaterfallMarkers(QList<SWGSpectrumWaterfallMarker*>* waterfall_markers);
virtual bool isSet() override;
@ -202,6 +211,12 @@ private:
qint32 ws_spectrum_port;
bool m_ws_spectrum_port_isSet;
QList<SWGSpectrumHistogramMarker*>* histogram_markers;
bool m_histogram_markers_isSet;
QList<SWGSpectrumWaterfallMarker*>* waterfall_markers;
bool m_waterfall_markers_isSet;
};
}

Wyświetl plik

@ -264,8 +264,10 @@
#include "SWGSoapySDRInputSettings.h"
#include "SWGSoapySDROutputSettings.h"
#include "SWGSoapySDRReport.h"
#include "SWGSpectrumHistogramMarker.h"
#include "SWGSpectrumServer.h"
#include "SWGSpectrumServer_clients.h"
#include "SWGSpectrumWaterfallMarker.h"
#include "SWGStarTrackerActions.h"
#include "SWGStarTrackerDisplayLoSSettings.h"
#include "SWGStarTrackerDisplayLoSSettings_2.h"
@ -1562,6 +1564,11 @@ namespace SWGSDRangel {
obj->init();
return obj;
}
if(QString("SWGSpectrumHistogramMarker").compare(type) == 0) {
SWGSpectrumHistogramMarker *obj = new SWGSpectrumHistogramMarker();
obj->init();
return obj;
}
if(QString("SWGSpectrumServer").compare(type) == 0) {
SWGSpectrumServer *obj = new SWGSpectrumServer();
obj->init();
@ -1572,6 +1579,11 @@ namespace SWGSDRangel {
obj->init();
return obj;
}
if(QString("SWGSpectrumWaterfallMarker").compare(type) == 0) {
SWGSpectrumWaterfallMarker *obj = new SWGSpectrumWaterfallMarker();
obj->init();
return obj;
}
if(QString("SWGStarTrackerActions").compare(type) == 0) {
SWGStarTrackerActions *obj = new SWGStarTrackerActions();
obj->init();

Wyświetl plik

@ -0,0 +1,200 @@
/**
* SDRangel
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
*
* OpenAPI spec version: 6.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
#include "SWGSpectrumHistogramMarker.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGSpectrumHistogramMarker::SWGSpectrumHistogramMarker(QString* json) {
init();
this->fromJson(*json);
}
SWGSpectrumHistogramMarker::SWGSpectrumHistogramMarker() {
frequency = 0.0f;
m_frequency_isSet = false;
power = 0.0f;
m_power_isSet = false;
marker_type = 0;
m_marker_type_isSet = false;
marker_color = 0;
m_marker_color_isSet = false;
show = 0;
m_show_isSet = false;
}
SWGSpectrumHistogramMarker::~SWGSpectrumHistogramMarker() {
this->cleanup();
}
void
SWGSpectrumHistogramMarker::init() {
frequency = 0.0f;
m_frequency_isSet = false;
power = 0.0f;
m_power_isSet = false;
marker_type = 0;
m_marker_type_isSet = false;
marker_color = 0;
m_marker_color_isSet = false;
show = 0;
m_show_isSet = false;
}
void
SWGSpectrumHistogramMarker::cleanup() {
}
SWGSpectrumHistogramMarker*
SWGSpectrumHistogramMarker::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGSpectrumHistogramMarker::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&frequency, pJson["frequency"], "float", "");
::SWGSDRangel::setValue(&power, pJson["power"], "float", "");
::SWGSDRangel::setValue(&marker_type, pJson["markerType"], "qint32", "");
::SWGSDRangel::setValue(&marker_color, pJson["markerColor"], "qint32", "");
::SWGSDRangel::setValue(&show, pJson["show"], "qint32", "");
}
QString
SWGSpectrumHistogramMarker::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGSpectrumHistogramMarker::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_frequency_isSet){
obj->insert("frequency", QJsonValue(frequency));
}
if(m_power_isSet){
obj->insert("power", QJsonValue(power));
}
if(m_marker_type_isSet){
obj->insert("markerType", QJsonValue(marker_type));
}
if(m_marker_color_isSet){
obj->insert("markerColor", QJsonValue(marker_color));
}
if(m_show_isSet){
obj->insert("show", QJsonValue(show));
}
return obj;
}
float
SWGSpectrumHistogramMarker::getFrequency() {
return frequency;
}
void
SWGSpectrumHistogramMarker::setFrequency(float frequency) {
this->frequency = frequency;
this->m_frequency_isSet = true;
}
float
SWGSpectrumHistogramMarker::getPower() {
return power;
}
void
SWGSpectrumHistogramMarker::setPower(float power) {
this->power = power;
this->m_power_isSet = true;
}
qint32
SWGSpectrumHistogramMarker::getMarkerType() {
return marker_type;
}
void
SWGSpectrumHistogramMarker::setMarkerType(qint32 marker_type) {
this->marker_type = marker_type;
this->m_marker_type_isSet = true;
}
qint32
SWGSpectrumHistogramMarker::getMarkerColor() {
return marker_color;
}
void
SWGSpectrumHistogramMarker::setMarkerColor(qint32 marker_color) {
this->marker_color = marker_color;
this->m_marker_color_isSet = true;
}
qint32
SWGSpectrumHistogramMarker::getShow() {
return show;
}
void
SWGSpectrumHistogramMarker::setShow(qint32 show) {
this->show = show;
this->m_show_isSet = true;
}
bool
SWGSpectrumHistogramMarker::isSet(){
bool isObjectUpdated = false;
do{
if(m_frequency_isSet){
isObjectUpdated = true; break;
}
if(m_power_isSet){
isObjectUpdated = true; break;
}
if(m_marker_type_isSet){
isObjectUpdated = true; break;
}
if(m_marker_color_isSet){
isObjectUpdated = true; break;
}
if(m_show_isSet){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}
}

Wyświetl plik

@ -0,0 +1,82 @@
/**
* SDRangel
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
*
* OpenAPI spec version: 6.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
/*
* SWGSpectrumHistogramMarker.h
*
* Spectrum histogram marker settings
*/
#ifndef SWGSpectrumHistogramMarker_H_
#define SWGSpectrumHistogramMarker_H_
#include <QJsonObject>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGSpectrumHistogramMarker: public SWGObject {
public:
SWGSpectrumHistogramMarker();
SWGSpectrumHistogramMarker(QString* json);
virtual ~SWGSpectrumHistogramMarker();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGSpectrumHistogramMarker* fromJson(QString &jsonString) override;
float getFrequency();
void setFrequency(float frequency);
float getPower();
void setPower(float power);
qint32 getMarkerType();
void setMarkerType(qint32 marker_type);
qint32 getMarkerColor();
void setMarkerColor(qint32 marker_color);
qint32 getShow();
void setShow(qint32 show);
virtual bool isSet() override;
private:
float frequency;
bool m_frequency_isSet;
float power;
bool m_power_isSet;
qint32 marker_type;
bool m_marker_type_isSet;
qint32 marker_color;
bool m_marker_color_isSet;
qint32 show;
bool m_show_isSet;
};
}
#endif /* SWGSpectrumHistogramMarker_H_ */

Wyświetl plik

@ -0,0 +1,177 @@
/**
* SDRangel
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
*
* OpenAPI spec version: 6.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
#include "SWGSpectrumWaterfallMarker.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGSpectrumWaterfallMarker::SWGSpectrumWaterfallMarker(QString* json) {
init();
this->fromJson(*json);
}
SWGSpectrumWaterfallMarker::SWGSpectrumWaterfallMarker() {
frequency = 0.0f;
m_frequency_isSet = false;
time = 0.0f;
m_time_isSet = false;
marker_color = 0;
m_marker_color_isSet = false;
show = 0;
m_show_isSet = false;
}
SWGSpectrumWaterfallMarker::~SWGSpectrumWaterfallMarker() {
this->cleanup();
}
void
SWGSpectrumWaterfallMarker::init() {
frequency = 0.0f;
m_frequency_isSet = false;
time = 0.0f;
m_time_isSet = false;
marker_color = 0;
m_marker_color_isSet = false;
show = 0;
m_show_isSet = false;
}
void
SWGSpectrumWaterfallMarker::cleanup() {
}
SWGSpectrumWaterfallMarker*
SWGSpectrumWaterfallMarker::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGSpectrumWaterfallMarker::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&frequency, pJson["frequency"], "float", "");
::SWGSDRangel::setValue(&time, pJson["time"], "float", "");
::SWGSDRangel::setValue(&marker_color, pJson["markerColor"], "qint32", "");
::SWGSDRangel::setValue(&show, pJson["show"], "qint32", "");
}
QString
SWGSpectrumWaterfallMarker::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGSpectrumWaterfallMarker::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_frequency_isSet){
obj->insert("frequency", QJsonValue(frequency));
}
if(m_time_isSet){
obj->insert("time", QJsonValue(time));
}
if(m_marker_color_isSet){
obj->insert("markerColor", QJsonValue(marker_color));
}
if(m_show_isSet){
obj->insert("show", QJsonValue(show));
}
return obj;
}
float
SWGSpectrumWaterfallMarker::getFrequency() {
return frequency;
}
void
SWGSpectrumWaterfallMarker::setFrequency(float frequency) {
this->frequency = frequency;
this->m_frequency_isSet = true;
}
float
SWGSpectrumWaterfallMarker::getTime() {
return time;
}
void
SWGSpectrumWaterfallMarker::setTime(float time) {
this->time = time;
this->m_time_isSet = true;
}
qint32
SWGSpectrumWaterfallMarker::getMarkerColor() {
return marker_color;
}
void
SWGSpectrumWaterfallMarker::setMarkerColor(qint32 marker_color) {
this->marker_color = marker_color;
this->m_marker_color_isSet = true;
}
qint32
SWGSpectrumWaterfallMarker::getShow() {
return show;
}
void
SWGSpectrumWaterfallMarker::setShow(qint32 show) {
this->show = show;
this->m_show_isSet = true;
}
bool
SWGSpectrumWaterfallMarker::isSet(){
bool isObjectUpdated = false;
do{
if(m_frequency_isSet){
isObjectUpdated = true; break;
}
if(m_time_isSet){
isObjectUpdated = true; break;
}
if(m_marker_color_isSet){
isObjectUpdated = true; break;
}
if(m_show_isSet){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}
}

Wyświetl plik

@ -0,0 +1,76 @@
/**
* SDRangel
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
*
* OpenAPI spec version: 6.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
/*
* SWGSpectrumWaterfallMarker.h
*
* Spectrum waterfall marker settings
*/
#ifndef SWGSpectrumWaterfallMarker_H_
#define SWGSpectrumWaterfallMarker_H_
#include <QJsonObject>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGSpectrumWaterfallMarker: public SWGObject {
public:
SWGSpectrumWaterfallMarker();
SWGSpectrumWaterfallMarker(QString* json);
virtual ~SWGSpectrumWaterfallMarker();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGSpectrumWaterfallMarker* fromJson(QString &jsonString) override;
float getFrequency();
void setFrequency(float frequency);
float getTime();
void setTime(float time);
qint32 getMarkerColor();
void setMarkerColor(qint32 marker_color);
qint32 getShow();
void setShow(qint32 show);
virtual bool isSet() override;
private:
float frequency;
bool m_frequency_isSet;
float time;
bool m_time_isSet;
qint32 marker_color;
bool m_marker_color_isSet;
qint32 show;
bool m_show_isSet;
};
}
#endif /* SWGSpectrumWaterfallMarker_H_ */