Add NAVTEX waveform support and NT slice mode tolerance (#2132)#2137
Add NAVTEX waveform support and NT slice mode tolerance (#2132)#2137aethersdr-agent[bot] wants to merge 1 commit intomainfrom
Conversation
- Classify NT as USB-family digital mode in SliceModel filter polarity, MainWindow DAX TX routing, client-side DSP suppression, RxApplet mode→settings mapping, and VfoWidget filter presets/DSP controls - Create NavtexModel: parses "navtex sent"/"navtex status" statuses, formats "navtex send" commands with reply tracking (per FlexLib v4.2.18) - Wire NavtexModel into RadioModel: sub navtex all, status dispatch - Add NavtexApplet with compose form (tx_ident, subject_indicator, serial_num, msg_text) and status display (data wiring only) Co-Authored-By: Claude Opus 4.6 <[email protected]>
There was a problem hiding this comment.
Review: NAVTEX waveform support (#2137)
Nice work adding NAVTEX (NT) mode support. The mode-detection changes across MainWindow, RxApplet, VfoWidget, and SliceModel are thorough — NT is correctly categorized as USB-family digital in all the relevant places (DSP disable, squelch, filter presets, filter normalization). The NavtexModel follows the same command/status pattern as DvkModel and other models.
A few items worth addressing:
1. Command injection in NavtexModel::sendMessage (bug)
NavtexModel.cpp:25:
cmd += QString(" msg_text=\"%1\"").arg(msgText);If msgText contains a double-quote character, this breaks the command framing and could inject unexpected FlexLib commands. At minimum, strip or escape " characters before interpolation. The existing CwxModel::sendString handles this by replacing " — same approach would work here.
2. Unbounded m_msgs growth (resource leak)
NavtexModel appends to m_msgs on every send and every navtex sent status but never prunes. In a long-running session with active NAVTEX traffic, this vector grows without bound. Consider capping it (e.g., drop entries beyond 100 or 200), similar to how the spot model handles aging.
3. NavtexApplet compiled but not instantiated
NavtexApplet is added to CMakeLists and fully implemented, but nothing in the diff creates or parents it in the main window. The comment says "visual design/placement is maintainer-only per CLAUDE.md" which is fair — just flagging that the applet is unreachable at runtime right now. If that's intentional for a phased merge, might be worth noting in the PR description.
4. Minor: setRadioModel doesn't disconnect previous model
NavtexApplet::setRadioModel connects signals from m_navtexModel but doesn't disconnect if called a second time. Likely fine if it's only called once during setup, but a disconnect(m_navtexModel, ...) guard before reconnecting would be safer.
Everything else looks solid — the sub navtex all subscription, replyCommandReady signal for tracked command/response, parseSentStatus handling unknown-origin messages, and the isUsbFamily addition in SliceModel::applyStatus are all well done. Thanks for the contribution!
|
Holding this open — data layer + protocol plumbing is sound and correctly addresses #2132, but the user-visible feature is incomplete in a couple of material ways. Listing the gaps for the follow-up pass: Required before merge
Worth doing in the same pass
Already correct — no changes needed
cc @jensenpat — if any of this lands as a maintainer-driven follow-up rather than another AetherClaude pass, the activation-command piece is the main protocol-design call (auto-activate vs explicit button). |
|
Closing in favor of PR #2186, which carves out just the data-layer + protocol-plumbing work (the actual scope of #2132). The full review feedback on this PR included two required-before-merge items:
Both of those are UX decisions that #2132 explicitly carved out as maintainer-only. Rather than leave the PR open indefinitely waiting for the bot to address feedback that requires UX design, I've replayed just the protocol/data-layer work as PR #2186 with two improvements caught during the carve-out:
Plus a 21-assertion unit test for the state machine. The Bot couldn't be modified ( |
Pull request was closed
* NAVTEX waveform support — data layer + protocol plumbing (#2132) Adds support for FlexLib v4.2.18's NAVTEX maritime broadcast waveform. Scope is data layer + protocol plumbing only, per #2132's explicit "visual design + UX is maintainer-only" instruction. Carved out of bot PR #2137; the standalone NavtexApplet UI class it included was unwired (no AppletPanel registration, no construction site in MainWindow, no activate/deactivate command path), so it would have been dead code in production. Leaves the UI work for a maintainer-driven follow-up when the activate/deactivate UX is decided. See PR #2137 review comment for the full rationale. What's included: - NavtexModel: parses `navtex` and `navtex sent` status messages, formats `navtex send tx_ident=... subject_indicator=... msg_text=...`, tracks per-message state (Pending → Queued → Sent / Error). Pending messages keyed by command sequence number; promoted to Queued via the reply handler then to Sent via the broadcast. - RadioModel wiring: subscribes to `sub navtex all` and routes status to NavtexModel. Forwards commandReady and replyCommandReady, with a reply handler that drives handleSendResponse. - SliceModel: NT mode classified as USB-family for filter/AGC purposes (matches FlexLib's slice-mode handling for digital data modes). - MainWindow / RxApplet / VfoWidget: NT mode threaded through the mode-string switch so the GUI doesn't crash or fall through to "unknown" when a slice enters mode NT. Improvements over the original PR: 1. Quote-escape `msg_text="..."` in NavtexModel::sendMessage. The original `arg(msgText)` substitution would break the radio's command parser if the user's message contained a `"` or `\`. Backslash is escaped first to avoid double-escaping existing backslashes. 2. Failure-path bug fix in handleSendResponse: failure responses come as `R<seq>|<errcode>|` with empty body, so the original "if indexStr empty bail" check fired BEFORE the "if respVal != 0 mark Error" branch — making error reporting unreachable. Fixed by reordering: check pending entry first, then respVal != 0, then index parsing. 3. New unit test `tests/navtex_model_test.cpp` (21 assertions) covering: Pending → Queued promotion, Queued → Sent promotion, send-failure path, orphan navtex-sent (Multi-Flex case), case- insensitive status string parsing, msg_text quote/backslash escaping, idempotent navtex-sent handling. Fixes #2132. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * Fix Windows build: guard freedvReportingToggled connect on HAVE_RADE The DxClusterDialog::freedvReportingToggled connect lambda references m_radeEngine, m_radeSliceId, startFreeDvReporting(), and stopFreeDvReporting() — all of which are only declared under #ifdef HAVE_RADE. The connect itself was wrapped in #ifdef HAVE_WEBSOCKETS only, so on Windows (WebSockets present, RADE absent) the build broke with C2065/C3861. Introduced in #2173 (FreeDV Reporter), but check-windows skipped that PR because it didn't touch CMakeLists.txt / third_party / workflows. This NAVTEX branch modifies CMakeLists.txt for the new test executable, so check-windows fired and surfaced the regression. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Summary
Fixes #2132
What was changed
Add NAVTEX waveform support and NT slice mode tolerance (#2132)
Files modified
CMakeLists.txtsrc/gui/MainWindow.cppsrc/gui/NavtexApplet.cppsrc/gui/NavtexApplet.hsrc/gui/RxApplet.cppsrc/gui/VfoWidget.cppsrc/models/NavtexModel.cppsrc/models/NavtexModel.hsrc/models/RadioModel.cppsrc/models/RadioModel.hsrc/models/SliceModel.cppGenerated by AetherClaude (automated agent for AetherSDR)