Skip to content

Persist DEXP setting across app restarts#1004

Merged
ten9876 merged 4 commits into
aethersdr:mainfrom
boydsoftprez:fix/dexp-persist-995
Apr 8, 2026
Merged

Persist DEXP setting across app restarts#1004
ten9876 merged 4 commits into
aethersdr:mainfrom
boydsoftprez:fix/dexp-persist-995

Conversation

@boydsoftprez
Copy link
Copy Markdown
Collaborator

Summary

  • Add optimistic updates to setDexp() and setDexpLevel() in TransmitModel — the radio does not echo these in incremental status, so without optimistic updates the UI never reflected the actual state
  • Save DEXP on/off and level to AppSettings immediately when the user changes them in PhoneApplet (save-on-change, not save-on-close, since the radio can reset DEXP and overwrite the model before closeEvent)
  • Restore saved DEXP state on connect via the existing 500ms deferred-DSP timer in MainWindow

Three root causes were addressed:

  1. No persistence — DEXP state was never saved to AppSettings
  2. No optimistic updatesetDexp()/setDexpLevel() only emitted commands without updating the model, unlike setVoxEnable() and setSpeechProcessorEnable() which already had optimistic updates
  3. Save-on-close race — the radio resets DEXP on reconnect, overwriting the model before closeEvent could save the user's preference

Fixes #995

Test plan

  • Connect to radio, enable DEXP, set level, close app — settings file contains DexpEnabled=True and DexpLevel
  • Reopen app, connect — DEXP button shows checked, slider at saved level
  • Close with DEXP off, reopen — DEXP remains off
  • Verified on FLEX-6600

JJ Boyd ~KG4VCF
Co-Authored with Claude Code

boydsoftprez and others added 4 commits April 8, 2026 08:51
The Flex radio does not persist the downward expander (DEXP) state
across client sessions, so DEXP on/off and level reset to defaults on
every reconnect.  Save both values to AppSettings on close and restore
them in the existing deferred-DSP timer after first slice creation,
matching the pattern used for NR2/RN2/NR4/DFNR.

Fixes aethersdr#995

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The save-on-close approach fails for radio-applied settings like DEXP:
if the radio reboots and resets DEXP to off, the radio status overwrites
the model before closeEvent saves it, losing the user's preference.

Save DEXP on/off and level to AppSettings immediately when the user
changes them in PhoneApplet, so the preference survives radio reboots.
The save-on-close in MainWindow remains as a belt-and-suspenders backup.

Fixes aethersdr#995

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The save-on-close reads radio state (model), not user intent.  If the
radio resets DEXP (reboot, error, no firmware persistence), closeEvent
was overwriting the user's saved "True" with "False".  DEXP is now
saved only on user change in PhoneApplet, which captures intent and
survives radio resets.

Fixes aethersdr#995

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The radio does not echo dexp or noise_gate_level in incremental status
messages, so the model never updated after sending commands.  Add
optimistic model updates to setDexp() and setDexpLevel(), matching the
pattern already used by setVoxEnable() and setSpeechProcessorEnable().

This ensures the PhoneApplet UI reflects the user's setting immediately
and that the deferred restore on connect actually updates the UI.

Fixes aethersdr#995

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@boydsoftprez boydsoftprez requested a review from ten9876 as a code owner April 8, 2026 13:16
@boydsoftprez boydsoftprez mentioned this pull request Apr 8, 2026
2 tasks
@boydsoftprez boydsoftprez enabled auto-merge (squash) April 8, 2026 13:41
@ten9876 ten9876 merged commit 281067e into aethersdr:main Apr 8, 2026
5 checks passed
aethersdr-agent Bot pushed a commit that referenced this pull request Apr 10, 2026
* Persist DEXP setting across app restarts

The Flex radio does not persist the downward expander (DEXP) state
across client sessions, so DEXP on/off and level reset to defaults on
every reconnect.  Save both values to AppSettings on close and restore
them in the existing deferred-DSP timer after first slice creation,
matching the pattern used for NR2/RN2/NR4/DFNR.

Fixes #995

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Save DEXP preference on change, not just on close

The save-on-close approach fails for radio-applied settings like DEXP:
if the radio reboots and resets DEXP to off, the radio status overwrites
the model before closeEvent saves it, losing the user's preference.

Save DEXP on/off and level to AppSettings immediately when the user
changes them in PhoneApplet, so the preference survives radio reboots.
The save-on-close in MainWindow remains as a belt-and-suspenders backup.

Fixes #995

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Remove closeEvent DEXP save that overwrites user preference

The save-on-close reads radio state (model), not user intent.  If the
radio resets DEXP (reboot, error, no firmware persistence), closeEvent
was overwriting the user's saved "True" with "False".  DEXP is now
saved only on user change in PhoneApplet, which captures intent and
survives radio resets.

Fixes #995

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add optimistic updates for DEXP setters

The radio does not echo dexp or noise_gate_level in incremental status
messages, so the model never updated after sending commands.  Add
optimistic model updates to setDexp() and setDexpLevel(), matching the
pattern already used by setVoxEnable() and setSpeechProcessorEnable().

This ensures the PhoneApplet UI reflects the user's setting immediately
and that the deferred restore on connect actually updates the UI.

Fixes #995

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DEXP setting is not persistent

2 participants