Phase 3 (batch 5): route FM step through controller command

FM step is the only FM control exposed to another frontend (web:
SyncWebFMStep in, FWebServer.FMStepIdx out), so it's the FM param with
real cross-frontend value.

- TRadioController.SetFMStep clamps and fires OnStateChanged(rfFMStepIdx).
- OnControllerState updates the step dropdown, pushes FMStepIdx to the web
  server, and sets the FSpecView FM grid step (when in FM mode).
- MainForm.SetFMStep is now a thin wrapper over the command, so existing
  callers (band restore, dropdown select, web sync, XVTR restore) are
  unchanged.

FM squelch/CTCSS/repeater are intentionally left as-is: they are UI-only
(no web/CAT/daemon exposure) and already operate on controller state
fields, so routing them through commands adds ceremony without value for
the swappable-UI/daemon goals; CTCSS would also need CTCSS_TONES relocated
to a shared unit and repeater needs the network helpers (XvtrTranslate/
ActiveTXFreqHz) that belong to the heavy-command batch.

Builds clean (cocoa).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Uladzimir Karpenka
2026-06-04 15:10:44 +03:00
co-authored by Claude Opus 4.8
parent ad21516d48
commit 7d3570346f
2 changed files with 16 additions and 6 deletions
+11 -5
View File
@@ -1453,6 +1453,13 @@ begin
FSpecView.WfAGCEnabled := FController.FWfAGCEnabled;
rfWfNF:
FSpecView.WfNFEnabled := FController.FWfNFEnabled;
rfFMStepIdx:
begin
if FStepDropDown <> nil then FStepDropDown.SetItemIndex(FController.FFMStepIdx);
if FWebServer <> nil then FWebServer.FMStepIdx := FController.FFMStepIdx;
if (FController.FMode = MODE_FM) and (FSpecView <> nil) then
FSpecView.FMGridStepHz := FM_STEP_HZ[FController.FFMStepIdx];
end;
end;
finally
FSyncingFromController := False;
@@ -5400,11 +5407,10 @@ end;
procedure TMainForm.SetFMStep(Idx: Integer);
begin
FController.FFMStepIdx := Idx;
if FStepDropDown <> nil then FStepDropDown.SetItemIndex(Idx);
if FWebServer <> nil then FWebServer.FMStepIdx := Idx;
if (FController.FMode = MODE_FM) and (FSpecView <> nil) then
FSpecView.FMGridStepHz := FM_STEP_HZ[Idx];
// Тонкая обёртка: команда контроллера обновит UI/web/спецвью через
// OnControllerState(rfFMStepIdx). Сохранена для существующих вызовов
// (RestoreBand, dropdown-select, web-sync, XVTR-restore).
FController.SetFMStep(Idx);
end;
procedure TMainForm.BtnFMStepClick(Sender: TObject);