mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 18:43:51 +00:00
Fix FM step change from web UI; add FM grid to web spectrum/ruler
Web UI: stepSel.onchange now sends fm_step command to server when in FM mode; option values stay in Hz so tuneStep works unchanged. WebServer: add fm_step command handler and OnFMStep callback. MainForm: wire WebOnFMStep -> SyncWebFMStep -> SetFMStep + SaveCurrentBand. Web spectrum/ruler: vertical FM-step grid lines in drawSpec; FM-aligned ticks and labels in drawRuler with auto label-density (short ticks between labeled lines, measureText-based labelMult to prevent overlap). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -136,6 +136,7 @@ type
|
||||
TWebCmdFreqA = procedure(Hz: Double) of object;
|
||||
TWebCmdAttn = procedure(Idx: Integer) of object;
|
||||
TWebCmdTun = procedure(On_: Boolean) of object;
|
||||
TWebCmdFMStep = procedure(Idx: Integer) of object;
|
||||
// XVTR-band: web клиент кликнул кнопку трансвертера (Idx 0..CFG_XVTR_COUNT-1).
|
||||
// Idx=-1 — выход в HF.
|
||||
TWebCmdXvtrBand = procedure(Idx: Integer) of object;
|
||||
@@ -244,6 +245,7 @@ type
|
||||
FOnAttn: TWebCmdAttn;
|
||||
FAttnIdx: Integer;
|
||||
FOnTun: TWebCmdTun;
|
||||
FOnFMStep: TWebCmdFMStep;
|
||||
FTuning: Boolean;
|
||||
FDuplex: Boolean;
|
||||
FFreqMhzDigits: Integer; // 3=999MHz, 4=9.999GHz, 5=99.999GHz
|
||||
@@ -334,6 +336,7 @@ type
|
||||
property OnFreqA: TWebCmdFreqA read FOnFreqA write FOnFreqA;
|
||||
property OnAttn: TWebCmdAttn read FOnAttn write FOnAttn;
|
||||
property OnTun: TWebCmdTun read FOnTun write FOnTun;
|
||||
property OnFMStep: TWebCmdFMStep read FOnFMStep write FOnFMStep;
|
||||
property OnWebMic: TWebMicCB read FOnWebMic write FOnWebMic;
|
||||
end;
|
||||
|
||||
@@ -1184,6 +1187,14 @@ begin
|
||||
if Idx > 2 then Idx := 2;
|
||||
FStateLock.Enter; FAttnIdx := Idx; FStateLock.Leave;
|
||||
if Assigned(FOnAttn) then FOnAttn(Idx);
|
||||
end
|
||||
else if Cmd = 'fm_step' then
|
||||
begin
|
||||
Idx := JsonGetInt(Json, 'idx', FFMStepIdx);
|
||||
if Idx < 0 then Idx := 0;
|
||||
if Idx > 3 then Idx := 3;
|
||||
FStateLock.Enter; FFMStepIdx := Idx; FStateLock.Leave;
|
||||
if Assigned(FOnFMStep) then FOnFMStep(Idx);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user