mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 20:37:33 +00:00
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:
co-authored by
Claude Opus 4.8
parent
0a0a5c455e
commit
daee5672a9
+14
-1
@@ -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;
|
||||
|
||||
+1
-15
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user