1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -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")) {
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)
@ -367,6 +373,34 @@ void Interferometer::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings
response.getInterferometerSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getInterferometerSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
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)
@ -444,6 +478,20 @@ void Interferometer::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("filterChainHash") || force) {
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)

View File

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

View File

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

View File

@ -70,84 +70,13 @@ void ChannelAnalyzerWebAPIAdapter::webapiFormatChannelSettings(
SWGSDRangel::SWGGLScope *swgScope = new SWGSDRangel::SWGGLScope();
swgScope->init();
response.getChannelAnalyzerSettings()->setScopeConfig(swgScope);
swgScope->setDisplayMode(scopeSettings.m_displayMode);
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);
}
scopeSettings.formatTo(swgScope);
// spectrum
SWGSDRangel::SWGGLSpectrum *swgSpectrum = new SWGSDRangel::SWGGLSpectrum();
swgSpectrum->init();
response.getChannelAnalyzerSettings()->setSpectrumConfig(swgSpectrum);
swgSpectrum->setAveragingMode((int) spectrumSettings.m_averagingMode);
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);
spectrumSettings.formatTo(swgSpectrum);
}
int ChannelAnalyzerWebAPIAdapter::webapiSettingsPutPatch(
@ -227,225 +156,11 @@ void ChannelAnalyzerWebAPIAdapter::webapiUpdateChannelSettings(
settings.m_title = *response.getChannelAnalyzerSettings()->getTitle();
}
// scope
if (channelSettingsKeys.contains("scopeConfig"))
{
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;
}
}
}
}
if (channelSettingsKeys.contains("scopeConfig")) {
scopeSettings.updateFrom(channelSettingsKeys, response.getChannelAnalyzerSettings()->getScopeConfig());
}
// spectrum
if (channelSettingsKeys.contains("spectrumConfig"))
{
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();
}
if (channelSettingsKeys.contains("spectrumConfig")) {
spectrumSettings.updateFrom(channelSettingsKeys, response.getChannelAnalyzerSettings()->getSpectrumConfig());
}
}
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;
GLScopeSettings m_glScopeSettings;
SpectrumSettings m_SpectrumSettings;
static int qColorToInt(const QColor& color);
static QColor intToQColor(int intColor);
};
#endif // INCLUDE_CHANALYZER_WEBAPIADAPTER_H

View File

@ -345,6 +345,9 @@ void BFMDemod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getBfmDemodSettings()->getReverseApiChannelIndex();
}
if (settings.m_spectrumGUI && channelSettingsKeys.contains("spectrumConfig")) {
settings.m_spectrumGUI->updateFrom(channelSettingsKeys, response.getBfmDemodSettings()->getSpectrumConfig());
}
}
int BFMDemod::webapiReportGet(
@ -395,6 +398,20 @@ void BFMDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp
response.getBfmDemodSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getBfmDemodSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
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)
@ -551,6 +568,12 @@ void BFMDemod::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("streamIndex") || force) {
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)

View File

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

View File

@ -590,6 +590,9 @@ void ChirpChatDemod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getChirpChatDemodSettings()->getReverseApiChannelIndex();
}
if (settings.m_spectrumGUI && channelSettingsKeys.contains("spectrumConfig")) {
settings.m_spectrumGUI->updateFrom(channelSettingsKeys, response.getChirpChatDemodSettings()->getSpectrumConfig());
}
}
int ChirpChatDemod::webapiReportGet(
@ -647,6 +650,20 @@ void ChirpChatDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings
response.getChirpChatDemodSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getChirpChatDemodSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
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)
@ -799,6 +816,12 @@ void ChirpChatDemod::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("title") || force) {
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)

View File

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

View File

@ -342,6 +342,9 @@ void FreeDVDemod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getFreeDvDemodSettings()->getReverseApiChannelIndex();
}
if (settings.m_spectrumGUI && channelSettingsKeys.contains("spectrumConfig")) {
settings.m_spectrumGUI->updateFrom(channelSettingsKeys, response.getFreeDvDemodSettings()->getSpectrumConfig());
}
}
int FreeDVDemod::webapiReportGet(
@ -391,6 +394,20 @@ void FreeDVDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& r
response.getFreeDvDemodSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getFreeDvDemodSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
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)
@ -501,6 +518,12 @@ void FreeDVDemod::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("streamIndex") || force) {
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)

View File

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

View File

@ -417,6 +417,9 @@ void SSBDemod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getSsbDemodSettings()->getReverseApiChannelIndex();
}
if (settings.m_spectrumGUI && channelSettingsKeys.contains("spectrumConfig")) {
settings.m_spectrumGUI->updateFrom(channelSettingsKeys, response.getSsbDemodSettings()->getSpectrumConfig());
}
}
int SSBDemod::webapiReportGet(
@ -473,6 +476,20 @@ void SSBDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp
response.getSsbDemodSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getSsbDemodSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
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)
@ -604,6 +621,12 @@ void SSBDemod::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("streamIndex") || force) {
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)

View File

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

View File

