mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 20:37:33 +00:00
feat: unify band plan across desktop + web UIs
Web band selector was hardcoded to the HF plan, so on Pluto it showed 160m..6m instead of the VHF/UHF plan and highlighted the wrong entry (band switching itself already worked: web sends idx, controller maps it via the IsPluto plan). Mirror the sample-rate unification. Single source of truth = BoardUtils -> controller: - BoardUtils: TBandInfo/TBandPlanArray + BuildBandPlan(Pluto). - TRadioController.BandPlan returns BuildBandPlan(IsPluto). Both UIs derive from it: - Desktop already plan-aware (RelabelBands + RestoreBand) - unchanged. - Web: WebServer.SetBands + "bands" in state JSON; hosts push BandPlan on connect/startup; JS builds the band selector from state.bands (BAND_N/BAND_F now dynamic). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -547,6 +547,8 @@ type
|
||||
// Единый источник пресетов sample-rate для UI (desktop overlay + web).
|
||||
// Берётся из caps текущего бэкенда (HPSDR 48k..1536k / Pluto 576k..5760k).
|
||||
function SampleRatePresets: TBackendRateArray;
|
||||
// Единый источник band-плана для UI (HF / VHF-UHF по типу бэкенда).
|
||||
function BandPlan: TBandPlanArray;
|
||||
// True если активный бэкенд — Pluto (VHF/UHF band-план вместо HF).
|
||||
function IsPluto: Boolean;
|
||||
// Человекочитаемое имя подключённой платы для статус-строки (UI/Web).
|
||||
@@ -3162,6 +3164,11 @@ begin
|
||||
Result := BackendCaps.RatePresets;
|
||||
end;
|
||||
|
||||
function TRadioController.BandPlan: TBandPlanArray;
|
||||
begin
|
||||
Result := BuildBandPlan(IsPluto);
|
||||
end;
|
||||
|
||||
function TRadioController.IsPluto: Boolean;
|
||||
begin
|
||||
Result := (FNetwork <> nil) and (FNetwork.Caps.Kind = bkPluto);
|
||||
|
||||
Reference in New Issue
Block a user