1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-21 23:55:13 -05:00

Implement serialize and deserialize to/from API in Serializable interface. Related changes and fixes

This commit is contained in:
f4exb 2021-12-01 00:20:14 +01:00
parent a8d81b1458
commit 2a9cc27a41
114 changed files with 1893 additions and 520 deletions

View File

@ -342,6 +342,12 @@ void Interferometer::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) { if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getInterferometerSettings()->getReverseApiChannelIndex(); settings.m_reverseAPIChannelIndex = response.getInterferometerSettings()->getReverseApiChannelIndex();
} }
if (settings.m_spectrumGUI && channelSettingsKeys.contains("spectrumConfig")) {
settings.m_spectrumGUI->updateFrom(channelSettingsKeys, response.getInterferometerSettings()->getSpectrumConfig());
}
if (settings.m_scopeGUI && channelSettingsKeys.contains("scopeConfig")) {
settings.m_scopeGUI->updateFrom(channelSettingsKeys, response.getInterferometerSettings()->getScopeConfig());
}
} }
void Interferometer::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const InterferometerSettings& settings) void Interferometer::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const InterferometerSettings& settings)
@ -367,6 +373,34 @@ void Interferometer::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings
response.getInterferometerSettings()->setReverseApiPort(settings.m_reverseAPIPort); response.getInterferometerSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getInterferometerSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex); response.getInterferometerSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getInterferometerSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex); response.getInterferometerSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
if (settings.m_spectrumGUI)
{
if (response.getInterferometerSettings()->getSpectrumConfig())
{
settings.m_spectrumGUI->formatTo(response.getInterferometerSettings()->getSpectrumConfig());
}
else
{
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
response.getInterferometerSettings()->setSpectrumConfig(swgGLSpectrum);
}
}
if (settings.m_scopeGUI)
{
if (response.getInterferometerSettings()->getScopeConfig())
{
settings.m_scopeGUI->formatTo(response.getInterferometerSettings()->getScopeConfig());
}
else
{
SWGSDRangel::SWGGLScope *swgGLScope = new SWGSDRangel::SWGGLScope();
settings.m_scopeGUI->formatTo(swgGLScope);
response.getInterferometerSettings()->setScopeConfig(swgGLScope);
}
}
} }
void Interferometer::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const InterferometerSettings& settings, bool force) void Interferometer::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const InterferometerSettings& settings, bool force)
@ -444,6 +478,20 @@ void Interferometer::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("filterChainHash") || force) { if (channelSettingsKeys.contains("filterChainHash") || force) {
swgInterferometerSettings->setFilterChainHash(settings.m_filterChainHash); swgInterferometerSettings->setFilterChainHash(settings.m_filterChainHash);
} }
if (settings.m_spectrumGUI)
{
if (channelSettingsKeys.contains("spectrumConfig") || force) {
settings.m_spectrumGUI->formatTo(swgInterferometerSettings->getSpectrumConfig());
}
}
if (settings.m_scopeGUI)
{
if (channelSettingsKeys.contains("scopeConfig") || force) {
settings.m_scopeGUI->formatTo(swgInterferometerSettings->getScopeConfig());
}
}
} }
void Interferometer::networkManagerFinished(QNetworkReply *reply) void Interferometer::networkManagerFinished(QNetworkReply *reply)

View File

@ -85,6 +85,8 @@ bool InterferometerGUI::handleMessage(const Message& message)
{ {
const Interferometer::MsgConfigureInterferometer& notif = (const Interferometer::MsgConfigureInterferometer&) message; const Interferometer::MsgConfigureInterferometer& notif = (const Interferometer::MsgConfigureInterferometer&) message;
m_settings = notif.getSettings(); m_settings = notif.getSettings();
ui->scopeGUI->updateSettings();
ui->spectrumGUI->updateSettings();
displaySettings(); displaySettings();
return true; return true;
} }

View File

@ -59,7 +59,7 @@ void InterferometerWebAPIAdapter::webapiFormatChannelSettings(
swgScope->setTime(scopeSettings.m_time); swgScope->setTime(scopeSettings.m_time);
swgScope->setTimeOfs(scopeSettings.m_timeOfs); swgScope->setTimeOfs(scopeSettings.m_timeOfs);
swgScope->setTraceIntensity(scopeSettings.m_traceIntensity); swgScope->setTraceIntensity(scopeSettings.m_traceIntensity);
swgScope->setTraceLen(scopeSettings.m_traceLen); swgScope->setTraceLenMult(scopeSettings.m_traceLenMult);
swgScope->setTrigPre(scopeSettings.m_trigPre); swgScope->setTrigPre(scopeSettings.m_trigPre);
// array of traces // array of traces
@ -178,8 +178,8 @@ void InterferometerWebAPIAdapter::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("scopeConfig.traceIntensity")) { if (channelSettingsKeys.contains("scopeConfig.traceIntensity")) {
scopeSettings.m_traceIntensity = response.getInterferometerSettings()->getScopeConfig()->getTraceIntensity(); scopeSettings.m_traceIntensity = response.getInterferometerSettings()->getScopeConfig()->getTraceIntensity();
} }
if (channelSettingsKeys.contains("scopeConfig.traceLen")) { if (channelSettingsKeys.contains("scopeConfig.traceLenMult")) {
scopeSettings.m_traceLen = response.getInterferometerSettings()->getScopeConfig()->getTraceLen(); scopeSettings.m_traceLenMult = response.getInterferometerSettings()->getScopeConfig()->getTraceLenMult();
} }
if (channelSettingsKeys.contains("scopeConfig.trigPre")) { if (channelSettingsKeys.contains("scopeConfig.trigPre")) {
scopeSettings.m_trigPre = response.getInterferometerSettings()->getScopeConfig()->getTrigPre(); scopeSettings.m_trigPre = response.getInterferometerSettings()->getScopeConfig()->getTrigPre();

View File

@ -70,84 +70,13 @@ void ChannelAnalyzerWebAPIAdapter::webapiFormatChannelSettings(
SWGSDRangel::SWGGLScope *swgScope = new SWGSDRangel::SWGGLScope(); SWGSDRangel::SWGGLScope *swgScope = new SWGSDRangel::SWGGLScope();
swgScope->init(); swgScope->init();
response.getChannelAnalyzerSettings()->setScopeConfig(swgScope); response.getChannelAnalyzerSettings()->setScopeConfig(swgScope);
swgScope->setDisplayMode(scopeSettings.m_displayMode); scopeSettings.formatTo(swgScope);
swgScope->setGridIntensity(scopeSettings.m_gridIntensity);
swgScope->setTime(scopeSettings.m_time);
swgScope->setTimeOfs(scopeSettings.m_timeOfs);
swgScope->setTraceIntensity(scopeSettings.m_traceIntensity);
swgScope->setTraceLen(scopeSettings.m_traceLen);
swgScope->setTrigPre(scopeSettings.m_trigPre);
// array of traces
swgScope->setTracesData(new QList<SWGSDRangel::SWGTraceData *>);
std::vector<GLScopeSettings::TraceData>::const_iterator traceIt = scopeSettings.m_tracesData.begin();
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()->setHasTextOverlay(traceIt->m_hasTextOverlay ? 1 : 0);
swgScope->getTracesData()->back()->setStreamIndex(traceIt->m_streamIndex);
swgScope->getTracesData()->back()->setOfs(traceIt->m_ofs);
swgScope->getTracesData()->back()->setProjectionType((int) traceIt->m_projectionType);
swgScope->getTracesData()->back()->setTextOverlay(new QString(traceIt->m_textOverlay));
swgScope->getTracesData()->back()->setTraceColor(qColorToInt(traceIt->m_traceColor));
swgScope->getTracesData()->back()->setTraceColorB(traceIt->m_traceColorB);
swgScope->getTracesData()->back()->setTraceColorG(traceIt->m_traceColorG);
swgScope->getTracesData()->back()->setTraceColorR(traceIt->m_traceColorR);
swgScope->getTracesData()->back()->setTraceDelay(traceIt->m_traceDelay);
swgScope->getTracesData()->back()->setTraceDelayCoarse(traceIt->m_traceDelayCoarse);
swgScope->getTracesData()->back()->setTraceDelayFine(traceIt->m_traceDelayFine);
swgScope->getTracesData()->back()->setTriggerDisplayLevel(traceIt->m_triggerDisplayLevel);
swgScope->getTracesData()->back()->setViewTrace(traceIt->m_viewTrace ? 1 : 0);
}
// array of triggers
swgScope->setTriggersData(new QList<SWGSDRangel::SWGTriggerData *>);
std::vector<GLScopeSettings::TriggerData>::const_iterator triggerIt = scopeSettings.m_triggersData.begin();
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);
swgScope->getTriggersData()->back()->setTriggerColor(qColorToInt(triggerIt->m_triggerColor));
swgScope->getTriggersData()->back()->setTriggerColorB(triggerIt->m_triggerColorB);
swgScope->getTriggersData()->back()->setTriggerColorG(triggerIt->m_triggerColorG);
swgScope->getTriggersData()->back()->setTriggerColorR(triggerIt->m_triggerColorR);
swgScope->getTriggersData()->back()->setTriggerDelay(triggerIt->m_triggerDelay);
swgScope->getTriggersData()->back()->setTriggerDelayCoarse(triggerIt->m_triggerDelayCoarse);
swgScope->getTriggersData()->back()->setTriggerDelayFine(triggerIt->m_triggerDelayFine);
swgScope->getTriggersData()->back()->setTriggerDelayMult(triggerIt->m_triggerDelayMult);
swgScope->getTriggersData()->back()->setTriggerHoldoff(triggerIt->m_triggerHoldoff ? 1 : 0);
swgScope->getTriggersData()->back()->setTriggerLevel(triggerIt->m_triggerLevel);
swgScope->getTriggersData()->back()->setTriggerLevelCoarse(triggerIt->m_triggerLevelCoarse);
swgScope->getTriggersData()->back()->setTriggerLevelFine(triggerIt->m_triggerLevelFine);
swgScope->getTriggersData()->back()->setTriggerPositiveEdge(triggerIt->m_triggerPositiveEdge ? 1 : 0);
swgScope->getTriggersData()->back()->setTriggerRepeat(triggerIt->m_triggerRepeat);
}
// spectrum // spectrum
SWGSDRangel::SWGGLSpectrum *swgSpectrum = new SWGSDRangel::SWGGLSpectrum(); SWGSDRangel::SWGGLSpectrum *swgSpectrum = new SWGSDRangel::SWGGLSpectrum();
swgSpectrum->init(); swgSpectrum->init();
response.getChannelAnalyzerSettings()->setSpectrumConfig(swgSpectrum); response.getChannelAnalyzerSettings()->setSpectrumConfig(swgSpectrum);
swgSpectrum->setAveragingMode((int) spectrumSettings.m_averagingMode); spectrumSettings.formatTo(swgSpectrum);
swgSpectrum->setAveragingValue(SpectrumSettings::getAveragingValue(spectrumSettings.m_averagingIndex, spectrumSettings.m_averagingMode));
swgSpectrum->setDecay(spectrumSettings.m_decay);
swgSpectrum->setDecayDivisor(spectrumSettings.m_decayDivisor);
swgSpectrum->setDisplayCurrent(spectrumSettings.m_displayCurrent ? 1 : 0);
swgSpectrum->setDisplayGrid(spectrumSettings.m_displayGrid ? 1 : 0);
swgSpectrum->setDisplayGridIntensity(spectrumSettings.m_displayGridIntensity);
swgSpectrum->setDisplayHistogram(spectrumSettings.m_displayHistogram ? 1 : 0);
swgSpectrum->setDisplayMaxHold(spectrumSettings.m_displayMaxHold ? 1 : 0);
swgSpectrum->setDisplayTraceIntensity(spectrumSettings.m_displayTraceIntensity);
swgSpectrum->setDisplayWaterfall(spectrumSettings.m_displayWaterfall ? 1 : 0);
swgSpectrum->setFftOverlap(spectrumSettings.m_fftOverlap);
swgSpectrum->setFftSize(spectrumSettings.m_fftSize);
swgSpectrum->setFpsPeriodMs(spectrumSettings.m_fpsPeriodMs);
} }
int ChannelAnalyzerWebAPIAdapter::webapiSettingsPutPatch( int ChannelAnalyzerWebAPIAdapter::webapiSettingsPutPatch(
@ -227,225 +156,11 @@ void ChannelAnalyzerWebAPIAdapter::webapiUpdateChannelSettings(
settings.m_title = *response.getChannelAnalyzerSettings()->getTitle(); settings.m_title = *response.getChannelAnalyzerSettings()->getTitle();
} }
// scope // scope
if (channelSettingsKeys.contains("scopeConfig")) if (channelSettingsKeys.contains("scopeConfig")) {
{ scopeSettings.updateFrom(channelSettingsKeys, response.getChannelAnalyzerSettings()->getScopeConfig());
if (channelSettingsKeys.contains("scopeConfig.displayMode")) {
scopeSettings.m_displayMode = (GLScopeSettings::DisplayMode) response.getChannelAnalyzerSettings()->getScopeConfig()->getDisplayMode();
}
if (channelSettingsKeys.contains("scopeConfig.gridIntensity")) {
scopeSettings.m_gridIntensity = response.getChannelAnalyzerSettings()->getScopeConfig()->getGridIntensity();
}
if (channelSettingsKeys.contains("scopeConfig.time")) {
scopeSettings.m_time = response.getChannelAnalyzerSettings()->getScopeConfig()->getTime();
}
if (channelSettingsKeys.contains("scopeConfig.timeOfs")) {
scopeSettings.m_timeOfs = response.getChannelAnalyzerSettings()->getScopeConfig()->getTimeOfs();
}
if (channelSettingsKeys.contains("scopeConfig.traceIntensity")) {
scopeSettings.m_traceIntensity = response.getChannelAnalyzerSettings()->getScopeConfig()->getTraceIntensity();
}
if (channelSettingsKeys.contains("scopeConfig.traceLen")) {
scopeSettings.m_traceLen = response.getChannelAnalyzerSettings()->getScopeConfig()->getTraceLen();
}
if (channelSettingsKeys.contains("scopeConfig.trigPre")) {
scopeSettings.m_trigPre = response.getChannelAnalyzerSettings()->getScopeConfig()->getTrigPre();
}
// traces
if (channelSettingsKeys.contains("scopeConfig.tracesData"))
{
QList<SWGSDRangel::SWGTraceData *> *tracesData = response.getChannelAnalyzerSettings()->getScopeConfig()->getTracesData();
scopeSettings.m_tracesData.clear();
for (int i = 0; i < 10; i++) // no more than 10 traces anyway
{
if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1]").arg(i)))
{
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();
}
if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].hasTextOverlay").arg(i))) {
scopeSettings.m_tracesData.back().m_hasTextOverlay = traceData->getHasTextOverlay() != 0;
}
if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].inputIndex").arg(i))) {
scopeSettings.m_tracesData.back().m_streamIndex = traceData->getStreamIndex();
}
if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].ofs").arg(i))) {
scopeSettings.m_tracesData.back().m_ofs = traceData->getOfs();
}
if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].projectionType").arg(i))) {
scopeSettings.m_tracesData.back().m_projectionType = (Projector::ProjectionType) traceData->getProjectionType();
}
if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].traceColor").arg(i))) {
scopeSettings.m_tracesData.back().m_traceColor = intToQColor(traceData->getTraceColor());
}
if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].traceColorB").arg(i))) {
scopeSettings.m_tracesData.back().m_traceColorB = traceData->getTraceColorB();
}
if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].traceColorG").arg(i))) {
scopeSettings.m_tracesData.back().m_traceColorG = traceData->getTraceColorG();
}
if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].traceColorR").arg(i))) {
scopeSettings.m_tracesData.back().m_traceColorR = traceData->getTraceColorR();
}
if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].traceDelay").arg(i))) {
scopeSettings.m_tracesData.back().m_traceDelay = traceData->getTraceDelay();
}
if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].traceDelayCoarse").arg(i))) {
scopeSettings.m_tracesData.back().m_traceDelayCoarse = traceData->getTraceDelayCoarse();
}
if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].traceDelayFine").arg(i))) {
scopeSettings.m_tracesData.back().m_traceDelayFine = traceData->getTraceDelayFine();
}
if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].triggerDisplayLevel").arg(i))) {
scopeSettings.m_tracesData.back().m_triggerDisplayLevel = traceData->getTriggerDisplayLevel();
}
if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].viewTrace").arg(i))) {
scopeSettings.m_tracesData.back().m_viewTrace = traceData->getViewTrace() != 0;
}
}
else
{
break;
}
}
}
// triggers
if (channelSettingsKeys.contains("scopeConfig.triggersData"))
{
QList<SWGSDRangel::SWGTriggerData *> *triggersData = response.getChannelAnalyzerSettings()->getScopeConfig()->getTriggersData();
scopeSettings.m_triggersData.clear();
for (int i = 0; i < 10; i++) // no more than 10 triggers anyway
{
if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1]").arg(i)))
{
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();
}
if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].projectionType").arg(i))) {
scopeSettings.m_triggersData.back().m_projectionType = (Projector::ProjectionType) triggerData->getProjectionType();
}
if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerBothEdges").arg(i))) {
scopeSettings.m_triggersData.back().m_triggerBothEdges = triggerData->getTriggerBothEdges() != 0;
}
if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].triggerColor").arg(i))) {
scopeSettings.m_tracesData.back().m_traceColor = intToQColor(triggerData->getTriggerColor());
}
if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerColorB").arg(i))) {
scopeSettings.m_triggersData.back().m_triggerColorB = triggerData->getTriggerColorB();
}
if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerColorG").arg(i))) {
scopeSettings.m_triggersData.back().m_triggerColorG = triggerData->getTriggerColorG();
}
if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerColorR").arg(i))) {
scopeSettings.m_triggersData.back().m_triggerColorR = triggerData->getTriggerColorR();
}
if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerDelay").arg(i))) {
scopeSettings.m_triggersData.back().m_triggerDelay = triggerData->getTriggerDelay();
}
if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerDelayCoarse").arg(i))) {
scopeSettings.m_triggersData.back().m_triggerDelayCoarse = triggerData->getTriggerDelayCoarse();
}
if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerDelayFine").arg(i))) {
scopeSettings.m_triggersData.back().m_triggerDelayFine = triggerData->getTriggerDelayFine();
}
if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerDelayMult").arg(i))) {
scopeSettings.m_triggersData.back().m_triggerDelayMult = triggerData->getTriggerDelayMult();
}
if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerHoldoff").arg(i))) {
scopeSettings.m_triggersData.back().m_triggerHoldoff = triggerData->getTriggerHoldoff();
}
if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerLevel").arg(i))) {
scopeSettings.m_triggersData.back().m_triggerLevel = triggerData->getTriggerLevel();
}
if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerLevelCoarse").arg(i))) {
scopeSettings.m_triggersData.back().m_triggerLevelCoarse = triggerData->getTriggerLevelCoarse();
}
if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerLevelFine").arg(i))) {
scopeSettings.m_triggersData.back().m_triggerLevelFine = triggerData->getTriggerLevelFine();
}
if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerPositiveEdge").arg(i))) {
scopeSettings.m_triggersData.back().m_triggerPositiveEdge = triggerData->getTriggerPositiveEdge() != 0;
}
if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerRepeat").arg(i))) {
scopeSettings.m_triggersData.back().m_triggerRepeat = triggerData->getTriggerRepeat() != 0;
}
}
}
}
} }
// spectrum // spectrum
if (channelSettingsKeys.contains("spectrumConfig")) if (channelSettingsKeys.contains("spectrumConfig")) {
{ spectrumSettings.updateFrom(channelSettingsKeys, response.getChannelAnalyzerSettings()->getSpectrumConfig());
if (channelSettingsKeys.contains("spectrumConfig.averagingMode")) {
spectrumSettings.m_averagingMode = (SpectrumSettings::AveragingMode) response.getChannelAnalyzerSettings()->getSpectrumConfig()->getAveragingMode();
}
if (channelSettingsKeys.contains("spectrumConfig.averagingValue"))
{
spectrumSettings.m_averagingValue = response.getChannelAnalyzerSettings()->getSpectrumConfig()->getAveragingValue();
spectrumSettings.m_averagingIndex = SpectrumSettings::getAveragingIndex(spectrumSettings.m_averagingValue, spectrumSettings.m_averagingMode);
}
if (channelSettingsKeys.contains("spectrumConfig.decay")) {
spectrumSettings.m_decay = response.getChannelAnalyzerSettings()->getSpectrumConfig()->getDecay();
}
if (channelSettingsKeys.contains("spectrumConfig.decayDivisor")) {
spectrumSettings.m_decayDivisor = response.getChannelAnalyzerSettings()->getSpectrumConfig()->getDecayDivisor();
}
if (channelSettingsKeys.contains("spectrumConfig.displayCurrent")) {
spectrumSettings.m_displayCurrent = response.getChannelAnalyzerSettings()->getSpectrumConfig()->getDisplayCurrent() != 0;
}
if (channelSettingsKeys.contains("spectrumConfig.displayGrid")) {
spectrumSettings.m_displayGrid = response.getChannelAnalyzerSettings()->getSpectrumConfig()->getDisplayGrid() != 0;
}
if (channelSettingsKeys.contains("spectrumConfig.displayGridIntensity")) {
spectrumSettings.m_displayGridIntensity = response.getChannelAnalyzerSettings()->getSpectrumConfig()->getDisplayGridIntensity();
}
if (channelSettingsKeys.contains("spectrumConfig.displayHistogram")) {
spectrumSettings.m_displayHistogram = response.getChannelAnalyzerSettings()->getSpectrumConfig()->getDisplayHistogram() != 0;
}
if (channelSettingsKeys.contains("spectrumConfig.displayMaxHold")) {
spectrumSettings.m_displayMaxHold = response.getChannelAnalyzerSettings()->getSpectrumConfig()->getDisplayMaxHold() != 0;
}
if (channelSettingsKeys.contains("spectrumConfig.displayTraceIntensity")) {
spectrumSettings.m_displayTraceIntensity = response.getChannelAnalyzerSettings()->getSpectrumConfig()->getDisplayTraceIntensity();
}
if (channelSettingsKeys.contains("spectrumConfig.displayWaterfall")) {
spectrumSettings.m_displayWaterfall = response.getChannelAnalyzerSettings()->getSpectrumConfig()->getDisplayWaterfall() != 0;
}
if (channelSettingsKeys.contains("spectrumConfig.fftOverlap")) {
spectrumSettings.m_fftOverlap = response.getChannelAnalyzerSettings()->getSpectrumConfig()->getFftOverlap();
}
if (channelSettingsKeys.contains("spectrumConfig.fftSize")) {
spectrumSettings.m_fftSize = response.getChannelAnalyzerSettings()->getSpectrumConfig()->getFftSize();
}
if (channelSettingsKeys.contains("spectrumConfig.fpsPeriodMs")) {
spectrumSettings.m_fpsPeriodMs = response.getChannelAnalyzerSettings()->getSpectrumConfig()->getFpsPeriodMs();
}
} }
} }
int ChannelAnalyzerWebAPIAdapter::qColorToInt(const QColor& color)
{
return 256*256*color.blue() + 256*color.green() + color.red();
}
QColor ChannelAnalyzerWebAPIAdapter::intToQColor(int intColor)
{
int r = intColor % 256;
int bg = intColor / 256;
int g = bg % 256;
int b = bg / 256;
return QColor(r, g, b);
}

View File

@ -61,9 +61,6 @@ private:
ChannelAnalyzerSettings m_settings; ChannelAnalyzerSettings m_settings;
GLScopeSettings m_glScopeSettings; GLScopeSettings m_glScopeSettings;
SpectrumSettings m_SpectrumSettings; SpectrumSettings m_SpectrumSettings;
static int qColorToInt(const QColor& color);
static QColor intToQColor(int intColor);
}; };
#endif // INCLUDE_CHANALYZER_WEBAPIADAPTER_H #endif // INCLUDE_CHANALYZER_WEBAPIADAPTER_H

View File

@ -345,6 +345,9 @@ void BFMDemod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) { if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getBfmDemodSettings()->getReverseApiChannelIndex(); settings.m_reverseAPIChannelIndex = response.getBfmDemodSettings()->getReverseApiChannelIndex();
} }
if (settings.m_spectrumGUI && channelSettingsKeys.contains("spectrumConfig")) {
settings.m_spectrumGUI->updateFrom(channelSettingsKeys, response.getBfmDemodSettings()->getSpectrumConfig());
}
} }
int BFMDemod::webapiReportGet( int BFMDemod::webapiReportGet(
@ -395,6 +398,20 @@ void BFMDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp
response.getBfmDemodSettings()->setReverseApiPort(settings.m_reverseAPIPort); response.getBfmDemodSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getBfmDemodSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex); response.getBfmDemodSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getBfmDemodSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex); response.getBfmDemodSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
if (settings.m_spectrumGUI)
{
if (response.getBfmDemodSettings()->getSpectrumConfig())
{
settings.m_spectrumGUI->formatTo(response.getBfmDemodSettings()->getSpectrumConfig());
}
else
{
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
response.getBfmDemodSettings()->setSpectrumConfig(swgGLSpectrum);
}
}
} }
void BFMDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response) void BFMDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
@ -551,6 +568,12 @@ void BFMDemod::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("streamIndex") || force) { if (channelSettingsKeys.contains("streamIndex") || force) {
swgBFMDemodSettings->setStreamIndex(settings.m_streamIndex); swgBFMDemodSettings->setStreamIndex(settings.m_streamIndex);
} }
if (settings.m_spectrumGUI && (channelSettingsKeys.contains("spectrunConfig") || force))
{
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
swgBFMDemodSettings->setSpectrumConfig(swgGLSpectrum);
}
} }
void BFMDemod::networkManagerFinished(QNetworkReply *reply) void BFMDemod::networkManagerFinished(QNetworkReply *reply)

