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
+1 -15
View File
@@ -172,21 +172,7 @@ procedure TWebAdapter.OnBand(Idx: Integer);
begin FSyncInt := Idx; FController.Invoke(@SyncBand); end;
procedure TWebAdapter.SyncBand;
// Смена HF-диапазона из web/CAT. Выход из XVTR (если активен) + persist + restore.
begin
if (FSyncInt < 0) or (FSyncInt >= CFG_BAND_COUNT) then Exit;
if FController.FCurrentXvtr >= 0 then
begin
FController.SetXvtrBand(-1); // выход в HF (DeactivateXvtr несёт HF-возврат)
if FSyncInt = FController.FCurrentBand then Exit;
end
else if FSyncInt = FController.FCurrentBand then
Exit;
if FController.FDevConnected then
begin FController.SaveCurrentBand; FController.FSettings.Save; end;
FController.FCurrentBand := FSyncInt;
FController.RestoreBand(FController.FCurrentBand);
end;
begin FController.SetBand(FSyncInt); end; // XVTR-выход + persist + restore — в команде
procedure TWebAdapter.OnXvtrBand(Idx: Integer);
begin FSyncInt := Idx; FController.Invoke(@SyncXvtrBand); end;