fix: daemon mirrors freq_mhz_digits to web (VFO format)

The headless daemon never set the web server's FreqMhzDigits, so it
stayed at the constructor default (3 = up to 999 MHz) and VHF/UHF/SHF
frequencies didn't fit the web VFO display. The GUI mirrors this per-
device setting in ApplyFreqMhzDigits; the daemon now does the same on
connect (rfDevice) via PushFreqDigits, reading the value the controller
loaded into FLoadedGlobal.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-23 14:54:21 +03:00
co-authored by Claude Opus 4.8
parent 3cedc6225d
commit 8472c8e7b8
+12 -1
View File
@@ -57,6 +57,7 @@ type
procedure PushXvtr;
procedure PushRatePresets; // sample-rate пресеты бэкенда → web
procedure PushBands; // band-план бэкенда → web
procedure PushFreqDigits; // per-device freq_mhz_digits → web (формат VFO)
// Входящие web-команды (из WS-потока): запоминаем параметр и маршалим в Sync*.
procedure WebRun(On_: Boolean);
procedure WebConnect(const IP: string);
@@ -198,7 +199,7 @@ begin
// выходные web-списки, которых нет в периодическом PushState.
case Field of
rfDeviceList: PushDeviceList; // discovered обновился
rfXvtr, rfDevice: begin PushXvtr; PushDeviceList; PushRatePresets; PushBands; end; // connect / xvtr / backend
rfXvtr, rfDevice: begin PushXvtr; PushDeviceList; PushRatePresets; PushBands; PushFreqDigits; end; // connect / xvtr / backend
end;
end;
@@ -317,6 +318,16 @@ begin
with FCtrl.BackendCaps do FWeb.SetFreqRange(MinFreqHz, MaxFreqHz);
end;
procedure THeadlessHost.PushFreqDigits;
// Зеркалим per-device настройку формата VFO в web (как GUI ApplyFreqMhzDigits).
// Без этого демон всегда слал бы дефолтные 3 цифры (999 МГц), и VHF/UHF/SHF не влезал.
var d: Integer;
begin
d := FCtrl.FLoadedGlobal.FreqMhzDigits;
if d < 3 then d := 3 else if d > 5 then d := 5;
FWeb.FreqMhzDigits := d;
end;
// --- Входящие web-команды (WS-поток) → маршалинг в главный поток ---
procedure THeadlessHost.WebRun(On_: Boolean);