View File

@ -104,6 +104,7 @@ bool BFMDemodGUI::handleMessage(const Message& message)
const BFMDemod::MsgConfigureBFMDemod& cfg = (BFMDemod::MsgConfigureBFMDemod&) message; const BFMDemod::MsgConfigureBFMDemod& cfg = (BFMDemod::MsgConfigureBFMDemod&) message;
m_settings = cfg.getSettings(); m_settings = cfg.getSettings();
blockApplySettings(true); blockApplySettings(true);
ui->spectrumGUI->updateSettings();
displaySettings(); displaySettings();
blockApplySettings(false); blockApplySettings(false);
return true; return true;

View File

@ -590,6 +590,9 @@ void ChirpChatDemod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) { if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getChirpChatDemodSettings()->getReverseApiChannelIndex(); settings.m_reverseAPIChannelIndex = response.getChirpChatDemodSettings()->getReverseApiChannelIndex();
} }
if (settings.m_spectrumGUI && channelSettingsKeys.contains("spectrumConfig")) {
settings.m_spectrumGUI->updateFrom(channelSettingsKeys, response.getChirpChatDemodSettings()->getSpectrumConfig());
}
} }
int ChirpChatDemod::webapiReportGet( int ChirpChatDemod::webapiReportGet(
@ -647,6 +650,20 @@ void ChirpChatDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings
response.getChirpChatDemodSettings()->setReverseApiPort(settings.m_reverseAPIPort); response.getChirpChatDemodSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getChirpChatDemodSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex); response.getChirpChatDemodSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getChirpChatDemodSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex); response.getChirpChatDemodSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
if (settings.m_spectrumGUI)
{
if (response.getChirpChatDemodSettings()->getSpectrumConfig())
{
settings.m_spectrumGUI->formatTo(response.getChirpChatDemodSettings()->getSpectrumConfig());
}
else
{
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
response.getChirpChatDemodSettings()->setSpectrumConfig(swgGLSpectrum);
}
}
} }
void ChirpChatDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response) void ChirpChatDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
@ -799,6 +816,12 @@ void ChirpChatDemod::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("title") || force) { if (channelSettingsKeys.contains("title") || force) {
swgChirpChatDemodSettings->setTitle(new QString(settings.m_title)); swgChirpChatDemodSettings->setTitle(new QString(settings.m_title));
} }
if (settings.m_spectrumGUI && (channelSettingsKeys.contains("spectrunConfig") || force))
{
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
swgChirpChatDemodSettings->setSpectrumConfig(swgGLSpectrum);
}
} }
void ChirpChatDemod::networkManagerFinished(QNetworkReply *reply) void ChirpChatDemod::networkManagerFinished(QNetworkReply *reply)

View File

@ -115,6 +115,7 @@ bool ChirpChatDemodGUI::handleMessage(const Message& message)
const ChirpChatDemod::MsgConfigureChirpChatDemod& cfg = (ChirpChatDemod::MsgConfigureChirpChatDemod&) message; const ChirpChatDemod::MsgConfigureChirpChatDemod& cfg = (ChirpChatDemod::MsgConfigureChirpChatDemod&) message;
m_settings = cfg.getSettings(); m_settings = cfg.getSettings();
blockApplySettings(true); blockApplySettings(true);
ui->spectrumGUI->updateSettings();
displaySettings(); displaySettings();
blockApplySettings(false); blockApplySettings(false);

View File

@ -342,6 +342,9 @@ void FreeDVDemod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) { if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getFreeDvDemodSettings()->getReverseApiChannelIndex(); settings.m_reverseAPIChannelIndex = response.getFreeDvDemodSettings()->getReverseApiChannelIndex();
} }
if (settings.m_spectrumGUI && channelSettingsKeys.contains("spectrumConfig")) {
settings.m_spectrumGUI->updateFrom(channelSettingsKeys, response.getFreeDvDemodSettings()->getSpectrumConfig());
}
} }
int FreeDVDemod::webapiReportGet( int FreeDVDemod::webapiReportGet(
@ -391,6 +394,20 @@ void FreeDVDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& r
response.getFreeDvDemodSettings()->setReverseApiPort(settings.m_reverseAPIPort); response.getFreeDvDemodSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getFreeDvDemodSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex); response.getFreeDvDemodSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getFreeDvDemodSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex); response.getFreeDvDemodSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
if (settings.m_spectrumGUI)
{
if (response.getFreeDvDemodSettings()->getSpectrumConfig())
{
settings.m_spectrumGUI->formatTo(response.getFreeDvDemodSettings()->getSpectrumConfig());
}
else
{
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
response.getFreeDvDemodSettings()->setSpectrumConfig(swgGLSpectrum);
}
}
} }
void FreeDVDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response) void FreeDVDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
@ -501,6 +518,12 @@ void FreeDVDemod::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("streamIndex") || force) { if (channelSettingsKeys.contains("streamIndex") || force) {
swgFreeDVDemodSettings->setStreamIndex(settings.m_streamIndex); swgFreeDVDemodSettings->setStreamIndex(settings.m_streamIndex);
} }
if (settings.m_spectrumGUI && (channelSettingsKeys.contains("spectrunConfig") || force))
{
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
swgFreeDVDemodSettings->setSpectrumConfig(swgGLSpectrum);
}
} }
void FreeDVDemod::networkManagerFinished(QNetworkReply *reply) void FreeDVDemod::networkManagerFinished(QNetworkReply *reply)

View File

@ -83,6 +83,7 @@ bool FreeDVDemodGUI::handleMessage(const Message& message)
const FreeDVDemod::MsgConfigureFreeDVDemod& cfg = (FreeDVDemod::MsgConfigureFreeDVDemod&) message; const FreeDVDemod::MsgConfigureFreeDVDemod& cfg = (FreeDVDemod::MsgConfigureFreeDVDemod&) message;
m_settings = cfg.getSettings(); m_settings = cfg.getSettings();
blockApplySettings(true); blockApplySettings(true);
ui->spectrumGUI->updateSettings();
displaySettings(); displaySettings();
blockApplySettings(false); blockApplySettings(false);
return true; return true;

View File

@ -417,6 +417,9 @@ void SSBDemod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) { if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getSsbDemodSettings()->getReverseApiChannelIndex(); settings.m_reverseAPIChannelIndex = response.getSsbDemodSettings()->getReverseApiChannelIndex();
} }
if (settings.m_spectrumGUI && channelSettingsKeys.contains("spectrumConfig")) {
settings.m_spectrumGUI->updateFrom(channelSettingsKeys, response.getSsbDemodSettings()->getSpectrumConfig());
}
} }
int SSBDemod::webapiReportGet( int SSBDemod::webapiReportGet(
@ -473,6 +476,20 @@ void SSBDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp
response.getSsbDemodSettings()->setReverseApiPort(settings.m_reverseAPIPort); response.getSsbDemodSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getSsbDemodSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex); response.getSsbDemodSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getSsbDemodSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex); response.getSsbDemodSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
if (settings.m_spectrumGUI)
{
if (response.getSsbDemodSettings()->getSpectrumConfig())
{
settings.m_spectrumGUI->formatTo(response.getSsbDemodSettings()->getSpectrumConfig());
}
else
{
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
response.getSsbDemodSettings()->setSpectrumConfig(swgGLSpectrum);
}
}
} }
void SSBDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response) void SSBDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
@ -604,6 +621,12 @@ void SSBDemod::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("streamIndex") || force) { if (channelSettingsKeys.contains("streamIndex") || force) {
swgSSBDemodSettings->setStreamIndex(settings.m_streamIndex); swgSSBDemodSettings->setStreamIndex(settings.m_streamIndex);
} }
if (settings.m_spectrumGUI && (channelSettingsKeys.contains("spectrunConfig") || force))
{
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
swgSSBDemodSettings->setSpectrumConfig(swgGLSpectrum);
}
} }
void SSBDemod::networkManagerFinished(QNetworkReply *reply) void SSBDemod::networkManagerFinished(QNetworkReply *reply)

View File

@ -69,6 +69,7 @@ bool SSBDemodGUI::handleMessage(const Message& message)
const SSBDemod::MsgConfigureSSBDemod& cfg = (SSBDemod::MsgConfigureSSBDemod&) message; const SSBDemod::MsgConfigureSSBDemod& cfg = (SSBDemod::MsgConfigureSSBDemod&) message;
m_settings = cfg.getSettings(); m_settings = cfg.getSettings();
blockApplySettings(true); blockApplySettings(true);
ui->spectrumGUI->updateSettings();
displaySettings(); displaySettings();
blockApplySettings(false); blockApplySettings(false);
return true; return true;

View File

@ -494,6 +494,9 @@ void FileSink::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("inputFrequencyOffset")) { if (channelSettingsKeys.contains("inputFrequencyOffset")) {
settings.m_reverseAPIChannelIndex = response.getFileSinkSettings()->getInputFrequencyOffset(); settings.m_reverseAPIChannelIndex = response.getFileSinkSettings()->getInputFrequencyOffset();
} }
if (settings.m_spectrumGUI && channelSettingsKeys.contains("spectrumConfig")) {
settings.m_spectrumGUI->updateFrom(channelSettingsKeys, response.getFileSinkSettings()->getSpectrumConfig());
}
} }
void FileSink::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const FileSinkSettings& settings) void FileSink::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const FileSinkSettings& settings)
@ -532,6 +535,20 @@ void FileSink::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp
response.getFileSinkSettings()->setReverseApiPort(settings.m_reverseAPIPort); response.getFileSinkSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getFileSinkSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex); response.getFileSinkSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getFileSinkSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex); response.getFileSinkSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
if (settings.m_spectrumGUI)
{
if (response.getFileSinkSettings()->getSpectrumConfig())
{
settings.m_spectrumGUI->formatTo(response.getFileSinkSettings()->getSpectrumConfig());
}
else
{
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
response.getFileSinkSettings()->setSpectrumConfig(swgGLSpectrum);
}
}
} }
void FileSink::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response) void FileSink::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
@ -642,6 +659,12 @@ void FileSink::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("streamIndex")) { if (channelSettingsKeys.contains("streamIndex")) {
swgFileSinkSettings->setStreamIndex(settings.m_streamIndex); swgFileSinkSettings->setStreamIndex(settings.m_streamIndex);
} }
if (settings.m_spectrumGUI && (channelSettingsKeys.contains("spectrunConfig") || force))
{
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
swgFileSinkSettings->setSpectrumConfig(swgGLSpectrum);
}
} }
void FileSink::networkManagerFinished(QNetworkReply *reply) void FileSink::networkManagerFinished(QNetworkReply *reply)

View File

@ -96,6 +96,7 @@ bool FileSinkGUI::handleMessage(const Message& message)
const FileSink::MsgConfigureFileSink& cfg = (FileSink::MsgConfigureFileSink&) message; const FileSink::MsgConfigureFileSink& cfg = (FileSink::MsgConfigureFileSink&) message;
m_settings = cfg.getSettings(); m_settings = cfg.getSettings();
blockApplySettings(true); blockApplySettings(true);
ui->glSpectrumGUI->updateSettings();
displaySettings(); displaySettings();
blockApplySettings(false); blockApplySettings(false);
return true; return true;

View File

@ -399,6 +399,9 @@ void FreqTracker::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) { if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getFreqTrackerSettings()->getReverseApiChannelIndex(); settings.m_reverseAPIChannelIndex = response.getFreqTrackerSettings()->getReverseApiChannelIndex();
} }
if (settings.m_spectrumGUI && channelSettingsKeys.contains("spectrumConfig")) {
settings.m_spectrumGUI->updateFrom(channelSettingsKeys, response.getFreqTrackerSettings()->getSpectrumConfig());
}
} }
int FreqTracker::webapiReportGet( int FreqTracker::webapiReportGet(
@ -446,6 +449,20 @@ void FreqTracker::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& r
response.getFreqTrackerSettings()->setReverseApiPort(settings.m_reverseAPIPort); response.getFreqTrackerSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getFreqTrackerSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex); response.getFreqTrackerSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getFreqTrackerSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex); response.getFreqTrackerSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
if (settings.m_spectrumGUI)
{
if (response.getFreqTrackerSettings()->getSpectrumConfig())
{
settings.m_spectrumGUI->formatTo(response.getFreqTrackerSettings()->getSpectrumConfig());
}
else
{
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
response.getFreqTrackerSettings()->setSpectrumConfig(swgGLSpectrum);
}
}
} }
void FreqTracker::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response) void FreqTracker::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
@ -568,6 +585,12 @@ void FreqTracker::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("streamIndex") || force) { if (channelSettingsKeys.contains("streamIndex") || force) {
swgFreqTrackerSettings->setStreamIndex(settings.m_streamIndex); swgFreqTrackerSettings->setStreamIndex(settings.m_streamIndex);
} }
if (settings.m_spectrumGUI && (channelSettingsKeys.contains("spectrunConfig") || force))
{
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
swgFreqTrackerSettings->setSpectrumConfig(swgGLSpectrum);
}
} }
void FreqTracker::networkManagerFinished(QNetworkReply *reply) void FreqTracker::networkManagerFinished(QNetworkReply *reply)

View File

@ -81,6 +81,7 @@ bool FreqTrackerGUI::handleMessage(const Message& message)
const FreqTracker::MsgConfigureFreqTracker& cfg = (FreqTracker::MsgConfigureFreqTracker&) message; const FreqTracker::MsgConfigureFreqTracker& cfg = (FreqTracker::MsgConfigureFreqTracker&) message;
m_settings = cfg.getSettings(); m_settings = cfg.getSettings();
blockApplySettings(true); blockApplySettings(true);
ui->spectrumGUI->updateSettings();
displaySettings(); displaySettings();
blockApplySettings(false); blockApplySettings(false);
return true; return true;

View File

@ -494,6 +494,9 @@ void SigMFFileSink::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("inputFrequencyOffset")) { if (channelSettingsKeys.contains("inputFrequencyOffset")) {
settings.m_reverseAPIChannelIndex = response.getSigMfFileSinkSettings()->getInputFrequencyOffset(); settings.m_reverseAPIChannelIndex = response.getSigMfFileSinkSettings()->getInputFrequencyOffset();
} }
if (settings.m_spectrumGUI && channelSettingsKeys.contains("spectrumConfig")) {
settings.m_spectrumGUI->updateFrom(channelSettingsKeys, response.getSigMfFileSinkSettings()->getSpectrumConfig());
}
} }
void SigMFFileSink::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const SigMFFileSinkSettings& settings) void SigMFFileSink::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const SigMFFileSinkSettings& settings)
@ -532,6 +535,20 @@ void SigMFFileSink::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings&
response.getSigMfFileSinkSettings()->setReverseApiPort(settings.m_reverseAPIPort); response.getSigMfFileSinkSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getSigMfFileSinkSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex); response.getSigMfFileSinkSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getSigMfFileSinkSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex); response.getSigMfFileSinkSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
if (settings.m_spectrumGUI)
{
if (response.getSigMfFileSinkSettings()->getSpectrumConfig())
{
settings.m_spectrumGUI->formatTo(response.getSigMfFileSinkSettings()->getSpectrumConfig());
}
else
{
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
response.getSigMfFileSinkSettings()->setSpectrumConfig(swgGLSpectrum);
}
}
} }
void SigMFFileSink::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response) void SigMFFileSink::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
@ -642,6 +659,12 @@ void SigMFFileSink::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("streamIndex")) { if (channelSettingsKeys.contains("streamIndex")) {
swgSigMFFileSinkSettings->setStreamIndex(settings.m_streamIndex); swgSigMFFileSinkSettings->setStreamIndex(settings.m_streamIndex);
} }
if (settings.m_spectrumGUI && (channelSettingsKeys.contains("spectrunConfig") || force))
{
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
swgSigMFFileSinkSettings->setSpectrumConfig(swgGLSpectrum);
}
} }
void SigMFFileSink::networkManagerFinished(QNetworkReply *reply) void SigMFFileSink::networkManagerFinished(QNetworkReply *reply)

View File

@ -95,6 +95,7 @@ bool SigMFFileSinkGUI::handleMessage(const Message& message)
const SigMFFileSink::MsgConfigureSigMFFileSink& cfg = (SigMFFileSink::MsgConfigureSigMFFileSink&) message; const SigMFFileSink::MsgConfigureSigMFFileSink& cfg = (SigMFFileSink::MsgConfigureSigMFFileSink&) message;
m_settings = cfg.getSettings(); m_settings = cfg.getSettings();
blockApplySettings(true); blockApplySettings(true);
ui->glSpectrumGUI->updateSettings();
displaySettings(); displaySettings();
blockApplySettings(false); blockApplySettings(false);
return true; return true;

View File

@ -385,6 +385,9 @@ void UDPSink::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) { if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getUdpSinkSettings()->getReverseApiChannelIndex(); settings.m_reverseAPIChannelIndex = response.getUdpSinkSettings()->getReverseApiChannelIndex();
} }
if (settings.m_spectrumGUI && channelSettingsKeys.contains("spectrumConfig")) {
settings.m_spectrumGUI->updateFrom(channelSettingsKeys, response.getUdpSinkSettings()->getSpectrumConfig());
}
} }
int UDPSink::webapiReportGet( int UDPSink::webapiReportGet(
@ -443,6 +446,20 @@ void UDPSink::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& respo
response.getUdpSinkSettings()->setReverseApiPort(settings.m_reverseAPIPort); response.getUdpSinkSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getUdpSinkSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex); response.getUdpSinkSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getUdpSinkSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex); response.getUdpSinkSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
if (settings.m_spectrumGUI)
{
if (response.getUdpSinkSettings()->getSpectrumConfig())
{
settings.m_spectrumGUI->formatTo(response.getUdpSinkSettings()->getSpectrumConfig());
}
else
{
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
response.getUdpSinkSettings()->setSpectrumConfig(swgGLSpectrum);
}
}
} }
void UDPSink::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response) void UDPSink::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
@ -576,6 +593,12 @@ void UDPSink::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("streamIndex") || force) { if (channelSettingsKeys.contains("streamIndex") || force) {
swgUDPSinkSettings->setStreamIndex(settings.m_streamIndex); swgUDPSinkSettings->setStreamIndex(settings.m_streamIndex);
} }
if (settings.m_spectrumGUI && (channelSettingsKeys.contains("spectrunConfig") || force))
{
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
swgUDPSinkSettings->setSpectrumConfig(swgGLSpectrum);
}
} }
void UDPSink::networkManagerFinished(QNetworkReply *reply) void UDPSink::networkManagerFinished(QNetworkReply *reply)

View File

@ -75,6 +75,7 @@ bool UDPSinkGUI::handleMessage(const Message& message )
const UDPSink::MsgConfigureUDPSink& cfg = (UDPSink::MsgConfigureUDPSink&) message; const UDPSink::MsgConfigureUDPSink& cfg = (UDPSink::MsgConfigureUDPSink&) message;
m_settings = cfg.getSettings(); m_settings = cfg.getSettings();
blockApplySettings(true); blockApplySettings(true);
ui->spectrumGUI->updateSettings();
displaySettings(); displaySettings();
blockApplySettings(false); blockApplySettings(false);
return true; return true;

View File

@ -450,6 +450,9 @@ void FreeDVMod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) { if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getFreeDvModSettings()->getReverseApiChannelIndex(); settings.m_reverseAPIChannelIndex = response.getFreeDvModSettings()->getReverseApiChannelIndex();
} }
if (settings.m_spectrumGUI && channelSettingsKeys.contains("spectrumConfig")) {
settings.m_spectrumGUI->updateFrom(channelSettingsKeys, response.getFreeDvModSettings()->getSpectrumConfig());
}
} }
int FreeDVMod::webapiReportGet( int FreeDVMod::webapiReportGet(
@ -504,6 +507,20 @@ void FreeDVMod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& res
response.getFreeDvModSettings()->setReverseApiPort(settings.m_reverseAPIPort); response.getFreeDvModSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getFreeDvModSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex); response.getFreeDvModSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getFreeDvModSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex); response.getFreeDvModSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
if (settings.m_spectrumGUI)
{
if (response.getFreeDvModSettings()->getSpectrumConfig())
{
settings.m_spectrumGUI->formatTo(response.getFreeDvModSettings()->getSpectrumConfig());
}
else
{
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
response.getFreeDvModSettings()->setSpectrumConfig(swgGLSpectrum);
}
}
} }
void FreeDVMod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response) void FreeDVMod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
@ -647,6 +664,12 @@ void FreeDVMod::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("streamIndex") || force) { if (channelSettingsKeys.contains("streamIndex") || force) {
swgFreeDVModSettings->setStreamIndex(settings.m_streamIndex); swgFreeDVModSettings->setStreamIndex(settings.m_streamIndex);
} }
if (settings.m_spectrumGUI && (channelSettingsKeys.contains("spectrunConfig") || force))
{
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
swgFreeDVModSettings->setSpectrumConfig(swgGLSpectrum);
}
if (force) if (force)
{ {

View File

@ -104,6 +104,7 @@ bool FreeDVModGUI::handleMessage(const Message& message)
const FreeDVMod::MsgConfigureFreeDVMod& cfg = (FreeDVMod::MsgConfigureFreeDVMod&) message; const FreeDVMod::MsgConfigureFreeDVMod& cfg = (FreeDVMod::MsgConfigureFreeDVMod&) message;
m_settings = cfg.getSettings(); m_settings = cfg.getSettings();
blockApplySettings(true); blockApplySettings(true);
ui->spectrumGUI->updateSettings();
displaySettings(); displaySettings();
blockApplySettings(false); blockApplySettings(false);
return true; return true;

View File

@ -521,6 +521,9 @@ void SSBMod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) { if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getSsbModSettings()->getReverseApiChannelIndex(); settings.m_reverseAPIChannelIndex = response.getSsbModSettings()->getReverseApiChannelIndex();
} }
if (settings.m_spectrumGUI && channelSettingsKeys.contains("spectrumConfig")) {
settings.m_spectrumGUI->updateFrom(channelSettingsKeys, response.getSsbModSettings()->getSpectrumConfig());
}
} }
int SSBMod::webapiReportGet( int SSBMod::webapiReportGet(
@ -582,6 +585,20 @@ void SSBMod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& respon
response.getSsbModSettings()->setReverseApiPort(settings.m_reverseAPIPort); response.getSsbModSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getSsbModSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex); response.getSsbModSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getSsbModSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex); response.getSsbModSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
if (settings.m_spectrumGUI)
{
if (response.getSsbModSettings()->getSpectrumConfig())
{
settings.m_spectrumGUI->formatTo(response.getSsbModSettings()->getSpectrumConfig());
}
else
{
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
response.getSsbModSettings()->setSpectrumConfig(swgGLSpectrum);
}
}
} }
void SSBMod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response) void SSBMod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
@ -746,6 +763,12 @@ void SSBMod::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("streamIndex") || force) { if (channelSettingsKeys.contains("streamIndex") || force) {
swgSSBModSettings->setStreamIndex(settings.m_streamIndex); swgSSBModSettings->setStreamIndex(settings.m_streamIndex);
} }
if (settings.m_spectrumGUI && (channelSettingsKeys.contains("spectrunConfig") || force))
{
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
swgSSBModSettings->setSpectrumConfig(swgGLSpectrum);
}
if (force) if (force)
{ {

View File

@ -110,6 +110,7 @@ bool SSBModGUI::handleMessage(const Message& message)
} }
m_settings = mod_settings; m_settings = mod_settings;
blockApplySettings(true); blockApplySettings(true);
ui->spectrumGUI->updateSettings();
displaySettings(); displaySettings();
blockApplySettings(false); blockApplySettings(false);
return true; return true;

View File

