mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 20:37:33 +00:00
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:
+12
-1
@@ -57,6 +57,7 @@ type
|
|||||||
procedure PushXvtr;
|
procedure PushXvtr;
|
||||||
procedure PushRatePresets; // sample-rate пресеты бэкенда → web
|
procedure PushRatePresets; // sample-rate пресеты бэкенда → web
|
||||||
procedure PushBands; // band-план бэкенда → web
|
procedure PushBands; // band-план бэкенда → web
|
||||||
|
procedure PushFreqDigits; // per-device freq_mhz_digits → web (формат VFO)
|
||||||
// Входящие web-команды (из WS-потока): запоминаем параметр и маршалим в Sync*.
|
// Входящие web-команды (из WS-потока): запоминаем параметр и маршалим в Sync*.
|
||||||
procedure WebRun(On_: Boolean);
|
procedure WebRun(On_: Boolean);
|
||||||
procedure WebConnect(const IP: string);
|
procedure WebConnect(const IP: string);
|
||||||
@@ -198,7 +199,7 @@ begin
|
|||||||
// выходные web-списки, которых нет в периодическом PushState.
|
// выходные web-списки, которых нет в периодическом PushState.
|
||||||
case Field of
|
case Field of
|
||||||
rfDeviceList: PushDeviceList; // discovered обновился
|
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;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -317,6 +318,16 @@ begin
|
|||||||
with FCtrl.BackendCaps do FWeb.SetFreqRange(MinFreqHz, MaxFreqHz);
|
with FCtrl.BackendCaps do FWeb.SetFreqRange(MinFreqHz, MaxFreqHz);
|
||||||
end;
|
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-поток) → маршалинг в главный поток ---
|
// --- Входящие web-команды (WS-поток) → маршалинг в главный поток ---
|
||||||
|
|
||||||
procedure THeadlessHost.WebRun(On_: Boolean);
|
procedure THeadlessHost.WebRun(On_: Boolean);
|
||||||
|
|||||||
Reference in New Issue
Block a user