feat(kpa1500): live amp client — poll, telemetry panel, controls (FR-AMP-03) - #185
Open
dc0sk wants to merge 1 commit into
Open
feat(kpa1500): live amp client — poll, telemetry panel, controls (FR-AMP-03)#185dc0sk wants to merge 1 commit into
dc0sk wants to merge 1 commit into
Conversation
…AMP-03) Wire the k4-kpa codec to a real connection. A background worker (app/src/kpa.rs) mirrors the K4 worker's shared-snapshot model: it owns the amplifier's TCP socket (its own Ethernet command server, port 1500), polls on the configured interval, parses replies via k4_kpa::apply, and publishes a KpaState + connection status the UI copies on tick. The connection is reconciled off the tick against `enabled && K4-connected && host-set`, so it follows the K4 link, the enable toggle and host edits with no per-event wiring, and drops cleanly otherwise; transport errors surface in the amp window rather than going silent. UI: a top-bar amp indicator (shown only when enabled; click opens the amp window) whose colour and wording follow the telemetry — fault red beats mode, Operate green with live power/SWR, Caution on SWR >= 2.0, Standby amber, down-link dim. The KPA1500 window gains live telemetry (mode, power, SWR, temp, band, antenna, ATU, fan, fault, firmware) and controls (Operate/Standby, ATU in/bypass, antenna). Deferred: a full ATU tune (needs the K4 keyed — couples to the arm-gated TX path). Verified end to end against a mock KPA1500 TCP server: the worker connects, the panel fills with live telemetry, the top-bar indicator reads "AMP OPER 1200 W SWR 1.3", and STANDBY round-trips (command reaches the amp, poll reflects it back, UI updates). Indicator precedence is unit-tested (fr_amp_03_amp_indicator_precedence_and_wording). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KiAgfnGv746wwVBSfFkoRY
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
Third slice of KPA1500 support: the live client. Wires the
k4-kpacodec (#184) to a real connection and surfaces the amplifier in the UI.app/src/kpa.rs) — mirrors the K4 worker's shared-snapshot model: owns the amp's TCP socket (its own Ethernet server, port 1500), polls on interval, parses viak4_kpa::apply, publishesKpaState+ connection status the UI copies on tick. Connect-with-timeout, reconnect backoff, control-command send.enabled && K4-connected && host-set, so the amp link follows the K4 link, the enable toggle and host edits without per-event wiring; transport errors surface, not silent.Deferred: a full ATU tune (needs the K4 keyed — couples to the arm-gated TX path).
Verification
End-to-end against a mock KPA1500 TCP server (in demo mode):
ESTABon port 1500), the amp window fills with live telemetry, the top-bar indicator readsAMP OPER 1200 W SWR 1.3(green);^OS0;reaches the amp, the next poll reflects it, and the panel + indicator flip to Standby.Indicator precedence/wording is unit-tested (
fr_amp_03_amp_indicator_precedence_and_wording). fmt + clippy + full workspace tests +xtask traceall green (pre-commit gate). Evidence tier: L1 for the indicator, mock-server integration for the socket/poll/control path; a run against a real KPA1500 is the remaining HIL step.🤖 Generated with Claude Code