@ -418,6 +418,9 @@ void UDPSource::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) { if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getUdpSourceSettings()->getReverseApiChannelIndex(); settings.m_reverseAPIChannelIndex = response.getUdpSourceSettings()->getReverseApiChannelIndex();
} }
if (settings.m_spectrumGUI && channelSettingsKeys.contains("spectrumConfig")) {
settings.m_spectrumGUI->updateFrom(channelSettingsKeys, response.getUdpSourceSettings()->getSpectrumConfig());
}
} }
int UDPSource::webapiReportGet( int UDPSource::webapiReportGet(
@ -483,6 +486,20 @@ void UDPSource::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& res
response.getUdpSourceSettings()->setReverseApiPort(settings.m_reverseAPIPort); response.getUdpSourceSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getUdpSourceSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex); response.getUdpSourceSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getUdpSourceSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex); response.getUdpSourceSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
if (settings.m_spectrumGUI)
{
if (response.getUdpSourceSettings()->getSpectrumConfig())
{
settings.m_spectrumGUI->formatTo(response.getUdpSourceSettings()->getSpectrumConfig());
}
else
{
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
response.getUdpSourceSettings()->setSpectrumConfig(swgGLSpectrum);
}
}
} }
void UDPSource::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response) void UDPSource::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
@ -623,6 +640,12 @@ void UDPSource::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("streamIndex") || force) { if (channelSettingsKeys.contains("streamIndex") || force) {
swgUDPSourceSettings->setStreamIndex(settings.m_streamIndex); swgUDPSourceSettings->setStreamIndex(settings.m_streamIndex);
} }
if (settings.m_spectrumGUI && (channelSettingsKeys.contains("spectrunConfig") || force))
{
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
swgUDPSourceSettings->setSpectrumConfig(swgGLSpectrum);
}
} }
void UDPSource::networkManagerFinished(QNetworkReply *reply) void UDPSource::networkManagerFinished(QNetworkReply *reply)

View File

@ -72,6 +72,7 @@ bool UDPSourceGUI::handleMessage(const Message& message)
const UDPSource::MsgConfigureUDPSource& cfg = (UDPSource::MsgConfigureUDPSource&) message; const UDPSource::MsgConfigureUDPSource& cfg = (UDPSource::MsgConfigureUDPSource&) message;
m_settings = cfg.getSettings(); m_settings = cfg.getSettings();
blockApplySettings(true); blockApplySettings(true);
ui->spectrumGUI->updateSettings();
displaySettings(); displaySettings();
blockApplySettings(false); blockApplySettings(false);
return true; return true;

View File

@ -423,6 +423,34 @@ void DemodAnalyzer::webapiFormatFeatureSettings(
response.getDemodAnalyzerSettings()->setReverseApiPort(settings.m_reverseAPIPort); response.getDemodAnalyzerSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getDemodAnalyzerSettings()->setReverseApiFeatureSetIndex(settings.m_reverseAPIFeatureSetIndex); response.getDemodAnalyzerSettings()->setReverseApiFeatureSetIndex(settings.m_reverseAPIFeatureSetIndex);
response.getDemodAnalyzerSettings()->setReverseApiFeatureIndex(settings.m_reverseAPIFeatureIndex); response.getDemodAnalyzerSettings()->setReverseApiFeatureIndex(settings.m_reverseAPIFeatureIndex);
if (settings.m_spectrumGUI)
{
if (response.getDemodAnalyzerSettings()->getSpectrumConfig())
{
settings.m_spectrumGUI->formatTo(response.getDemodAnalyzerSettings()->getSpectrumConfig());
}
else
{
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
response.getDemodAnalyzerSettings()->setSpectrumConfig(swgGLSpectrum);
}
}
if (settings.m_scopeGUI)
{
if (response.getDemodAnalyzerSettings()->getScopeConfig())
{
settings.m_scopeGUI->formatTo(response.getDemodAnalyzerSettings()->getScopeConfig());
}
else
{
SWGSDRangel::SWGGLScope *swgGLScope = new SWGSDRangel::SWGGLScope();
settings.m_scopeGUI->formatTo(swgGLScope);
response.getDemodAnalyzerSettings()->setScopeConfig(swgGLScope);
}
}
} }
void DemodAnalyzer::webapiUpdateFeatureSettings( void DemodAnalyzer::webapiUpdateFeatureSettings(
@ -454,6 +482,12 @@ void DemodAnalyzer::webapiUpdateFeatureSettings(
if (featureSettingsKeys.contains("reverseAPIFeatureIndex")) { if (featureSettingsKeys.contains("reverseAPIFeatureIndex")) {
settings.m_reverseAPIFeatureIndex = response.getDemodAnalyzerSettings()->getReverseApiFeatureIndex(); settings.m_reverseAPIFeatureIndex = response.getDemodAnalyzerSettings()->getReverseApiFeatureIndex();
} }
if (settings.m_spectrumGUI && featureSettingsKeys.contains("spectrumConfig")) {
settings.m_spectrumGUI->updateFrom(featureSettingsKeys, response.getDemodAnalyzerSettings()->getSpectrumConfig());
}
if (settings.m_scopeGUI && featureSettingsKeys.contains("scopeConfig")) {
settings.m_scopeGUI->updateFrom(featureSettingsKeys, response.getDemodAnalyzerSettings()->getScopeConfig());
}
} }
void DemodAnalyzer::webapiReverseSendSettings(QList<QString>& featureSettingsKeys, const DemodAnalyzerSettings& settings, bool force) void DemodAnalyzer::webapiReverseSendSettings(QList<QString>& featureSettingsKeys, const DemodAnalyzerSettings& settings, bool force)

View File

@ -76,6 +76,8 @@ bool DemodAnalyzerGUI::handleMessage(const Message& message)
const DemodAnalyzer::MsgConfigureDemodAnalyzer& cfg = (DemodAnalyzer::MsgConfigureDemodAnalyzer&) message; const DemodAnalyzer::MsgConfigureDemodAnalyzer& cfg = (DemodAnalyzer::MsgConfigureDemodAnalyzer&) message;
m_settings = cfg.getSettings(); m_settings = cfg.getSettings();
blockApplySettings(true); blockApplySettings(true);
ui->spectrumGUI->updateSettings();
ui->scopeGUI->updateSettings();
displaySettings(); displaySettings();
blockApplySettings(false); blockApplySettings(false);

View File

@ -688,7 +688,6 @@ MapGUI::MapGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *featur
ui->setupUi(this); ui->setupUi(this);
m_helpURL = "plugins/feature/map/readme.md"; m_helpURL = "plugins/feature/map/readme.md";
quint16 port = 0; // Pick a free port
// Free keys, so no point in stealing them :) // Free keys, so no point in stealing them :)
QString tfKey = m_settings.m_thunderforestAPIKey.isEmpty() ? "3e1f614f78a345459931ba3c898e975e" : m_settings.m_thunderforestAPIKey; QString tfKey = m_settings.m_thunderforestAPIKey.isEmpty() ? "3e1f614f78a345459931ba3c898e975e" : m_settings.m_thunderforestAPIKey;
QString mtKey = m_settings.m_maptilerAPIKey.isEmpty() ? "q2RVNAe3eFKCH4XsrE3r" : m_settings.m_maptilerAPIKey; QString mtKey = m_settings.m_maptilerAPIKey.isEmpty() ? "q2RVNAe3eFKCH4XsrE3r" : m_settings.m_maptilerAPIKey;

View File

@ -15,6 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // // along with this program. If not, see <http://www.gnu.org/licenses/>. //
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#include "SWGChannelMarker.h"
#include "dsp/channelmarker.h" #include "dsp/channelmarker.h"
#include "util/simpleserializer.h" #include "util/simpleserializer.h"
@ -195,6 +196,40 @@ bool ChannelMarker::deserialize(const QByteArray& data)
} }
} }
void ChannelMarker::formatTo(SWGSDRangel::SWGObject *swgObject) const
{
SWGSDRangel::SWGChannelMarker *swgChannelMarker = static_cast<SWGSDRangel::SWGChannelMarker *>(swgObject);
swgChannelMarker->setCenterFrequency(getCenterFrequency());
swgChannelMarker->setColor(getColor().rgb());
swgChannelMarker->setFrequencyScaleDisplayType((int) getFrequencyScaleDisplayType());
if (swgChannelMarker->getTitle()) {
*swgChannelMarker->getTitle() = getTitle();
} else {
swgChannelMarker->setTitle(new QString(getTitle()));
}
}
void ChannelMarker::updateFrom(const QStringList& keys, const SWGSDRangel::SWGObject *swgObject)
{
SWGSDRangel::SWGChannelMarker *swgChannelMarker =
static_cast<SWGSDRangel::SWGChannelMarker *>(const_cast<SWGSDRangel::SWGObject *>(swgObject));
if (keys.contains("channelMarker.centerFrequency")) {
setCenterFrequency(swgChannelMarker->getCenterFrequency());
}
if (keys.contains("channelMarker.color")) {
setColor(swgChannelMarker->getColor());
}
if (keys.contains("channelMarker.frequencyScaleDisplayType")) {
setFrequencyScaleDisplayType((frequencyScaleDisplay_t) swgChannelMarker->getFrequencyScaleDisplayType());
}
if (keys.contains("channelMarker.title")) {
setTitle(*swgChannelMarker->getTitle());
}
}
void ChannelMarker::addStreamIndex(int streamIndex) void ChannelMarker::addStreamIndex(int streamIndex)
{ {
m_enabledStreamsBits |= (1<<streamIndex); m_enabledStreamsBits |= (1<<streamIndex);

View File

@ -101,6 +101,8 @@ public:
virtual QByteArray serialize() const; virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data); virtual bool deserialize(const QByteArray& data);
virtual void formatTo(SWGSDRangel::SWGObject *swgObject) const;
virtual void updateFrom(const QStringList& keys, const SWGSDRangel::SWGObject *swgObject);
protected: protected:
static QRgb m_colorTable[]; static QRgb m_colorTable[];

View File

@ -614,36 +614,7 @@ void CWKeyer::webapiSettingsPutPatch(
SWGSDRangel::SWGCWKeyerSettings *apiCwKeyerSettings SWGSDRangel::SWGCWKeyerSettings *apiCwKeyerSettings
) )
{ {
if (channelSettingsKeys.contains("cwKeyer.loop")) { cwKeyerSettings.updateFrom(channelSettingsKeys, apiCwKeyerSettings);
cwKeyerSettings.m_loop = apiCwKeyerSettings->getLoop() != 0;
}
if (channelSettingsKeys.contains("cwKeyer.mode")) {
cwKeyerSettings.m_mode = (CWKeyerSettings::CWMode) apiCwKeyerSettings->getMode();
}
if (channelSettingsKeys.contains("cwKeyer.text")) {
cwKeyerSettings.m_text = *apiCwKeyerSettings->getText();
}
if (channelSettingsKeys.contains("cwKeyer.sampleRate")) {
cwKeyerSettings.m_sampleRate = apiCwKeyerSettings->getSampleRate();
}
if (channelSettingsKeys.contains("cwKeyer.wpm")) {
cwKeyerSettings.m_wpm = apiCwKeyerSettings->getWpm();
}
if (channelSettingsKeys.contains("cwKeyer.keyboardIambic")) {
cwKeyerSettings.m_keyboardIambic = apiCwKeyerSettings->getKeyboardIambic() != 0;
}
if (channelSettingsKeys.contains("cwKeyer.dotKey")) {
cwKeyerSettings.m_dotKey = (Qt::Key) apiCwKeyerSettings->getDotKey();
}
if (channelSettingsKeys.contains("cwKeyer.dotKeyModifiers")) {
cwKeyerSettings.m_dotKeyModifiers = (Qt::KeyboardModifiers) apiCwKeyerSettings->getDotKeyModifiers();
}
if (channelSettingsKeys.contains("cwKeyer.dashKey")) {
cwKeyerSettings.m_dashKey = (Qt::Key) apiCwKeyerSettings->getDashKey();
}
if (channelSettingsKeys.contains("cwKeyer.dashKeyModifiers")) {
cwKeyerSettings.m_dashKeyModifiers = (Qt::KeyboardModifiers) apiCwKeyerSettings->getDashKeyModifiers();
}
} }
void CWKeyer::webapiFormatChannelSettings( void CWKeyer::webapiFormatChannelSettings(
@ -651,20 +622,5 @@ void CWKeyer::webapiFormatChannelSettings(
const CWKeyerSettings& cwKeyerSettings const CWKeyerSettings& cwKeyerSettings
) )
{ {
apiCwKeyerSettings->setLoop(cwKeyerSettings.m_loop ? 1 : 0); cwKeyerSettings.formatTo(apiCwKeyerSettings);
apiCwKeyerSettings->setMode((int) cwKeyerSettings.m_mode);
apiCwKeyerSettings->setSampleRate(cwKeyerSettings.m_sampleRate);
if (apiCwKeyerSettings->getText()) {
*apiCwKeyerSettings->getText() = cwKeyerSettings.m_text;
} else {
apiCwKeyerSettings->setText(new QString(cwKeyerSettings.m_text));
}
apiCwKeyerSettings->setWpm(cwKeyerSettings.m_wpm);
apiCwKeyerSettings->setKeyboardIambic(cwKeyerSettings.m_keyboardIambic ? 1 : 0);
apiCwKeyerSettings->setDotKey((int) cwKeyerSettings.m_dotKey);
apiCwKeyerSettings->setDotKeyModifiers((unsigned int) cwKeyerSettings.m_dotKeyModifiers);
apiCwKeyerSettings->setDashKey((int) cwKeyerSettings.m_dashKey);
apiCwKeyerSettings->setDashKeyModifiers((unsigned int) cwKeyerSettings.m_dashKeyModifiers);
} }

View File

@ -16,6 +16,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // // along with this program. If not, see <http://www.gnu.org/licenses/>. //
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#include "SWGCWKeyerSettings.h"
#include "util/simpleserializer.h" #include "util/simpleserializer.h"
#include "cwkeyersettings.h" #include "cwkeyersettings.h"
@ -95,3 +96,62 @@ bool CWKeyerSettings::deserialize(const QByteArray& data)
return false; return false;
} }
} }
void CWKeyerSettings::formatTo(SWGSDRangel::SWGObject *swgObject) const
{
SWGSDRangel::SWGCWKeyerSettings *apiCwKeyerSettings = static_cast<SWGSDRangel::SWGCWKeyerSettings *>(swgObject);
apiCwKeyerSettings->setLoop(m_loop ? 1 : 0);
apiCwKeyerSettings->setMode((int) m_mode);
apiCwKeyerSettings->setSampleRate(m_sampleRate);
if (apiCwKeyerSettings->getText()) {
*apiCwKeyerSettings->getText() = m_text;
} else {
apiCwKeyerSettings->setText(new QString(m_text));
}
apiCwKeyerSettings->setWpm(m_wpm);
apiCwKeyerSettings->setKeyboardIambic(m_keyboardIambic ? 1 : 0);
apiCwKeyerSettings->setDotKey((int) m_dotKey);
apiCwKeyerSettings->setDotKeyModifiers((unsigned int) m_dotKeyModifiers);
apiCwKeyerSettings->setDashKey((int) m_dashKey);
apiCwKeyerSettings->setDashKeyModifiers((unsigned int) m_dashKeyModifiers);
}
void CWKeyerSettings::updateFrom(const QStringList& keys, const SWGSDRangel::SWGObject *swgObject)
{
SWGSDRangel::SWGCWKeyerSettings *apiCwKeyerSettings =
static_cast<SWGSDRangel::SWGCWKeyerSettings *>(const_cast<SWGSDRangel::SWGObject *>(swgObject));
if (keys.contains("cwKeyer.loop")) {
m_loop = apiCwKeyerSettings->getLoop() != 0;
}
if (keys.contains("cwKeyer.mode")) {
m_mode = (CWKeyerSettings::CWMode) apiCwKeyerSettings->getMode();
}
if (keys.contains("cwKeyer.text")) {
m_text = *apiCwKeyerSettings->getText();
}
if (keys.contains("cwKeyer.sampleRate")) {
m_sampleRate = apiCwKeyerSettings->getSampleRate();
}
if (keys.contains("cwKeyer.wpm")) {
m_wpm = apiCwKeyerSettings->getWpm();
}
if (keys.contains("cwKeyer.keyboardIambic")) {
m_keyboardIambic = apiCwKeyerSettings->getKeyboardIambic() != 0;
}
if (keys.contains("cwKeyer.dotKey")) {
m_dotKey = (Qt::Key) apiCwKeyerSettings->getDotKey();
}
if (keys.contains("cwKeyer.dotKeyModifiers")) {
m_dotKeyModifiers = (Qt::KeyboardModifiers) apiCwKeyerSettings->getDotKeyModifiers();
}
if (keys.contains("cwKeyer.dashKey")) {
m_dashKey = (Qt::Key) apiCwKeyerSettings->getDashKey();
}
if (keys.contains("cwKeyer.dashKeyModifiers")) {
m_dashKeyModifiers = (Qt::KeyboardModifiers) apiCwKeyerSettings->getDashKeyModifiers();
}
}

View File

@ -23,8 +23,9 @@
#include <QByteArray> #include <QByteArray>
#include "export.h" #include "export.h"
#include "settings/serializable.h"
class SDRBASE_API CWKeyerSettings class SDRBASE_API CWKeyerSettings: public Serializable
{ {
public: public:
typedef enum typedef enum
@ -52,6 +53,8 @@ public:
QByteArray serialize() const; QByteArray serialize() const;
bool deserialize(const QByteArray& data); bool deserialize(const QByteArray& data);
virtual void formatTo(SWGSDRangel::SWGObject *swgObject) const;
virtual void updateFrom(const QStringList& keys, const SWGSDRangel::SWGObject *swgObject);
}; };

View File

