mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 18:43:51 +00:00
Phase 3 (batch 17): move CTUN center scroll (SetCenter) into the controller
SetCenter was a Phase-1 skeleton; filled it with the CTUN view-scroll logic: set FCenterFreq, shift the demodulator by (active VFO - center), push a full HP frame, and emit Changed(rfCenterFreq). The UI renders via OnControllerState (invalidate ruler cache + deferred spectrum redraw, since a drag emits many events). Both entry points now call FController.SetCenter: the desktop CTUN drag (DoSpectrumDrag) and the web center scroll (SyncWebCenter). Removes the duplicated inline shift/network logic from both. Side effect / latent fix: the web center scroll previously only called UpdateState without SendFullHP (the desktop path did both), so a web scroll did not push the new DDC center to the radio immediately. Routing it through PushNetworkState now sends the full HP frame like the desktop path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
831e5c3a31
commit
c249b46b17
+11
-1
@@ -893,7 +893,17 @@ begin
|
||||
end;
|
||||
|
||||
procedure TRadioController.SetCenter(Hz: Double);
|
||||
begin FCenterFreq := Hz; Changed(rfCenterFreq); { TODO wiring } end;
|
||||
// CTUN-скролл окна просмотра: двигаем DDC-центр БЕЗ смены VFO. Демодулятор
|
||||
// сдвигаем = активный VFO − новый центр; полный HP-кадр в радио. Рендер
|
||||
// (ruler/спектр) — в UI через OnControllerState(rfCenterFreq).
|
||||
// Точки входа: десктопный CTUN-drag и web (SyncWebCenter).
|
||||
begin
|
||||
FCenterFreq := Hz;
|
||||
if FWDSPReady and Assigned(FDSPEngine) then
|
||||
FDSPEngine.SetShift(ActiveVfoHz - FCenterFreq);
|
||||
PushNetworkState;
|
||||
Changed(rfCenterFreq);
|
||||
end;
|
||||
|
||||
procedure TRadioController.VfoSwap;
|
||||
// Меняем VFO A/B местами и перестраиваем приёмник на новую частоту активного
|
||||
|
||||
Reference in New Issue
Block a user