Skip to content

feat(cw): CW Send dialog with macro tokens and Callsign field - #6

Open
tcpreplay-dev wants to merge 2 commits into
feature/keyer-options-uifrom
feature/cw-send-dialog
Open

tcpreplay-dev wants to merge 2 commits into
feature/keyer-options-uifrom
feature/cw-send-dialog

Conversation

@tcpreplay-dev

Copy link
Copy Markdown
Owner

Summary

  • New CW Send dialog: type text or fire 8 macro buttons (F1-F8) to key CW on the K4 via its own KY text buffer, confirmed by real KY0/KY1 replies (grey → in-flight → amber, red on stall) — no local timing guesses.
  • PTT button relabels to "CW" in CW mode and opens the dialog instead of doing audio PTT.
  • New Options > CW Macros page for editing the 8 macros and the immediate/word-complete send mode... actually mode toggle later moved into the dialog itself.
  • Macro tokens: ~ expands to the operator's own callsign, * expands to a new Callsign field (station currently being worked, session-local).
  • Escape aborts sending without closing the dialog; Abort button matches.
  • CwSendController unit 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.
  • Hardware-confirmed fix: a throwaway leading character absorbs the K4's TX ramp-up so the real first character of every send isn't clipped.

Test plan

  • ctest -R CwSendControllerTests passes
  • Manually verified against a live K4 (0 W into dummy load): CW mode relabeling, dialog open/close, typed + macro sends confirm correctly, abort mid-send, macro token expansion, tooltips, Escape-to-abort, focus behavior with the new Callsign field

🤖 Generated with Claude Code

https://claude.ai/code/session_01TwJeVFnBk868bnkYDKaX12

tcpreplay-dev and others added 2 commits August 26, 2026 08:51
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
@tcpreplay-dev

Copy link
Copy Markdown
Owner Author

Sample screenshots

image image

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.

1 participant