@ -15,9 +15,13 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // // along with this program. If not, see <http://www.gnu.org/licenses/>. //
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#include <QColor>
#include "util/simpleserializer.h" #include "util/simpleserializer.h"
#include "glscopesettings.h" #include "glscopesettings.h"
#include "SWGGLScope.h"
const double GLScopeSettings::AMPS[27] = { const double GLScopeSettings::AMPS[27] = {
2e-1, 1e-1, 5e-2, 2e-1, 1e-1, 5e-2,
2e-2, 1e-2, 5e-3, 2e-2, 1e-2, 5e-3,
@ -39,20 +43,14 @@ GLScopeSettings::GLScopeSettings(const GLScopeSettings& t)
{ {
resetToDefaults(); resetToDefaults();
for (unsigned int i = 0; i < m_maxNbTraces; i++) { m_tracesData = t.m_tracesData;
m_tracesData[i] = t.m_tracesData[i]; m_triggersData = t.m_triggersData;
}
for (unsigned int i = 0; i < m_maxNbTriggers; i++) {
m_triggersData[i] = t.m_triggersData[i];
}
m_displayMode = t.m_displayMode; m_displayMode = t.m_displayMode;
m_traceIntensity = t.m_traceIntensity; m_traceIntensity = t.m_traceIntensity;
m_gridIntensity = t.m_gridIntensity; m_gridIntensity = t.m_gridIntensity;
m_time = t.m_time; m_time = t.m_time;
m_timeOfs = t.m_timeOfs; m_timeOfs = t.m_timeOfs;
m_traceLen = t.m_traceLen; m_traceLenMult = t.m_traceLenMult;
m_trigPre = t.m_trigPre; m_trigPre = t.m_trigPre;
} }
@ -66,7 +64,7 @@ void GLScopeSettings::resetToDefaults()
m_gridIntensity = 10; m_gridIntensity = 10;
m_time = 1; m_time = 1;
m_timeOfs = 0; m_timeOfs = 0;
m_traceLen = 1; m_traceLenMult = 1;
m_trigPre = 0; m_trigPre = 0;
} }
@ -80,7 +78,7 @@ QByteArray GLScopeSettings::serialize() const
s.writeS32(3, m_gridIntensity); s.writeS32(3, m_gridIntensity);
s.writeS32(4, m_time); s.writeS32(4, m_time);
// s.writeS32(5, m_timeOfs); // s.writeS32(5, m_timeOfs);
s.writeS32(6, m_traceLen); s.writeS32(6, m_traceLenMult);
std::vector<TraceData>::const_iterator traceDataIt = m_tracesData.begin(); std::vector<TraceData>::const_iterator traceDataIt = m_tracesData.begin();
unsigned int i = 0; unsigned int i = 0;
@ -149,7 +147,7 @@ bool GLScopeSettings::deserialize(const QByteArray& data)
d.readS32(3, &m_gridIntensity, 10); d.readS32(3, &m_gridIntensity, 10);
d.readS32(4, &m_time, 1); d.readS32(4, &m_time, 1);
// d.readS32(5, &m_timeOfs, 0); // d.readS32(5, &m_timeOfs, 0);
d.readS32(6, &m_traceLen, 1); d.readS32(6, &m_traceLenMult, 1);
d.readS32(201, &m_trigPre, 0); d.readS32(201, &m_trigPre, 0);
uint32_t nbTracesSaved; uint32_t nbTracesSaved;
@ -234,27 +232,263 @@ bool GLScopeSettings::deserialize(const QByteArray& data)
} }
} }
void GLScopeSettings::formatTo(SWGSDRangel::SWGObject *swgObject) const
{
SWGSDRangel::SWGGLScope *swgScope = static_cast<SWGSDRangel::SWGGLScope *>(swgObject);
swgScope->setDisplayMode(m_displayMode);
swgScope->setGridIntensity(m_gridIntensity);
swgScope->setTime(m_time);
swgScope->setTimeOfs(m_timeOfs);
swgScope->setTraceIntensity(m_traceIntensity);
swgScope->setTraceLenMult(m_traceLenMult);
swgScope->setTrigPre(m_trigPre);
// array of traces
swgScope->setTracesData(new QList<SWGSDRangel::SWGTraceData *>);
std::vector<GLScopeSettings::TraceData>::const_iterator traceIt = m_tracesData.begin();
for (; traceIt != 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()->setHasTextOverlay(traceIt->m_hasTextOverlay ? 1 : 0);
swgScope->getTracesData()->back()->setStreamIndex(traceIt->m_streamIndex);
swgScope->getTracesData()->back()->setOfs(traceIt->m_ofs);
swgScope->getTracesData()->back()->setProjectionType((int) traceIt->m_projectionType);
swgScope->getTracesData()->back()->setTextOverlay(new QString(traceIt->m_textOverlay));
swgScope->getTracesData()->back()->setTraceColor(qColorToInt(traceIt->m_traceColor));
swgScope->getTracesData()->back()->setTraceColorB(traceIt->m_traceColorB);
swgScope->getTracesData()->back()->setTraceColorG(traceIt->m_traceColorG);
swgScope->getTracesData()->back()->setTraceColorR(traceIt->m_traceColorR);
swgScope->getTracesData()->back()->setTraceDelay(traceIt->m_traceDelay);
swgScope->getTracesData()->back()->setTraceDelayCoarse(traceIt->m_traceDelayCoarse);
swgScope->getTracesData()->back()->setTraceDelayFine(traceIt->m_traceDelayFine);
swgScope->getTracesData()->back()->setTriggerDisplayLevel(traceIt->m_triggerDisplayLevel);
swgScope->getTracesData()->back()->setViewTrace(traceIt->m_viewTrace ? 1 : 0);
}
// array of triggers
swgScope->setTriggersData(new QList<SWGSDRangel::SWGTriggerData *>);
std::vector<GLScopeSettings::TriggerData>::const_iterator triggerIt = m_triggersData.begin();
for (; triggerIt != 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);
swgScope->getTriggersData()->back()->setTriggerColor(qColorToInt(triggerIt->m_triggerColor));
swgScope->getTriggersData()->back()->setTriggerColorB(triggerIt->m_triggerColorB);
swgScope->getTriggersData()->back()->setTriggerColorG(triggerIt->m_triggerColorG);
swgScope->getTriggersData()->back()->setTriggerColorR(triggerIt->m_triggerColorR);
swgScope->getTriggersData()->back()->setTriggerDelay(triggerIt->m_triggerDelay);
swgScope->getTriggersData()->back()->setTriggerDelayCoarse(triggerIt->m_triggerDelayCoarse);
swgScope->getTriggersData()->back()->setTriggerDelayFine(triggerIt->m_triggerDelayFine);
swgScope->getTriggersData()->back()->setTriggerDelayMult(triggerIt->m_triggerDelayMult);
swgScope->getTriggersData()->back()->setTriggerHoldoff(triggerIt->m_triggerHoldoff ? 1 : 0);
swgScope->getTriggersData()->back()->setTriggerLevel(triggerIt->m_triggerLevel);
swgScope->getTriggersData()->back()->setTriggerLevelCoarse(triggerIt->m_triggerLevelCoarse);
swgScope->getTriggersData()->back()->setTriggerLevelFine(triggerIt->m_triggerLevelFine);
swgScope->getTriggersData()->back()->setTriggerPositiveEdge(triggerIt->m_triggerPositiveEdge ? 1 : 0);
swgScope->getTriggersData()->back()->setTriggerRepeat(triggerIt->m_triggerRepeat);
}
}
void GLScopeSettings::updateFrom(const QStringList& keys, const SWGSDRangel::SWGObject *swgObject)
{
SWGSDRangel::SWGGLScope *swgScope =
static_cast<SWGSDRangel::SWGGLScope *>(const_cast<SWGSDRangel::SWGObject *>(swgObject));
if (keys.contains("scopeConfig.displayMode")) {
m_displayMode = (GLScopeSettings::DisplayMode) swgScope->getDisplayMode();
}
if (keys.contains("scopeConfig.gridIntensity")) {
m_gridIntensity = swgScope->getGridIntensity();
}
if (keys.contains("scopeConfig.time")) {
m_time = swgScope->getTime();
}
if (keys.contains("scopeConfig.timeOfs")) {
m_timeOfs = swgScope->getTimeOfs();
}
if (keys.contains("scopeConfig.traceIntensity")) {
m_traceIntensity = swgScope->getTraceIntensity();
}
if (keys.contains("scopeConfig.traceLenMult")) {
m_traceLenMult = swgScope->getTraceLenMult();
}
if (keys.contains("scopeConfig.trigPre")) {
m_trigPre = swgScope->getTrigPre();
}
// traces
if (keys.contains("scopeConfig.tracesData"))
{
QList<SWGSDRangel::SWGTraceData *> *tracesData = swgScope->getTracesData();
m_tracesData.clear();
for (int i = 0; i < 10; i++) // no more than 10 traces anyway
{
if (keys.contains(QString("scopeConfig.tracesData[%1]").arg(i)))
{
SWGSDRangel::SWGTraceData *traceData = tracesData->at(i);
m_tracesData.push_back(GLScopeSettings::TraceData());
if (keys.contains(QString("scopeConfig.tracesData[%1].streamIndex").arg(i))) {
m_tracesData.back().m_streamIndex = traceData->getStreamIndex();
}
if (keys.contains(QString("scopeConfig.tracesData[%1].amp").arg(i))) {
m_tracesData.back().m_amp = traceData->getAmp();
}
if (keys.contains(QString("scopeConfig.tracesData[%1].hasTextOverlay").arg(i))) {
m_tracesData.back().m_hasTextOverlay = traceData->getHasTextOverlay() != 0;
}
if (keys.contains(QString("scopeConfig.tracesData[%1].inputIndex").arg(i))) {
m_tracesData.back().m_streamIndex = traceData->getStreamIndex();
}
if (keys.contains(QString("scopeConfig.tracesData[%1].ofs").arg(i))) {
m_tracesData.back().m_ofs = traceData->getOfs();
}
if (keys.contains(QString("scopeConfig.tracesData[%1].projectionType").arg(i))) {
m_tracesData.back().m_projectionType = (Projector::ProjectionType) traceData->getProjectionType();
}
if (keys.contains(QString("scopeConfig.tracesData[%1].traceColor").arg(i))) {
m_tracesData.back().m_traceColor = intToQColor(traceData->getTraceColor());
}
if (keys.contains(QString("scopeConfig.tracesData[%1].traceColorB").arg(i))) {
m_tracesData.back().m_traceColorB = traceData->getTraceColorB();
}
if (keys.contains(QString("scopeConfig.tracesData[%1].traceColorG").arg(i))) {
m_tracesData.back().m_traceColorG = traceData->getTraceColorG();
}
if (keys.contains(QString("scopeConfig.tracesData[%1].traceColorR").arg(i))) {
m_tracesData.back().m_traceColorR = traceData->getTraceColorR();
}
if (keys.contains(QString("scopeConfig.tracesData[%1].traceDelay").arg(i))) {
m_tracesData.back().m_traceDelay = traceData->getTraceDelay();
}
if (keys.contains(QString("scopeConfig.tracesData[%1].traceDelayCoarse").arg(i))) {
m_tracesData.back().m_traceDelayCoarse = traceData->getTraceDelayCoarse();
}
if (keys.contains(QString("scopeConfig.tracesData[%1].traceDelayFine").arg(i))) {
m_tracesData.back().m_traceDelayFine = traceData->getTraceDelayFine();
}
if (keys.contains(QString("scopeConfig.tracesData[%1].triggerDisplayLevel").arg(i))) {
m_tracesData.back().m_triggerDisplayLevel = traceData->getTriggerDisplayLevel();
}
if (keys.contains(QString("scopeConfig.tracesData[%1].viewTrace").arg(i))) {
m_tracesData.back().m_viewTrace = traceData->getViewTrace() != 0;
}
}
else
{
break;
}
}
}
// triggers
if (keys.contains("scopeConfig.triggersData"))
{
QList<SWGSDRangel::SWGTriggerData *> *triggersData = swgScope->getTriggersData();
m_triggersData.clear();
for (int i = 0; i < 10; i++) // no more than 10 triggers anyway
{
if (keys.contains(QString("scopeConfig.triggersData[%1]").arg(i)))
{
SWGSDRangel::SWGTriggerData *triggerData = triggersData->at(i);
m_triggersData.push_back(GLScopeSettings::TriggerData());
if (keys.contains(QString("scopeConfig.triggersData[%1].streamIndex").arg(i))) {
m_triggersData.back().m_streamIndex = triggerData->getStreamIndex();
}
if (keys.contains(QString("scopeConfig.triggersData[%1].inputIndex").arg(i))) {
m_triggersData.back().m_inputIndex = triggerData->getInputIndex();
}
if (keys.contains(QString("scopeConfig.triggersData[%1].projectionType").arg(i))) {
m_triggersData.back().m_projectionType = (Projector::ProjectionType) triggerData->getProjectionType();
}
if (keys.contains(QString("scopeConfig.triggersData[%1].triggerBothEdges").arg(i))) {
m_triggersData.back().m_triggerBothEdges = triggerData->getTriggerBothEdges() != 0;
}
if (keys.contains(QString("scopeConfig.tracesData[%1].triggerColor").arg(i))) {
m_tracesData.back().m_traceColor = intToQColor(triggerData->getTriggerColor());
}
if (keys.contains(QString("scopeConfig.triggersData[%1].triggerColorB").arg(i))) {
m_triggersData.back().m_triggerColorB = triggerData->getTriggerColorB();
}
if (keys.contains(QString("scopeConfig.triggersData[%1].triggerColorG").arg(i))) {
m_triggersData.back().m_triggerColorG = triggerData->getTriggerColorG();
}
if (keys.contains(QString("scopeConfig.triggersData[%1].triggerColorR").arg(i))) {
m_triggersData.back().m_triggerColorR = triggerData->getTriggerColorR();
}
if (keys.contains(QString("scopeConfig.triggersData[%1].triggerDelay").arg(i))) {
m_triggersData.back().m_triggerDelay = triggerData->getTriggerDelay();
}
if (keys.contains(QString("scopeConfig.triggersData[%1].triggerDelayCoarse").arg(i))) {
m_triggersData.back().m_triggerDelayCoarse = triggerData->getTriggerDelayCoarse();
}
if (keys.contains(QString("scopeConfig.triggersData[%1].triggerDelayFine").arg(i))) {
m_triggersData.back().m_triggerDelayFine = triggerData->getTriggerDelayFine();
}
if (keys.contains(QString("scopeConfig.triggersData[%1].triggerDelayMult").arg(i))) {
m_triggersData.back().m_triggerDelayMult = triggerData->getTriggerDelayMult();
}
if (keys.contains(QString("scopeConfig.triggersData[%1].triggerHoldoff").arg(i))) {
m_triggersData.back().m_triggerHoldoff = triggerData->getTriggerHoldoff();
}
if (keys.contains(QString("scopeConfig.triggersData[%1].triggerLevel").arg(i))) {
m_triggersData.back().m_triggerLevel = triggerData->getTriggerLevel();
}
if (keys.contains(QString("scopeConfig.triggersData[%1].triggerLevelCoarse").arg(i))) {
m_triggersData.back().m_triggerLevelCoarse = triggerData->getTriggerLevelCoarse();
}
if (keys.contains(QString("scopeConfig.triggersData[%1].triggerLevelFine").arg(i))) {
m_triggersData.back().m_triggerLevelFine = triggerData->getTriggerLevelFine();
}
if (keys.contains(QString("scopeConfig.triggersData[%1].triggerPositiveEdge").arg(i))) {
m_triggersData.back().m_triggerPositiveEdge = triggerData->getTriggerPositiveEdge() != 0;
}
if (keys.contains(QString("scopeConfig.triggersData[%1].triggerRepeat").arg(i))) {
m_triggersData.back().m_triggerRepeat = triggerData->getTriggerRepeat() != 0;
}
}
}
}
}
GLScopeSettings& GLScopeSettings::operator=(const GLScopeSettings& t) GLScopeSettings& GLScopeSettings::operator=(const GLScopeSettings& t)
{ {
// Check for self assignment // Check for self assignment
if (this != &t) if (this != &t)
{ {
for (unsigned int i = 0; i < m_maxNbTraces; i++) { m_tracesData = t.m_tracesData;
m_tracesData[i] = t.m_tracesData[i]; m_triggersData = t.m_triggersData;
}
for (unsigned int i = 0; i < m_maxNbTriggers; i++) {
m_triggersData[i] = t.m_triggersData[i];
}
m_displayMode = t.m_displayMode; m_displayMode = t.m_displayMode;
m_traceIntensity = t.m_traceIntensity; m_traceIntensity = t.m_traceIntensity;
m_gridIntensity = t.m_gridIntensity; m_gridIntensity = t.m_gridIntensity;
m_time = t.m_time; m_time = t.m_time;
m_timeOfs = t.m_timeOfs; m_timeOfs = t.m_timeOfs;
m_traceLen = t.m_traceLen; m_traceLenMult = t.m_traceLenMult;
m_trigPre = t.m_trigPre; m_trigPre = t.m_trigPre;
} }
return *this; return *this;
} }
int GLScopeSettings::qColorToInt(const QColor& color)
{
return 256*256*color.blue() + 256*color.green() + color.red();
}
QColor GLScopeSettings::intToQColor(int intColor)
{
int r = intColor % 256;
int bg = intColor / 256;
int g = bg % 256;
int b = bg / 256;
return QColor(r, g, b);
}

View File

@ -152,7 +152,7 @@ public:
int m_gridIntensity; int m_gridIntensity;
int m_time; int m_time;
int m_timeOfs; int m_timeOfs;
int m_traceLen; int m_traceLenMult;
int m_trigPre; int m_trigPre;
std::vector<TraceData> m_tracesData; std::vector<TraceData> m_tracesData;
std::vector<TriggerData> m_triggersData; std::vector<TriggerData> m_triggersData;
@ -171,8 +171,11 @@ public:
virtual QByteArray serialize() const; virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data); virtual bool deserialize(const QByteArray& data);
virtual void formatTo(SWGSDRangel::SWGObject *swgObject) const;
virtual void updateFrom(const QStringList& keys, const SWGSDRangel::SWGObject *swgObject);
GLScopeSettings& operator=(const GLScopeSettings& t); GLScopeSettings& operator=(const GLScopeSettings& t);
static int qColorToInt(const QColor& color);
static QColor intToQColor(int intColor);
}; };
#endif // SDRBASE_DSP_GLSCOPESETTINGS_H #endif // SDRBASE_DSP_GLSCOPESETTINGS_H

View File

@ -159,7 +159,7 @@ void ScopeVis::configure(
if (m_traceSize != traceSize) if (m_traceSize != traceSize)
{ {
setTraceSize(traceSize); setTraceSize(traceSize);
m_settings.m_traceLen = traceSize; m_settings.m_traceLenMult = traceSize / getTraceChunkSize();
m_triggerState = TriggerUntriggered; m_triggerState = TriggerUntriggered;
m_traces.resetControls(); m_traces.resetControls();
} }
@ -1120,9 +1120,9 @@ void ScopeVis::applySettings(const GLScopeSettings& settings, bool force)
for (unsigned int i = 0; i < m_settings.m_tracesData.size(); i++) for (unsigned int i = 0; i < m_settings.m_tracesData.size(); i++)
{ {
if (i < m_traces.size()) { // change trace if (i < m_traces.size()) { // change trace
changeTrace(m_settings.m_tracesData[i], i); changeTrace(settings.m_tracesData[i], i);
} else { // add trace } else { // add trace
addTrace(m_settings.m_tracesData[i]); addTrace(settings.m_tracesData[i]);
} }
} }

View File

@ -15,6 +15,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // // along with this program. If not, see <http://www.gnu.org/licenses/>. //
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#include "SWGGLSpectrum.h"
#include "util/simpleserializer.h" #include "util/simpleserializer.h"
#include "spectrumsettings.h" #include "spectrumsettings.h"
@ -53,6 +55,7 @@ void SpectrumSettings::resetToDefaults()
m_linear = false; m_linear = false;
m_ssb = false; m_ssb = false;
m_usb = true; m_usb = true;
m_wsSpectrum = false;
m_wsSpectrumAddress = "127.0.0.1"; m_wsSpectrumAddress = "127.0.0.1";
m_wsSpectrumPort = 8887; m_wsSpectrumPort = 8887;
} }
@ -86,6 +89,7 @@ QByteArray SpectrumSettings::serialize() const
s.writeBool(24, m_ssb); s.writeBool(24, m_ssb);
s.writeBool(25, m_usb); s.writeBool(25, m_usb);
s.writeS32(26, m_fpsPeriodMs); s.writeS32(26, m_fpsPeriodMs);
s.writeBool(27, m_wsSpectrum);
s.writeS32(100, m_histogramMarkers.size()); s.writeS32(100, m_histogramMarkers.size());
for (int i = 0; i < m_histogramMarkers.size(); i++) { for (int i = 0; i < m_histogramMarkers.size(); i++) {
@ -146,6 +150,7 @@ bool SpectrumSettings::deserialize(const QByteArray& data)
d.readBool(24, &m_ssb, false); d.readBool(24, &m_ssb, false);
d.readBool(25, &m_usb, true); d.readBool(25, &m_usb, true);
d.readS32(26, &tmp, 50); d.readS32(26, &tmp, 50);
d.readBool(27, &m_wsSpectrum, false);
m_fpsPeriodMs = tmp < 5 ? 5 : tmp > 500 ? 500 : tmp; m_fpsPeriodMs = tmp < 5 ? 5 : tmp > 500 ? 500 : tmp;
int histogramMarkersSize; int histogramMarkersSize;
@ -186,6 +191,122 @@ bool SpectrumSettings::deserialize(const QByteArray& data)
} }
} }
void SpectrumSettings::formatTo(SWGSDRangel::SWGObject *swgObject) const
{
SWGSDRangel::SWGGLSpectrum *swgSpectrum = static_cast<SWGSDRangel::SWGGLSpectrum *>(swgObject);
swgSpectrum->setFftWindow((int) m_fftWindow);
swgSpectrum->setFftSize(m_fftSize);
swgSpectrum->setFftOverlap(m_fftOverlap);
swgSpectrum->setAveragingMode((int) m_averagingMode);
swgSpectrum->setAveragingValue(SpectrumSettings::getAveragingValue(m_averagingIndex, m_averagingMode));
swgSpectrum->setRefLevel(m_refLevel);
swgSpectrum->setPowerRange(m_powerRange);
swgSpectrum->setFpsPeriodMs(m_fpsPeriodMs);
swgSpectrum->setLinear(m_linear ? 1 : 0);
swgSpectrum->setWsSpectrum(m_wsSpectrum ? 1 : 0);
swgSpectrum->setWsSpectrumPort(m_wsSpectrumPort);
if (swgSpectrum->getWsSpectrumAddress()) {
*swgSpectrum->getWsSpectrumAddress() = m_wsSpectrumAddress;
} else {
swgSpectrum->setWsSpectrumAddress(new QString(m_wsSpectrumAddress));
}
swgSpectrum->setDisplayHistogram(m_displayHistogram ? 1 : 0);
swgSpectrum->setDecay(m_decay);
swgSpectrum->setDecayDivisor(m_decayDivisor);
swgSpectrum->setHistogramStroke(m_histogramStroke);
swgSpectrum->setDisplayMaxHold(m_displayMaxHold ? 1 : 0);
swgSpectrum->setDisplayCurrent(m_displayCurrent ? 1 : 0);
swgSpectrum->setDisplayTraceIntensity(m_displayTraceIntensity);
swgSpectrum->setInvertedWaterfall(m_invertedWaterfall ? 1 : 0);
swgSpectrum->setDisplayWaterfall(m_displayWaterfall ? 1 : 0);
swgSpectrum->setDisplayGrid(m_displayGrid ? 1 : 0);
swgSpectrum->setDisplayGridIntensity(m_displayGridIntensity);
}
void SpectrumSettings::updateFrom(const QStringList& keys, const SWGSDRangel::SWGObject *swgObject)
{
SWGSDRangel::SWGGLSpectrum *swgSpectrum =
static_cast<SWGSDRangel::SWGGLSpectrum *>(const_cast<SWGSDRangel::SWGObject *>(swgObject));
if (keys.contains("spectrumConfig.fftWindow")) {
m_fftWindow = (FFTWindow::Function) swgSpectrum->getFftWindow();
}
if (keys.contains("spectrumConfig.fftSize")) {
m_fftSize = swgSpectrum->getFftSize();
}
if (keys.contains("spectrumConfig.fftOverlap")) {
m_fftOverlap = swgSpectrum->getFftOverlap();
}
if (keys.contains("spectrumConfig.averagingMode")) {
m_averagingMode = (SpectrumSettings::AveragingMode) swgSpectrum->getAveragingMode();
}
if (keys.contains("spectrumConfig.averagingValue"))
{
m_averagingValue = swgSpectrum->getAveragingValue();
m_averagingIndex = SpectrumSettings::getAveragingIndex(m_averagingValue, m_averagingMode);
}
if (keys.contains("spectrumConfig.refLevel")) {
m_refLevel = swgSpectrum->getRefLevel();
}
if (keys.contains("spectrumConfig.powerRange")) {
m_powerRange = swgSpectrum->getPowerRange();
}
if (keys.contains("spectrumConfig.fpsPeriodMs")) {
m_fpsPeriodMs = swgSpectrum->getFpsPeriodMs();
}
if (keys.contains("spectrumConfig.linear")) {
m_linear = swgSpectrum->getLinear() != 0;
}
if (keys.contains("spectrumConfig.wsSpectrum")) {
m_wsSpectrum = swgSpectrum->getWsSpectrum() != 0;
}
if (keys.contains("spectrumConfig.wsSpectrum")) {
m_wsSpectrum = swgSpectrum->getWsSpectrum() != 0;
}
if (keys.contains("spectrumConfig.wsSpectrumAddress")) {
m_wsSpectrumAddress = *swgSpectrum->getWsSpectrumAddress();
}
if (keys.contains("spectrumConfig.wsSpectrumPort")) {
m_wsSpectrumPort = swgSpectrum->getWsSpectrumPort();
}
if (keys.contains("spectrumConfig.displayHistogram")) {
m_displayHistogram = swgSpectrum->getDisplayHistogram() != 0;
}
if (keys.contains("spectrumConfig.decay")) {
m_decay = swgSpectrum->getDecay();
}
if (keys.contains("spectrumConfig.decayDivisor")) {
m_decayDivisor = swgSpectrum->getDecayDivisor();
}
if (keys.contains("spectrumConfig.histogramStroke")) {
m_histogramStroke = swgSpectrum->getHistogramStroke();
}
if (keys.contains("spectrumConfig.displayMaxHold")) {
m_displayMaxHold = swgSpectrum->getDisplayMaxHold() != 0;
}
if (keys.contains("spectrumConfig.displayCurrent")) {
m_displayCurrent = swgSpectrum->getDisplayCurrent() != 0;
}
if (keys.contains("spectrumConfig.displayTraceIntensity")) {
m_displayTraceIntensity = swgSpectrum->getDisplayTraceIntensity();
}
if (keys.contains("spectrumConfig.invertedWaterfall")) {
m_invertedWaterfall = swgSpectrum->getInvertedWaterfall() != 0;
}
if (keys.contains("spectrumConfig.displayWaterfall")) {
m_displayWaterfall = swgSpectrum->getDisplayWaterfall() != 0;
}
if (keys.contains("spectrumConfig.displayGrid")) {
m_displayGrid = swgSpectrum->getDisplayGrid() != 0;
}
if (keys.contains("spectrumConfig.displayGridIntensity")) {
m_displayGridIntensity = swgSpectrum->getDisplayGridIntensity();
}
}
int SpectrumSettings::getAveragingMaxScale(AveragingMode averagingMode) int SpectrumSettings::getAveragingMaxScale(AveragingMode averagingMode)
{ {
if (averagingMode == AvgModeMoving) { if (averagingMode == AvgModeMoving) {

View File

@ -68,8 +68,9 @@ public:
bool m_linear; //!< linear else logarithmic scale bool m_linear; //!< linear else logarithmic scale
bool m_ssb; //!< SSB display with spectrum center at start of array or display - else spectrum center is on center bool m_ssb; //!< SSB display with spectrum center at start of array or display - else spectrum center is on center
bool m_usb; //!< USB display with increasing frequencies towads the right - else decreasing frequencies bool m_usb; //!< USB display with increasing frequencies towads the right - else decreasing frequencies
QString m_wsSpectrumAddress; bool m_wsSpectrum; //!< Start or stop websocket spectrum server
uint16_t m_wsSpectrumPort; QString m_wsSpectrumAddress; //!< websocket spectrum server address
uint16_t m_wsSpectrumPort; //!< websocket spectrum server port
QList<SpectrumHistogramMarker> m_histogramMarkers; QList<SpectrumHistogramMarker> m_histogramMarkers;
QList<SpectrumWaterfallMarker> m_waterfallMarkers; QList<SpectrumWaterfallMarker> m_waterfallMarkers;
static const int m_log2FFTSizeMin = 6; // 64 static const int m_log2FFTSizeMin = 6; // 64
@ -81,6 +82,8 @@ public:
virtual QByteArray serialize() const; virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data); virtual bool deserialize(const QByteArray& data);
virtual void formatTo(SWGSDRangel::SWGObject *swgObject) const;
virtual void updateFrom(const QStringList& keys, const SWGSDRangel::SWGObject *swgObject);
QList<SpectrumHistogramMarker>& getHistogramMarkers() { return m_histogramMarkers; } QList<SpectrumHistogramMarker>& getHistogramMarkers() { return m_histogramMarkers; }
QList<SpectrumWaterfallMarker>& getWaterfallMarkers() { return m_waterfallMarkers; } QList<SpectrumWaterfallMarker>& getWaterfallMarkers() { return m_waterfallMarkers; }

View File

@ -24,6 +24,7 @@
<file>webapi/doc/swagger/include/BladeRF2.yaml</file> <file>webapi/doc/swagger/include/BladeRF2.yaml</file>
<file>webapi/doc/swagger/include/ChannelActions.yaml</file> <file>webapi/doc/swagger/include/ChannelActions.yaml</file>
<file>webapi/doc/swagger/include/ChannelAnalyzer.yaml</file> <file>webapi/doc/swagger/include/ChannelAnalyzer.yaml</file>
<file>webapi/doc/swagger/include/ChannelMarker.yaml</file>
<file>webapi/doc/swagger/include/ChannelSettings.yaml</file> <file>webapi/doc/swagger/include/ChannelSettings.yaml</file>
<file>webapi/doc/swagger/include/ChannelReport.yaml</file> <file>webapi/doc/swagger/include/ChannelReport.yaml</file>
<file>webapi/doc/swagger/include/ChirpChatDemod.yaml</file> <file>webapi/doc/swagger/include/ChirpChatDemod.yaml</file>

View File

@ -2325,6 +2325,9 @@ margin-bottom: 20px;
}, },
"reverseAPIChannelIndex" : { "reverseAPIChannelIndex" : {
"type" : "integer" "type" : "integer"
},
"spectrumConfig" : {
"$ref" : "#/definitions/GLSpectrum"
} }
}, },
"description" : "BFMDemod" "description" : "BFMDemod"
@ -3003,6 +3006,9 @@ margin-bottom: 20px;
}, },
"scopeConfig" : { "scopeConfig" : {
"$ref" : "#/definitions/GLScope" "$ref" : "#/definitions/GLScope"
},
"channelMarker" : {
"$ref" : "#/definitions/ChannelMarker"
} }
}, },
"description" : "ChannelAnalyzer" "description" : "ChannelAnalyzer"
@ -3048,6 +3054,25 @@ margin-bottom: 20px;
} }
}, },
"description" : "Summarized information about channel plugin" "description" : "Summarized information about channel plugin"
};
defs.ChannelMarker = {
"properties" : {
"centerFrequency" : {
"type" : "integer"
},
"color" : {
"type" : "integer",
"description" : "RGB color"
},
"title" : {
"type" : "string"
},
"frequencyScaleDisplayType" : {
"type" : "integer",
"description" : "ChannelMarker::frequencyScaleDisplay_t"
}
},
"description" : "ChannelMarker settings"
}; };
defs.ChannelReport = { defs.ChannelReport = {
"required" : [ "direction" ], "required" : [ "direction" ],
@ -3536,6 +3561,9 @@ margin-bottom: 20px;
}, },
"reverseAPIChannelIndex" : { "reverseAPIChannelIndex" : {
"type" : "integer" "type" : "integer"
},
"spectrumConfig" : {
"$ref" : "#/definitions/GLSpectrum"
} }
}, },
"description" : "ChirpChatDemod" "description" : "ChirpChatDemod"
@ -5395,6 +5423,9 @@ margin-bottom: 20px;
}, },
"reverseAPIChannelIndex" : { "reverseAPIChannelIndex" : {
"type" : "integer" "type" : "integer"
},
"spectrumConfig" : {
"$ref" : "#/definitions/GLSpectrum"
} }
}, },
"description" : "FileSink" "description" : "FileSink"
@ -5575,6 +5606,9 @@ margin-bottom: 20px;
}, },
"reverseAPIChannelIndex" : { "reverseAPIChannelIndex" : {
"type" : "integer" "type" : "integer"
},
"spectrumConfig" : {
"$ref" : "#/definitions/GLSpectrum"
} }
}, },
"description" : "FreeDVDemod" "description" : "FreeDVDemod"
@ -5658,6 +5692,9 @@ margin-bottom: 20px;
}, },
"cwKeyer" : { "cwKeyer" : {
"$ref" : "#/definitions/CWKeyerSettings" "$ref" : "#/definitions/CWKeyerSettings"
},
"spectrumConfig" : {
"$ref" : "#/definitions/GLSpectrum"
} }
}, },
"description" : "FreeDVMod" "description" : "FreeDVMod"
@ -5763,6 +5800,9 @@ margin-bottom: 20px;
}, },
"reverseAPIChannelIndex" : { "reverseAPIChannelIndex" : {
"type" : "integer" "type" : "integer"
},
"spectrumConfig" : {
"$ref" : "#/definitions/GLSpectrum"
} }
}, },
"description" : "FreqTracker" "description" : "FreqTracker"
@ -5827,8 +5867,9 @@ margin-bottom: 20px;
"timeOfs" : { "timeOfs" : {
"type" : "integer" "type" : "integer"
}, },
"traceLen" : { "traceLenMult" : {
"type" : "integer" "type" : "integer",
"description" : "Trace length multiplier (multiplies 4800 samples)"
}, },
"trigPre" : { "trigPre" : {
"type" : "integer" "type" : "integer"
@ -5934,6 +5975,10 @@ margin-bottom: 20px;
"type" : "integer", "type" : "integer",
"description" : "boolean" "description" : "boolean"
}, },
"wsSpectrum" : {
"type" : "integer",
"description" : "Boolean - Start or stop websocket server\n * 0 - Stop server\n * 1 - Start server\n"
},
"wsSpectrumAddress" : { "wsSpectrumAddress" : {
"type" : "string", "type" : "string",
"description" : "IPv4 address of interface the websocket server is listening to" "description" : "IPv4 address of interface the websocket server is listening to"
@ -10304,6 +10349,9 @@ margin-bottom: 20px;
}, },
"reverseAPIChannelIndex" : { "reverseAPIChannelIndex" : {
"type" : "integer" "type" : "integer"
},
"spectrumConfig" : {
"$ref" : "#/definitions/GLSpectrum"
} }
}, },
"description" : "SSBDemod" "description" : "SSBDemod"
@ -10410,6 +10458,9 @@ margin-bottom: 20px;
}, },
"cwKeyer" : { "cwKeyer" : {
"$ref" : "#/definitions/CWKeyerSettings" "$ref" : "#/definitions/CWKeyerSettings"
},
"spectrumConfig" : {
"$ref" : "#/definitions/GLSpectrum"
} }
}, },
"description" : "SSBMod" "description" : "SSBMod"
@ -10954,6 +11005,9 @@ margin-bottom: 20px;
}, },
"reverseAPIChannelIndex" : { "reverseAPIChannelIndex" : {
"type" : "integer" "type" : "integer"
},
"spectrumConfig" : {
"$ref" : "#/definitions/GLSpectrum"
} }
}, },
"description" : "SigMFFileSink" "description" : "SigMFFileSink"
@ -12201,6 +12255,9 @@ margin-bottom: 20px;
}, },
"reverseAPIChannelIndex" : { "reverseAPIChannelIndex" : {
"type" : "integer" "type" : "integer"
},
"spectrumConfig" : {
"$ref" : "#/definitions/GLSpectrum"
} }
}, },
"description" : "UDPSink" "description" : "UDPSink"
@ -12326,6 +12383,9 @@ margin-bottom: 20px;
}, },
"reverseAPIChannelIndex" : { "reverseAPIChannelIndex" : {
"type" : "integer" "type" : "integer"
},
"spectrumConfig" : {
"$ref" : "#/definitions/GLSpectrum"
} }
}, },
"description" : "UDPSource" "description" : "UDPSource"
@ -51387,7 +51447,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2021-11-24T06:35:35.789+01:00 Generated 2021-11-30T22:42:47.179+01:00
</div> </div>
</div> </div>
</div> </div>

