mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-03-22 20:28:58 -04:00
Spectrum: added markers display to API
This commit is contained in:
parent
c025ea47ee
commit
1305fa931f
@ -265,6 +265,7 @@ void SpectrumSettings::formatTo(SWGSDRangel::SWGObject *swgObject) const
|
||||
swgSpectrum->setSsb(m_ssb ? 1 : 0);
|
||||
swgSpectrum->setUsb(m_usb ? 1 : 0);
|
||||
swgSpectrum->setWaterfallShare(m_waterfallShare);
|
||||
swgSpectrum->setMarkersDisplay((int) m_markersDisplay);
|
||||
|
||||
if (m_histogramMarkers.size() > 0)
|
||||
{
|
||||
@ -398,6 +399,9 @@ void SpectrumSettings::updateFrom(const QStringList& keys, const SWGSDRangel::SW
|
||||
if (keys.contains("spectrumConfig.waterfallShare")) {
|
||||
m_waterfallShare = swgSpectrum->getWaterfallShare();
|
||||
}
|
||||
if (keys.contains("spectrumConfig.markersDisplay")) {
|
||||
m_markersDisplay = (SpectrumSettings::MarkersDisplay) swgSpectrum->getMarkersDisplay();
|
||||
}
|
||||
|
||||
if (keys.contains("spectrumConfig.histogramMarkers"))
|
||||
{
|
||||
|
@ -6151,6 +6151,10 @@ margin-bottom: 20px;
|
||||
"type" : "integer",
|
||||
"description" : "port on which the websocket server is listening"
|
||||
},
|
||||
"markersDisplay" : {
|
||||
"type" : "integer",
|
||||
"description" : "Display markers (SpectrumSettings::MarkersDisplay)\n * 0 - Mome\n * 1 - Spectrum markers (histogram and waterfall)\n * 2 - Spectrum annotation markers\n"
|
||||
},
|
||||
"histogramMarkers" : {
|
||||
"type" : "array",
|
||||
"items" : {
|
||||
@ -51969,7 +51973,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2022-01-21T22:15:59.334+01:00
|
||||
Generated 2022-01-22T07:01:26.727+01:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -140,6 +140,13 @@ GLSpectrum:
|
||||
wsSpectrumPort:
|
||||
description: port on which the websocket server is listening
|
||||
type: integer
|
||||
markersDisplay:
|
||||
type: integer
|
||||
description: >
|
||||
Display markers (SpectrumSettings::MarkersDisplay)
|
||||
* 0 - Mome
|
||||
* 1 - Spectrum markers (histogram and waterfall)
|
||||
* 2 - Spectrum annotation markers
|
||||
histogramMarkers:
|
||||
type: array
|
||||
items:
|
||||
|
@ -165,6 +165,7 @@ void WebAPIAdapterBase::webapiFormatPreset(
|
||||
swgSpectrumConfig->setAveragingMode((int) m_spectrumSettings.m_averagingMode);
|
||||
swgSpectrumConfig->setAveragingValue(SpectrumSettings::getAveragingValue(m_spectrumSettings.m_averagingIndex, m_spectrumSettings.m_averagingMode));
|
||||
swgSpectrumConfig->setLinear(m_spectrumSettings.m_linear ? 1 : 0);
|
||||
swgSpectrumConfig->setMarkersDisplay((int) m_spectrumSettings.m_markersDisplay);
|
||||
}
|
||||
|
||||
int nbChannels = preset.getChannelCount();
|
||||
@ -378,6 +379,9 @@ void WebAPIAdapterBase::webapiUpdatePreset(
|
||||
if (spectrumIt->contains("waterfallShare")) {
|
||||
spectrumSettings.m_waterfallShare = apiPreset->getSpectrumConfig()->getWaterfallShare();
|
||||
}
|
||||
if (spectrumIt->contains("markersDisplay")) {
|
||||
spectrumSettings.m_markersDisplay = (SpectrumSettings::MarkersDisplay) apiPreset->getSpectrumConfig()->getMarkersDisplay();
|
||||
}
|
||||
}
|
||||
|
||||
preset->setSpectrumConfig(spectrumSettings.serialize());
|
||||
|
@ -140,6 +140,13 @@ GLSpectrum:
|
||||
wsSpectrumPort:
|
||||
description: port on which the websocket server is listening
|
||||
type: integer
|
||||
markersDisplay:
|
||||
type: integer
|
||||
description: >
|
||||
Display markers (SpectrumSettings::MarkersDisplay)
|
||||
* 0 - Mome
|
||||
* 1 - Spectrum markers (histogram and waterfall)
|
||||
* 2 - Spectrum annotation markers
|
||||
histogramMarkers:
|
||||
type: array
|
||||
items:
|
||||
|
@ -6151,6 +6151,10 @@ margin-bottom: 20px;
|
||||
"type" : "integer",
|
||||
"description" : "port on which the websocket server is listening"
|
||||
},
|
||||
"markersDisplay" : {
|
||||
"type" : "integer",
|
||||
"description" : "Display markers (SpectrumSettings::MarkersDisplay)\n * 0 - Mome\n * 1 - Spectrum markers (histogram and waterfall)\n * 2 - Spectrum annotation markers\n"
|
||||
},
|
||||
"histogramMarkers" : {
|
||||
"type" : "array",
|
||||
"items" : {
|
||||
@ -51969,7 +51973,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2022-01-21T22:15:59.334+01:00
|
||||
Generated 2022-01-22T07:01:26.727+01:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -80,6 +80,8 @@ SWGGLSpectrum::SWGGLSpectrum() {
|
||||
m_ws_spectrum_address_isSet = false;
|
||||
ws_spectrum_port = 0;
|
||||
m_ws_spectrum_port_isSet = false;
|
||||
markers_display = 0;
|
||||
m_markers_display_isSet = false;
|
||||
histogram_markers = nullptr;
|
||||
m_histogram_markers_isSet = false;
|
||||
waterfall_markers = nullptr;
|
||||
@ -146,6 +148,8 @@ SWGGLSpectrum::init() {
|
||||
m_ws_spectrum_address_isSet = false;
|
||||
ws_spectrum_port = 0;
|
||||
m_ws_spectrum_port_isSet = false;
|
||||
markers_display = 0;
|
||||
m_markers_display_isSet = false;
|
||||
histogram_markers = new QList<SWGSpectrumHistogramMarker*>();
|
||||
m_histogram_markers_isSet = false;
|
||||
waterfall_markers = new QList<SWGSpectrumWaterfallMarker*>();
|
||||
@ -184,6 +188,7 @@ SWGGLSpectrum::cleanup() {
|
||||
delete ws_spectrum_address;
|
||||
}
|
||||
|
||||
|
||||
if(histogram_markers != nullptr) {
|
||||
auto arr = histogram_markers;
|
||||
for(auto o: *arr) {
|
||||
@ -270,6 +275,8 @@ SWGGLSpectrum::fromJsonObject(QJsonObject &pJson) {
|
||||
|
||||
::SWGSDRangel::setValue(&ws_spectrum_port, pJson["wsSpectrumPort"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&markers_display, pJson["markersDisplay"], "qint32", "");
|
||||
|
||||
|
||||
::SWGSDRangel::setValue(&histogram_markers, pJson["histogramMarkers"], "QList", "SWGSpectrumHistogramMarker");
|
||||
|
||||
@ -370,6 +377,9 @@ SWGGLSpectrum::asJsonObject() {
|
||||
if(m_ws_spectrum_port_isSet){
|
||||
obj->insert("wsSpectrumPort", QJsonValue(ws_spectrum_port));
|
||||
}
|
||||
if(m_markers_display_isSet){
|
||||
obj->insert("markersDisplay", QJsonValue(markers_display));
|
||||
}
|
||||
if(histogram_markers && histogram_markers->size() > 0){
|
||||
toJsonArray((QList<void*>*)histogram_markers, obj, "histogramMarkers", "SWGSpectrumHistogramMarker");
|
||||
}
|
||||
@ -643,6 +653,16 @@ SWGGLSpectrum::setWsSpectrumPort(qint32 ws_spectrum_port) {
|
||||
this->m_ws_spectrum_port_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGGLSpectrum::getMarkersDisplay() {
|
||||
return markers_display;
|
||||
}
|
||||
void
|
||||
SWGGLSpectrum::setMarkersDisplay(qint32 markers_display) {
|
||||
this->markers_display = markers_display;
|
||||
this->m_markers_display_isSet = true;
|
||||
}
|
||||
|
||||
QList<SWGSpectrumHistogramMarker*>*
|
||||
SWGGLSpectrum::getHistogramMarkers() {
|
||||
return histogram_markers;
|
||||
@ -756,6 +776,9 @@ SWGGLSpectrum::isSet(){
|
||||
if(m_ws_spectrum_port_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_markers_display_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(histogram_markers && (histogram_markers->size() > 0)){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
|
@ -124,6 +124,9 @@ public:
|
||||
qint32 getWsSpectrumPort();
|
||||
void setWsSpectrumPort(qint32 ws_spectrum_port);
|
||||
|
||||
qint32 getMarkersDisplay();
|
||||
void setMarkersDisplay(qint32 markers_display);
|
||||
|
||||
QList<SWGSpectrumHistogramMarker*>* getHistogramMarkers();
|
||||
void setHistogramMarkers(QList<SWGSpectrumHistogramMarker*>* histogram_markers);
|
||||
|
||||
@ -215,6 +218,9 @@ private:
|
||||
qint32 ws_spectrum_port;
|
||||
bool m_ws_spectrum_port_isSet;
|
||||
|
||||
qint32 markers_display;
|
||||
bool m_markers_display_isSet;
|
||||
|
||||
QList<SWGSpectrumHistogramMarker*>* histogram_markers;
|
||||
bool m_histogram_markers_isSet;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user