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>
This commit is contained in:
Uladzimir Karpenka
2026-06-09 10:22:15 +03:00
co-authored by Claude Opus 4.8
parent 0a0a5c455e
commit daee5672a9
2 changed files with 15 additions and 16 deletions
+14 -1
View File
@@ -1545,7 +1545,20 @@ begin
end;
procedure TRadioController.SetBand(Idx: Integer);
begin FCurrentBand := Idx; Changed(rfBand); { TODO wiring: RestoreBand } end;
// Смена HF-диапазона по индексу (web/CAT/BandUp-Down). Выход из XVTR (если активен),
// персист покидаемого, restore нового. Полная команда — не трогает UI.
begin
if (Idx < 0) or (Idx >= CFG_BAND_COUNT) then Exit;
if FCurrentXvtr >= 0 then
begin
DeactivateXvtr; // выход в HF (HF-возврат внутри)
if Idx = FCurrentBand then Exit;
end
else if Idx = FCurrentBand then Exit;
if FDevConnected then begin SaveCurrentBand; FSettings.Save; end;
FCurrentBand := Idx;
RestoreBand(Idx);
end;
procedure TRadioController.BandUp;
begin if FCurrentBand < CFG_BAND_COUNT - 1 then SetBand(FCurrentBand + 1); end;