View File

@ -44,6 +44,8 @@ BFMDemodSettings:
type: integer type: integer
reverseAPIChannelIndex: reverseAPIChannelIndex:
type: integer type: integer
spectrumConfig:
$ref: "/doc/swagger/include/GLSpectrum.yaml#/GLSpectrum"
BFMDemodReport: BFMDemodReport:
description: BFMDemod description: BFMDemod

View File

@ -54,3 +54,5 @@ ChannelAnalyzerSettings:
$ref: "/doc/swagger/include/GLSpectrum.yaml#/GLSpectrum" $ref: "/doc/swagger/include/GLSpectrum.yaml#/GLSpectrum"
scopeConfig: scopeConfig:
$ref: "/doc/swagger/include/GLScope.yaml#/GLScope" $ref: "/doc/swagger/include/GLScope.yaml#/GLScope"
channelMarker:
$ref: "/doc/swagger/include/ChannelMarker.yaml#/ChannelMarker"

View File

@ -0,0 +1,13 @@
ChannelMarker:
description: ChannelMarker settings
properties:
centerFrequency:
type: integer
color:
type: integer
description: RGB color
title:
type: string
frequencyScaleDisplayType:
type: integer
description: ChannelMarker::frequencyScaleDisplay_t

View File

@ -118,6 +118,8 @@ ChirpChatDemodSettings:
type: integer type: integer
reverseAPIChannelIndex: reverseAPIChannelIndex:
type: integer type: integer
spectrumConfig:
$ref: "/doc/swagger/include/GLSpectrum.yaml#/GLSpectrum"
ChirpChatDemodReport: ChirpChatDemodReport:
description: ChirpChatDemod description: ChirpChatDemod

View File

@ -48,6 +48,8 @@ FileSinkSettings:
type: integer type: integer
reverseAPIChannelIndex: reverseAPIChannelIndex:
type: integer type: integer
spectrumConfig:
$ref: "/doc/swagger/include/GLSpectrum.yaml#/GLSpectrum"
FileSinkReport: FileSinkReport:
description: FileSink description: FileSink

View File

@ -42,6 +42,8 @@ FreeDVDemodSettings:
type: integer type: integer
reverseAPIChannelIndex: reverseAPIChannelIndex:
type: integer type: integer
spectrumConfig:
$ref: "/doc/swagger/include/GLSpectrum.yaml#/GLSpectrum"
FreeDVDemodReport: FreeDVDemodReport:
description: FreeDVDemod description: FreeDVDemod

View File

@ -44,6 +44,8 @@ FreeDVModSettings:
type: integer type: integer
cwKeyer: cwKeyer:
$ref: "/doc/swagger/include/CWKeyer.yaml#/CWKeyerSettings" $ref: "/doc/swagger/include/CWKeyer.yaml#/CWKeyerSettings"
spectrumConfig:
$ref: "/doc/swagger/include/GLSpectrum.yaml#/GLSpectrum"
FreeDVModReport: FreeDVModReport:
description: FreeDVMod description: FreeDVMod

View File

@ -57,6 +57,8 @@ FreqTrackerSettings:
type: integer type: integer
reverseAPIChannelIndex: reverseAPIChannelIndex:
type: integer type: integer
spectrumConfig:
$ref: "/doc/swagger/include/GLSpectrum.yaml#/GLSpectrum"
FreqTrackerReport: FreqTrackerReport:
description: FreqTracker description: FreqTracker

View File

@ -129,8 +129,9 @@ GLScope:
type: integer type: integer
timeOfs: timeOfs:
type: integer type: integer
traceLen: traceLenMult:
type: integer type: integer
description: Trace length multiplier (multiplies 4800 samples)
trigPre: trigPre:
type: integer type: integer
tracesData: tracesData:

View File

@ -62,6 +62,12 @@ GLSpectrum:
usb: usb:
description: boolean description: boolean
type: integer type: integer
wsSpectrum:
type: integer
description: >
Boolean - Start or stop websocket server
* 0 - Stop server
* 1 - Start server
wsSpectrumAddress: wsSpectrumAddress:
description: IPv4 address of interface the websocket server is listening to description: IPv4 address of interface the websocket server is listening to
type: string type: string

View File

@ -62,6 +62,8 @@ SSBDemodSettings:
type: integer type: integer
reverseAPIChannelIndex: reverseAPIChannelIndex:
type: integer type: integer
spectrumConfig:
$ref: "/doc/swagger/include/GLSpectrum.yaml#/GLSpectrum"
SSBDemodReport: SSBDemodReport:
description: SSBDemod description: SSBDemod

View File

@ -60,6 +60,8 @@ SSBModSettings:
type: integer type: integer
cwKeyer: cwKeyer:
$ref: "/doc/swagger/include/CWKeyer.yaml#/CWKeyerSettings" $ref: "/doc/swagger/include/CWKeyer.yaml#/CWKeyerSettings"
spectrumConfig:
$ref: "/doc/swagger/include/GLSpectrum.yaml#/GLSpectrum"
SSBModReport: SSBModReport:
description: SSBMod description: SSBMod

View File

@ -48,6 +48,8 @@ SigMFFileSinkSettings:
type: integer type: integer
reverseAPIChannelIndex: reverseAPIChannelIndex:
type: integer type: integer
spectrumConfig:
$ref: "/doc/swagger/include/GLSpectrum.yaml#/GLSpectrum"
SigMFFileSinkReport: SigMFFileSinkReport:
description: SigMFFileSink description: SigMFFileSink

View File

@ -69,6 +69,8 @@ UDPSinkSettings:
type: integer type: integer
reverseAPIChannelIndex: reverseAPIChannelIndex:
type: integer type: integer
spectrumConfig:
$ref: "/doc/swagger/include/GLSpectrum.yaml#/GLSpectrum"
UDPSinkReport: UDPSinkReport:
description: UDPSink description: UDPSink

View File

@ -71,6 +71,8 @@ UDPSourceSettings:
type: integer type: integer
reverseAPIChannelIndex: reverseAPIChannelIndex:
type: integer type: integer
spectrumConfig:
$ref: "/doc/swagger/include/GLSpectrum.yaml#/GLSpectrum"
UDPSourceReport: UDPSourceReport:
description: UDPSource description: UDPSource

View File

@ -18,12 +18,19 @@
#ifndef SDRBASE_SETTINGS_SERIALIZABLE_H_ #ifndef SDRBASE_SETTINGS_SERIALIZABLE_H_
#define SDRBASE_SETTINGS_SERIALIZABLE_H_ #define SDRBASE_SETTINGS_SERIALIZABLE_H_
namespace SWGSDRangel {
class SWGObject;
}
class QStringList;
class Serializable class Serializable
{ {
public: public:
virtual ~Serializable() {} virtual ~Serializable() {}
virtual QByteArray serialize() const = 0; virtual QByteArray serialize() const = 0; //!< Serialize to inary
virtual bool deserialize(const QByteArray& data) = 0; virtual bool deserialize(const QByteArray& data) = 0; //!< Deserialize from binary
virtual void formatTo(SWGSDRangel::SWGObject *swgObject) const = 0; //!< Serialize to API
virtual void updateFrom(const QStringList& keys, const SWGSDRangel::SWGObject *swgObject) = 0; //!< Deserialize from API
}; };
#endif /* SDRBASE_SETTINGS_SERIALIZABLE_H_ */ #endif /* SDRBASE_SETTINGS_SERIALIZABLE_H_ */

View File

@ -1884,7 +1884,11 @@ void WebAPIRequestMapper::devicesetDeviceService(const std::string& indexStr, qt
} }
} }
void WebAPIRequestMapper::devicesetDeviceSettingsService(const std::string& indexStr, qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response) void WebAPIRequestMapper::devicesetDeviceSettingsService(
const std::string& indexStr,
qtwebapp::HttpRequest& request,
qtwebapp::HttpResponse& response
)
{ {
SWGSDRangel::SWGErrorResponse errorResponse; SWGSDRangel::SWGErrorResponse errorResponse;
response.setHeader("Content-Type", "application/json"); response.setHeader("Content-Type", "application/json");
@ -4136,14 +4140,8 @@ bool WebAPIRequestMapper::getChannelSettings(
if (channelKeys.contains(channelSettingsKey) && channelSettingsJson[channelSettingsKey].isObject()) if (channelKeys.contains(channelSettingsKey) && channelSettingsJson[channelSettingsKey].isObject())
{ {
QJsonObject settingsJsonObject = channelSettingsJson[channelSettingsKey].toObject(); QJsonObject settingsJsonObject = channelSettingsJson[channelSettingsKey].toObject();
channelSettingsKeys = settingsJsonObject.keys(); extractKeys(settingsJsonObject, channelSettingsKeys);
qDebug() << "WebAPIRequestMapper::getChannelSettings: channelSettingsKeys: " << channelSettingsKeys;
// get possible sub-keys
if (channelSettingsKeys.contains("cwKeyer"))
{
QJsonObject cwJson; // unused
appendSettingsSubKeys(settingsJsonObject, cwJson, "cwKeyer", channelSettingsKeys);
}
if (channelSettingsKey == "ADSBDemodSettings") if (channelSettingsKey == "ADSBDemodSettings")
{ {
@ -4197,7 +4195,8 @@ bool WebAPIRequestMapper::getChannelSettings(
} }
else if (channelSettingsKey == "ChannelAnalyzerSettings") else if (channelSettingsKey == "ChannelAnalyzerSettings")
{ {
processChannelAnalyzerSettings(channelSettings, settingsJsonObject, channelSettingsKeys); channelSettings->setChannelAnalyzerSettings(new SWGSDRangel::SWGChannelAnalyzerSettings());
processChannelAnalyzerSettings(channelSettings, settingsJsonObject);
} }
else if (channelSettingsKey == "ChirpChatDemodSettings") else if (channelSettingsKey == "ChirpChatDemodSettings")
{ {
@ -4473,7 +4472,12 @@ bool WebAPIRequestMapper::appendPresetDeviceKeys(
{ {
SWGSDRangel::SWGDeviceSettings *deviceSettings = new SWGSDRangel::SWGDeviceSettings(); SWGSDRangel::SWGDeviceSettings *deviceSettings = new SWGSDRangel::SWGDeviceSettings();
device->setConfig(deviceSettings); device->setConfig(deviceSettings);
return getDeviceSettings(WebAPIUtils::m_deviceIdToSettingsKey[*deviceId], deviceSettings, deviceSettngsJson["config"].toObject(), devicelKeys.m_deviceKeys); return getDeviceSettings(
WebAPIUtils::m_deviceIdToSettingsKey[*deviceId],
deviceSettings,
deviceSettngsJson["config"].toObject(),
devicelKeys.m_deviceKeys
);
} }
else else
{ {
@ -4498,7 +4502,8 @@ bool WebAPIRequestMapper::getDeviceSettings(
if (deviceKeys.contains(deviceSettingsKey) && deviceSettingsJson[deviceSettingsKey].isObject()) if (deviceKeys.contains(deviceSettingsKey) && deviceSettingsJson[deviceSettingsKey].isObject())
{ {
QJsonObject settingsJsonObject = deviceSettingsJson[deviceSettingsKey].toObject(); QJsonObject settingsJsonObject = deviceSettingsJson[deviceSettingsKey].toObject();
deviceSettingsKeys = settingsJsonObject.keys(); extractKeys(settingsJsonObject, deviceSettingsKeys);
qDebug() << "WebAPIRequestMapper::getDeviceSettings: deviceSettingsKeys: " << deviceSettingsKeys;
if (deviceSettingsKey == "airspySettings") if (deviceSettingsKey == "airspySettings")
{ {
@ -4542,10 +4547,6 @@ bool WebAPIRequestMapper::getDeviceSettings(
} }
else if (deviceSettingsKey == "bladeRF2MIMOSettings") else if (deviceSettingsKey == "bladeRF2MIMOSettings")
{ {
if (deviceSettingsKeys.contains("streams") && settingsJsonObject["streams"].isArray()) {
appendSettingsArrayKeys(settingsJsonObject, "streams", deviceSettingsKeys);
}
deviceSettings->setBladeRf2MimoSettings(new SWGSDRangel::SWGBladeRF2MIMOSettings()); deviceSettings->setBladeRf2MimoSettings(new SWGSDRangel::SWGBladeRF2MIMOSettings());
deviceSettings->getBladeRf2MimoSettings()->fromJsonObject(settingsJsonObject); deviceSettings->getBladeRf2MimoSettings()->fromJsonObject(settingsJsonObject);
} }
@ -4596,19 +4597,11 @@ bool WebAPIRequestMapper::getDeviceSettings(
} }
else if (deviceSettingsKey == "limeSdrMIMOSettings") else if (deviceSettingsKey == "limeSdrMIMOSettings")
{ {
if (deviceSettingsKeys.contains("streams") && settingsJsonObject["streams"].isArray()) {
appendSettingsArrayKeys(settingsJsonObject, "streams", deviceSettingsKeys);
}
deviceSettings->setLimeSdrMimoSettings(new SWGSDRangel::SWGLimeSdrMIMOSettings()); deviceSettings->setLimeSdrMimoSettings(new SWGSDRangel::SWGLimeSdrMIMOSettings());
deviceSettings->getLimeSdrMimoSettings()->fromJsonObject(settingsJsonObject); deviceSettings->getLimeSdrMimoSettings()->fromJsonObject(settingsJsonObject);
} }
else if (deviceSettingsKey == "metisMISOSettings") else if (deviceSettingsKey == "metisMISOSettings")
{ {
if (deviceSettingsKeys.contains("streams") && settingsJsonObject["streams"].isArray()) {
appendSettingsArrayKeys(settingsJsonObject, "streams", deviceSettingsKeys);
}
deviceSettings->setMetisMisoSettings(new SWGSDRangel::SWGMetisMISOSettings()); deviceSettings->setMetisMisoSettings(new SWGSDRangel::SWGMetisMISOSettings());
deviceSettings->getMetisMisoSettings()->fromJsonObject(settingsJsonObject); deviceSettings->getMetisMisoSettings()->fromJsonObject(settingsJsonObject);
} }
@ -4668,20 +4661,12 @@ bool WebAPIRequestMapper::getDeviceSettings(
} }
else if (deviceSettingsKey == "testMISettings") else if (deviceSettingsKey == "testMISettings")
{ {
if (deviceSettingsKeys.contains("streams") && settingsJsonObject["streams"].isArray()) {
appendSettingsArrayKeys(settingsJsonObject, "streams", deviceSettingsKeys);
}
deviceSettings->setTestMiSettings(new SWGSDRangel::SWGTestMISettings()); deviceSettings->setTestMiSettings(new SWGSDRangel::SWGTestMISettings());
deviceSettings->getTestMiSettings()->init(); deviceSettings->getTestMiSettings()->init();
deviceSettings->getTestMiSettings()->fromJsonObject(settingsJsonObject); deviceSettings->getTestMiSettings()->fromJsonObject(settingsJsonObject);
} }
else if (deviceSettingsKey == "testMOSyncSettings") else if (deviceSettingsKey == "testMOSyncSettings")
{ {
if (deviceSettingsKeys.contains("streams") && settingsJsonObject["streams"].isArray()) {
appendSettingsArrayKeys(settingsJsonObject, "streams", deviceSettingsKeys);
}
deviceSettings->setTestMoSyncSettings(new SWGSDRangel::SWGTestMOSyncSettings()); deviceSettings->setTestMoSyncSettings(new SWGSDRangel::SWGTestMOSyncSettings());
deviceSettings->getTestMoSyncSettings()->fromJsonObject(settingsJsonObject); deviceSettings->getTestMoSyncSettings()->fromJsonObject(settingsJsonObject);
} }
@ -4707,10 +4692,6 @@ bool WebAPIRequestMapper::getDeviceSettings(
} }
else if (deviceSettingsKey == "XtrxMIMOSettings") else if (deviceSettingsKey == "XtrxMIMOSettings")
{ {
if (deviceSettingsKeys.contains("streams") && settingsJsonObject["streams"].isArray()) {
appendSettingsArrayKeys(settingsJsonObject, "streams", deviceSettingsKeys);
}
deviceSettings->setXtrxMimoSettings(new SWGSDRangel::SWGXtrxMIMOSettings()); deviceSettings->setXtrxMimoSettings(new SWGSDRangel::SWGXtrxMIMOSettings());
deviceSettings->getXtrxMimoSettings()->fromJsonObject(settingsJsonObject); deviceSettings->getXtrxMimoSettings()->fromJsonObject(settingsJsonObject);
} }
@ -4793,7 +4774,8 @@ bool WebAPIRequestMapper::getFeatureSettings(
if (featureKeys.contains(featureSettingsKey) && featureSettingsJson[featureSettingsKey].isObject()) if (featureKeys.contains(featureSettingsKey) && featureSettingsJson[featureSettingsKey].isObject())
{ {
QJsonObject settingsJsonObject = featureSettingsJson[featureSettingsKey].toObject(); QJsonObject settingsJsonObject = featureSettingsJson[featureSettingsKey].toObject();
featureSettingsKeys = settingsJsonObject.keys(); extractKeys(settingsJsonObject, featureSettingsKeys);
qDebug() << "WebAPIRequestMapper::getFeatureSettings: featureSettingsKeys: " << featureSettingsKeys;
if (featureSettingsKey == "AISSSettings") if (featureSettingsKey == "AISSSettings")
{ {
@ -4810,6 +4792,11 @@ bool WebAPIRequestMapper::getFeatureSettings(
featureSettings->setAprsSettings(new SWGSDRangel::SWGAPRSSettings()); featureSettings->setAprsSettings(new SWGSDRangel::SWGAPRSSettings());
featureSettings->getAprsSettings()->fromJsonObject(settingsJsonObject); featureSettings->getAprsSettings()->fromJsonObject(settingsJsonObject);
} }
else if (featureSettingsKey == "DemodAnalyzerSettings")
{
featureSettings->setDemodAnalyzerSettings(new SWGSDRangel::SWGDemodAnalyzerSettings());
featureSettings->getDemodAnalyzerSettings()->fromJsonObject(settingsJsonObject);
}
else if (featureSettingsKey == "GS232ControllerSettings") else if (featureSettingsKey == "GS232ControllerSettings")
{ {
featureSettings->setGs232ControllerSettings(new SWGSDRangel::SWGGS232ControllerSettings()); featureSettings->setGs232ControllerSettings(new SWGSDRangel::SWGGS232ControllerSettings());
@ -4933,39 +4920,39 @@ bool WebAPIRequestMapper::getFeatureActions(
} }
} }
void WebAPIRequestMapper::appendSettingsSubKeys( void WebAPIRequestMapper::extractKeys(
const QJsonObject& parentSettingsJsonObject, const QJsonObject& rootJsonObject,
QJsonObject& childSettingsJsonObject, QStringList& keyList
const QString& parentKey, )
QStringList& keyList)
{ {
childSettingsJsonObject = parentSettingsJsonObject[parentKey].toObject(); QStringList rootKeys = rootJsonObject.keys();
QStringList childSettingsKeys = childSettingsJsonObject.keys();
for (int i = 0; i < childSettingsKeys.size(); i++) { for (auto rootKey : rootKeys)
keyList.append(parentKey + QString(".") + childSettingsKeys.at(i));
}
}
void WebAPIRequestMapper::appendSettingsArrayKeys(
const QJsonObject& parentSettingsJsonObject,
const QString& parentKey,
QStringList& keyList)
{
QJsonArray arrayJson = parentSettingsJsonObject[parentKey].toArray();
for (int arrayIndex = 0; arrayIndex < arrayJson.count(); arrayIndex++)
{ {
QJsonValue v = arrayJson.at(arrayIndex); keyList.append(rootKey);
if (v.isObject()) if (rootJsonObject[rootKey].isObject())
{ {
QJsonObject itemSettingsJsonObject = v.toObject(); QStringList subKeys;
QStringList itemSettingsKeys = itemSettingsJsonObject.keys(); extractKeys(rootJsonObject[rootKey].toObject(), subKeys);
keyList.append(tr("%1[%2]").arg(parentKey).arg(arrayIndex));
for (int i = 0; i < itemSettingsKeys.size(); i++) { for (auto subKey : subKeys) {
keyList.append(tr("%1[%2].%3").arg(parentKey).arg(arrayIndex).arg(itemSettingsKeys[i])); keyList.append(tr("%1.%2").arg(rootKey).arg(subKey));
}
}
else if (rootJsonObject[rootKey].isArray())
{
QJsonArray arrayJson = rootJsonObject[rootKey].toArray();
for (int arrayIndex = 0; arrayIndex < arrayJson.count(); arrayIndex++)
{
QStringList subKeys;
extractKeys(arrayJson.at(arrayIndex).toObject(), subKeys);
keyList.append(tr("%1[%2]").arg(rootKey).arg(arrayIndex));
for (auto subKey : subKeys) {
keyList.append(tr("%1[%2].%3").arg(rootKey).arg(arrayIndex).arg(subKey));
}
} }
} }
} }
@ -5155,8 +5142,7 @@ void WebAPIRequestMapper::resetFeatureActions(SWGSDRangel::SWGFeatureActions& fe
void WebAPIRequestMapper::processChannelAnalyzerSettings( void WebAPIRequestMapper::processChannelAnalyzerSettings(
SWGSDRangel::SWGChannelSettings *channelSettings, SWGSDRangel::SWGChannelSettings *channelSettings,
const QJsonObject& channelSettingsJson, const QJsonObject& channelSettingsJson
QStringList& channelSettingsKeys
) )
{ {
SWGSDRangel::SWGChannelAnalyzerSettings *channelAnalyzerSettings = new SWGSDRangel::SWGChannelAnalyzerSettings(); SWGSDRangel::SWGChannelAnalyzerSettings *channelAnalyzerSettings = new SWGSDRangel::SWGChannelAnalyzerSettings();
@ -5215,7 +5201,6 @@ void WebAPIRequestMapper::processChannelAnalyzerSettings(
spectrum->init(); spectrum->init();
channelAnalyzerSettings->setSpectrumConfig(spectrum); channelAnalyzerSettings->setSpectrumConfig(spectrum);
QJsonObject spectrumJson; QJsonObject spectrumJson;
appendSettingsSubKeys(channelSettingsJson, spectrumJson, "spectrumConfig", channelSettingsKeys);
spectrum->fromJsonObject(spectrumJson); spectrum->fromJsonObject(spectrumJson);
} }
@ -5225,7 +5210,6 @@ void WebAPIRequestMapper::processChannelAnalyzerSettings(
scopeConfig->init(); scopeConfig->init();
channelAnalyzerSettings->setScopeConfig(scopeConfig); channelAnalyzerSettings->setScopeConfig(scopeConfig);
QJsonObject scopeConfigJson; QJsonObject scopeConfigJson;
appendSettingsSubKeys(channelSettingsJson, scopeConfigJson, "scopeConfig", channelSettingsKeys);
scopeConfig->fromJsonObject(scopeConfigJson); scopeConfig->fromJsonObject(scopeConfigJson);
if (scopeConfigJson.contains("tracesData") && scopeConfigJson["tracesData"].isArray()) if (scopeConfigJson.contains("tracesData") && scopeConfigJson["tracesData"].isArray())
@ -5241,13 +5225,6 @@ void WebAPIRequestMapper::processChannelAnalyzerSettings(
QJsonObject traceJson = tracesJson.at(i).toObject(); QJsonObject traceJson = tracesJson.at(i).toObject();
traceData->fromJsonObject(traceJson); traceData->fromJsonObject(traceJson);
} }
QStringList tracesDataKeys;
appendSettingsArrayKeys(scopeConfigJson, "tracesData", tracesDataKeys);
for (int i = 0; i < tracesDataKeys.size(); i++) {
channelSettingsKeys.append(QString("scopeConfig.") + tracesDataKeys.at(i));
}
} }
if (scopeConfigJson.contains("triggersData") && scopeConfigJson["triggersData"].isArray()) if (scopeConfigJson.contains("triggersData") && scopeConfigJson["triggersData"].isArray())
@ -5263,13 +5240,6 @@ void WebAPIRequestMapper::processChannelAnalyzerSettings(
QJsonObject triggerJson = triggersJson.at(i).toObject(); QJsonObject triggerJson = triggersJson.at(i).toObject();
triggerData->fromJsonObject(triggerJson); triggerData->fromJsonObject(triggerJson);
} }
QStringList triggersDataKeys;
appendSettingsArrayKeys(scopeConfigJson, "triggersData", triggersDataKeys);
for (int i = 0; i < triggersDataKeys.size(); i++) {
channelSettingsKeys.append(QString("scopeConfig.") + triggersDataKeys.at(i));
}
} }
} }
} }
@ -5471,8 +5441,6 @@ void WebAPIRequestMapper::processSoapySDRSettings(
QJsonObject argValueJson = argsJson.at(i).toObject(); QJsonObject argValueJson = argsJson.at(i).toObject();
argValue->fromJsonObject(argValueJson); argValue->fromJsonObject(argValueJson);
} }
appendSettingsArrayKeys(deviceSettingsJson, "deviceArgSettings", deviceSettingsKeys);
} }
if (deviceSettingsKeys.contains("individualGains")) if (deviceSettingsKeys.contains("individualGains"))
@ -5493,8 +5461,6 @@ void WebAPIRequestMapper::processSoapySDRSettings(
QJsonObject argValueJson = argsJson.at(i).toObject(); QJsonObject argValueJson = argsJson.at(i).toObject();
argValue->fromJsonObject(argValueJson); argValue->fromJsonObject(argValueJson);
} }
appendSettingsArrayKeys(deviceSettingsJson, "individualGains", deviceSettingsKeys);
} }
if (deviceSettingsKeys.contains("streamArgSettings")) if (deviceSettingsKeys.contains("streamArgSettings"))
@ -5515,8 +5481,6 @@ void WebAPIRequestMapper::processSoapySDRSettings(
QJsonObject argValueJson = argsJson.at(i).toObject(); QJsonObject argValueJson = argsJson.at(i).toObject();
argValue->fromJsonObject(argValueJson); argValue->fromJsonObject(argValueJson);
} }
appendSettingsArrayKeys(deviceSettingsJson, "streamArgSettings", deviceSettingsKeys);
} }
if (deviceSettingsKeys.contains("tunableElements")) if (deviceSettingsKeys.contains("tunableElements"))
@ -5537,7 +5501,5 @@ void WebAPIRequestMapper::processSoapySDRSettings(
QJsonObject argValueJson = argsJson.at(i).toObject(); QJsonObject argValueJson = argsJson.at(i).toObject();
argValue->fromJsonObject(argValueJson); argValue->fromJsonObject(argValueJson);
} }
appendSettingsArrayKeys(deviceSettingsJson, "tunableElements", deviceSettingsKeys);
} }
} }

