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:
+8
-2
@@ -524,8 +524,10 @@ begin
|
||||
'function updSpan(s){SPANS.forEach((hz,i)=>{const b=q("sb"+i);if(b)b.classList.toggle("on",hz===s);});}' +
|
||||
'buildSpanButtons();' +
|
||||
|
||||
'const BAND_N=["160m","80m","60m","40m","30m","20m","17m","15m","12m","10m","6m"];' +
|
||||
'const BAND_F=[1900000,3750000,5357000,7100000,10125000,14200000,18120000,21200000,24940000,28500000,50150000];' +
|
||||
// BAND_N/BAND_F строятся из state.bands (HPSDR HF / Pluto VHF-UHF); ниже —
|
||||
// bootstrap-значения до первого state. Единый источник — backend в контроллере.
|
||||
'let BAND_N=["160m","80m","60m","40m","30m","20m","17m","15m","12m","10m","6m"];' +
|
||||
'let BAND_F=[1840000,3700000,5357000,7100000,10120000,14200000,18130000,21300000,24940000,28400000,50150000];' +
|
||||
// XVTR-band list, обновляется из state ("xvtr_bands":[{idx,name},...]).
|
||||
// Активное значение — "xvtr_current" (-1 = HF). В <select> используем
|
||||
// значения "h<n>" для HF и "x<idx>" для XVTR, чтобы различать.
|
||||
@@ -689,6 +691,10 @@ begin
|
||||
// Пресеты sample-rate сменились (другой бэкенд) — перестраиваем span-кнопки.
|
||||
'if(msg.rate_presets!=null&&Array.isArray(msg.rate_presets)&&msg.rate_presets.length){' +
|
||||
'if(JSON.stringify(msg.rate_presets)!==JSON.stringify(SPANS)){SPANS=msg.rate_presets;buildSpanButtons();}}' +
|
||||
// Band-план сменился (другой бэкенд: HF↔VHF/UHF) — перестраиваем band-selector.
|
||||
'if(msg.bands!=null&&Array.isArray(msg.bands)&&msg.bands.length){' +
|
||||
'const nn=msg.bands.map(function(b){return b.name;});' +
|
||||
'if(JSON.stringify(nn)!==JSON.stringify(BAND_N)){BAND_N=nn;BAND_F=msg.bands.map(function(b){return b.freq;});rebuildBandSel();}}' +
|
||||
// Обновляем localCenter/localSpan из сервера только когда пользователь не тянет
|
||||
'if(!dragging&&Date.now()-wheelActiveTs>300){' +
|
||||
// В CTUN без DUP: TX-спектр WDSP центрирован по vfo_a_hz, а не по DDC LO.
|
||||
|
||||
Reference in New Issue
Block a user