feat(antenna): per-band tune frequency for Ultrabeam and SteppIR
The band buttons in Station Control tuned to a fixed mid-band frequency baked into the frontend. An operator who lives in the CW segment, or in the FT8 window, got the antenna resonant somewhere he never operates and had to nudge it every time. The SteppIR's own controller has a Frequency (KHz) column per band for exactly this; this is that column. Stored sparsely: a band with no entry uses its default, so nothing migrates and an operator sets only the bands he cares about. Left empty the Settings box shows the default as its placeholder, which makes clearing it the obvious way back. The value is checked against the band plan before it is kept, because it goes to the antenna as a tune command — a lost digit (1450 for 20 m) or kHz typed as MHz would send the elements travelling to a length wrong for the band the operator is on, and on a SteppIR that journey inhibits transmit the whole way. A rejected entry is logged and the band falls back to its default. Resolution happens in the backend and rides on the existing status poll, so the widget no longer decides where a band button goes and cannot drift from what Settings shows. Its own table stays only as a floor for the first poll.
This commit is contained in:
@@ -116,7 +116,7 @@ function RotatorWidget({ hd, refetch, centerLat, centerLon, bearing, t }: Rotato
|
||||
);
|
||||
}
|
||||
|
||||
type AntStatus = { enabled: boolean; type: string; connected: boolean; direction: number; frequency: number; moving: boolean; elements: number[]; follow?: boolean; step_khz?: number; track_mode?: string; bands?: string[] };
|
||||
type AntStatus = { enabled: boolean; type: string; connected: boolean; direction: number; frequency: number; moving: boolean; elements: number[]; follow?: boolean; step_khz?: number; track_mode?: string; bands?: string[]; band_freqs?: Record<string, number> };
|
||||
|
||||
// Where each band button points the antenna.
|
||||
//
|
||||
@@ -241,7 +241,10 @@ function MotorAntennaWidget({ ant, refetch, t }: { ant: AntStatus; refetch: () =
|
||||
<div className="text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-1">{t('station.bands')}</div>
|
||||
<div className="grid grid-cols-5 gap-1">
|
||||
{(ant.bands ?? []).map((b: string) => {
|
||||
const khz = ANT_BAND_KHZ[b];
|
||||
// Where this band tunes is resolved by the backend — the operator's
|
||||
// per-band choice from Settings, or the default. ANT_BAND_KHZ is only
|
||||
// the floor for a status poll that hasn't landed yet.
|
||||
const khz = ant.band_freqs?.[b] || ANT_BAND_KHZ[b];
|
||||
if (!khz) return null;
|
||||
// "On this band" from the antenna's own frequency, not the rig's:
|
||||
// the widget must show where the ANTENNA is, which is the whole
|
||||
|
||||
Reference in New Issue
Block a user