View File

@ -185,16 +185,10 @@ private:
QStringList& deviceActionsKeys QStringList& deviceActionsKeys
); );
void appendSettingsSubKeys( void extractKeys(
const QJsonObject& parentSettingsJsonObject, const QJsonObject& rootJsonObject,
QJsonObject& childSettingsJsonObject, QStringList& keyList
const QString& parentKey, );
QStringList& keyList);
void appendSettingsArrayKeys(
const QJsonObject& parentSettingsJsonObject,
const QString& parentKey,
QStringList& keyList);
bool getFeatureSettings( bool getFeatureSettings(
const QString& featureSettingsKey, const QString& featureSettingsKey,
@ -227,8 +221,7 @@ private:
void processChannelAnalyzerSettings( void processChannelAnalyzerSettings(
SWGSDRangel::SWGChannelSettings *channelSettings, SWGSDRangel::SWGChannelSettings *channelSettings,
const QJsonObject& channelSettingsJson, const QJsonObject& channelSettingsJson
QStringList& channelSettingsKeys
); );
void processSoapySDRSettings( void processSoapySDRSettings(

View File

@ -267,6 +267,7 @@ const QMap<QString, QString> WebAPIUtils::m_featureTypeToSettingsKey = {
{"AIS", "AISSettings"}, {"AIS", "AISSettings"},
{"AntennaTools", "AntennaToolsSettings"}, {"AntennaTools", "AntennaToolsSettings"},
{"APRS", "APRSSettings"}, {"APRS", "APRSSettings"},
{"DemodAnalyzer", "DemodAnalyzerSettings"},
{"GS232Controller", "GS232ControllerSettings"}, {"GS232Controller", "GS232ControllerSettings"},
{"Map", "MapSettings"}, {"Map", "MapSettings"},
{"PERTester", "PERTesterSettings"}, {"PERTester", "PERTesterSettings"},
@ -292,6 +293,7 @@ const QMap<QString, QString> WebAPIUtils::m_featureURIToSettingsKey = {
{"sdrangel.feature.ais", "AISSSettings"}, {"sdrangel.feature.ais", "AISSSettings"},
{"sdrangel.feature.antennatools", "AntennaToolsSettings"}, {"sdrangel.feature.antennatools", "AntennaToolsSettings"},
{"sdrangel.feature.aprs", "APRSSettings"}, {"sdrangel.feature.aprs", "APRSSettings"},
{"sdrangel.feature.demodanalyzer", "DemodAnalyzerSettings"},
{"sdrangel.feature.gs232controller", "GS232ControllerSettings"}, {"sdrangel.feature.gs232controller", "GS232ControllerSettings"},
{"sdrangel.feature.map", "MapSettings"}, {"sdrangel.feature.map", "MapSettings"},
{"sdrangel.feature.pertester", "PERTesterSettings"}, {"sdrangel.feature.pertester", "PERTesterSettings"},

View File

@ -81,6 +81,16 @@ bool CWKeyerGUI::deserialize(const QByteArray& data)
} }
} }
void CWKeyerGUI::formatTo(SWGSDRangel::SWGObject *swgObject) const
{
m_settings.formatTo(swgObject);
}
void CWKeyerGUI::updateFrom(const QStringList& keys, const SWGSDRangel::SWGObject *swgObject)
{
m_settings.updateFrom(keys, swgObject);
}
// === SLOTS ================================================================== // === SLOTS ==================================================================
void CWKeyerGUI::on_cwTextClear_clicked(bool checked) void CWKeyerGUI::on_cwTextClear_clicked(bool checked)

View File

@ -47,6 +47,8 @@ public:
void resetToDefaults(); void resetToDefaults();
QByteArray serialize() const; QByteArray serialize() const;
bool deserialize(const QByteArray& data); bool deserialize(const QByteArray& data);
virtual void formatTo(SWGSDRangel::SWGObject *swgObject) const;
virtual void updateFrom(const QStringList& keys, const SWGSDRangel::SWGObject *swgObject);
void setSettings(const CWKeyerSettings& settings) { m_settings = settings; } void setSettings(const CWKeyerSettings& settings) { m_settings = settings; }
void displaySettings(); void displaySettings();

View File

@ -35,7 +35,6 @@ GLScopeGUI::GLScopeGUI(QWidget* parent) :
m_sampleRate(0), m_sampleRate(0),
m_timeBase(1), m_timeBase(1),
m_timeOffset(0), m_timeOffset(0),
m_traceLenMult(1),
m_ctlTraceIndex(0), m_ctlTraceIndex(0),
m_ctlTriggerIndex(0) m_ctlTriggerIndex(0)
{ {
@ -105,7 +104,7 @@ void GLScopeGUI::setBuddies(MessageQueue* messageQueue, ScopeVis* scopeVis, GLSc
fillProjectionCombo(ui->trigMode); fillProjectionCombo(ui->trigMode);
m_scopeVis->configure( m_scopeVis->configure(
2*m_traceLenMult*m_scopeVis->getTraceChunkSize(), 2*m_settings.m_traceLenMult*m_scopeVis->getTraceChunkSize(),
m_timeBase, m_timeBase,
m_timeOffset*10, m_timeOffset*10,
(uint32_t) (m_glScope->getTraceSize() * (ui->trigPre->value()/100.0f)), (uint32_t) (m_glScope->getTraceSize() * (ui->trigPre->value()/100.0f)),
@ -113,7 +112,7 @@ void GLScopeGUI::setBuddies(MessageQueue* messageQueue, ScopeVis* scopeVis, GLSc
); );
m_scopeVis->configure( m_scopeVis->configure(
m_traceLenMult*m_scopeVis->getTraceChunkSize(), m_settings.m_traceLenMult*m_scopeVis->getTraceChunkSize(),
m_timeBase, m_timeBase,
m_timeOffset*10, m_timeOffset*10,
(uint32_t) (m_glScope->getTraceSize() * (ui->trigPre->value()/100.0f)), (uint32_t) (m_glScope->getTraceSize() * (ui->trigPre->value()/100.0f)),
@ -149,8 +148,8 @@ void GLScopeGUI::onScopeSampleRateChanged(int sampleRate)
void GLScopeGUI::onScopeTraceSizeChanged(uint32_t traceNbSamples) void GLScopeGUI::onScopeTraceSizeChanged(uint32_t traceNbSamples)
{ {
qDebug("GLScopeGUI::onScopeTraceSizeChanged: %u", traceNbSamples); qDebug("GLScopeGUI::onScopeTraceSizeChanged: %u", traceNbSamples);
m_traceLenMult = traceNbSamples / m_scopeVis->getTraceChunkSize(); m_settings.m_traceLenMult = traceNbSamples / m_scopeVis->getTraceChunkSize();
ui->traceLen->setValue(m_traceLenMult); ui->traceLen->setValue(m_settings.m_traceLenMult);
setTraceLenDisplay(); setTraceLenDisplay();
} }
@ -263,6 +262,22 @@ bool GLScopeGUI::deserialize(const QByteArray& data)
return ret; return ret;
} }
void GLScopeGUI::formatTo(SWGSDRangel::SWGObject *swgObject) const
{
m_settings.formatTo(swgObject);
}
void GLScopeGUI::updateFrom(const QStringList& keys, const SWGSDRangel::SWGObject *swgObject)
{
m_settings.updateFrom(keys, swgObject);
}
void GLScopeGUI::updateSettings()
{
displaySettings();
applySettings(m_settings); /// FIXME
}
void GLScopeGUI::setNbStreams(unsigned int nbStreams) void GLScopeGUI::setNbStreams(unsigned int nbStreams)
{ {
QStringList streamNames; QStringList streamNames;
@ -464,7 +479,7 @@ void GLScopeGUI::on_time_valueChanged(int value)
setTimeScaleDisplay(); setTimeScaleDisplay();
setTraceDelayDisplay(); setTraceDelayDisplay();
m_scopeVis->configure( m_scopeVis->configure(
m_traceLenMult*m_scopeVis->getTraceChunkSize(), m_settings.m_traceLenMult*m_scopeVis->getTraceChunkSize(),
m_timeBase, m_timeBase,
m_timeOffset*10, m_timeOffset*10,
(uint32_t) (m_glScope->getTraceSize() * (ui->trigPre->value()/100.0f)), (uint32_t) (m_glScope->getTraceSize() * (ui->trigPre->value()/100.0f)),
@ -482,7 +497,7 @@ void GLScopeGUI::on_timeOfs_valueChanged(int value)
m_settings.m_timeOfs = value; m_settings.m_timeOfs = value;
setTimeOfsDisplay(); setTimeOfsDisplay();
m_scopeVis->configure( m_scopeVis->configure(
m_traceLenMult*m_scopeVis->getTraceChunkSize(), m_settings.m_traceLenMult*m_scopeVis->getTraceChunkSize(),
m_timeBase, m_timeBase,
m_timeOffset*10, m_timeOffset*10,
(uint32_t) (m_glScope->getTraceSize() * (ui->trigPre->value()/100.0f)), (uint32_t) (m_glScope->getTraceSize() * (ui->trigPre->value()/100.0f)),
@ -502,10 +517,9 @@ void GLScopeGUI::on_traceLen_valueChanged(int value)
return; return;
} }
m_traceLenMult = value; m_settings.m_traceLenMult = value;
m_settings.m_traceLen = m_traceLenMult*m_scopeVis->getTraceChunkSize();
m_scopeVis->configure( m_scopeVis->configure(
m_traceLenMult*m_scopeVis->getTraceChunkSize(), m_settings.m_traceLenMult*m_scopeVis->getTraceChunkSize(),
m_timeBase, m_timeBase,
m_timeOffset*10, m_timeOffset*10,
(uint32_t) (m_glScope->getTraceSize() * (ui->trigPre->value()/100.0f)), (uint32_t) (m_glScope->getTraceSize() * (ui->trigPre->value()/100.0f)),
@ -945,7 +959,7 @@ void GLScopeGUI::on_trigPre_valueChanged(int value)
(void) value; (void) value;
setTrigPreDisplay(); setTrigPreDisplay();
m_scopeVis->configure( m_scopeVis->configure(
m_traceLenMult*m_scopeVis->getTraceChunkSize(), m_settings.m_traceLenMult*m_scopeVis->getTraceChunkSize(),
m_timeBase, m_timeBase,
m_timeOffset*10, m_timeOffset*10,
(uint32_t) (m_glScope->getTraceSize() * (ui->trigPre->value()/100.0f)), (uint32_t) (m_glScope->getTraceSize() * (ui->trigPre->value()/100.0f)),
@ -986,7 +1000,7 @@ void GLScopeGUI::on_freerun_toggled(bool checked)
} }
m_scopeVis->configure( m_scopeVis->configure(
m_traceLenMult*m_scopeVis->getTraceChunkSize(), m_settings.m_traceLenMult*m_scopeVis->getTraceChunkSize(),
m_timeBase, m_timeBase,
m_timeOffset*10, m_timeOffset*10,
(uint32_t) (m_glScope->getTraceSize() * (ui->trigPre->value()/100.0f)), (uint32_t) (m_glScope->getTraceSize() * (ui->trigPre->value()/100.0f)),
@ -1043,7 +1057,7 @@ void GLScopeGUI::setTimeScaleDisplay()
void GLScopeGUI::setTraceLenDisplay() void GLScopeGUI::setTraceLenDisplay()
{ {
unsigned int n_samples = m_traceLenMult * m_scopeVis->getTraceChunkSize(); unsigned int n_samples = m_settings.m_traceLenMult * m_scopeVis->getTraceChunkSize();
if (n_samples < 1000) { if (n_samples < 1000) {
ui->traceLenText->setToolTip(tr("%1 S").arg(n_samples)); ui->traceLenText->setToolTip(tr("%1 S").arg(n_samples));
@ -1209,7 +1223,7 @@ void GLScopeGUI::setTrigDelayDisplay()
if (m_sampleRate > 0) if (m_sampleRate > 0)
{ {
double delayMult = ui->trigDelayCoarse->value() + ui->trigDelayFine->value() / (m_scopeVis->getTraceChunkSize() / 10.0); double delayMult = ui->trigDelayCoarse->value() + ui->trigDelayFine->value() / (m_scopeVis->getTraceChunkSize() / 10.0);
unsigned int n_samples_delay = m_traceLenMult * m_scopeVis->getTraceChunkSize() * delayMult; unsigned int n_samples_delay = m_settings.m_traceLenMult * m_scopeVis->getTraceChunkSize() * delayMult;
if (n_samples_delay < 1000) { if (n_samples_delay < 1000) {
ui->trigDelayText->setToolTip(tr("%1 S").arg(n_samples_delay)); ui->trigDelayText->setToolTip(tr("%1 S").arg(n_samples_delay));
@ -1361,7 +1375,7 @@ void GLScopeGUI::fillTriggerData(GLScopeSettings::TriggerData& triggerData)
triggerData.m_triggerHoldoff = ui->trigHoldoff->value(); triggerData.m_triggerHoldoff = ui->trigHoldoff->value();
triggerData.m_triggerRepeat = ui->trigCount->value(); triggerData.m_triggerRepeat = ui->trigCount->value();
triggerData.m_triggerDelayMult = ui->trigDelayCoarse->value() + ui->trigDelayFine->value() / (m_scopeVis->getTraceChunkSize() / 10.0); triggerData.m_triggerDelayMult = ui->trigDelayCoarse->value() + ui->trigDelayFine->value() / (m_scopeVis->getTraceChunkSize() / 10.0);
triggerData.m_triggerDelay = (int) (m_traceLenMult * m_scopeVis->getTraceChunkSize() * triggerData.m_triggerDelayMult); triggerData.m_triggerDelay = (int) (m_settings.m_traceLenMult * m_scopeVis->getTraceChunkSize() * triggerData.m_triggerDelayMult);
triggerData.m_triggerDelayCoarse = ui->trigDelayCoarse->value(); triggerData.m_triggerDelayCoarse = ui->trigDelayCoarse->value();
triggerData.m_triggerDelayFine = ui->trigDelayFine->value(); triggerData.m_triggerDelayFine = ui->trigDelayFine->value();
triggerData.setColor(m_focusedTriggerColor); triggerData.setColor(m_focusedTriggerColor);
@ -1490,7 +1504,7 @@ void GLScopeGUI::displaySettings()
setTimeScaleDisplay(); setTimeScaleDisplay();
ui->timeOfs->setValue(m_settings.m_timeOfs); ui->timeOfs->setValue(m_settings.m_timeOfs);
setTimeOfsDisplay(); setTimeOfsDisplay();
ui->traceLen->setValue(m_traceLenMult); ui->traceLen->setValue(m_settings.m_traceLenMult);
} }
bool GLScopeGUI::handleMessage(Message* message) bool GLScopeGUI::handleMessage(Message* message)
@ -1777,7 +1791,7 @@ void GLScopeGUI::focusOnTrigger(int triggerIndex)
void GLScopeGUI::traceLengthChange() void GLScopeGUI::traceLengthChange()
{ {
on_traceLen_valueChanged(m_traceLenMult); on_traceLen_valueChanged(m_settings.m_traceLenMult);
} }
void GLScopeGUI::settingsTraceAdd(const GLScopeSettings::TraceData& traceData) void GLScopeGUI::settingsTraceAdd(const GLScopeSettings::TraceData& traceData)

View File

@ -49,6 +49,9 @@ public:
void resetToDefaults(); void resetToDefaults();
virtual QByteArray serialize() const; virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data); virtual bool deserialize(const QByteArray& data);
virtual void formatTo(SWGSDRangel::SWGObject *swgObject) const;
virtual void updateFrom(const QStringList& keys, const SWGSDRangel::SWGObject *swgObject);
void updateSettings();
bool handleMessage(Message* message); bool handleMessage(Message* message);
unsigned int getNbTraces() const { return m_settings.m_tracesData.size(); } unsigned int getNbTraces() const { return m_settings.m_tracesData.size(); }
@ -155,7 +158,6 @@ private:
int m_sampleRate; int m_sampleRate;
int m_timeBase; int m_timeBase;
int m_timeOffset; int m_timeOffset;
int m_traceLenMult;
QColor m_focusedTraceColor; QColor m_focusedTraceColor;
QColor m_focusedTriggerColor; QColor m_focusedTriggerColor;
int m_ctlTraceIndex; //!< controlled trace index int m_ctlTraceIndex; //!< controlled trace index

View File

@ -115,6 +115,22 @@ bool GLSpectrumGUI::deserialize(const QByteArray& data)
} }
} }
void GLSpectrumGUI::formatTo(SWGSDRangel::SWGObject *swgObject) const
{
m_settings.formatTo(swgObject);
}
void GLSpectrumGUI::updateFrom(const QStringList& keys, const SWGSDRangel::SWGObject *swgObject)
{
m_settings.updateFrom(keys, swgObject);
}
void GLSpectrumGUI::updateSettings()
{
displaySettings();
applySettings();
}
void GLSpectrumGUI::displaySettings() void GLSpectrumGUI::displaySettings()
{ {
blockApplySettings(true); blockApplySettings(true);

View File

@ -58,6 +58,9 @@ public:
void resetToDefaults(); void resetToDefaults();
virtual QByteArray serialize() const; virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data); virtual bool deserialize(const QByteArray& data);
virtual void formatTo(SWGSDRangel::SWGObject *swgObject) const;
virtual void updateFrom(const QStringList& keys, const SWGSDRangel::SWGObject *swgObject);
void updateSettings();
private: private:
Ui::GLSpectrumGUI* ui; Ui::GLSpectrumGUI* ui;

View File

@ -44,6 +44,8 @@ BFMDemodSettings:
type: integer type: integer
reverseAPIChannelIndex: reverseAPIChannelIndex:
type: integer type: integer
spectrumConfig:
$ref: "http://swgserver:8081/api/swagger/include/GLSpectrum.yaml#/GLSpectrum"
BFMDemodReport: BFMDemodReport:
description: BFMDemod description: BFMDemod

View File

@ -54,3 +54,5 @@ ChannelAnalyzerSettings:
$ref: "http://swgserver:8081/api/swagger/include/GLSpectrum.yaml#/GLSpectrum" $ref: "http://swgserver:8081/api/swagger/include/GLSpectrum.yaml#/GLSpectrum"
scopeConfig: scopeConfig:
$ref: "http://swgserver:8081/api/swagger/include/GLScope.yaml#/GLScope" $ref: "http://swgserver:8081/api/swagger/include/GLScope.yaml#/GLScope"
channelMarker:
$ref: "http://swgserver:8081/api/swagger/include/ChannelMarker.yaml#/ChannelMarker"

View File

@ -0,0 +1,13 @@
ChannelMarker:
description: ChannelMarker settings
properties:
centerFrequency:
type: integer
color:
type: integer
description: RGB color
title:
type: string
frequencyScaleDisplayType:
type: integer
description: ChannelMarker::frequencyScaleDisplay_t

View File

@ -118,6 +118,8 @@ ChirpChatDemodSettings:
type: integer type: integer
reverseAPIChannelIndex: reverseAPIChannelIndex:
type: integer type: integer
spectrumConfig:
$ref: "http://swgserver:8081/api/swagger/include/GLSpectrum.yaml#/GLSpectrum"
ChirpChatDemodReport: ChirpChatDemodReport:
description: ChirpChatDemod description: ChirpChatDemod

View File

@ -48,6 +48,8 @@ FileSinkSettings:
type: integer type: integer
reverseAPIChannelIndex: reverseAPIChannelIndex:
type: integer type: integer
spectrumConfig:
$ref: "http://swgserver:8081/api/swagger/include/GLSpectrum.yaml#/GLSpectrum"
FileSinkReport: FileSinkReport:
description: FileSink description: FileSink

View File

@ -42,6 +42,8 @@ FreeDVDemodSettings:
type: integer type: integer
reverseAPIChannelIndex: reverseAPIChannelIndex:
type: integer type: integer
spectrumConfig:
$ref: "http://swgserver:8081/api/swagger/include/GLSpectrum.yaml#/GLSpectrum"
FreeDVDemodReport: FreeDVDemodReport:
description: FreeDVDemod description: FreeDVDemod

View File

@ -44,6 +44,8 @@ FreeDVModSettings:
type: integer type: integer
cwKeyer: cwKeyer:
$ref: "http://swgserver:8081/api/swagger/include/CWKeyer.yaml#/CWKeyerSettings" $ref: "http://swgserver:8081/api/swagger/include/CWKeyer.yaml#/CWKeyerSettings"
spectrumConfig:
$ref: "http://swgserver:8081/api/swagger/include/GLSpectrum.yaml#/GLSpectrum"
FreeDVModReport: FreeDVModReport:
description: FreeDVMod description: FreeDVMod

View File

@ -57,6 +57,8 @@ FreqTrackerSettings:
type: integer type: integer
reverseAPIChannelIndex: reverseAPIChannelIndex:
type: integer type: integer
spectrumConfig:
$ref: "http://swgserver:8081/api/swagger/include/GLSpectrum.yaml#/GLSpectrum"
FreqTrackerReport: FreqTrackerReport:
description: FreqTracker description: FreqTracker

View File

@ -129,8 +129,9 @@ GLScope:
type: integer type: integer
timeOfs: timeOfs:
type: integer type: integer
traceLen: traceLenMult:
type: integer type: integer
description: Trace length multiplier (multiplies 4800 samples)
trigPre: trigPre:
type: integer type: integer
tracesData: tracesData:

View File

@ -62,6 +62,12 @@ GLSpectrum:
usb: usb:
description: boolean description: boolean
type: integer type: integer
wsSpectrum:
type: integer
description: >
Boolean - Start or stop websocket server
* 0 - Stop server
* 1 - Start server
wsSpectrumAddress: wsSpectrumAddress:
description: IPv4 address of interface the websocket server is listening to description: IPv4 address of interface the websocket server is listening to
type: string type: string

View File

@ -62,6 +62,8 @@ SSBDemodSettings:
type: integer type: integer
reverseAPIChannelIndex: reverseAPIChannelIndex:
type: integer type: integer
spectrumConfig:
$ref: "http://swgserver:8081/api/swagger/include/GLSpectrum.yaml#/GLSpectrum"
SSBDemodReport: SSBDemodReport:
description: SSBDemod description: SSBDemod

View File

@ -60,6 +60,8 @@ SSBModSettings:
type: integer type: integer
cwKeyer: cwKeyer:
$ref: "http://swgserver:8081/api/swagger/include/CWKeyer.yaml#/CWKeyerSettings" $ref: "http://swgserver:8081/api/swagger/include/CWKeyer.yaml#/CWKeyerSettings"
spectrumConfig:
$ref: "http://swgserver:8081/api/swagger/include/GLSpectrum.yaml#/GLSpectrum"
SSBModReport: SSBModReport:
description: SSBMod description: SSBMod

View File

@ -48,6 +48,8 @@ SigMFFileSinkSettings:
type: integer type: integer
reverseAPIChannelIndex: reverseAPIChannelIndex:
type: integer type: integer
spectrumConfig:
$ref: "http://swgserver:8081/api/swagger/include/GLSpectrum.yaml#/GLSpectrum"
SigMFFileSinkReport: SigMFFileSinkReport:
description: SigMFFileSink description: SigMFFileSink

View File

@ -69,6 +69,8 @@ UDPSinkSettings:
type: integer type: integer
reverseAPIChannelIndex: reverseAPIChannelIndex:
type: integer type: integer
spectrumConfig:
$ref: "http://swgserver:8081/api/swagger/include/GLSpectrum.yaml#/GLSpectrum"
UDPSinkReport: UDPSinkReport:
description: UDPSink description: UDPSink

View File

@ -71,6 +71,8 @@ UDPSourceSettings:
type: integer type: integer
reverseAPIChannelIndex: reverseAPIChannelIndex:
type: integer type: integer
spectrumConfig:
$ref: "http://swgserver:8081/api/swagger/include/GLSpectrum.yaml#/GLSpectrum"
UDPSourceReport: UDPSourceReport:
description: UDPSource description: UDPSource

View File

@ -2325,6 +2325,9 @@ margin-bottom: 20px;
}, },
"reverseAPIChannelIndex" : { "reverseAPIChannelIndex" : {
"type" : "integer" "type" : "integer"
},
"spectrumConfig" : {
"$ref" : "#/definitions/GLSpectrum"
} }
}, },
"description" : "BFMDemod" "description" : "BFMDemod"
@ -3003,6 +3006,9 @@ margin-bottom: 20px;
}, },
"scopeConfig" : { "scopeConfig" : {
"$ref" : "#/definitions/GLScope" "$ref" : "#/definitions/GLScope"
},
"channelMarker" : {
"$ref" : "#/definitions/ChannelMarker"
} }
}, },
"description" : "ChannelAnalyzer" "description" : "ChannelAnalyzer"
@ -3048,6 +3054,25 @@ margin-bottom: 20px;
} }
}, },
"description" : "Summarized information about channel plugin" "description" : "Summarized information about channel plugin"
};
defs.ChannelMarker = {
"properties" : {
"centerFrequency" : {
"type" : "integer"
},
"color" : {
"type" : "integer",
"description" : "RGB color"
},
"title" : {
"type" : "string"
},
"frequencyScaleDisplayType" : {
"type" : "integer",
"description" : "ChannelMarker::frequencyScaleDisplay_t"
}
},
"description" : "ChannelMarker settings"
}; };
defs.ChannelReport = { defs.ChannelReport = {
"required" : [ "direction" ], "required" : [ "direction" ],
@ -3536,6 +3561,9 @@ margin-bottom: 20px;
}, },
"reverseAPIChannelIndex" : { "reverseAPIChannelIndex" : {
"type" : "integer" "type" : "integer"
},
"spectrumConfig" : {
"$ref" : "#/definitions/GLSpectrum"
} }
}, },
"description" : "ChirpChatDemod" "description" : "ChirpChatDemod"
@ -5395,6 +5423,9 @@ margin-bottom: 20px;
}, },
"reverseAPIChannelIndex" : { "reverseAPIChannelIndex" : {
"type" : "integer" "type" : "integer"
},
"spectrumConfig" : {
"$ref" : "#/definitions/GLSpectrum"
} }
}, },
"description" : "FileSink" "description" : "FileSink"
@ -5575,6 +5606,9 @@ margin-bottom: 20px;
}, },
"reverseAPIChannelIndex" : { "reverseAPIChannelIndex" : {
"type" : "integer" "type" : "integer"
},
"spectrumConfig" : {
"$ref" : "#/definitions/GLSpectrum"
} }
}, },
"description" : "FreeDVDemod" "description" : "FreeDVDemod"
@ -5658,6 +5692,9 @@ margin-bottom: 20px;
}, },
"cwKeyer" : { "cwKeyer" : {
"$ref" : "#/definitions/CWKeyerSettings" "$ref" : "#/definitions/CWKeyerSettings"
},
"spectrumConfig" : {
"$ref" : "#/definitions/GLSpectrum"
} }
}, },
"description" : "FreeDVMod" "description" : "FreeDVMod"
@ -5763,6 +5800,9 @@ margin-bottom: 20px;
}, },
"reverseAPIChannelIndex" : { "reverseAPIChannelIndex" : {
"type" : "integer" "type" : "integer"
},
"spectrumConfig" : {
"$ref" : "#/definitions/GLSpectrum"
} }
}, },
"description" : "FreqTracker" "description" : "FreqTracker"
@ -5827,8 +5867,9 @@ margin-bottom: 20px;
"timeOfs" : { "timeOfs" : {
"type" : "integer" "type" : "integer"
}, },
"traceLen" : { "traceLenMult" : {
"type" : "integer" "type" : "integer",
"description" : "Trace length multiplier (multiplies 4800 samples)"
}, },
"trigPre" : { "trigPre" : {
"type" : "integer" "type" : "integer"
@ -5934,6 +5975,10 @@ margin-bottom: 20px;
"type" : "integer", "type" : "integer",
"description" : "boolean" "description" : "boolean"
}, },
"wsSpectrum" : {
"type" : "integer",
"description" : "Boolean - Start or stop websocket server\n * 0 - Stop server\n * 1 - Start server\n"
},
"wsSpectrumAddress" : { "wsSpectrumAddress" : {
"type" : "string", "type" : "string",
"description" : "IPv4 address of interface the websocket server is listening to" "description" : "IPv4 address of interface the websocket server is listening to"
@ -10304,6 +10349,9 @@ margin-bottom: 20px;
}, },
"reverseAPIChannelIndex" : { "reverseAPIChannelIndex" : {
"type" : "integer" "type" : "integer"
},
"spectrumConfig" : {
"$ref" : "#/definitions/GLSpectrum"
} }
}, },
"description" : "SSBDemod" "description" : "SSBDemod"
@ -10410,6 +10458,9 @@ margin-bottom: 20px;
}, },
"cwKeyer" : { "cwKeyer" : {
"$ref" : "#/definitions/CWKeyerSettings" "$ref" : "#/definitions/CWKeyerSettings"
},
"spectrumConfig" : {
"$ref" : "#/definitions/GLSpectrum"
} }
}, },
"description" : "SSBMod" "description" : "SSBMod"
@ -10954,6 +11005,9 @@ margin-bottom: 20px;
}, },
"reverseAPIChannelIndex" : { "reverseAPIChannelIndex" : {
"type" : "integer" "type" : "integer"
},
"spectrumConfig" : {
"$ref" : "#/definitions/GLSpectrum"
} }
}, },
"description" : "SigMFFileSink" "description" : "SigMFFileSink"
@ -12201,6 +12255,9 @@ margin-bottom: 20px;
}, },
"reverseAPIChannelIndex" : { "reverseAPIChannelIndex" : {
"type" : "integer" "type" : "integer"
},
"spectrumConfig" : {
"$ref" : "#/definitions/GLSpectrum"
} }
}, },
"description" : "UDPSink" "description" : "UDPSink"
@ -12326,6 +12383,9 @@ margin-bottom: 20px;
}, },
"reverseAPIChannelIndex" : { "reverseAPIChannelIndex" : {
"type" : "integer" "type" : "integer"
},
"spectrumConfig" : {
"$ref" : "#/definitions/GLSpectrum"
} }
}, },
"description" : "UDPSource" "description" : "UDPSource"
@ -51387,7 +51447,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2021-11-24T06:35:35.789+01:00 Generated 2021-11-30T22:42:47.179+01:00
</div> </div>
</div> </div>
</div> </div>

