mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 18:43:51 +00:00
Phase 5: add OnAfterTune hook so all tune paths run channel orchestration
Channel orchestration (deactivate-on-tune-away, auto-CTCSS/pre-channel-drive restore) was glued to MainForm.ApplyVfoA, so only desktop/web-freq tuning ran it. Add TRadioController.OnAfterTune, fired at the very end of SetVfoA (after the rfVfoA render returns — outside its guard, no re-entrancy), wired to ChannelController.OnVfoTuned. Now every SetVfoA caller (desktop, web, CAT, encoder TuneActiveBy, SetActiveVfo, channel apply) is uniformly channel-aware and headless-compatible. ApplyVfoA becomes a thin delegate. Minor improvement: encoder tune-away now deactivates an active channel like desktop; SetActiveVfo/channel-apply are no-ops (freq matches). Foundation for moving RestoreBand's retune into the controller (Band command). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
5f5558e4a2
commit
7b40eae174
@@ -109,6 +109,7 @@ type
|
||||
private
|
||||
FOnInvoke: TUIInvokeEvent;
|
||||
FOnStateChanged: TRadioStateEvent;
|
||||
FOnAfterTune: TThreadMethod; // пост-тюн хук: канал-оркестрация после SetVfoA
|
||||
procedure Changed(Field: TRadioField);
|
||||
procedure ApplyAGCToEngine; // применяет FAGCMode к WDSP (единый маппинг)
|
||||
procedure ApplyModeDefaults; // дефолтный фильтр/девиация под текущий FMode
|
||||
@@ -423,6 +424,10 @@ type
|
||||
// ---- События наружу ----
|
||||
property OnInvoke: TUIInvokeEvent read FOnInvoke write FOnInvoke;
|
||||
property OnStateChanged: TRadioStateEvent read FOnStateChanged write FOnStateChanged;
|
||||
// Пост-тюн хук: вызывается в КОНЦЕ SetVfoA (после Changed(rfVfoA), т.е. вне
|
||||
// рендера) — сюда вешается канальная оркестрация (ChannelController.OnVfoTuned),
|
||||
// чтобы любой путь тюнинга (desktop/web/CAT/энкодер) был канал-aware headless.
|
||||
property OnAfterTune: TThreadMethod read FOnAfterTune write FOnAfterTune;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@@ -1233,6 +1238,10 @@ begin
|
||||
|
||||
PushNetworkState;
|
||||
Changed(rfVfoA);
|
||||
// Канальная оркестрация — ПОСЛЕ рендера rfVfoA (вне его try/finally-гарда), без
|
||||
// ре-ентранси: OnVfoTuned зовёт команды (SetDrive/SetFMRpt), которым нужен
|
||||
// чистый верхний уровень OnControllerState.
|
||||
if Assigned(FOnAfterTune) then FOnAfterTune;
|
||||
end;
|
||||
|
||||
procedure TRadioController.SetVfoB(Hz: Double);
|
||||
|
||||
Reference in New Issue
Block a user