diff --git a/MainForm.pas b/MainForm.pas index f5f34f4..9f573f1 100644 --- a/MainForm.pas +++ b/MainForm.pas @@ -5611,32 +5611,13 @@ begin end; procedure TMainForm.SyncWebFreq; -var BandIdx: Integer; begin - // Веб шлёт "freq" для активного VFO + // Веб шлёт "freq" для активного VFO — маршрутизируем через те же команды, + // что и десктоп (рендер/сеть/band-detect внутри них и в OnControllerState). if FController.FActiveVfo = 0 then ApplyVfoA(Round(FWebSyncFreq)) else - begin - FController.FVfoB := FWebSyncFreq; - FreqDispB.Frequency := Round(FController.FVfoB); - FController.FCenterFreq := FController.FVfoB; - if FController.FWDSPReady then FController.FDSPEngine.SetShift(0.0); - if FController.FRunning then - FController.FNetwork.SetRunAndFreq(True, XvtrTranslate(FController.FCenterFreq), XvtrTranslate(FController.FCenterFreq), FController.FDriveLevel); - BandIdx := FreqToBandIdx(FController.FVfoB); - if (BandIdx >= 0) and (BandIdx <> FController.FCurrentBand) then - begin - StyleButton(BtnBand[FController.FCurrentBand], False); - FController.FCurrentBand := BandIdx; - StyleButton(BtnBand[FController.FCurrentBand], True); - end; - FSpecView.InvalidateRulerCache; - SyncSpecViewFreq; - FSpecView.DrawSpectrum; PbSpectrum.Invalidate; - if PbRuler <> nil then PbRuler.Invalidate; - UpdateVfoDisplay; - end; + FController.SetVfoB(FWebSyncFreq); end; procedure TMainForm.WebOnMode(Mode: Integer); @@ -5956,30 +5937,10 @@ begin end; procedure TMainForm.SyncWebFreqB; -var BandIdx: Integer; begin - FController.FVfoB := FWebSyncFreq; - FreqDispB.Frequency := Round(FController.FVfoB); - if FController.FActiveVfo = 1 then - begin - FController.FCenterFreq := FController.FVfoB; - if not FController.FCTun then - if FController.FWDSPReady then FController.FDSPEngine.SetShift(0.0); - if FController.FRunning then - FController.FNetwork.SetRunAndFreq(True, XvtrTranslate(FController.FCenterFreq), XvtrTranslate(FController.FCenterFreq), FController.FDriveLevel); - BandIdx := FreqToBandIdx(FController.FVfoB); - if (BandIdx >= 0) and (BandIdx <> FController.FCurrentBand) then - begin - StyleButton(BtnBand[FController.FCurrentBand], False); - FController.FCurrentBand := BandIdx; - StyleButton(BtnBand[FController.FCurrentBand], True); - end; - FSpecView.InvalidateRulerCache; - SyncSpecViewFreq; - FSpecView.DrawSpectrum; PbSpectrum.Invalidate; - if PbRuler <> nil then PbRuler.Invalidate; - end; - UpdateVfoDisplay; + // Унифицировано с десктопом: команда хранит частоту, при активном B + // перестраивает приёмник (CTUN-aware) + сеть; рендер — через rfVfoB/rfBand. + FController.SetVfoB(FWebSyncFreq); end; // ── Активный VFO (из веба) ─────────────────────────────────────────────── @@ -7063,29 +7024,9 @@ begin end; procedure TMainForm.SyncCATVfoB; -var BandIdx: Integer; begin - FController.FVfoB := FCATSyncFreq; - FreqDispB.Frequency := Round(FController.FVfoB); - if FController.FActiveVfo = 1 then - begin - FController.FCenterFreq := FController.FVfoB; - if FController.FWDSPReady then FController.FDSPEngine.SetShift(0.0); - if FController.FRunning then - FController.FNetwork.SetRunAndFreq(True, XvtrTranslate(FController.FCenterFreq), XvtrTranslate(FController.FCenterFreq), FController.FDriveLevel); - BandIdx := FreqToBandIdx(FController.FVfoB); - if (BandIdx >= 0) and (BandIdx <> FController.FCurrentBand) then - begin - StyleButton(BtnBand[FController.FCurrentBand], False); - FController.FCurrentBand := BandIdx; - StyleButton(BtnBand[FController.FCurrentBand], True); - end; - FSpecView.InvalidateRulerCache; - SyncSpecViewFreq; - FSpecView.DrawSpectrum; PbSpectrum.Invalidate; - if PbRuler <> nil then PbRuler.Invalidate; - UpdateVfoDisplay; - end; + // Унифицировано с десктопом/вебом: та же команда SetVfoB. + FController.SetVfoB(FCATSyncFreq); end; procedure TMainForm.SyncCATBandUp;