View File

@ -64,6 +64,8 @@ SWGBFMDemodSettings::SWGBFMDemodSettings() {
m_reverse_api_device_index_isSet = false; m_reverse_api_device_index_isSet = false;
reverse_api_channel_index = 0; reverse_api_channel_index = 0;
m_reverse_api_channel_index_isSet = false; m_reverse_api_channel_index_isSet = false;
spectrum_config = nullptr;
m_spectrum_config_isSet = false;
} }
SWGBFMDemodSettings::~SWGBFMDemodSettings() { SWGBFMDemodSettings::~SWGBFMDemodSettings() {
@ -108,6 +110,8 @@ SWGBFMDemodSettings::init() {
m_reverse_api_device_index_isSet = false; m_reverse_api_device_index_isSet = false;
reverse_api_channel_index = 0; reverse_api_channel_index = 0;
m_reverse_api_channel_index_isSet = false; m_reverse_api_channel_index_isSet = false;
spectrum_config = new SWGGLSpectrum();
m_spectrum_config_isSet = false;
} }
void void
@ -136,6 +140,9 @@ SWGBFMDemodSettings::cleanup() {
if(spectrum_config != nullptr) {
delete spectrum_config;
}
} }
SWGBFMDemodSettings* SWGBFMDemodSettings*
@ -185,6 +192,8 @@ SWGBFMDemodSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&reverse_api_channel_index, pJson["reverseAPIChannelIndex"], "qint32", ""); ::SWGSDRangel::setValue(&reverse_api_channel_index, pJson["reverseAPIChannelIndex"], "qint32", "");
::SWGSDRangel::setValue(&spectrum_config, pJson["spectrumConfig"], "SWGGLSpectrum", "SWGGLSpectrum");
} }
QString QString
@ -255,6 +264,9 @@ SWGBFMDemodSettings::asJsonObject() {
if(m_reverse_api_channel_index_isSet){ if(m_reverse_api_channel_index_isSet){
obj->insert("reverseAPIChannelIndex", QJsonValue(reverse_api_channel_index)); obj->insert("reverseAPIChannelIndex", QJsonValue(reverse_api_channel_index));
} }
if((spectrum_config != nullptr) && (spectrum_config->isSet())){
toJsonValue(QString("spectrumConfig"), spectrum_config, obj, QString("SWGGLSpectrum"));
}
return obj; return obj;
} }
@ -439,6 +451,16 @@ SWGBFMDemodSettings::setReverseApiChannelIndex(qint32 reverse_api_channel_index)
this->m_reverse_api_channel_index_isSet = true; this->m_reverse_api_channel_index_isSet = true;
} }
SWGGLSpectrum*
SWGBFMDemodSettings::getSpectrumConfig() {
return spectrum_config;
}
void
SWGBFMDemodSettings::setSpectrumConfig(SWGGLSpectrum* spectrum_config) {
this->spectrum_config = spectrum_config;
this->m_spectrum_config_isSet = true;
}
bool bool
SWGBFMDemodSettings::isSet(){ SWGBFMDemodSettings::isSet(){
@ -498,6 +520,9 @@ SWGBFMDemodSettings::isSet(){
if(m_reverse_api_channel_index_isSet){ if(m_reverse_api_channel_index_isSet){
isObjectUpdated = true; break; isObjectUpdated = true; break;
} }
if(spectrum_config && spectrum_config->isSet()){
isObjectUpdated = true; break;
}
}while(false); }while(false);
return isObjectUpdated; return isObjectUpdated;
} }

View File

@ -22,6 +22,7 @@
#include <QJsonObject> #include <QJsonObject>
#include "SWGGLSpectrum.h"
#include <QString> #include <QString>
#include "SWGObject.h" #include "SWGObject.h"
@ -96,6 +97,9 @@ public:
qint32 getReverseApiChannelIndex(); qint32 getReverseApiChannelIndex();
void setReverseApiChannelIndex(qint32 reverse_api_channel_index); void setReverseApiChannelIndex(qint32 reverse_api_channel_index);
SWGGLSpectrum* getSpectrumConfig();
void setSpectrumConfig(SWGGLSpectrum* spectrum_config);
virtual bool isSet() override; virtual bool isSet() override;
@ -154,6 +158,9 @@ private:
qint32 reverse_api_channel_index; qint32 reverse_api_channel_index;
bool m_reverse_api_channel_index_isSet; bool m_reverse_api_channel_index_isSet;
SWGGLSpectrum* spectrum_config;
bool m_spectrum_config_isSet;
}; };
} }

View File

@ -70,6 +70,8 @@ SWGChannelAnalyzerSettings::SWGChannelAnalyzerSettings() {
m_spectrum_config_isSet = false; m_spectrum_config_isSet = false;
scope_config = nullptr; scope_config = nullptr;
m_scope_config_isSet = false; m_scope_config_isSet = false;
channel_marker = nullptr;
m_channel_marker_isSet = false;
} }
SWGChannelAnalyzerSettings::~SWGChannelAnalyzerSettings() { SWGChannelAnalyzerSettings::~SWGChannelAnalyzerSettings() {
@ -120,6 +122,8 @@ SWGChannelAnalyzerSettings::init() {
m_spectrum_config_isSet = false; m_spectrum_config_isSet = false;
scope_config = new SWGGLScope(); scope_config = new SWGGLScope();
m_scope_config_isSet = false; m_scope_config_isSet = false;
channel_marker = new SWGChannelMarker();
m_channel_marker_isSet = false;
} }
void void
@ -151,6 +155,9 @@ SWGChannelAnalyzerSettings::cleanup() {
if(scope_config != nullptr) { if(scope_config != nullptr) {
delete scope_config; delete scope_config;
} }
if(channel_marker != nullptr) {
delete channel_marker;
}
} }
SWGChannelAnalyzerSettings* SWGChannelAnalyzerSettings*
@ -206,6 +213,8 @@ SWGChannelAnalyzerSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&scope_config, pJson["scopeConfig"], "SWGGLScope", "SWGGLScope"); ::SWGSDRangel::setValue(&scope_config, pJson["scopeConfig"], "SWGGLScope", "SWGGLScope");
::SWGSDRangel::setValue(&channel_marker, pJson["channelMarker"], "SWGChannelMarker", "SWGChannelMarker");
} }
QString QString
@ -285,6 +294,9 @@ SWGChannelAnalyzerSettings::asJsonObject() {
if((scope_config != nullptr) && (scope_config->isSet())){ if((scope_config != nullptr) && (scope_config->isSet())){
toJsonValue(QString("scopeConfig"), scope_config, obj, QString("SWGGLScope")); toJsonValue(QString("scopeConfig"), scope_config, obj, QString("SWGGLScope"));
} }
if((channel_marker != nullptr) && (channel_marker->isSet())){
toJsonValue(QString("channelMarker"), channel_marker, obj, QString("SWGChannelMarker"));
}
return obj; return obj;
} }
@ -499,6 +511,16 @@ SWGChannelAnalyzerSettings::setScopeConfig(SWGGLScope* scope_config) {
this->m_scope_config_isSet = true; this->m_scope_config_isSet = true;
} }
SWGChannelMarker*
SWGChannelAnalyzerSettings::getChannelMarker() {
return channel_marker;
}
void
SWGChannelAnalyzerSettings::setChannelMarker(SWGChannelMarker* channel_marker) {
this->channel_marker = channel_marker;
this->m_channel_marker_isSet = true;
}
bool bool
SWGChannelAnalyzerSettings::isSet(){ SWGChannelAnalyzerSettings::isSet(){
@ -567,6 +589,9 @@ SWGChannelAnalyzerSettings::isSet(){
if(scope_config && scope_config->isSet()){ if(scope_config && scope_config->isSet()){
isObjectUpdated = true; break; isObjectUpdated = true; break;
} }
if(channel_marker && channel_marker->isSet()){
isObjectUpdated = true; break;
}
}while(false); }while(false);
return isObjectUpdated; return isObjectUpdated;
} }

View File

@ -22,6 +22,7 @@
#include <QJsonObject> #include <QJsonObject>
#include "SWGChannelMarker.h"
#include "SWGGLScope.h" #include "SWGGLScope.h"
#include "SWGGLSpectrum.h" #include "SWGGLSpectrum.h"
#include <QString> #include <QString>
@ -107,6 +108,9 @@ public:
SWGGLScope* getScopeConfig(); SWGGLScope* getScopeConfig();
void setScopeConfig(SWGGLScope* scope_config); void setScopeConfig(SWGGLScope* scope_config);
SWGChannelMarker* getChannelMarker();
void setChannelMarker(SWGChannelMarker* channel_marker);
virtual bool isSet() override; virtual bool isSet() override;
@ -174,6 +178,9 @@ private:
SWGGLScope* scope_config; SWGGLScope* scope_config;
bool m_scope_config_isSet; bool m_scope_config_isSet;
SWGChannelMarker* channel_marker;
bool m_channel_marker_isSet;
}; };
} }

View File

@ -0,0 +1,179 @@
/**
* 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 "SWGChannelMarker.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGChannelMarker::SWGChannelMarker(QString* json) {
init();
this->fromJson(*json);
}
SWGChannelMarker::SWGChannelMarker() {
center_frequency = 0;
m_center_frequency_isSet = false;
color = 0;
m_color_isSet = false;
title = nullptr;
m_title_isSet = false;
frequency_scale_display_type = 0;
m_frequency_scale_display_type_isSet = false;
}
SWGChannelMarker::~SWGChannelMarker() {
this->cleanup();
}
void
SWGChannelMarker::init() {
center_frequency = 0;
m_center_frequency_isSet = false;
color = 0;
m_color_isSet = false;
title = new QString("");
m_title_isSet = false;
frequency_scale_display_type = 0;
m_frequency_scale_display_type_isSet = false;
}
void
SWGChannelMarker::cleanup() {
if(title != nullptr) {
delete title;
}
}
SWGChannelMarker*
SWGChannelMarker::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGChannelMarker::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&center_frequency, pJson["centerFrequency"], "qint32", "");
::SWGSDRangel::setValue(&color, pJson["color"], "qint32", "");
::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString");
::SWGSDRangel::setValue(&frequency_scale_display_type, pJson["frequencyScaleDisplayType"], "qint32", "");
}
QString
SWGChannelMarker::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGChannelMarker::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_center_frequency_isSet){
obj->insert("centerFrequency", QJsonValue(center_frequency));
}
if(m_color_isSet){
obj->insert("color", QJsonValue(color));
}
if(title != nullptr && *title != QString("")){
toJsonValue(QString("title"), title, obj, QString("QString"));
}
if(m_frequency_scale_display_type_isSet){
obj->insert("frequencyScaleDisplayType", QJsonValue(frequency_scale_display_type));
}
return obj;
}
qint32
SWGChannelMarker::getCenterFrequency() {
return center_frequency;
}
void
SWGChannelMarker::setCenterFrequency(qint32 center_frequency) {
this->center_frequency = center_frequency;
this->m_center_frequency_isSet = true;
}
qint32
SWGChannelMarker::getColor() {
return color;
}
void
SWGChannelMarker::setColor(qint32 color) {
this->color = color;
this->m_color_isSet = true;
}
QString*
SWGChannelMarker::getTitle() {
return title;
}
void
SWGChannelMarker::setTitle(QString* title) {
this->title = title;
this->m_title_isSet = true;
}
qint32
SWGChannelMarker::getFrequencyScaleDisplayType() {
return frequency_scale_display_type;
}
void
SWGChannelMarker::setFrequencyScaleDisplayType(qint32 frequency_scale_display_type) {
this->frequency_scale_display_type = frequency_scale_display_type;
this->m_frequency_scale_display_type_isSet = true;
}
bool
SWGChannelMarker::isSet(){
bool isObjectUpdated = false;
do{
if(m_center_frequency_isSet){
isObjectUpdated = true; break;
}
if(m_color_isSet){
isObjectUpdated = true; break;
}
if(title && *title != QString("")){
isObjectUpdated = true; break;
}
if(m_frequency_scale_display_type_isSet){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}
}

View File

@ -0,0 +1,77 @@
/**
* 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.
*/
/*
* SWGChannelMarker.h
*
* ChannelMarker settings
*/
#ifndef SWGChannelMarker_H_
#define SWGChannelMarker_H_
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGChannelMarker: public SWGObject {
public:
SWGChannelMarker();
SWGChannelMarker(QString* json);
virtual ~SWGChannelMarker();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGChannelMarker* fromJson(QString &jsonString) override;
qint32 getCenterFrequency();
void setCenterFrequency(qint32 center_frequency);
qint32 getColor();
void setColor(qint32 color);
QString* getTitle();
void setTitle(QString* title);
qint32 getFrequencyScaleDisplayType();
void setFrequencyScaleDisplayType(qint32 frequency_scale_display_type);
virtual bool isSet() override;
private:
qint32 center_frequency;
bool m_center_frequency_isSet;
qint32 color;
bool m_color_isSet;
QString* title;
bool m_title_isSet;
qint32 frequency_scale_display_type;
bool m_frequency_scale_display_type_isSet;
};
}
#endif /* SWGChannelMarker_H_ */

View File