@ -494,6 +494,9 @@ void FileSink::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("inputFrequencyOffset")) {
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)
@ -532,6 +535,20 @@ void FileSink::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp
response.getFileSinkSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getFileSinkSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
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)
@ -642,6 +659,12 @@ void FileSink::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("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)

View File

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

View File

@ -399,6 +399,9 @@ void FreqTracker::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getFreqTrackerSettings()->getReverseApiChannelIndex();
}
if (settings.m_spectrumGUI && channelSettingsKeys.contains("spectrumConfig")) {
settings.m_spectrumGUI->updateFrom(channelSettingsKeys, response.getFreqTrackerSettings()->getSpectrumConfig());
}
}
int FreqTracker::webapiReportGet(
@ -446,6 +449,20 @@ void FreqTracker::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& r
response.getFreqTrackerSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getFreqTrackerSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
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)
@ -568,6 +585,12 @@ void FreqTracker::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("streamIndex") || force) {
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)

View File

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

View File

@ -494,6 +494,9 @@ void SigMFFileSink::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("inputFrequencyOffset")) {
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)
@ -532,6 +535,20 @@ void SigMFFileSink::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings&
response.getSigMfFileSinkSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getSigMfFileSinkSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
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)
@ -642,6 +659,12 @@ void SigMFFileSink::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("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)

View File

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

View File

@ -385,6 +385,9 @@ void UDPSink::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getUdpSinkSettings()->getReverseApiChannelIndex();
}
if (settings.m_spectrumGUI && channelSettingsKeys.contains("spectrumConfig")) {
settings.m_spectrumGUI->updateFrom(channelSettingsKeys, response.getUdpSinkSettings()->getSpectrumConfig());
}
}
int UDPSink::webapiReportGet(
@ -443,6 +446,20 @@ void UDPSink::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& respo
response.getUdpSinkSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getUdpSinkSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
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)
@ -576,6 +593,12 @@ void UDPSink::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("streamIndex") || force) {
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)

View File

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

View File

@ -450,6 +450,9 @@ void FreeDVMod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getFreeDvModSettings()->getReverseApiChannelIndex();
}
if (settings.m_spectrumGUI && channelSettingsKeys.contains("spectrumConfig")) {
settings.m_spectrumGUI->updateFrom(channelSettingsKeys, response.getFreeDvModSettings()->getSpectrumConfig());
}
}
int FreeDVMod::webapiReportGet(
@ -504,6 +507,20 @@ void FreeDVMod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& res
response.getFreeDvModSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getFreeDvModSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
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)
@ -647,6 +664,12 @@ void FreeDVMod::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("streamIndex") || force) {
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)
{

View File

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

View File

@ -521,6 +521,9 @@ void SSBMod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getSsbModSettings()->getReverseApiChannelIndex();
}
if (settings.m_spectrumGUI && channelSettingsKeys.contains("spectrumConfig")) {
settings.m_spectrumGUI->updateFrom(channelSettingsKeys, response.getSsbModSettings()->getSpectrumConfig());
}
}
int SSBMod::webapiReportGet(
@ -582,6 +585,20 @@ void SSBMod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& respon
response.getSsbModSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getSsbModSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
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)
@ -746,6 +763,12 @@ void SSBMod::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("streamIndex") || force) {
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)
{

View File

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

View File

@ -418,6 +418,9 @@ void UDPSource::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getUdpSourceSettings()->getReverseApiChannelIndex();
}
if (settings.m_spectrumGUI && channelSettingsKeys.contains("spectrumConfig")) {
settings.m_spectrumGUI->updateFrom(channelSettingsKeys, response.getUdpSourceSettings()->getSpectrumConfig());
}
}
int UDPSource::webapiReportGet(
@ -483,6 +486,20 @@ void UDPSource::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& res
response.getUdpSourceSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getUdpSourceSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
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)
@ -623,6 +640,12 @@ void UDPSource::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("streamIndex") || force) {
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)

View File

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

View File

