Commit Graph
24 Commits
Author SHA1 Message Date
Jon Beniston 852fd6e10c Add connections overlay 2026-09-27 23:09:10 +01:00
Jon BenistonandClaude Opus 5 71d8650c6d Drive feature state from a signal rather than polling it
Every feature GUI ran its own one second QTimer, read getState(), compared
it against a remembered m_lastFeatureState and restyled its start/stop
button when the two differed. The same twenty five lines appeared in each
of them.

Feature now keeps m_state private behind setState(), which emits
stateChanged() when it actually changes, and FeatureGUI grows a shared
updateStartStopButton() that restyles the button and reports an error
state. A GUI connects to the signal and calls that, so the state is
reflected as soon as it changes rather than up to a second later, and the
per feature timers and m_lastFeatureState members are gone.

FeatureUISet disconnects the feature from its GUI before the feature is
deleted: QObject emits destroyed() before dropping its connections, so a
stateChanged() emitted from the feature's destructor could otherwise reach
a GUI that has already deleted its ui object.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-11 17:49:02 +01:00
Jon BenistonandClaude Opus 5 17f51d3ace Implement the new Web API endpoints and reports
Server side for the spectrum paths added to the spec: GET spectrum/report
returns whichever measurement is switched on, POST spectrum/actions
carries autoscale, clearSpectrum, resetMeasurements, freeze and
gotoMarker, and GET spectrum/data returns the power values reduced to a
number of bins. The display actions reach the spectrum through new
GLSpectrumInterface methods that default to doing nothing, so an instance
without a GUI ignores them rather than every caller having to know.

The measurement results are kept as plain values behind a lock and
published once per displayed frame, so a report costs nothing until one is
asked for, and the figures match what is on screen.

Also completes the main spectrum settings, which were only partly carried
over the API, and adds reports that had no way to be read at all: vessels
for AIS, stations for APRS, sondes for Radiosonde, the programme list for
DAB, the RDS programme service name for BFM, and validity flags for the
ADS-B aircraft report so a caller can tell a missing position from one at
zero. Map settings are exposed through their generated setters.

Two fixes found while testing: the frequency scanner dropped the frequency
list because the API calls it "frequencies" and everything downstream
keys it as "frequencySettings", and the spectrum adapters bound a
reference to the error message before init() had allocated one, so every
error path returned no response at all.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-11 17:27:22 +01:00
Jon BenistonandClaude Opus 5 60db861797 Fix QString leak in the web API settings and report formatters
The generated SWG setters overwrite the string pointer without deleting
what is already there, and every webapiSettingsGet and webapiReportGet
calls init() first, which has allocated one. Each call therefore leaked a
QString per string field. Measured at 117 bytes per settings GET for the
Satellite Tracker, over 20,000 requests.

Assign in place when the pointer is already set, which is what these same
functions have always done for title and reverseAPIAddress. 394 sites
across webapiFormatChannelSettings, webapiFormatDeviceSettings,
webapiFormatFeatureSettings and the three report equivalents.

The webapiReverseSend* functions are deliberately left alone: they build a
fresh SWG object whose constructor leaves the pointers null, so passing a
new QString is correct there.

After the change the same measurement is flat, at 7 bytes per GET.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-11 16:54:42 +01:00
f4exb fcbaf95403 Fixed settings keys 2026-02-12 23:23:27 +01:00
Mykola Dvornik 15337cac66 Fix bug that prevents settings changes updates via reverse API
Most plugins that use reverse API to PATCH settings updates to remote
server only do so when `useReverseAPI` is toggled, but not when the
relevant settings are being updated. So lets fix the precondition to
use the `m_useReverseAPI` flag instead.
2024-04-14 18:58:12 +02:00
Daniele Forsi 8c3f7e3775 Remove unused includes and use more direct includes 2024-04-11 23:31:34 +02:00
srcejon e0839fce82 Map: Add Spy Server and Kiwi SDR. Add weather and satellite overlays. 2024-02-27 15:40:06 +00:00
f4exb 00b041d762 Rewriting of copyright notices for plugins/features. Part of #1893 2023-11-18 13:12:18 +01:00
Jon Beniston 50035d40c8 Map updates:
Add left double click to add marker to 3D map.
Add support for alititudeReference for polygon and polyline.
Add support for plugins to set color of polygons.
2023-03-21 11:07:25 +00:00
f4exb 9f13c002ab Map feature: added MIMO devices when scanning for channels 2023-01-24 00:37:42 +01:00
f4exb 79808fb852 Map feature: Make settings assignments atomic. Part of #1329 2022-11-27 20:00:43 +01:00
Jiří Pinkava 0df2d75e6d Replace deprecated QMutex(Recursive) with QRecursiveMutex 2022-09-17 23:00:07 +02:00
f4exb 2f89b79c84 Massive UI revamping (v7): added channels 2022-04-12 16:20:45 +02:00
f4exb 35f1c2aacc Map feature and dependent plugins: implement new message pipes. Part of #1154 2022-03-29 20:12:15 +02:00
f4exb 4111c967e9 Fixed some signal/slot connects. Removed unnecessary m_channelMessageQueue in ChannelAPI. Fixes #1185 2022-03-23 22:32:23 +01:00
Jon Beniston 29b2941951 Map Updates
Fix 3D map for Qt < 5.15.
Add 3D map label scale setting.
Add 3D map time to Web report.
Reduce height of display settings dialog to fit on smaller screens.
2022-02-09 16:41:40 +00:00
Jon Beniston 97f9835a71 Add 3D Map to Map feature 2022-02-04 20:40:43 +00:00
f4exb 98b305f320 Make rollup state a serializable object so that it can be dumped in JSON format for the API. Prerequisite tp #1050 2022-01-09 05:27:12 +01:00
f4exb 920fa82022 Implemented run action API in relevant feature plugins 2021-10-22 02:01:33 +02:00
f4exb 17869f2dac API: Features: correct feature set and feature indexes replacing device and channel indexes respectively 2021-09-17 00:52:08 +02:00
Jon Beniston d507f49626 Instantiate QNetworkAccessManager to avoid crash on reverse API usage 2021-01-15 11:24:21 +00:00
Jon Beniston af7e69c7c1 Fix gcc warnings 2021-01-13 23:03:55 +00:00
Jon Beniston bbe75aab6f Add Map feature for displaying the combined items from other plugins 2021-01-13 20:07:28 +00:00