@ -82,6 +82,8 @@ SWGChirpChatDemodSettings::SWGChirpChatDemodSettings() {
m_reverse_api_device_index_isSet = false; m_reverse_api_device_index_isSet = false;
reverse_api_channel_index = 0; reverse_api_channel_index = 0;
m_reverse_api_channel_index_isSet = false; m_reverse_api_channel_index_isSet = false;
spectrum_config = nullptr;
m_spectrum_config_isSet = false;
} }
SWGChirpChatDemodSettings::~SWGChirpChatDemodSettings() { SWGChirpChatDemodSettings::~SWGChirpChatDemodSettings() {
@ -144,6 +146,8 @@ SWGChirpChatDemodSettings::init() {
m_reverse_api_device_index_isSet = false; m_reverse_api_device_index_isSet = false;
reverse_api_channel_index = 0; reverse_api_channel_index = 0;
m_reverse_api_channel_index_isSet = false; m_reverse_api_channel_index_isSet = false;
spectrum_config = new SWGGLSpectrum();
m_spectrum_config_isSet = false;
} }
void void
@ -181,6 +185,9 @@ SWGChirpChatDemodSettings::cleanup() {
if(spectrum_config != nullptr) {
delete spectrum_config;
}
} }
SWGChirpChatDemodSettings* SWGChirpChatDemodSettings*
@ -248,6 +255,8 @@ SWGChirpChatDemodSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&reverse_api_channel_index, pJson["reverseAPIChannelIndex"], "qint32", ""); ::SWGSDRangel::setValue(&reverse_api_channel_index, pJson["reverseAPIChannelIndex"], "qint32", "");
::SWGSDRangel::setValue(&spectrum_config, pJson["spectrumConfig"], "SWGGLSpectrum", "SWGGLSpectrum");
} }
QString QString
@ -345,6 +354,9 @@ SWGChirpChatDemodSettings::asJsonObject() {
if(m_reverse_api_channel_index_isSet){ if(m_reverse_api_channel_index_isSet){
obj->insert("reverseAPIChannelIndex", QJsonValue(reverse_api_channel_index)); obj->insert("reverseAPIChannelIndex", QJsonValue(reverse_api_channel_index));
} }
if((spectrum_config != nullptr) && (spectrum_config->isSet())){
toJsonValue(QString("spectrumConfig"), spectrum_config, obj, QString("SWGGLSpectrum"));
}
return obj; return obj;
} }
@ -619,6 +631,16 @@ SWGChirpChatDemodSettings::setReverseApiChannelIndex(qint32 reverse_api_channel_
this->m_reverse_api_channel_index_isSet = true; this->m_reverse_api_channel_index_isSet = true;
} }
SWGGLSpectrum*
SWGChirpChatDemodSettings::getSpectrumConfig() {
return spectrum_config;
}
void
SWGChirpChatDemodSettings::setSpectrumConfig(SWGGLSpectrum* spectrum_config) {
this->spectrum_config = spectrum_config;
this->m_spectrum_config_isSet = true;
}
bool bool
SWGChirpChatDemodSettings::isSet(){ SWGChirpChatDemodSettings::isSet(){
@ -705,6 +727,9 @@ SWGChirpChatDemodSettings::isSet(){
if(m_reverse_api_channel_index_isSet){ if(m_reverse_api_channel_index_isSet){
isObjectUpdated = true; break; isObjectUpdated = true; break;
} }
if(spectrum_config && spectrum_config->isSet()){
isObjectUpdated = true; break;
}
}while(false); }while(false);
return isObjectUpdated; return isObjectUpdated;
} }

View File

@ -22,6 +22,7 @@
#include <QJsonObject> #include <QJsonObject>
#include "SWGGLSpectrum.h"
#include <QString> #include <QString>
#include "SWGObject.h" #include "SWGObject.h"
@ -123,6 +124,9 @@ public:
qint32 getReverseApiChannelIndex(); qint32 getReverseApiChannelIndex();
void setReverseApiChannelIndex(qint32 reverse_api_channel_index); void setReverseApiChannelIndex(qint32 reverse_api_channel_index);
SWGGLSpectrum* getSpectrumConfig();
void setSpectrumConfig(SWGGLSpectrum* spectrum_config);
virtual bool isSet() override; virtual bool isSet() override;
@ -208,6 +212,9 @@ private:
qint32 reverse_api_channel_index; qint32 reverse_api_channel_index;
bool m_reverse_api_channel_index_isSet; bool m_reverse_api_channel_index_isSet;
SWGGLSpectrum* spectrum_config;
bool m_spectrum_config_isSet;
}; };
} }

View File

@ -60,6 +60,8 @@ SWGFileSinkSettings::SWGFileSinkSettings() {
m_reverse_api_device_index_isSet = false; m_reverse_api_device_index_isSet = false;
reverse_api_channel_index = 0; reverse_api_channel_index = 0;
m_reverse_api_channel_index_isSet = false; m_reverse_api_channel_index_isSet = false;
spectrum_config = nullptr;
m_spectrum_config_isSet = false;
} }
SWGFileSinkSettings::~SWGFileSinkSettings() { SWGFileSinkSettings::~SWGFileSinkSettings() {
@ -100,6 +102,8 @@ SWGFileSinkSettings::init() {
m_reverse_api_device_index_isSet = false; m_reverse_api_device_index_isSet = false;
reverse_api_channel_index = 0; reverse_api_channel_index = 0;
m_reverse_api_channel_index_isSet = false; m_reverse_api_channel_index_isSet = false;
spectrum_config = new SWGGLSpectrum();
m_spectrum_config_isSet = false;
} }
void void
@ -126,6 +130,9 @@ SWGFileSinkSettings::cleanup() {
if(spectrum_config != nullptr) {
delete spectrum_config;
}
} }
SWGFileSinkSettings* SWGFileSinkSettings*
@ -171,6 +178,8 @@ SWGFileSinkSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&reverse_api_channel_index, pJson["reverseAPIChannelIndex"], "qint32", ""); ::SWGSDRangel::setValue(&reverse_api_channel_index, pJson["reverseAPIChannelIndex"], "qint32", "");
::SWGSDRangel::setValue(&spectrum_config, pJson["spectrumConfig"], "SWGGLSpectrum", "SWGGLSpectrum");
} }
QString QString
@ -235,6 +244,9 @@ SWGFileSinkSettings::asJsonObject() {
if(m_reverse_api_channel_index_isSet){ if(m_reverse_api_channel_index_isSet){
obj->insert("reverseAPIChannelIndex", QJsonValue(reverse_api_channel_index)); obj->insert("reverseAPIChannelIndex", QJsonValue(reverse_api_channel_index));
} }
if((spectrum_config != nullptr) && (spectrum_config->isSet())){
toJsonValue(QString("spectrumConfig"), spectrum_config, obj, QString("SWGGLSpectrum"));
}
return obj; return obj;
} }
@ -399,6 +411,16 @@ SWGFileSinkSettings::setReverseApiChannelIndex(qint32 reverse_api_channel_index)
this->m_reverse_api_channel_index_isSet = true; this->m_reverse_api_channel_index_isSet = true;
} }
SWGGLSpectrum*
SWGFileSinkSettings::getSpectrumConfig() {
return spectrum_config;
}
void
SWGFileSinkSettings::setSpectrumConfig(SWGGLSpectrum* spectrum_config) {
this->spectrum_config = spectrum_config;
this->m_spectrum_config_isSet = true;
}
bool bool
SWGFileSinkSettings::isSet(){ SWGFileSinkSettings::isSet(){
@ -452,6 +474,9 @@ SWGFileSinkSettings::isSet(){
if(m_reverse_api_channel_index_isSet){ if(m_reverse_api_channel_index_isSet){
isObjectUpdated = true; break; isObjectUpdated = true; break;
} }
if(spectrum_config && spectrum_config->isSet()){
isObjectUpdated = true; break;
}
}while(false); }while(false);
return isObjectUpdated; return isObjectUpdated;
} }

View File

@ -22,6 +22,7 @@
#include <QJsonObject> #include <QJsonObject>
#include "SWGGLSpectrum.h"
#include <QString> #include <QString>
#include "SWGObject.h" #include "SWGObject.h"
@ -90,6 +91,9 @@ public:
qint32 getReverseApiChannelIndex(); qint32 getReverseApiChannelIndex();
void setReverseApiChannelIndex(qint32 reverse_api_channel_index); void setReverseApiChannelIndex(qint32 reverse_api_channel_index);
SWGGLSpectrum* getSpectrumConfig();
void setSpectrumConfig(SWGGLSpectrum* spectrum_config);
virtual bool isSet() override; virtual bool isSet() override;
@ -142,6 +146,9 @@ private:
qint32 reverse_api_channel_index; qint32 reverse_api_channel_index;
bool m_reverse_api_channel_index_isSet; bool m_reverse_api_channel_index_isSet;
SWGGLSpectrum* spectrum_config;
bool m_spectrum_config_isSet;
}; };
} }

View File

@ -60,6 +60,8 @@ SWGFreeDVDemodSettings::SWGFreeDVDemodSettings() {
m_reverse_api_device_index_isSet = false; m_reverse_api_device_index_isSet = false;
reverse_api_channel_index = 0; reverse_api_channel_index = 0;
m_reverse_api_channel_index_isSet = false; m_reverse_api_channel_index_isSet = false;
spectrum_config = nullptr;
m_spectrum_config_isSet = false;
} }
SWGFreeDVDemodSettings::~SWGFreeDVDemodSettings() { SWGFreeDVDemodSettings::~SWGFreeDVDemodSettings() {
@ -100,6 +102,8 @@ SWGFreeDVDemodSettings::init() {
m_reverse_api_device_index_isSet = false; m_reverse_api_device_index_isSet = false;
reverse_api_channel_index = 0; reverse_api_channel_index = 0;
m_reverse_api_channel_index_isSet = false; m_reverse_api_channel_index_isSet = false;
spectrum_config = new SWGGLSpectrum();
m_spectrum_config_isSet = false;
} }
void void
@ -126,6 +130,9 @@ SWGFreeDVDemodSettings::cleanup() {
if(spectrum_config != nullptr) {
delete spectrum_config;
}
} }
SWGFreeDVDemodSettings* SWGFreeDVDemodSettings*
@ -171,6 +178,8 @@ SWGFreeDVDemodSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&reverse_api_channel_index, pJson["reverseAPIChannelIndex"], "qint32", ""); ::SWGSDRangel::setValue(&reverse_api_channel_index, pJson["reverseAPIChannelIndex"], "qint32", "");
::SWGSDRangel::setValue(&spectrum_config, pJson["spectrumConfig"], "SWGGLSpectrum", "SWGGLSpectrum");
} }
QString QString
@ -235,6 +244,9 @@ SWGFreeDVDemodSettings::asJsonObject() {
if(m_reverse_api_channel_index_isSet){ if(m_reverse_api_channel_index_isSet){
obj->insert("reverseAPIChannelIndex", QJsonValue(reverse_api_channel_index)); obj->insert("reverseAPIChannelIndex", QJsonValue(reverse_api_channel_index));
} }
if((spectrum_config != nullptr) && (spectrum_config->isSet())){
toJsonValue(QString("spectrumConfig"), spectrum_config, obj, QString("SWGGLSpectrum"));
}
return obj; return obj;
} }
@ -399,6 +411,16 @@ SWGFreeDVDemodSettings::setReverseApiChannelIndex(qint32 reverse_api_channel_ind
this->m_reverse_api_channel_index_isSet = true; this->m_reverse_api_channel_index_isSet = true;
} }
SWGGLSpectrum*
SWGFreeDVDemodSettings::getSpectrumConfig() {
return spectrum_config;
}
void
SWGFreeDVDemodSettings::setSpectrumConfig(SWGGLSpectrum* spectrum_config) {
this->spectrum_config = spectrum_config;
this->m_spectrum_config_isSet = true;
}
bool bool
SWGFreeDVDemodSettings::isSet(){ SWGFreeDVDemodSettings::isSet(){
@ -452,6 +474,9 @@ SWGFreeDVDemodSettings::isSet(){
if(m_reverse_api_channel_index_isSet){ if(m_reverse_api_channel_index_isSet){
isObjectUpdated = true; break; isObjectUpdated = true; break;
} }
if(spectrum_config && spectrum_config->isSet()){
isObjectUpdated = true; break;
}
}while(false); }while(false);
return isObjectUpdated; return isObjectUpdated;
} }

View File

@ -22,6 +22,7 @@
#include <QJsonObject> #include <QJsonObject>
#include "SWGGLSpectrum.h"
#include <QString> #include <QString>
#include "SWGObject.h" #include "SWGObject.h"
@ -90,6 +91,9 @@ public:
qint32 getReverseApiChannelIndex(); qint32 getReverseApiChannelIndex();
void setReverseApiChannelIndex(qint32 reverse_api_channel_index); void setReverseApiChannelIndex(qint32 reverse_api_channel_index);
SWGGLSpectrum* getSpectrumConfig();
void setSpectrumConfig(SWGGLSpectrum* spectrum_config);
virtual bool isSet() override; virtual bool isSet() override;
@ -142,6 +146,9 @@ private:
qint32 reverse_api_channel_index; qint32 reverse_api_channel_index;
bool m_reverse_api_channel_index_isSet; bool m_reverse_api_channel_index_isSet;
SWGGLSpectrum* spectrum_config;
bool m_spectrum_config_isSet;
}; };
} }

View File

@ -66,6 +66,8 @@ SWGFreeDVModSettings::SWGFreeDVModSettings() {
m_reverse_api_channel_index_isSet = false; m_reverse_api_channel_index_isSet = false;
cw_keyer = nullptr; cw_keyer = nullptr;
m_cw_keyer_isSet = false; m_cw_keyer_isSet = false;
spectrum_config = nullptr;
m_spectrum_config_isSet = false;
} }
SWGFreeDVModSettings::~SWGFreeDVModSettings() { SWGFreeDVModSettings::~SWGFreeDVModSettings() {
@ -112,6 +114,8 @@ SWGFreeDVModSettings::init() {
m_reverse_api_channel_index_isSet = false; m_reverse_api_channel_index_isSet = false;
cw_keyer = new SWGCWKeyerSettings(); cw_keyer = new SWGCWKeyerSettings();
m_cw_keyer_isSet = false; m_cw_keyer_isSet = false;
spectrum_config = new SWGGLSpectrum();
m_spectrum_config_isSet = false;
} }
void void
@ -143,6 +147,9 @@ SWGFreeDVModSettings::cleanup() {
if(cw_keyer != nullptr) { if(cw_keyer != nullptr) {
delete cw_keyer; delete cw_keyer;
} }
if(spectrum_config != nullptr) {
delete spectrum_config;
}
} }
SWGFreeDVModSettings* SWGFreeDVModSettings*
@ -194,6 +201,8 @@ SWGFreeDVModSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&cw_keyer, pJson["cwKeyer"], "SWGCWKeyerSettings", "SWGCWKeyerSettings"); ::SWGSDRangel::setValue(&cw_keyer, pJson["cwKeyer"], "SWGCWKeyerSettings", "SWGCWKeyerSettings");
::SWGSDRangel::setValue(&spectrum_config, pJson["spectrumConfig"], "SWGGLSpectrum", "SWGGLSpectrum");
} }
QString QString
@ -267,6 +276,9 @@ SWGFreeDVModSettings::asJsonObject() {
if((cw_keyer != nullptr) && (cw_keyer->isSet())){ if((cw_keyer != nullptr) && (cw_keyer->isSet())){
toJsonValue(QString("cwKeyer"), cw_keyer, obj, QString("SWGCWKeyerSettings")); toJsonValue(QString("cwKeyer"), cw_keyer, obj, QString("SWGCWKeyerSettings"));
} }
if((spectrum_config != nullptr) && (spectrum_config->isSet())){
toJsonValue(QString("spectrumConfig"), spectrum_config, obj, QString("SWGGLSpectrum"));
}
return obj; return obj;
} }
@ -461,6 +473,16 @@ SWGFreeDVModSettings::setCwKeyer(SWGCWKeyerSettings* cw_keyer) {
this->m_cw_keyer_isSet = true; this->m_cw_keyer_isSet = true;
} }
SWGGLSpectrum*
SWGFreeDVModSettings::getSpectrumConfig() {
return spectrum_config;
}
void
SWGFreeDVModSettings::setSpectrumConfig(SWGGLSpectrum* spectrum_config) {
this->spectrum_config = spectrum_config;
this->m_spectrum_config_isSet = true;
}
bool bool
SWGFreeDVModSettings::isSet(){ SWGFreeDVModSettings::isSet(){
@ -523,6 +545,9 @@ SWGFreeDVModSettings::isSet(){
if(cw_keyer && cw_keyer->isSet()){ if(cw_keyer && cw_keyer->isSet()){
isObjectUpdated = true; break; isObjectUpdated = true; break;
} }
if(spectrum_config && spectrum_config->isSet()){
isObjectUpdated = true; break;
}
}while(false); }while(false);
return isObjectUpdated; return isObjectUpdated;
} }

View File

@ -23,6 +23,7 @@
#include "SWGCWKeyerSettings.h" #include "SWGCWKeyerSettings.h"
#include "SWGGLSpectrum.h"
#include <QString> #include <QString>
#include "SWGObject.h" #include "SWGObject.h"
@ -100,6 +101,9 @@ public:
SWGCWKeyerSettings* getCwKeyer(); SWGCWKeyerSettings* getCwKeyer();
void setCwKeyer(SWGCWKeyerSettings* cw_keyer); void setCwKeyer(SWGCWKeyerSettings* cw_keyer);
SWGGLSpectrum* getSpectrumConfig();
void setSpectrumConfig(SWGGLSpectrum* spectrum_config);
virtual bool isSet() override; virtual bool isSet() override;
@ -161,6 +165,9 @@ private:
SWGCWKeyerSettings* cw_keyer; SWGCWKeyerSettings* cw_keyer;
bool m_cw_keyer_isSet; bool m_cw_keyer_isSet;
SWGGLSpectrum* spectrum_config;
bool m_spectrum_config_isSet;
}; };
} }

View File

@ -68,6 +68,8 @@ SWGFreqTrackerSettings::SWGFreqTrackerSettings() {
m_reverse_api_device_index_isSet = false; m_reverse_api_device_index_isSet = false;
reverse_api_channel_index = 0; reverse_api_channel_index = 0;
m_reverse_api_channel_index_isSet = false; m_reverse_api_channel_index_isSet = false;
spectrum_config = nullptr;
m_spectrum_config_isSet = false;
} }
SWGFreqTrackerSettings::~SWGFreqTrackerSettings() { SWGFreqTrackerSettings::~SWGFreqTrackerSettings() {
@ -116,6 +118,8 @@ SWGFreqTrackerSettings::init() {
m_reverse_api_device_index_isSet = false; m_reverse_api_device_index_isSet = false;
reverse_api_channel_index = 0; reverse_api_channel_index = 0;
m_reverse_api_channel_index_isSet = false; m_reverse_api_channel_index_isSet = false;
spectrum_config = new SWGGLSpectrum();
m_spectrum_config_isSet = false;
} }
void void
@ -144,6 +148,9 @@ SWGFreqTrackerSettings::cleanup() {
if(spectrum_config != nullptr) {
delete spectrum_config;
}
} }
SWGFreqTrackerSettings* SWGFreqTrackerSettings*
@ -197,6 +204,8 @@ SWGFreqTrackerSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&reverse_api_channel_index, pJson["reverseAPIChannelIndex"], "qint32", ""); ::SWGSDRangel::setValue(&reverse_api_channel_index, pJson["reverseAPIChannelIndex"], "qint32", "");
::SWGSDRangel::setValue(&spectrum_config, pJson["spectrumConfig"], "SWGGLSpectrum", "SWGGLSpectrum");
} }
QString QString
@ -273,6 +282,9 @@ SWGFreqTrackerSettings::asJsonObject() {
if(m_reverse_api_channel_index_isSet){ if(m_reverse_api_channel_index_isSet){
obj->insert("reverseAPIChannelIndex", QJsonValue(reverse_api_channel_index)); obj->insert("reverseAPIChannelIndex", QJsonValue(reverse_api_channel_index));
} }
if((spectrum_config != nullptr) && (spectrum_config->isSet())){
toJsonValue(QString("spectrumConfig"), spectrum_config, obj, QString("SWGGLSpectrum"));
}
return obj; return obj;
} }
@ -477,6 +489,16 @@ SWGFreqTrackerSettings::setReverseApiChannelIndex(qint32 reverse_api_channel_ind
this->m_reverse_api_channel_index_isSet = true; this->m_reverse_api_channel_index_isSet = true;
} }
SWGGLSpectrum*
SWGFreqTrackerSettings::getSpectrumConfig() {
return spectrum_config;
}
void
SWGFreqTrackerSettings::setSpectrumConfig(SWGGLSpectrum* spectrum_config) {
this->spectrum_config = spectrum_config;
this->m_spectrum_config_isSet = true;
}
bool bool
SWGFreqTrackerSettings::isSet(){ SWGFreqTrackerSettings::isSet(){
@ -542,6 +564,9 @@ SWGFreqTrackerSettings::isSet(){
if(m_reverse_api_channel_index_isSet){ if(m_reverse_api_channel_index_isSet){
isObjectUpdated = true; break; isObjectUpdated = true; break;
} }
if(spectrum_config && spectrum_config->isSet()){
isObjectUpdated = true; break;
}
}while(false); }while(false);
return isObjectUpdated; return isObjectUpdated;
} }

View File

@ -22,6 +22,7 @@
#include <QJsonObject> #include <QJsonObject>
#include "SWGGLSpectrum.h"
#include <QString> #include <QString>
#include "SWGObject.h" #include "SWGObject.h"
@ -102,6 +103,9 @@ public:
qint32 getReverseApiChannelIndex(); qint32 getReverseApiChannelIndex();
void setReverseApiChannelIndex(qint32 reverse_api_channel_index); void setReverseApiChannelIndex(qint32 reverse_api_channel_index);
SWGGLSpectrum* getSpectrumConfig();
void setSpectrumConfig(SWGGLSpectrum* spectrum_config);
virtual bool isSet() override; virtual bool isSet() override;
@ -166,6 +170,9 @@ private:
qint32 reverse_api_channel_index; qint32 reverse_api_channel_index;
bool m_reverse_api_channel_index_isSet; bool m_reverse_api_channel_index_isSet;
SWGGLSpectrum* spectrum_config;
bool m_spectrum_config_isSet;
}; };
} }

View File

@ -38,8 +38,8 @@ SWGGLScope::SWGGLScope() {
m_time_isSet = false; m_time_isSet = false;
time_ofs = 0; time_ofs = 0;
m_time_ofs_isSet = false; m_time_ofs_isSet = false;
trace_len = 0; trace_len_mult = 0;
m_trace_len_isSet = false; m_trace_len_mult_isSet = false;
trig_pre = 0; trig_pre = 0;
m_trig_pre_isSet = false; m_trig_pre_isSet = false;
traces_data = nullptr; traces_data = nullptr;
@ -64,8 +64,8 @@ SWGGLScope::init() {
m_time_isSet = false; m_time_isSet = false;
time_ofs = 0; time_ofs = 0;
m_time_ofs_isSet = false; m_time_ofs_isSet = false;
trace_len = 0; trace_len_mult = 0;
m_trace_len_isSet = false; m_trace_len_mult_isSet = false;
trig_pre = 0; trig_pre = 0;
m_trig_pre_isSet = false; m_trig_pre_isSet = false;
traces_data = new QList<SWGTraceData*>(); traces_data = new QList<SWGTraceData*>();
@ -120,7 +120,7 @@ SWGGLScope::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&time_ofs, pJson["timeOfs"], "qint32", ""); ::SWGSDRangel::setValue(&time_ofs, pJson["timeOfs"], "qint32", "");
::SWGSDRangel::setValue(&trace_len, pJson["traceLen"], "qint32", ""); ::SWGSDRangel::setValue(&trace_len_mult, pJson["traceLenMult"], "qint32", "");
::SWGSDRangel::setValue(&trig_pre, pJson["trigPre"], "qint32", ""); ::SWGSDRangel::setValue(&trig_pre, pJson["trigPre"], "qint32", "");
@ -159,8 +159,8 @@ SWGGLScope::asJsonObject() {
if(m_time_ofs_isSet){ if(m_time_ofs_isSet){
obj->insert("timeOfs", QJsonValue(time_ofs)); obj->insert("timeOfs", QJsonValue(time_ofs));
} }
if(m_trace_len_isSet){ if(m_trace_len_mult_isSet){
obj->insert("traceLen", QJsonValue(trace_len)); obj->insert("traceLenMult", QJsonValue(trace_len_mult));
} }
if(m_trig_pre_isSet){ if(m_trig_pre_isSet){
obj->insert("trigPre", QJsonValue(trig_pre)); obj->insert("trigPre", QJsonValue(trig_pre));
@ -226,13 +226,13 @@ SWGGLScope::setTimeOfs(qint32 time_ofs) {
} }
qint32 qint32
SWGGLScope::getTraceLen() { SWGGLScope::getTraceLenMult() {
return trace_len; return trace_len_mult;
} }
void void
SWGGLScope::setTraceLen(qint32 trace_len) { SWGGLScope::setTraceLenMult(qint32 trace_len_mult) {
this->trace_len = trace_len; this->trace_len_mult = trace_len_mult;
this->m_trace_len_isSet = true; this->m_trace_len_mult_isSet = true;
} }
qint32 qint32
@ -285,7 +285,7 @@ SWGGLScope::isSet(){
if(m_time_ofs_isSet){ if(m_time_ofs_isSet){
isObjectUpdated = true; break; isObjectUpdated = true; break;
} }
if(m_trace_len_isSet){ if(m_trace_len_mult_isSet){
isObjectUpdated = true; break; isObjectUpdated = true; break;
} }
if(m_trig_pre_isSet){ if(m_trig_pre_isSet){

Some files were not shown because too many files have changed in this diff Show More