diff --git a/plugins/channelmimo/interferometer/interferometergui.cpp b/plugins/channelmimo/interferometer/interferometergui.cpp index de1553ca0..35d66e50c 100644 --- a/plugins/channelmimo/interferometer/interferometergui.cpp +++ b/plugins/channelmimo/interferometer/interferometergui.cpp @@ -126,7 +126,6 @@ InterferometerGUI::InterferometerGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUI ui->glSpectrum->setLsbDisplay(false); ui->glScope->setTraceModulo(Interferometer::m_fftSize); - ui->glSpectrum->connectTimer(MainCore::instance()->getMasterTimer()); ui->glScope->connectTimer(MainCore::instance()->getMasterTimer()); connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); diff --git a/plugins/channelmimo/interferometer/interferometerwebapiadapter.cpp b/plugins/channelmimo/interferometer/interferometerwebapiadapter.cpp index 789e54e05..14d0491af 100644 --- a/plugins/channelmimo/interferometer/interferometerwebapiadapter.cpp +++ b/plugins/channelmimo/interferometer/interferometerwebapiadapter.cpp @@ -132,6 +132,7 @@ void InterferometerWebAPIAdapter::webapiFormatChannelSettings( swgSpectrum->setDisplayWaterfall(spectrumSettings.m_displayWaterfall ? 1 : 0); swgSpectrum->setFftOverlap(spectrumSettings.m_fftOverlap); swgSpectrum->setFftSize(spectrumSettings.m_fftSize); + swgSpectrum->setFpsPeriodMs(spectrumSettings.m_fpsPeriodMs); } int InterferometerWebAPIAdapter::webapiSettingsPutPatch( @@ -369,6 +370,9 @@ void InterferometerWebAPIAdapter::webapiUpdateChannelSettings( if (channelSettingsKeys.contains("spectrumConfig.fftSize")) { spectrumSettings.m_fftSize = response.getInterferometerSettings()->getSpectrumConfig()->getFftSize(); } + if (channelSettingsKeys.contains("spectrumConfig.fpsPeriodMs")) { + spectrumSettings.m_fpsPeriodMs = response.getInterferometerSettings()->getSpectrumConfig()->getFpsPeriodMs(); + } } } diff --git a/plugins/channelrx/chanalyzer/chanalyzergui.cpp b/plugins/channelrx/chanalyzer/chanalyzergui.cpp index e15b5060b..2ca683fa0 100644 --- a/plugins/channelrx/chanalyzer/chanalyzergui.cpp +++ b/plugins/channelrx/chanalyzer/chanalyzergui.cpp @@ -392,7 +392,6 @@ ChannelAnalyzerGUI::ChannelAnalyzerGUI(PluginAPI* pluginAPI, DeviceUISet *device ui->glSpectrum->setSsbSpectrum(false); ui->glSpectrum->setLsbDisplay(false); - ui->glSpectrum->connectTimer(MainCore::instance()->getMasterTimer()); ui->glScope->connectTimer(MainCore::instance()->getMasterTimer()); connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); @@ -427,7 +426,6 @@ ChannelAnalyzerGUI::ChannelAnalyzerGUI(PluginAPI* pluginAPI, DeviceUISet *device ChannelAnalyzerGUI::~ChannelAnalyzerGUI() { qDebug("ChannelAnalyzerGUI::~ChannelAnalyzerGUI"); - ui->glSpectrum->disconnectTimer(); ui->glScope->disconnectTimer(); delete ui; delete m_spectrumScopeComboVis; diff --git a/plugins/channelrx/chanalyzer/chanalyzerwebapiadapter.cpp b/plugins/channelrx/chanalyzer/chanalyzerwebapiadapter.cpp index 78be75bd5..63bcab1f9 100644 --- a/plugins/channelrx/chanalyzer/chanalyzerwebapiadapter.cpp +++ b/plugins/channelrx/chanalyzer/chanalyzerwebapiadapter.cpp @@ -144,6 +144,7 @@ void ChannelAnalyzerWebAPIAdapter::webapiFormatChannelSettings( swgSpectrum->setDisplayWaterfall(spectrumSettings.m_displayWaterfall ? 1 : 0); swgSpectrum->setFftOverlap(spectrumSettings.m_fftOverlap); swgSpectrum->setFftSize(spectrumSettings.m_fftSize); + swgSpectrum->setFpsPeriodMs(spectrumSettings.m_fpsPeriodMs); } int ChannelAnalyzerWebAPIAdapter::webapiSettingsPutPatch( @@ -417,6 +418,9 @@ void ChannelAnalyzerWebAPIAdapter::webapiUpdateChannelSettings( if (channelSettingsKeys.contains("spectrumConfig.fftSize")) { spectrumSettings.m_fftSize = response.getChannelAnalyzerSettings()->getSpectrumConfig()->getFftSize(); } + if (channelSettingsKeys.contains("spectrumConfig.fpsPeriodMs")) { + spectrumSettings.m_fpsPeriodMs = response.getChannelAnalyzerSettings()->getSpectrumConfig()->getFpsPeriodMs(); + } } } diff --git a/plugins/channelrx/demodfreedv/freedvdemodgui.cpp b/plugins/channelrx/demodfreedv/freedvdemodgui.cpp index 62f0102ca..c6ab63d63 100644 --- a/plugins/channelrx/demodfreedv/freedvdemodgui.cpp +++ b/plugins/channelrx/demodfreedv/freedvdemodgui.cpp @@ -266,7 +266,6 @@ FreeDVDemodGUI::FreeDVDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, B ui->glSpectrum->setDisplayWaterfall(true); ui->glSpectrum->setDisplayMaxHold(true); ui->glSpectrum->setSsbSpectrum(true); - ui->glSpectrum->connectTimer(MainCore::instance()->getMasterTimer()); connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); diff --git a/plugins/channelrx/demodssb/ssbdemodgui.cpp b/plugins/channelrx/demodssb/ssbdemodgui.cpp index 68ef329f0..dc9e69390 100644 --- a/plugins/channelrx/demodssb/ssbdemodgui.cpp +++ b/plugins/channelrx/demodssb/ssbdemodgui.cpp @@ -308,7 +308,6 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban ui->glSpectrum->setDisplayWaterfall(true); ui->glSpectrum->setDisplayMaxHold(true); ui->glSpectrum->setSsbSpectrum(true); - ui->glSpectrum->connectTimer(MainCore::instance()->getMasterTimer()); connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); diff --git a/plugins/channelrx/udpsink/udpsinkgui.cpp b/plugins/channelrx/udpsink/udpsinkgui.cpp index b7cf5f832..2afa8864b 100644 --- a/plugins/channelrx/udpsink/udpsinkgui.cpp +++ b/plugins/channelrx/udpsink/udpsinkgui.cpp @@ -167,7 +167,6 @@ UDPSinkGUI::UDPSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandS ui->glSpectrum->setDisplayWaterfall(true); ui->glSpectrum->setDisplayMaxHold(true); - ui->glSpectrum->connectTimer(MainCore::instance()->getMasterTimer()); connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); m_channelMarker.blockSignals(true); diff --git a/plugins/channeltx/mod802.15.4/ieee_802_15_4_modgui.cpp b/plugins/channeltx/mod802.15.4/ieee_802_15_4_modgui.cpp index 7f33ae557..0a8ee3868 100644 --- a/plugins/channeltx/mod802.15.4/ieee_802_15_4_modgui.cpp +++ b/plugins/channeltx/mod802.15.4/ieee_802_15_4_modgui.cpp @@ -385,7 +385,6 @@ IEEE_802_15_4_ModGUI::IEEE_802_15_4_ModGUI(PluginAPI* pluginAPI, DeviceUISet *de ui->glSpectrum->setDisplayWaterfall(false); ui->glSpectrum->setDisplayMaxHold(false); ui->glSpectrum->setDisplayHistogram(false); - ui->glSpectrum->connectTimer(MainCore::instance()->getMasterTimer()); CRightClickEnabler *repeatRightClickEnabler = new CRightClickEnabler(ui->repeat); connect(repeatRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(repeatSelect())); diff --git a/plugins/channeltx/modfreedv/freedvmodgui.cpp b/plugins/channeltx/modfreedv/freedvmodgui.cpp index b5d2fb7c7..a06ab537b 100644 --- a/plugins/channeltx/modfreedv/freedvmodgui.cpp +++ b/plugins/channeltx/modfreedv/freedvmodgui.cpp @@ -361,7 +361,6 @@ FreeDVModGUI::FreeDVModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb ui->glSpectrum->setDisplayWaterfall(true); ui->glSpectrum->setDisplayMaxHold(true); ui->glSpectrum->setSsbSpectrum(true); - ui->glSpectrum->connectTimer(MainCore::instance()->getMasterTimer()); connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); diff --git a/plugins/channeltx/modpacket/packetmodgui.cpp b/plugins/channeltx/modpacket/packetmodgui.cpp index dbee80ecf..ffd6b55d5 100644 --- a/plugins/channeltx/modpacket/packetmodgui.cpp +++ b/plugins/channeltx/modpacket/packetmodgui.cpp @@ -420,7 +420,6 @@ PacketModGUI::PacketModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb ui->glSpectrum->setDisplayWaterfall(false); ui->glSpectrum->setDisplayMaxHold(false); ui->glSpectrum->setDisplayHistogram(false); - ui->glSpectrum->connectTimer(MainCore::instance()->getMasterTimer()); CRightClickEnabler *repeatRightClickEnabler = new CRightClickEnabler(ui->repeat); connect(repeatRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(repeatSelect())); diff --git a/plugins/channeltx/modssb/ssbmodgui.cpp b/plugins/channeltx/modssb/ssbmodgui.cpp index 7afae21b8..d66938e12 100644 --- a/plugins/channeltx/modssb/ssbmodgui.cpp +++ b/plugins/channeltx/modssb/ssbmodgui.cpp @@ -426,7 +426,6 @@ SSBModGUI::SSBModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam ui->glSpectrum->setDisplayWaterfall(true); ui->glSpectrum->setDisplayMaxHold(true); ui->glSpectrum->setSsbSpectrum(true); - ui->glSpectrum->connectTimer(MainCore::instance()->getMasterTimer()); connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); diff --git a/plugins/channeltx/udpsource/udpsourcegui.cpp b/plugins/channeltx/udpsource/udpsourcegui.cpp index 252320fb0..d6b5d96f7 100644 --- a/plugins/channeltx/udpsource/udpsourcegui.cpp +++ b/plugins/channeltx/udpsource/udpsourcegui.cpp @@ -125,7 +125,6 @@ UDPSourceGUI::UDPSourceGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb ui->glSpectrum->setDisplayWaterfall(true); ui->glSpectrum->setDisplayMaxHold(true); - ui->glSpectrum->connectTimer(MainCore::instance()->getMasterTimer()); connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); m_channelMarker.blockSignals(true); diff --git a/plugins/feature/demodanalyzer/demodanalyzergui.cpp b/plugins/feature/demodanalyzer/demodanalyzergui.cpp index fb41e8581..11960c2da 100644 --- a/plugins/feature/demodanalyzer/demodanalyzergui.cpp +++ b/plugins/feature/demodanalyzer/demodanalyzergui.cpp @@ -163,7 +163,6 @@ DemodAnalyzerGUI::DemodAnalyzerGUI(PluginAPI* pluginAPI, FeatureUISet *featureUI m_scopeVis->setLiveRate(m_sampleRate/(1<glSpectrum->connectTimer(MainCore::instance()->getMasterTimer()); ui->glScope->connectTimer(MainCore::instance()->getMasterTimer()); connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); diff --git a/plugins/samplemimo/testmosync/testmosyncgui.cpp b/plugins/samplemimo/testmosync/testmosyncgui.cpp index 7f3e8198e..cbcd64670 100644 --- a/plugins/samplemimo/testmosync/testmosyncgui.cpp +++ b/plugins/samplemimo/testmosync/testmosyncgui.cpp @@ -62,7 +62,6 @@ TestMOSyncGui::TestMOSyncGui(DeviceUISet *deviceUISet, QWidget* parent) : m_spectrumVis->setGLSpectrum(ui->glSpectrum); ui->glSpectrum->setCenterFrequency(m_settings.m_centerFrequency); ui->glSpectrum->setSampleRate(m_settings.m_sampleRate*(1<glSpectrum->connectTimer(MainCore::instance()->getMasterTimer()); ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); connect(&(m_deviceUISet->m_deviceAPI->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick())); diff --git a/plugins/samplesink/testsink/testsinkgui.cpp b/plugins/samplesink/testsink/testsinkgui.cpp index 22000ceb0..5afe0f4ab 100644 --- a/plugins/samplesink/testsink/testsinkgui.cpp +++ b/plugins/samplesink/testsink/testsinkgui.cpp @@ -61,7 +61,6 @@ TestSinkGui::TestSinkGui(DeviceUISet *deviceUISet, QWidget* parent) : m_spectrumVis->setGLSpectrum(ui->glSpectrum); ui->glSpectrum->setCenterFrequency(m_settings.m_centerFrequency); ui->glSpectrum->setSampleRate(m_settings.m_sampleRate*(1<glSpectrum->connectTimer(MainCore::instance()->getMasterTimer()); ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); connect(&(m_deviceUISet->m_deviceAPI->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick())); diff --git a/sdrbase/dsp/glspectrumsettings.cpp b/sdrbase/dsp/glspectrumsettings.cpp index 9592815ef..42a926da3 100644 --- a/sdrbase/dsp/glspectrumsettings.cpp +++ b/sdrbase/dsp/glspectrumsettings.cpp @@ -34,6 +34,7 @@ void GLSpectrumSettings::resetToDefaults() m_fftWindow = FFTWindow::Hanning; m_refLevel = 0; m_powerRange = 100; + m_fpsPeriodMs = 50; m_decay = 1; m_decayDivisor = 1; m_histogramStroke = 30; @@ -65,6 +66,7 @@ QByteArray GLSpectrumSettings::serialize() const s.writeS32(3, (int) m_fftWindow); s.writeReal(4, m_refLevel); s.writeReal(5, m_powerRange); + s.writeS32(26, m_fpsPeriodMs); s.writeBool(6, m_displayWaterfall); s.writeBool(7, m_invertedWaterfall); s.writeBool(8, m_displayMaxHold); @@ -108,6 +110,7 @@ bool GLSpectrumSettings::deserialize(const QByteArray& data) m_fftWindow = (FFTWindow::Function) tmp; d.readReal(4, &m_refLevel, 0); d.readReal(5, &m_powerRange, 100); + d.readS32(26, &m_fpsPeriodMs, 50); d.readBool(6, &m_displayWaterfall, true); d.readBool(7, &m_invertedWaterfall, true); d.readBool(8, &m_displayMaxHold, false); diff --git a/sdrbase/dsp/glspectrumsettings.h b/sdrbase/dsp/glspectrumsettings.h index a3a734c7a..04d206d60 100644 --- a/sdrbase/dsp/glspectrumsettings.h +++ b/sdrbase/dsp/glspectrumsettings.h @@ -41,6 +41,7 @@ public: FFTWindow::Function m_fftWindow; Real m_refLevel; Real m_powerRange; + int m_fpsPeriodMs; //!< FPS capping period in ms FPS = 1000/m_fpsPeriodMs. If zero: no limit. int m_decay; int m_decayDivisor; int m_histogramStroke; diff --git a/sdrbase/dsp/spectrumvis.cpp b/sdrbase/dsp/spectrumvis.cpp index ecb56e72f..78762d7de 100644 --- a/sdrbase/dsp/spectrumvis.cpp +++ b/sdrbase/dsp/spectrumvis.cpp @@ -721,6 +721,7 @@ void SpectrumVis::applySettings(const GLSpectrumSettings& settings, bool force) << " m_averagingMode: " << settings.m_averagingMode << " m_refLevel: " << settings.m_refLevel << " m_powerRange: " << settings.m_powerRange + << " m_fpsPeriodMs: " << settings.m_fpsPeriodMs << " m_linear: " << settings.m_linear << " m_ssb: " << settings.m_ssb << " m_usb: " << settings.m_usb @@ -919,6 +920,7 @@ void SpectrumVis::webapiFormatSpectrumSettings(SWGSDRangel::SWGGLSpectrum& respo response.setFftWindow((int) settings.m_fftWindow); response.setRefLevel(settings.m_refLevel); response.setPowerRange(settings.m_powerRange); + response.setFpsPeriodMs(settings.m_fpsPeriodMs); response.setDecay(settings.m_decay); response.setDecayDivisor(settings.m_decayDivisor); response.setHistogramStroke(settings.m_histogramStroke); @@ -965,6 +967,9 @@ void SpectrumVis::webapiUpdateSpectrumSettings( if (spectrumSettingsKeys.contains("powerRange")) { settings.m_powerRange = response.getPowerRange(); } + if (spectrumSettingsKeys.contains("fpsPeriodMs")) { + settings.m_fpsPeriodMs = response.getFpsPeriodMs(); + } if (spectrumSettingsKeys.contains("decay")) { settings.m_decay = response.getDecay(); } diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index 9fff6eac4..e7bd6038b 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -4835,6 +4835,10 @@ margin-bottom: 20px; "type" : "number", "format" : "float" }, + "fpsPeriodMs" : { + "type" : "integer", + "description" : "FPS capping period in milliseconds. 0 for no limit." + }, "displayWaterfall" : { "type" : "integer", "description" : "boolean" @@ -6278,9 +6282,9 @@ margin-bottom: 20px; "type" : "integer", "description" : "Angle to rotate the image by" }, - "imageFixedSize" : { + "imageMinZoom" : { "type" : "integer", - "description" : "Keep the image the same size, regardless of map zoom level (1 for yes, 0 for no)" + "description" : "Minimim zoom value" }, "text" : { "type" : "string" @@ -6294,6 +6298,11 @@ margin-bottom: 20px; "type" : "number", "format" : "float", "description" : "Longitude in decimal degrees, positive to the east" + }, + "altitude" : { + "type" : "number", + "format" : "float", + "description" : "Altitude / height above sea level in metres" } }, "description" : "An item to draw on the map. Set image to an empty string to remove item from the map." @@ -6313,9 +6322,9 @@ margin-bottom: 20px; "type" : "integer", "description" : "Angle to rotate the image by" }, - "imageFixedSize" : { + "imageMinZoom" : { "type" : "integer", - "description" : "Keep the image the same size, regardless of map zoom level (1 for yes, 0 for no)" + "description" : "Minimim zoom value" }, "text" : { "type" : "string" @@ -6329,6 +6338,11 @@ margin-bottom: 20px; "type" : "number", "format" : "float", "description" : "Longitude in decimal degrees, positive to the east" + }, + "altitude" : { + "type" : "number", + "format" : "float", + "description" : "Altitude / height above sea level in metres" } }, "description" : "An item to draw on the map. Set image to an empty string to remove item from the map." @@ -45272,7 +45286,7 @@ except ApiException as e:
- Generated 2021-01-13T17:40:49.583+01:00 + Generated 2021-02-11T23:51:16.152+01:00
diff --git a/sdrbase/resources/webapi/doc/swagger/include/APRS.yaml b/sdrbase/resources/webapi/doc/swagger/include/APRS.yaml index 6a65d4aea..f61120a68 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/APRS.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/APRS.yaml @@ -4,15 +4,15 @@ APRSSettings: igateServer: type: string igatePort: - type: integer + type: integer igateCallsign: type: string igatePasscode: type: string igateFilter: - type: string + type: string igateEnabled: - type: integer + type: integer title: type: string rgbColor: diff --git a/sdrbase/resources/webapi/doc/swagger/include/GLSpectrum.yaml b/sdrbase/resources/webapi/doc/swagger/include/GLSpectrum.yaml index 6f96f7679..f61a40efe 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/GLSpectrum.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/GLSpectrum.yaml @@ -14,6 +14,9 @@ GLSpectrum: powerRange: type: number format: float + fpsPeriodMs: + type: integer + description: FPS capping period in milliseconds. 0 for no limit. displayWaterfall: description: boolean type: integer diff --git a/sdrbase/resources/webapi/doc/swagger/include/Map.yaml b/sdrbase/resources/webapi/doc/swagger/include/Map.yaml index ca50b0b58..19ff43c16 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/Map.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/Map.yaml @@ -34,16 +34,18 @@ MapItem: properties: name: description: "A name for the item" - type: string + type: string image: description: "Filename or URL of image to draw on the map" type: string imageRotation: description: "Angle to rotate the image by" type: integer - imageFixedSize: - description: "Keep the image the same size, regardless of map zoom level (1 for yes, 0 for no)" + default: 0 + imageMinZoom: + description: "Minimim zoom value" type: integer + default: 11 text: descrption: "Text to draw on the map when item is selected" type: string @@ -55,3 +57,7 @@ MapItem: description: "Longitude in decimal degrees, positive to the east" type: number format: float + altitude: + description: "Altitude / height above sea level in metres" + type: number + format: float diff --git a/sdrbase/resources/webapi/doc/swagger/include/StarTracker.yaml b/sdrbase/resources/webapi/doc/swagger/include/StarTracker.yaml index 99403d533..3a1128447 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/StarTracker.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/StarTracker.yaml @@ -9,25 +9,25 @@ StarTrackerSettings: type: string dec: description: "Declination of custom target" - type: string - latitude: + type: string + latitude: description: "Latitude in decimal degrees (North positive) of observation/antenna location" type: number format: float longitude: description: "Longitude in decimal degrees (East positive) of observation/antenna location" - type: number + type: number format: float dateTime: - description: "Date and time of observation. ISO 8601 extended format: yyyy-MM-ddTHH:mm:ss with Z suffix for UTC. Empty string for current time." + description: "Date and time of observation. ISO 8601 extended format: yyyy-MM-ddTHH:mm:ss with Z suffix for UTC. Empty string for current time." type: string - refraction: + refraction: description: "Atmospheric refraction correction (None or Saemundsson)" type: string pressure: description: "Air pressure in millibars, for refraction" type: number - format: float + format: float temperature: description: "Air temperature in Celsuis, for refraction" type: number @@ -47,17 +47,17 @@ StarTrackerSettings: frequency: description: "Frequency of radio waves being observed in MHz" type: number - format: float + format: float stellariumServerEnabled: descrption: "Enable Stellarium server (1 for yes, 0 for no)" - type: integer + type: integer stellariumPort: description: "IP port number for Stellarium server to listen on (Default is 10001)." type: integer updatePeriod: description: "Time in seconds between each calculation of the target's position" type: number - format: float + format: float epoch: description: "Epoch for RA and Dec (J2000 or JNOW)" type: string @@ -69,7 +69,7 @@ StarTrackerSettings: type: integer drawStarOnMap: description: "Draw the overhead position of the target Star on the Map (1 for yes, 0 for no)" - type: integer + type: integer title: type: string rgbColor: diff --git a/sdrbase/webapi/webapiadapterbase.cpp b/sdrbase/webapi/webapiadapterbase.cpp index d390554b3..4a2a78285 100644 --- a/sdrbase/webapi/webapiadapterbase.cpp +++ b/sdrbase/webapi/webapiadapterbase.cpp @@ -149,6 +149,7 @@ void WebAPIAdapterBase::webapiFormatPreset( swgSpectrumConfig->setFftWindow((int) m_spectrumSettings.m_fftWindow); swgSpectrumConfig->setRefLevel(m_spectrumSettings.m_refLevel); swgSpectrumConfig->setPowerRange(m_spectrumSettings.m_powerRange); + swgSpectrumConfig->setFpsPeriodMs(m_spectrumSettings.m_fpsPeriodMs); swgSpectrumConfig->setDisplayWaterfall(m_spectrumSettings.m_displayWaterfall ? 1 : 0); swgSpectrumConfig->setInvertedWaterfall(m_spectrumSettings.m_invertedWaterfall ? 1 : 0); swgSpectrumConfig->setDisplayMaxHold(m_spectrumSettings.m_displayMaxHold ? 1 : 0); @@ -369,6 +370,9 @@ void WebAPIAdapterBase::webapiUpdatePreset( if (spectrumIt->contains("refLevel")) { spectrumSettings.m_refLevel = apiPreset->getSpectrumConfig()->getRefLevel(); } + if (spectrumIt->contains("fpsPeriodMs")) { + spectrumSettings.m_fpsPeriodMs = apiPreset->getSpectrumConfig()->getFpsPeriodMs(); + } if (spectrumIt->contains("waterfallShare")) { spectrumSettings.m_waterfallShare = apiPreset->getSpectrumConfig()->getWaterfallShare(); } diff --git a/sdrbase/webapi/webapirequestmapper.cpp b/sdrbase/webapi/webapirequestmapper.cpp index 925e4721d..d0df93b7a 100644 --- a/sdrbase/webapi/webapirequestmapper.cpp +++ b/sdrbase/webapi/webapirequestmapper.cpp @@ -3391,6 +3391,11 @@ bool WebAPIRequestMapper::validateSpectrumSettings(SWGSDRangel::SWGGLSpectrum& s spectrumSettings.setPowerRange(jsonObject["powerRange"].toDouble(100.0)); spectrumSettingsKeys.append("powerRange"); } + if (jsonObject.contains("fpsPeriodMs")) + { + spectrumSettings.setFpsPeriodMs(jsonObject["fpsPeriodMs"].toInt(50)); + spectrumSettingsKeys.append("fpsPeriodMs"); + } if (jsonObject.contains("displayWaterfall")) { spectrumSettings.setDisplayWaterfall(jsonObject["displayWaterfall"].toInt(0)); diff --git a/sdrgui/device/deviceuiset.cpp b/sdrgui/device/deviceuiset.cpp index 4d8854d10..4a402af14 100644 --- a/sdrgui/device/deviceuiset.cpp +++ b/sdrgui/device/deviceuiset.cpp @@ -36,12 +36,11 @@ #include "deviceuiset.h" -DeviceUISet::DeviceUISet(int tabIndex, DeviceSet *deviceSet, QTimer& timer) +DeviceUISet::DeviceUISet(int tabIndex, DeviceSet *deviceSet) { m_spectrum = new GLSpectrum; m_spectrumVis = deviceSet->m_spectrumVis; m_spectrumVis->setGLSpectrum(m_spectrum); - m_spectrum->connectTimer(timer); m_spectrumGUI = new GLSpectrumGUI; m_spectrumGUI->setBuddies(m_spectrumVis, m_spectrum); m_channelWindow = new ChannelWindow; diff --git a/sdrgui/device/deviceuiset.h b/sdrgui/device/deviceuiset.h index 5c77b053e..35d48e3d6 100644 --- a/sdrgui/device/deviceuiset.h +++ b/sdrgui/device/deviceuiset.h @@ -61,7 +61,7 @@ public: DSPDeviceMIMOEngine *m_deviceMIMOEngine; QByteArray m_mainWindowState; - DeviceUISet(int tabIndex, DeviceSet *deviceSet, QTimer& timer); + DeviceUISet(int tabIndex, DeviceSet *deviceSet); ~DeviceUISet(); GLSpectrum *getSpectrum() { return m_spectrum; } //!< Direct spectrum getter diff --git a/sdrgui/gui/glspectrum.cpp b/sdrgui/gui/glspectrum.cpp index 43239d058..ebf7b8d73 100644 --- a/sdrgui/gui/glspectrum.cpp +++ b/sdrgui/gui/glspectrum.cpp @@ -37,7 +37,7 @@ GLSpectrum::GLSpectrum(QWidget* parent) : QGLWidget(parent), m_cursorState(CSNormal), m_cursorChannel(0), - m_masterTimer(nullptr), + m_fpsPeriodMs(50), m_mouseInside(false), m_changesPending(true), m_centerFrequency(100000000), @@ -160,8 +160,9 @@ GLSpectrum::GLSpectrum(QWidget* parent) : m_textOverlayFont.setBold(true); // m_textOverlayFont.setPointSize(font().pointSize() - 1); + m_timer.setTimerType(Qt::PreciseTimer); connect(&m_timer, SIGNAL(timeout()), this, SLOT(tick())); - m_timer.start(50); + m_timer.start(m_fpsPeriodMs); } GLSpectrum::~GLSpectrum() @@ -428,6 +429,10 @@ void GLSpectrum::newSpectrum(const std::vector& spectrum, int fftSize) updateWaterfall(spectrum); updateHistogram(spectrum); + + if (m_fpsPeriodMs == 0) { + update(); + } } void GLSpectrum::updateWaterfall(const std::vector& spectrum) @@ -2288,24 +2293,20 @@ void GLSpectrum::setWaterfallShare(Real waterfallShare) m_changesPending = true; } -void GLSpectrum::connectTimer(const QTimer& timer) +void GLSpectrum::setFPSPeriodMs(int fpsPeriodMs) { - qDebug() << "GLSpectrum::connectTimer"; - disconnect(&m_timer, SIGNAL(timeout()), this, SLOT(tick())); - connect(&timer, SIGNAL(timeout()), this, SLOT(tick())); - m_masterTimer = &timer; - m_timer.stop(); -} + if (fpsPeriodMs == 0) + { + disconnect(&m_timer, SIGNAL(timeout()), this, SLOT(tick())); + m_timer.stop(); + } + else + { + connect(&m_timer, SIGNAL(timeout()), this, SLOT(tick())); + m_timer.start(fpsPeriodMs); + } -void GLSpectrum::disconnectTimer() -{ - qDebug() << "GLScope::disconnectTimer"; - - if (m_masterTimer) { - disconnect(m_masterTimer, SIGNAL(timeout()), this, SLOT(tick())); - } - - m_masterTimer = nullptr; + m_fpsPeriodMs = fpsPeriodMs; } void GLSpectrum::cleanup() diff --git a/sdrgui/gui/glspectrum.h b/sdrgui/gui/glspectrum.h index 63613e3c7..35782210b 100644 --- a/sdrgui/gui/glspectrum.h +++ b/sdrgui/gui/glspectrum.h @@ -108,8 +108,7 @@ public: Real getWaterfallShare() const { return m_waterfallShare; } void setWaterfallShare(Real waterfallShare); - void connectTimer(const QTimer& timer); - void disconnectTimer(); + void setFPSPeriodMs(int fpsPeriodMs); void setDisplayedStream(bool sourceOrSink, int streamIndex) { @@ -237,7 +236,7 @@ private: int m_cursorChannel; QTimer m_timer; - const QTimer *m_masterTimer; + int m_fpsPeriodMs; QMutex m_mutex; bool m_mouseInside; bool m_changesPending; diff --git a/sdrgui/gui/glspectrumgui.cpp b/sdrgui/gui/glspectrumgui.cpp index 3c5370700..cbafe7167 100644 --- a/sdrgui/gui/glspectrumgui.cpp +++ b/sdrgui/gui/glspectrumgui.cpp @@ -32,6 +32,8 @@ #include "util/db.h" #include "ui_glspectrumgui.h" +const int GLSpectrumGUI::m_fpsMs[] = {500, 200, 100, 50, 20, 10, 5, 0}; + GLSpectrumGUI::GLSpectrumGUI(QWidget* parent) : QWidget(parent), ui(new Ui::GLSpectrumGUI), @@ -144,6 +146,24 @@ void GLSpectrumGUI::displaySettings() } } + if (m_settings.m_fpsPeriodMs == 0) + { + ui->fps->setCurrentIndex(sizeof(m_fpsMs)/sizeof(m_fpsMs[0]) - 1); + } + else + { + unsigned int i = 0; + + for (; i < sizeof(m_fpsMs)/sizeof(m_fpsMs[0]); i++) + { + if (m_settings.m_fpsPeriodMs >= m_fpsMs[i]) { + break; + } + } + + ui->fps->setCurrentIndex(i); + } + ui->fftOverlap->setValue(m_settings.m_fftOverlap); setMaximumOverlap(); ui->averaging->setCurrentIndex(m_settings.m_averagingIndex); @@ -208,6 +228,7 @@ void GLSpectrumGUI::applyGLSpectrumSettings() qDebug("GLSpectrumGUI::applySettings: refLevel: %e powerRange: %e", refLevel, powerRange); m_glSpectrum->setReferenceLevel(refLevel); m_glSpectrum->setPowerRange(powerRange); + m_glSpectrum->setFPSPeriodMs(m_settings.m_fpsPeriodMs); m_glSpectrum->setLinear(m_settings.m_linear); } @@ -323,6 +344,13 @@ void GLSpectrumGUI::on_levelRange_valueChanged(int value) applySettings(); } +void GLSpectrumGUI::on_fps_currentIndexChanged(int index) +{ + m_settings.m_fpsPeriodMs = m_fpsMs[index]; + qDebug("GLSpectrumGUI::on_fps_currentIndexChanged: %d ms", m_settings.m_fpsPeriodMs); + applySettings(); +} + void GLSpectrumGUI::on_decay_valueChanged(int index) { m_settings.m_decay = index; diff --git a/sdrgui/gui/glspectrumgui.h b/sdrgui/gui/glspectrumgui.h index 758c9204e..0c07b85de 100644 --- a/sdrgui/gui/glspectrumgui.h +++ b/sdrgui/gui/glspectrumgui.h @@ -67,6 +67,7 @@ private: MessageQueue m_messageQueue; GLSpectrumSettings m_settings; bool m_doApplySettings; + static const int m_fpsMs[]; void blockApplySettings(bool block); void applySettings(); @@ -89,6 +90,7 @@ private slots: void on_autoscale_clicked(bool checked); void on_refLevel_valueChanged(int value); void on_levelRange_valueChanged(int value); + void on_fps_currentIndexChanged(int index); void on_decay_valueChanged(int index); void on_decayDivisor_valueChanged(int index); void on_stroke_valueChanged(int index); diff --git a/sdrgui/gui/glspectrumgui.ui b/sdrgui/gui/glspectrumgui.ui index b3ff51e56..05595d61c 100644 --- a/sdrgui/gui/glspectrumgui.ui +++ b/sdrgui/gui/glspectrumgui.ui @@ -226,7 +226,7 @@ - 45 + 55 0 @@ -443,6 +443,68 @@ + + + + + 55 + 0 + + + + + 45 + 16777215 + + + + Spectrum maximum FPS (NL for No Limit) + + + 3 + + + + 2 + + + + + 5 + + + + + 10 + + + + + 20 + + + + + 50 + + + + + 100 + + + + + 200 + + + + + NL + + + + diff --git a/sdrgui/mainwindow.cpp b/sdrgui/mainwindow.cpp index e7fdcf688..f7d2839c4 100644 --- a/sdrgui/mainwindow.cpp +++ b/sdrgui/mainwindow.cpp @@ -304,7 +304,7 @@ void MainWindow::addSourceDevice(int deviceIndex) ui->inputViewDock->addDevice(0, deviceTabIndex); m_mainCore->appendDeviceSet(0); - m_deviceUIs.push_back(new DeviceUISet(deviceTabIndex, m_mainCore->m_deviceSets.back(), m_mainCore->m_masterTimer)); + m_deviceUIs.push_back(new DeviceUISet(deviceTabIndex, m_mainCore->m_deviceSets.back())); m_deviceUIs.back()->m_deviceSourceEngine = dspDeviceSourceEngine; m_mainCore->m_deviceSets.back()->m_deviceSourceEngine = dspDeviceSourceEngine; m_deviceUIs.back()->m_deviceSinkEngine = nullptr; @@ -383,7 +383,7 @@ void MainWindow::addSinkDevice() ui->inputViewDock->addDevice(1, deviceTabIndex); m_mainCore->appendDeviceSet(1); - m_deviceUIs.push_back(new DeviceUISet(deviceTabIndex, m_mainCore->m_deviceSets.back(), m_mainCore->m_masterTimer)); + m_deviceUIs.push_back(new DeviceUISet(deviceTabIndex, m_mainCore->m_deviceSets.back())); m_deviceUIs.back()->m_deviceSourceEngine = nullptr; m_mainCore->m_deviceSets.back()->m_deviceSourceEngine = nullptr; m_deviceUIs.back()->m_deviceSinkEngine = dspDeviceSinkEngine; @@ -460,7 +460,7 @@ void MainWindow::addMIMODevice() ui->inputViewDock->addDevice(2, deviceTabIndex); m_mainCore->appendDeviceSet(2); - m_deviceUIs.push_back(new DeviceUISet(deviceTabIndex, m_mainCore->m_deviceSets.back(), m_mainCore->m_masterTimer)); + m_deviceUIs.push_back(new DeviceUISet(deviceTabIndex, m_mainCore->m_deviceSets.back())); m_deviceUIs.back()->m_deviceSourceEngine = nullptr; m_mainCore->m_deviceSets.back()->m_deviceSourceEngine = nullptr; m_deviceUIs.back()->m_deviceSinkEngine = nullptr; diff --git a/swagger/sdrangel/api/swagger/include/GLSpectrum.yaml b/swagger/sdrangel/api/swagger/include/GLSpectrum.yaml index 6f96f7679..f61a40efe 100644 --- a/swagger/sdrangel/api/swagger/include/GLSpectrum.yaml +++ b/swagger/sdrangel/api/swagger/include/GLSpectrum.yaml @@ -14,6 +14,9 @@ GLSpectrum: powerRange: type: number format: float + fpsPeriodMs: + type: integer + description: FPS capping period in milliseconds. 0 for no limit. displayWaterfall: description: boolean type: integer diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index 9fff6eac4..e7bd6038b 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -4835,6 +4835,10 @@ margin-bottom: 20px; "type" : "number", "format" : "float" }, + "fpsPeriodMs" : { + "type" : "integer", + "description" : "FPS capping period in milliseconds. 0 for no limit." + }, "displayWaterfall" : { "type" : "integer", "description" : "boolean" @@ -6278,9 +6282,9 @@ margin-bottom: 20px; "type" : "integer", "description" : "Angle to rotate the image by" }, - "imageFixedSize" : { + "imageMinZoom" : { "type" : "integer", - "description" : "Keep the image the same size, regardless of map zoom level (1 for yes, 0 for no)" + "description" : "Minimim zoom value" }, "text" : { "type" : "string" @@ -6294,6 +6298,11 @@ margin-bottom: 20px; "type" : "number", "format" : "float", "description" : "Longitude in decimal degrees, positive to the east" + }, + "altitude" : { + "type" : "number", + "format" : "float", + "description" : "Altitude / height above sea level in metres" } }, "description" : "An item to draw on the map. Set image to an empty string to remove item from the map." @@ -6313,9 +6322,9 @@ margin-bottom: 20px; "type" : "integer", "description" : "Angle to rotate the image by" }, - "imageFixedSize" : { + "imageMinZoom" : { "type" : "integer", - "description" : "Keep the image the same size, regardless of map zoom level (1 for yes, 0 for no)" + "description" : "Minimim zoom value" }, "text" : { "type" : "string" @@ -6329,6 +6338,11 @@ margin-bottom: 20px; "type" : "number", "format" : "float", "description" : "Longitude in decimal degrees, positive to the east" + }, + "altitude" : { + "type" : "number", + "format" : "float", + "description" : "Altitude / height above sea level in metres" } }, "description" : "An item to draw on the map. Set image to an empty string to remove item from the map." @@ -45272,7 +45286,7 @@ except ApiException as e:
- Generated 2021-01-13T17:40:49.583+01:00 + Generated 2021-02-11T23:51:16.152+01:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGGLSpectrum.cpp b/swagger/sdrangel/code/qt5/client/SWGGLSpectrum.cpp index fb657963e..cd7c78e49 100644 --- a/swagger/sdrangel/code/qt5/client/SWGGLSpectrum.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGGLSpectrum.cpp @@ -38,6 +38,8 @@ SWGGLSpectrum::SWGGLSpectrum() { m_ref_level_isSet = false; power_range = 0.0f; m_power_range_isSet = false; + fps_period_ms = 0; + m_fps_period_ms_isSet = false; display_waterfall = 0; m_display_waterfall_isSet = false; inverted_waterfall = 0; @@ -94,6 +96,8 @@ SWGGLSpectrum::init() { m_ref_level_isSet = false; power_range = 0.0f; m_power_range_isSet = false; + fps_period_ms = 0; + m_fps_period_ms_isSet = false; display_waterfall = 0; m_display_waterfall_isSet = false; inverted_waterfall = 0; @@ -156,6 +160,7 @@ SWGGLSpectrum::cleanup() { + if(ws_spectrum_address != nullptr) { @@ -185,6 +190,8 @@ SWGGLSpectrum::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&power_range, pJson["powerRange"], "float", ""); + ::SWGSDRangel::setValue(&fps_period_ms, pJson["fpsPeriodMs"], "qint32", ""); + ::SWGSDRangel::setValue(&display_waterfall, pJson["displayWaterfall"], "qint32", ""); ::SWGSDRangel::setValue(&inverted_waterfall, pJson["invertedWaterfall"], "qint32", ""); @@ -254,6 +261,9 @@ SWGGLSpectrum::asJsonObject() { if(m_power_range_isSet){ obj->insert("powerRange", QJsonValue(power_range)); } + if(m_fps_period_ms_isSet){ + obj->insert("fpsPeriodMs", QJsonValue(fps_period_ms)); + } if(m_display_waterfall_isSet){ obj->insert("displayWaterfall", QJsonValue(display_waterfall)); } @@ -365,6 +375,16 @@ SWGGLSpectrum::setPowerRange(float power_range) { this->m_power_range_isSet = true; } +qint32 +SWGGLSpectrum::getFpsPeriodMs() { + return fps_period_ms; +} +void +SWGGLSpectrum::setFpsPeriodMs(qint32 fps_period_ms) { + this->fps_period_ms = fps_period_ms; + this->m_fps_period_ms_isSet = true; +} + qint32 SWGGLSpectrum::getDisplayWaterfall() { return display_waterfall; @@ -575,6 +595,9 @@ SWGGLSpectrum::isSet(){ if(m_power_range_isSet){ isObjectUpdated = true; break; } + if(m_fps_period_ms_isSet){ + isObjectUpdated = true; break; + } if(m_display_waterfall_isSet){ isObjectUpdated = true; break; } diff --git a/swagger/sdrangel/code/qt5/client/SWGGLSpectrum.h b/swagger/sdrangel/code/qt5/client/SWGGLSpectrum.h index 60ad20ef4..ed2c021a3 100644 --- a/swagger/sdrangel/code/qt5/client/SWGGLSpectrum.h +++ b/swagger/sdrangel/code/qt5/client/SWGGLSpectrum.h @@ -57,6 +57,9 @@ public: float getPowerRange(); void setPowerRange(float power_range); + qint32 getFpsPeriodMs(); + void setFpsPeriodMs(qint32 fps_period_ms); + qint32 getDisplayWaterfall(); void setDisplayWaterfall(qint32 display_waterfall); @@ -133,6 +136,9 @@ private: float power_range; bool m_power_range_isSet; + qint32 fps_period_ms; + bool m_fps_period_ms_isSet; + qint32 display_waterfall; bool m_display_waterfall_isSet;