feat(cw): CW Send dialog with macro tokens and Callsign field - #6
Open
tcpreplay-dev wants to merge 2 commits into
Open
tcpreplay-dev wants to merge 2 commits into
tcpreplay-dev wants to merge 2 commits into
Conversation
Repurposes the bottom-bar PTT button as a CW button when the radio is in CW mode (PTT is meaningless there — the K4 is keyed via CAT, not mic audio). Clicking it opens a modeless CW Send dialog: type or fire one of 8 macro buttons (F1-F8, editable in a new Options > CW Macros page) and the text is sent to the K4's own KY text buffer and rendered as CW. Confirmation is driven entirely by the K4's real KY0/KY1 buffer-status replies — text shown in the dialog goes grey (queued) -> mid-tone (in the K4's buffer) -> amber (KY0 confirmed it was actually keyed), or red if that confirmation times out. Nothing brightens on a local timing guess. Sends are strictly serial (one chunk in the K4's buffer at a time) so behavior doesn't depend on unverified K4 append/replace semantics. Abort sends "RX;" to force TX off and halts the pipeline without clearing what's already on screen. CwSendController is deliberately decoupled from ConnectionController/ TcpClient — it only emits sendCatRequested(QString) and expects onCatResponse()/onDisconnected() fed from outside — so its chunking/ confirm/timeout state machine is unit-testable with plain Qt6::Core. Hardware-confirmed fix: the K4's TX relay/ALC ramp-up clips the first real character of every fresh KY send, so a throwaway leading 'E' (shortest element) is sacrificed to absorb it instead of a real letter. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TwJeVFnBk868bnkYDKaX12
… field Macros can now contain ~ (expands to the operator's own callsign) and * (expands to a new Callsign field in the CW Send dialog, representing the station currently being worked). Loosely follows the token convention used by contest logging software (N1MM, SkookumLogger), scoped down to just the two tokens that map to something real in QK4 today. Callsign is session-local state owned by CwSendDialog (not persisted — it changes every contact and has no K4 CAT command behind it, so it belongs in neither RadioState nor RadioSettings). CwSendController stays token-unaware; expansion happens in the dialog before text is committed. Also: macro button tooltips now show the expanded preview with an (F1)-style shortcut prefix; Escape aborts sending instead of closing the dialog; and the immediate-vs-word-complete send mode checkbox moved from the CW Macros options page into the CW Send dialog itself, since it's something an operator wants to flip live rather than dig into Options for. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TwJeVFnBk868bnkYDKaX12
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
KYtext buffer, confirmed by realKY0/KY1replies (grey → in-flight → amber, red on stall) — no local timing guesses.~expands to the operator's own callsign,*expands to a new Callsign field (station currently being worked, session-local).CwSendControllerunit tests (tests/test_cwsendcontroller.cpp) cover chunking, confirm/timeout, abort, and mode-gating — fully decoupled from the network stack so no live radio needed to test the state machine.Test plan
ctest -R CwSendControllerTestspasses🤖 Generated with Claude Code
https://claude.ai/code/session_01TwJeVFnBk868bnkYDKaX12