Commit Graph
8 Commits
Author SHA1 Message Date
Uladzimir KarpenkaandClaude Opus 4.8 daee5672a9 Phase 5: fill SetBand as a real band-by-index command
SetBand was a skeleton (FCurrentBand := Idx + Changed), leaving BandUp/BandDown
non-functional. Fill it with the band-change logic (XVTR-exit + persist + restore)
that WebAdapter.SyncBand had inline; SyncBand now just calls FController.SetBand.
Gives CAT band up/down/by-index a controller command to call (Phase 4) instead of
routing through the web adapter.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 10:22:15 +03:00
Uladzimir KarpenkaandClaude Opus 4.8 0a0a5c455e Phase 3 (WA2e): move web Freq/FreqA handlers into the adapter
With ApplyVfoA now a thin SetVfoA delegate (channel orchestration on the
OnAfterTune hook), the web Freq/FreqA handlers carry no MainForm logic — move
them to TWebAdapter.OnFreq (active-VFO routing → SetVfoA/SetVfoB) and OnFreqA
(SetVfoA). CAT freq (CATSetVfoA/SyncCATVfoA) left as-is — moves with the CAT
adapter (Phase 4).

Remaining host-coupled web handlers: Run / Connect / device CRUD (daemon entry).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 10:18:59 +03:00
Uladzimir KarpenkaandClaude Opus 4.8 7630172e50 Phase 3 (WA2d): move web Band/XvtrBand handlers into the adapter
Now that RestoreBand and XVTR enter/exit are full controller commands, the web
Band and XvtrBand handlers carry no MainForm orchestration — move them to
TWebAdapter.OnBand/OnXvtrBand (validation + SaveCurrentBand/persist + command).
CAT Ctx.DoBandByIndex and CAT band up/down repointed to FWebAdapter.OnBand.

Remaining host-coupled web handlers: Freq/FreqA (ApplyVfoA channel orchestration),
Run/Connect/device CRUD (daemon entry).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 10:09:06 +03:00
Uladzimir KarpenkaandClaude Opus 4.8 5f5558e4a2 Phase 3 (WA2c): move web Span into the adapter; SetSampleRate self-persists
Now that global-settings persistence is controller-owned, fold the persist into
SetSampleRate (sample rate is global; self-gated on FDevConnected). OnSampleRateSelect
becomes a thin wrapper. Web Span moves to TWebAdapter.OnSpan (keeps the valid-span
whitelist), so the last span coupling to MainForm is gone.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 21:03:47 +03:00
Uladzimir KarpenkaandClaude Opus 4.8 e1ecf947b8 Phase 3 (WA3): move outgoing web state-mirror into the web adapter
The per-tick PushSpectrum mirror (status strings + ~40 state values + spectrum/
waterfall buffers) moves out of SpectrumTimerTick into TWebAdapter.PushState,
which reads FController for everything and takes the pixel buffers as params.
MainForm's timer now just calls FWebAdapter.PushState(FSpectrumBuf, FWaterfallBuf).

Server lifecycle/ownership stays in MainForm for now — it's still driven by the
remaining host-coupled handlers (PushXvtrToWeb, device CRUD); ownership transfer
completes when those move.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 20:36:01 +03:00
Uladzimir KarpenkaandClaude Opus 4.8 e5a13096dc Phase 3 (WA2b): move web Drive handler into the web adapter
Now that SetDrive is a complete command, the web/CAT Drive handler moves into
TWebAdapter.OnDrive (the one handler WA1 left behind). CAT context SetDriveLevel
repointed to it too.

Makes the channel-power-clear reactive: ChannelController.OnDriveChanged fires on
the rfDrive event and clears FPreChannelPower for any external drive change
(slider/web/encoder), guarded by FRestoringDrive for the unit's own apply/restore.
This removes the imperative ClearPreChannelPower coupling so SetDrive callers need
no channel knowledge.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 20:26:30 +03:00
Uladzimir KarpenkaandClaude Opus 4.8 06fd730ff4 Phase 3 (WA2a): move WebOnMic into the web adapter
WebOnMic only feeds TX mic samples to the controller's WDSP engine
(no UI, thread-safe like the other engine data callbacks), so it moves
verbatim into TWebAdapter.OnMic. FWebServer.OnWebMic now points there.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 16:15:52 +03:00
Uladzimir KarpenkaandClaude Opus 4.8 2f8b0bdf48 Phase 3 (WA1): extract web adapter into WebAdapter.pas
Move the pure controller-command web handlers out of MainForm into a
new TWebAdapter (bridge between TWebServer and TRadioController),
marshalling via FController.Invoke so it is daemon-ready.

- 20 handlers moved: Mode/Filter/AGC/AGCTop/Volume/WfAGC/WfNF/Mute/
  NR/NB/SNB/ANF/FreqB/Center/Attn/ActiveVfo/Ctun/MOX/Tun/FMStep +
  ClientActiveChanged. Each calls a controller command directly.
- CAT context (Ctx.Set*) and CATSetFilterIdx repointed to the adapter,
  since CAT reuses these as its command layer.
- Host-dependent handlers (Freq/Band/XvtrBand/Span/Run/Drive/connect/
  disconnect/CRUD/mic) and the outgoing PushSpectrum mirror stay in
  MainForm for now (WA2/WA3); IWebHost is the placeholder seam.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 16:03:49 +03:00