@ -423,6 +423,34 @@ void DemodAnalyzer::webapiFormatFeatureSettings(
response.getDemodAnalyzerSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getDemodAnalyzerSettings()->setReverseApiFeatureSetIndex(settings.m_reverseAPIFeatureSetIndex);
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(
@ -454,6 +482,12 @@ void DemodAnalyzer::webapiUpdateFeatureSettings(
if (featureSettingsKeys.contains("reverseAPIFeatureIndex")) {
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)

View File

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

View File

@ -688,7 +688,6 @@ MapGUI::MapGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *featur
ui->setupUi(this);
m_helpURL = "plugins/feature/map/readme.md";
quint16 port = 0; // Pick a free port
// Free keys, so no point in stealing them :)
QString tfKey = m_settings.m_thunderforestAPIKey.isEmpty() ? "3e1f614f78a345459931ba3c898e975e" : m_settings.m_thunderforestAPIKey;
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/>. //
///////////////////////////////////////////////////////////////////////////////////
#include "SWGChannelMarker.h"
#include "dsp/channelmarker.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)
{
m_enabledStreamsBits |= (1<<streamIndex);

View File

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

View File

@ -614,36 +614,7 @@ void CWKeyer::webapiSettingsPutPatch(
SWGSDRangel::SWGCWKeyerSettings *apiCwKeyerSettings
)
{
if (channelSettingsKeys.contains("cwKeyer.loop")) {
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();
}
cwKeyerSettings.updateFrom(channelSettingsKeys, apiCwKeyerSettings);
}
void CWKeyer::webapiFormatChannelSettings(
@ -651,20 +622,5 @@ void CWKeyer::webapiFormatChannelSettings(
const CWKeyerSettings& cwKeyerSettings
)
{
apiCwKeyerSettings->setLoop(cwKeyerSettings.m_loop ? 1 : 0);
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);
cwKeyerSettings.formatTo(apiCwKeyerSettings);
}

View File

@ -16,6 +16,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#include "SWGCWKeyerSettings.h"
#include "util/simpleserializer.h"
#include "cwkeyersettings.h"
@ -95,3 +96,62 @@ bool CWKeyerSettings::deserialize(const QByteArray& data)
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 "export.h"
#include "settings/serializable.h"
class SDRBASE_API CWKeyerSettings
class SDRBASE_API CWKeyerSettings: public Serializable
{
public:
typedef enum
@ -52,6 +53,8 @@ public:
QByteArray serialize() const;
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/>. //
///////////////////////////////////////////////////////////////////////////////////
#include <QColor>
#include "util/simpleserializer.h"
#include "glscopesettings.h"
#include "SWGGLScope.h"
const double GLScopeSettings::AMPS[27] = {
2e-1, 1e-1, 5e-2,
2e-2, 1e-2, 5e-3,
@ -39,20 +43,14 @@ GLScopeSettings::GLScopeSettings(const GLScopeSettings& t)
{
resetToDefaults();
for (unsigned int i = 0; i < m_maxNbTraces; i++) {
m_tracesData[i] = t.m_tracesData[i];
}
for (unsigned int i = 0; i < m_maxNbTriggers; i++) {
m_triggersData[i] = t.m_triggersData[i];
}
m_tracesData = t.m_tracesData;
m_triggersData = t.m_triggersData;
m_displayMode = t.m_displayMode;
m_traceIntensity = t.m_traceIntensity;
m_gridIntensity = t.m_gridIntensity;
m_time = t.m_time;
m_timeOfs = t.m_timeOfs;
m_traceLen = t.m_traceLen;
m_traceLenMult = t.m_traceLenMult;
m_trigPre = t.m_trigPre;
}
@ -66,7 +64,7 @@ void GLScopeSettings::resetToDefaults()
m_gridIntensity = 10;
m_time = 1;
m_timeOfs = 0;
m_traceLen = 1;
m_traceLenMult = 1;
m_trigPre = 0;
}
@ -80,7 +78,7 @@ QByteArray GLScopeSettings::serialize() const
s.writeS32(3, m_gridIntensity);
s.writeS32(4, m_time);
// s.writeS32(5, m_timeOfs);
s.writeS32(6, m_traceLen);
s.writeS32(6, m_traceLenMult);
std::vector<TraceData>::const_iterator traceDataIt = m_tracesData.begin();
unsigned int i = 0;
@ -149,7 +147,7 @@ bool GLScopeSettings::deserialize(const QByteArray& data)
d.readS32(3, &m_gridIntensity, 10);
d.readS32(4, &m_time, 1);
// d.readS32(5, &m_timeOfs, 0);
d.readS32(6, &m_traceLen, 1);
d.readS32(6, &m_traceLenMult, 1);
d.readS32(201, &m_trigPre, 0);
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)
{
// Check for self assignment
if (this != &t)
{
for (unsigned int i = 0; i < m_maxNbTraces; i++) {
m_tracesData[i] = t.m_tracesData[i];
}
for (unsigned int i = 0; i < m_maxNbTriggers; i++) {
m_triggersData[i] = t.m_triggersData[i];
}
m_tracesData = t.m_tracesData;
m_triggersData = t.m_triggersData;
m_displayMode = t.m_displayMode;
m_traceIntensity = t.m_traceIntensity;
m_gridIntensity = t.m_gridIntensity;
m_time = t.m_time;
m_timeOfs = t.m_timeOfs;
m_traceLen = t.m_traceLen;
m_traceLenMult = t.m_traceLenMult;
m_trigPre = t.m_trigPre;
}
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_time;
int m_timeOfs;
int m_traceLen;
int m_traceLenMult;
int m_trigPre;
std::vector<TraceData> m_tracesData;
std::vector<TriggerData> m_triggersData;
@ -171,8 +171,11 @@ public:
virtual QByteArray serialize() const;
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);
static int qColorToInt(const QColor& color);
static QColor intToQColor(int intColor);
};
#endif // SDRBASE_DSP_GLSCOPESETTINGS_H

View File

@ -159,7 +159,7 @@ void ScopeVis::configure(
if (m_traceSize != traceSize)
{
setTraceSize(traceSize);
m_settings.m_traceLen = traceSize;
m_settings.m_traceLenMult = traceSize / getTraceChunkSize();
m_triggerState = TriggerUntriggered;
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++)
{
if (i < m_traces.size()) { // change trace
changeTrace(m_settings.m_tracesData[i], i);
changeTrace(settings.m_tracesData[i], i);
} 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/>. //
///////////////////////////////////////////////////////////////////////////////////
#include "SWGGLSpectrum.h"
#include "util/simpleserializer.h"
#include "spectrumsettings.h"
@ -53,6 +55,7 @@ void SpectrumSettings::resetToDefaults()
m_linear = false;
m_ssb = false;
m_usb = true;
m_wsSpectrum = false;
m_wsSpectrumAddress = "127.0.0.1";
m_wsSpectrumPort = 8887;
}
@ -86,6 +89,7 @@ QByteArray SpectrumSettings::serialize() const
s.writeBool(24, m_ssb);
s.writeBool(25, m_usb);
s.writeS32(26, m_fpsPeriodMs);
s.writeBool(27, m_wsSpectrum);
s.writeS32(100, m_histogramMarkers.size());
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(25, &m_usb, true);
d.readS32(26, &tmp, 50);
d.readBool(27, &m_wsSpectrum, false);
m_fpsPeriodMs = tmp < 5 ? 5 : tmp > 500 ? 500 : tmp;
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)
{
if (averagingMode == AvgModeMoving) {

View File

@ -68,8 +68,9 @@ public:
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_usb; //!< USB display with increasing frequencies towads the right - else decreasing frequencies
QString m_wsSpectrumAddress;
uint16_t m_wsSpectrumPort;
bool m_wsSpectrum; //!< Start or stop websocket spectrum server
QString m_wsSpectrumAddress; //!< websocket spectrum server address
uint16_t m_wsSpectrumPort; //!< websocket spectrum server port
QList<SpectrumHistogramMarker> m_histogramMarkers;
QList<SpectrumWaterfallMarker> m_waterfallMarkers;
static const int m_log2FFTSizeMin = 6; // 64
@ -81,6 +82,8 @@ public:
virtual QByteArray serialize() const;
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<SpectrumWaterfallMarker>& getWaterfallMarkers() { return m_waterfallMarkers; }

View File

@ -24,6 +24,7 @@
<file>webapi/doc/swagger/include/BladeRF2.yaml</file>
<file>webapi/doc/swagger/include/ChannelActions.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/ChannelReport.yaml</file>
<file>webapi/doc/swagger/include/ChirpChatDemod.yaml</file>

View File

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

View File

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

View File

@ -54,3 +54,5 @@ ChannelAnalyzerSettings:
$ref: "/doc/swagger/include/GLSpectrum.yaml#/GLSpectrum"
scopeConfig:
$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
reverseAPIChannelIndex:
type: integer
spectrumConfig:
$ref: "/doc/swagger/include/GLSpectrum.yaml#/GLSpectrum"
ChirpChatDemodReport:
description: ChirpChatDemod

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -18,12 +18,19 @@
#ifndef SDRBASE_SETTINGS_SERIALIZABLE_H_
#define SDRBASE_SETTINGS_SERIALIZABLE_H_
namespace SWGSDRangel {
class SWGObject;
}
class QStringList;
class Serializable
{
public:
virtual ~Serializable() {}
virtual QByteArray serialize() const = 0;
virtual bool deserialize(const QByteArray& data) = 0;
virtual QByteArray serialize() const = 0; //!< Serialize to inary
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_ */

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

View File

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

View File

@ -267,6 +267,7 @@ const QMap<QString, QString> WebAPIUtils::m_featureTypeToSettingsKey = {
{"AIS", "AISSettings"},
{"AntennaTools", "AntennaToolsSettings"},
{"APRS", "APRSSettings"},
{"DemodAnalyzer", "DemodAnalyzerSettings"},
{"GS232Controller", "GS232ControllerSettings"},
{"Map", "MapSettings"},
{"PERTester", "PERTesterSettings"},
@ -292,6 +293,7 @@ const QMap<QString, QString> WebAPIUtils::m_featureURIToSettingsKey = {
{"sdrangel.feature.ais", "AISSSettings"},
{"sdrangel.feature.antennatools", "AntennaToolsSettings"},
{"sdrangel.feature.aprs", "APRSSettings"},
{"sdrangel.feature.demodanalyzer", "DemodAnalyzerSettings"},
{"sdrangel.feature.gs232controller", "GS232ControllerSettings"},
{"sdrangel.feature.map", "MapSettings"},
{"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 ==================================================================
void CWKeyerGUI::on_cwTextClear_clicked(bool checked)

View File

@ -47,6 +47,8 @@ public:
void resetToDefaults();
QByteArray serialize() const;
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 displaySettings();

View File

@ -35,7 +35,6 @@ GLScopeGUI::GLScopeGUI(QWidget* parent) :
m_sampleRate(0),
m_timeBase(1),
m_timeOffset(0),
m_traceLenMult(1),
m_ctlTraceIndex(0),
m_ctlTriggerIndex(0)
{
@ -105,7 +104,7 @@ void GLScopeGUI::setBuddies(MessageQueue* messageQueue, ScopeVis* scopeVis, GLSc
fillProjectionCombo(ui->trigMode);
m_scopeVis->configure(
2*m_traceLenMult*m_scopeVis->getTraceChunkSize(),
2*m_settings.m_traceLenMult*m_scopeVis->getTraceChunkSize(),
m_timeBase,
m_timeOffset*10,
(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_traceLenMult*m_scopeVis->getTraceChunkSize(),
m_settings.m_traceLenMult*m_scopeVis->getTraceChunkSize(),
m_timeBase,
m_timeOffset*10,
(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)
{
qDebug("GLScopeGUI::onScopeTraceSizeChanged: %u", traceNbSamples);
m_traceLenMult = traceNbSamples / m_scopeVis->getTraceChunkSize();
ui->traceLen->setValue(m_traceLenMult);
m_settings.m_traceLenMult = traceNbSamples / m_scopeVis->getTraceChunkSize();
ui->traceLen->setValue(m_settings.m_traceLenMult);
setTraceLenDisplay();
}
@ -263,6 +262,22 @@ bool GLScopeGUI::deserialize(const QByteArray& data)
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)
{
QStringList streamNames;
@ -464,7 +479,7 @@ void GLScopeGUI::on_time_valueChanged(int value)
setTimeScaleDisplay();
setTraceDelayDisplay();
m_scopeVis->configure(
m_traceLenMult*m_scopeVis->getTraceChunkSize(),
m_settings.m_traceLenMult*m_scopeVis->getTraceChunkSize(),
m_timeBase,
m_timeOffset*10,
(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;
setTimeOfsDisplay();
m_scopeVis->configure(
m_traceLenMult*m_scopeVis->getTraceChunkSize(),
m_settings.m_traceLenMult*m_scopeVis->getTraceChunkSize(),
m_timeBase,
m_timeOffset*10,
(uint32_t) (m_glScope->getTraceSize() * (ui->trigPre->value()/100.0f)),
@ -502,10 +517,9 @@ void GLScopeGUI::on_traceLen_valueChanged(int value)
return;
}
m_traceLenMult = value;
m_settings.m_traceLen = m_traceLenMult*m_scopeVis->getTraceChunkSize();
m_settings.m_traceLenMult = value;
m_scopeVis->configure(
m_traceLenMult*m_scopeVis->getTraceChunkSize(),
m_settings.m_traceLenMult*m_scopeVis->getTraceChunkSize(),
m_timeBase,
m_timeOffset*10,
(uint32_t) (m_glScope->getTraceSize() * (ui->trigPre->value()/100.0f)),
@ -945,7 +959,7 @@ void GLScopeGUI::on_trigPre_valueChanged(int value)
(void) value;
setTrigPreDisplay();
m_scopeVis->configure(
m_traceLenMult*m_scopeVis->getTraceChunkSize(),
m_settings.m_traceLenMult*m_scopeVis->getTraceChunkSize(),
m_timeBase,
m_timeOffset*10,
(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_traceLenMult*m_scopeVis->getTraceChunkSize(),
m_settings.m_traceLenMult*m_scopeVis->getTraceChunkSize(),
m_timeBase,
m_timeOffset*10,
(uint32_t) (m_glScope->getTraceSize() * (ui->trigPre->value()/100.0f)),
@ -1043,7 +1057,7 @@ void GLScopeGUI::setTimeScaleDisplay()
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) {
ui->traceLenText->setToolTip(tr("%1 S").arg(n_samples));
@ -1209,7 +1223,7 @@ void GLScopeGUI::setTrigDelayDisplay()
if (m_sampleRate > 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) {
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_triggerRepeat = ui->trigCount->value();
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_triggerDelayFine = ui->trigDelayFine->value();
triggerData.setColor(m_focusedTriggerColor);
@ -1490,7 +1504,7 @@ void GLScopeGUI::displaySettings()
setTimeScaleDisplay();
ui->timeOfs->setValue(m_settings.m_timeOfs);
setTimeOfsDisplay();
ui->traceLen->setValue(m_traceLenMult);
ui->traceLen->setValue(m_settings.m_traceLenMult);
}
bool GLScopeGUI::handleMessage(Message* message)
@ -1777,7 +1791,7 @@ void GLScopeGUI::focusOnTrigger(int triggerIndex)
void GLScopeGUI::traceLengthChange()
{
on_traceLen_valueChanged(m_traceLenMult);
on_traceLen_valueChanged(m_settings.m_traceLenMult);
}
void GLScopeGUI::settingsTraceAdd(const GLScopeSettings::TraceData& traceData)

View File

@ -49,6 +49,9 @@ public:
void resetToDefaults();
virtual QByteArray serialize() const;
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);
unsigned int getNbTraces() const { return m_settings.m_tracesData.size(); }
@ -155,7 +158,6 @@ private:
int m_sampleRate;
int m_timeBase;
int m_timeOffset;
int m_traceLenMult;
QColor m_focusedTraceColor;
QColor m_focusedTriggerColor;
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()
{
blockApplySettings(true);

View File

@ -58,6 +58,9 @@ public:
void resetToDefaults();
virtual QByteArray serialize() const;
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:
Ui::GLSpectrumGUI* ui;

View File

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

View File

@ -54,3 +54,5 @@ ChannelAnalyzerSettings:
$ref: "http://swgserver:8081/api/swagger/include/GLSpectrum.yaml#/GLSpectrum"
scopeConfig:
$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
reverseAPIChannelIndex:
type: integer
spectrumConfig:
$ref: "http://swgserver:8081/api/swagger/include/GLSpectrum.yaml#/GLSpectrum"
ChirpChatDemodReport:
description: ChirpChatDemod

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -22,6 +22,7 @@
#include <QJsonObject>
#include "SWGGLSpectrum.h"
#include <QString>
#include "SWGObject.h"
@ -96,6 +97,9 @@ public:
qint32 getReverseApiChannelIndex();
void setReverseApiChannelIndex(qint32 reverse_api_channel_index);
SWGGLSpectrum* getSpectrumConfig();
void setSpectrumConfig(SWGGLSpectrum* spectrum_config);
virtual bool isSet() override;
@ -154,6 +158,9 @@ private:
qint32 reverse_api_channel_index;
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;
scope_config = nullptr;
m_scope_config_isSet = false;
channel_marker = nullptr;
m_channel_marker_isSet = false;
}
SWGChannelAnalyzerSettings::~SWGChannelAnalyzerSettings() {
@ -120,6 +122,8 @@ SWGChannelAnalyzerSettings::init() {
m_spectrum_config_isSet = false;
scope_config = new SWGGLScope();
m_scope_config_isSet = false;
channel_marker = new SWGChannelMarker();
m_channel_marker_isSet = false;
}
void
@ -151,6 +155,9 @@ SWGChannelAnalyzerSettings::cleanup() {
if(scope_config != nullptr) {
delete scope_config;
}
if(channel_marker != nullptr) {
delete channel_marker;
}
}
SWGChannelAnalyzerSettings*
@ -206,6 +213,8 @@ SWGChannelAnalyzerSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&scope_config, pJson["scopeConfig"], "SWGGLScope", "SWGGLScope");
::SWGSDRangel::setValue(&channel_marker, pJson["channelMarker"], "SWGChannelMarker", "SWGChannelMarker");
}
QString
@ -285,6 +294,9 @@ SWGChannelAnalyzerSettings::asJsonObject() {
if((scope_config != nullptr) && (scope_config->isSet())){
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;
}
@ -499,6 +511,16 @@ SWGChannelAnalyzerSettings::setScopeConfig(SWGGLScope* scope_config) {
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
SWGChannelAnalyzerSettings::isSet(){
@ -567,6 +589,9 @@ SWGChannelAnalyzerSettings::isSet(){
if(scope_config && scope_config->isSet()){
isObjectUpdated = true; break;
}
if(channel_marker && channel_marker->isSet()){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}

View File

@ -22,6 +22,7 @@
#include <QJsonObject>
#include "SWGChannelMarker.h"
#include "SWGGLScope.h"
#include "SWGGLSpectrum.h"
#include <QString>
@ -107,6 +108,9 @@ public:
SWGGLScope* getScopeConfig();
void setScopeConfig(SWGGLScope* scope_config);
SWGChannelMarker* getChannelMarker();
void setChannelMarker(SWGChannelMarker* channel_marker);
virtual bool isSet() override;
@ -174,6 +178,9 @@ private:
SWGGLScope* scope_config;
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;
reverse_api_channel_index = 0;
m_reverse_api_channel_index_isSet = false;
spectrum_config = nullptr;
m_spectrum_config_isSet = false;
}
SWGChirpChatDemodSettings::~SWGChirpChatDemodSettings() {
@ -144,6 +146,8 @@ SWGChirpChatDemodSettings::init() {
m_reverse_api_device_index_isSet = false;
reverse_api_channel_index = 0;
m_reverse_api_channel_index_isSet = false;
spectrum_config = new SWGGLSpectrum();
m_spectrum_config_isSet = false;
}
void
@ -181,6 +185,9 @@ SWGChirpChatDemodSettings::cleanup() {
if(spectrum_config != nullptr) {
delete spectrum_config;
}
}
SWGChirpChatDemodSettings*
@ -248,6 +255,8 @@ SWGChirpChatDemodSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&reverse_api_channel_index, pJson["reverseAPIChannelIndex"], "qint32", "");
::SWGSDRangel::setValue(&spectrum_config, pJson["spectrumConfig"], "SWGGLSpectrum", "SWGGLSpectrum");
}
QString
@ -345,6 +354,9 @@ SWGChirpChatDemodSettings::asJsonObject() {
if(m_reverse_api_channel_index_isSet){
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;
}
@ -619,6 +631,16 @@ SWGChirpChatDemodSettings::setReverseApiChannelIndex(qint32 reverse_api_channel_
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
SWGChirpChatDemodSettings::isSet(){
@ -705,6 +727,9 @@ SWGChirpChatDemodSettings::isSet(){
if(m_reverse_api_channel_index_isSet){
isObjectUpdated = true; break;
}
if(spectrum_config && spectrum_config->isSet()){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}

View File

@ -22,6 +22,7 @@
#include <QJsonObject>
#include "SWGGLSpectrum.h"
#include <QString>
#include "SWGObject.h"
@ -123,6 +124,9 @@ public:
qint32 getReverseApiChannelIndex();
void setReverseApiChannelIndex(qint32 reverse_api_channel_index);
SWGGLSpectrum* getSpectrumConfig();
void setSpectrumConfig(SWGGLSpectrum* spectrum_config);
virtual bool isSet() override;
@ -208,6 +212,9 @@ private:
qint32 reverse_api_channel_index;
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;
reverse_api_channel_index = 0;
m_reverse_api_channel_index_isSet = false;
spectrum_config = nullptr;
m_spectrum_config_isSet = false;
}
SWGFileSinkSettings::~SWGFileSinkSettings() {
@ -100,6 +102,8 @@ SWGFileSinkSettings::init() {
m_reverse_api_device_index_isSet = false;
reverse_api_channel_index = 0;
m_reverse_api_channel_index_isSet = false;
spectrum_config = new SWGGLSpectrum();
m_spectrum_config_isSet = false;
}
void
@ -126,6 +130,9 @@ SWGFileSinkSettings::cleanup() {
if(spectrum_config != nullptr) {
delete spectrum_config;
}
}
SWGFileSinkSettings*
@ -171,6 +178,8 @@ SWGFileSinkSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&reverse_api_channel_index, pJson["reverseAPIChannelIndex"], "qint32", "");
::SWGSDRangel::setValue(&spectrum_config, pJson["spectrumConfig"], "SWGGLSpectrum", "SWGGLSpectrum");
}
QString
@ -235,6 +244,9 @@ SWGFileSinkSettings::asJsonObject() {
if(m_reverse_api_channel_index_isSet){
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;
}
@ -399,6 +411,16 @@ SWGFileSinkSettings::setReverseApiChannelIndex(qint32 reverse_api_channel_index)
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
SWGFileSinkSettings::isSet(){
@ -452,6 +474,9 @@ SWGFileSinkSettings::isSet(){
if(m_reverse_api_channel_index_isSet){
isObjectUpdated = true; break;
}
if(spectrum_config && spectrum_config->isSet()){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}

View File

@ -22,6 +22,7 @@
#include <QJsonObject>
#include "SWGGLSpectrum.h"
#include <QString>
#include "SWGObject.h"
@ -90,6 +91,9 @@ public:
qint32 getReverseApiChannelIndex();
void setReverseApiChannelIndex(qint32 reverse_api_channel_index);
SWGGLSpectrum* getSpectrumConfig();
void setSpectrumConfig(SWGGLSpectrum* spectrum_config);
virtual bool isSet() override;
@ -142,6 +146,9 @@ private:
qint32 reverse_api_channel_index;
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;
reverse_api_channel_index = 0;
m_reverse_api_channel_index_isSet = false;
spectrum_config = nullptr;
m_spectrum_config_isSet = false;
}
SWGFreeDVDemodSettings::~SWGFreeDVDemodSettings() {
@ -100,6 +102,8 @@ SWGFreeDVDemodSettings::init() {
m_reverse_api_device_index_isSet = false;
reverse_api_channel_index = 0;
m_reverse_api_channel_index_isSet = false;
spectrum_config = new SWGGLSpectrum();
m_spectrum_config_isSet = false;
}
void
@ -126,6 +130,9 @@ SWGFreeDVDemodSettings::cleanup() {
if(spectrum_config != nullptr) {
delete spectrum_config;
}
}
SWGFreeDVDemodSettings*
@ -171,6 +178,8 @@ SWGFreeDVDemodSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&reverse_api_channel_index, pJson["reverseAPIChannelIndex"], "qint32", "");
::SWGSDRangel::setValue(&spectrum_config, pJson["spectrumConfig"], "SWGGLSpectrum", "SWGGLSpectrum");
}
QString
@ -235,6 +244,9 @@ SWGFreeDVDemodSettings::asJsonObject() {
if(m_reverse_api_channel_index_isSet){
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;
}
@ -399,6 +411,16 @@ SWGFreeDVDemodSettings::setReverseApiChannelIndex(qint32 reverse_api_channel_ind
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
SWGFreeDVDemodSettings::isSet(){
@ -452,6 +474,9 @@ SWGFreeDVDemodSettings::isSet(){
if(m_reverse_api_channel_index_isSet){
isObjectUpdated = true; break;
}
if(spectrum_config && spectrum_config->isSet()){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}

View File

@ -22,6 +22,7 @@
#include <QJsonObject>
#include "SWGGLSpectrum.h"
#include <QString>
#include "SWGObject.h"
@ -90,6 +91,9 @@ public:
qint32 getReverseApiChannelIndex();
void setReverseApiChannelIndex(qint32 reverse_api_channel_index);
SWGGLSpectrum* getSpectrumConfig();
void setSpectrumConfig(SWGGLSpectrum* spectrum_config);
virtual bool isSet() override;
@ -142,6 +146,9 @@ private:
qint32 reverse_api_channel_index;
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;
cw_keyer = nullptr;
m_cw_keyer_isSet = false;
spectrum_config = nullptr;
m_spectrum_config_isSet = false;
}
SWGFreeDVModSettings::~SWGFreeDVModSettings() {
@ -112,6 +114,8 @@ SWGFreeDVModSettings::init() {
m_reverse_api_channel_index_isSet = false;
cw_keyer = new SWGCWKeyerSettings();
m_cw_keyer_isSet = false;
spectrum_config = new SWGGLSpectrum();
m_spectrum_config_isSet = false;
}
void
@ -143,6 +147,9 @@ SWGFreeDVModSettings::cleanup() {
if(cw_keyer != nullptr) {
delete cw_keyer;
}
if(spectrum_config != nullptr) {
delete spectrum_config;
}
}
SWGFreeDVModSettings*
@ -194,6 +201,8 @@ SWGFreeDVModSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&cw_keyer, pJson["cwKeyer"], "SWGCWKeyerSettings", "SWGCWKeyerSettings");
::SWGSDRangel::setValue(&spectrum_config, pJson["spectrumConfig"], "SWGGLSpectrum", "SWGGLSpectrum");
}
QString
@ -267,6 +276,9 @@ SWGFreeDVModSettings::asJsonObject() {
if((cw_keyer != nullptr) && (cw_keyer->isSet())){
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;
}
@ -461,6 +473,16 @@ SWGFreeDVModSettings::setCwKeyer(SWGCWKeyerSettings* cw_keyer) {
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
SWGFreeDVModSettings::isSet(){
@ -523,6 +545,9 @@ SWGFreeDVModSettings::isSet(){
if(cw_keyer && cw_keyer->isSet()){
isObjectUpdated = true; break;
}
if(spectrum_config && spectrum_config->isSet()){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}

View File

@ -23,6 +23,7 @@
#include "SWGCWKeyerSettings.h"
#include "SWGGLSpectrum.h"
#include <QString>
#include "SWGObject.h"
@ -100,6 +101,9 @@ public:
SWGCWKeyerSettings* getCwKeyer();
void setCwKeyer(SWGCWKeyerSettings* cw_keyer);
SWGGLSpectrum* getSpectrumConfig();
void setSpectrumConfig(SWGGLSpectrum* spectrum_config);
virtual bool isSet() override;
@ -161,6 +165,9 @@ private:
SWGCWKeyerSettings* cw_keyer;
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;
reverse_api_channel_index = 0;
m_reverse_api_channel_index_isSet = false;
spectrum_config = nullptr;
m_spectrum_config_isSet = false;
}
SWGFreqTrackerSettings::~SWGFreqTrackerSettings() {
@ -116,6 +118,8 @@ SWGFreqTrackerSettings::init() {
m_reverse_api_device_index_isSet = false;
reverse_api_channel_index = 0;
m_reverse_api_channel_index_isSet = false;
spectrum_config = new SWGGLSpectrum();
m_spectrum_config_isSet = false;
}
void
@ -144,6 +148,9 @@ SWGFreqTrackerSettings::cleanup() {
if(spectrum_config != nullptr) {
delete spectrum_config;
}
}
SWGFreqTrackerSettings*
@ -197,6 +204,8 @@ SWGFreqTrackerSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&reverse_api_channel_index, pJson["reverseAPIChannelIndex"], "qint32", "");
::SWGSDRangel::setValue(&spectrum_config, pJson["spectrumConfig"], "SWGGLSpectrum", "SWGGLSpectrum");
}
QString
@ -273,6 +282,9 @@ SWGFreqTrackerSettings::asJsonObject() {
if(m_reverse_api_channel_index_isSet){
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;
}
@ -477,6 +489,16 @@ SWGFreqTrackerSettings::setReverseApiChannelIndex(qint32 reverse_api_channel_ind
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
SWGFreqTrackerSettings::isSet(){
@ -542,6 +564,9 @@ SWGFreqTrackerSettings::isSet(){
if(m_reverse_api_channel_index_isSet){
isObjectUpdated = true; break;
}
if(spectrum_config && spectrum_config->isSet()){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}

View File

@ -22,6 +22,7 @@
#include <QJsonObject>
#include "SWGGLSpectrum.h"
#include <QString>
#include "SWGObject.h"
@ -102,6 +103,9 @@ public:
qint32 getReverseApiChannelIndex();
void setReverseApiChannelIndex(qint32 reverse_api_channel_index);
SWGGLSpectrum* getSpectrumConfig();
void setSpectrumConfig(SWGGLSpectrum* spectrum_config);
virtual bool isSet() override;
@ -166,6 +170,9 @@ private:
qint32 reverse_api_channel_index;
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;
time_ofs = 0;
m_time_ofs_isSet = false;
trace_len = 0;
m_trace_len_isSet = false;
trace_len_mult = 0;
m_trace_len_mult_isSet = false;
trig_pre = 0;
m_trig_pre_isSet = false;
traces_data = nullptr;
@ -64,8 +64,8 @@ SWGGLScope::init() {
m_time_isSet = false;
time_ofs = 0;
m_time_ofs_isSet = false;
trace_len = 0;
m_trace_len_isSet = false;
trace_len_mult = 0;
m_trace_len_mult_isSet = false;
trig_pre = 0;
m_trig_pre_isSet = false;
traces_data = new QList<SWGTraceData*>();
@ -120,7 +120,7 @@ SWGGLScope::fromJsonObject(QJsonObject &pJson) {
::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", "");
@ -159,8 +159,8 @@ SWGGLScope::asJsonObject() {
if(m_time_ofs_isSet){
obj->insert("timeOfs", QJsonValue(time_ofs));
}
if(m_trace_len_isSet){
obj->insert("traceLen", QJsonValue(trace_len));
if(m_trace_len_mult_isSet){
obj->insert("traceLenMult", QJsonValue(trace_len_mult));
}
if(m_trig_pre_isSet){
obj->insert("trigPre", QJsonValue(trig_pre));
@ -226,13 +226,13 @@ SWGGLScope::setTimeOfs(qint32 time_ofs) {
}
qint32
SWGGLScope::getTraceLen() {
return trace_len;
SWGGLScope::getTraceLenMult() {
return trace_len_mult;
}
void
SWGGLScope::setTraceLen(qint32 trace_len) {
this->trace_len = trace_len;
this->m_trace_len_isSet = true;
SWGGLScope::setTraceLenMult(qint32 trace_len_mult) {
this->trace_len_mult = trace_len_mult;
this->m_trace_len_mult_isSet = true;
}
qint32
@ -285,7 +285,7 @@ SWGGLScope::isSet(){
if(m_time_ofs_isSet){
isObjectUpdated = true; break;
}
if(m_trace_len_isSet){
if(m_trace_len_mult_isSet){
isObjectUpdated = true; break;
}
if(m_trig_pre_isSet){

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