feat: configurable SteppIR tunable range — skip follow/inhibit off-band
A SteppIR only covers part of the spectrum (a standard one is 20 m–6 m) but can't report its own range, so the follow loop's existing out-of-range guard (FreqMin/FreqMax) never engaged for it. Tuning the rig to a band the antenna can't reach (e.g. 30 m) made the loop keep trying — the immediate cause of the stuck TX interlock addressed in the previous commit. Add a Tunable range (MHz) setting to the Antenna panel, wired into the SteppIR adapter's Status().FreqMin/FreqMax so the follow loop skips out-of-range frequencies entirely: no tune command, no TX inhibit. Defaults to 13–54 MHz (20 m–6 m, the common model) when unset; widen the low edge for a 40 m-equipped SteppIR. Ultrabeam is unaffected (it reports its own per-band coverage). Keeps the last-commanded-freq deadband from the previous commit as a universal safety net for any flaky-status case within the valid range.
This commit is contained in:
@@ -1055,8 +1055,8 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
|
||||
const [rotatorTest, setRotatorTest] = useState<{ ok: boolean; msg: string } | null>(null);
|
||||
|
||||
// Motorized antenna (Ultrabeam TCP or SteppIR TCP/serial) settings.
|
||||
const [ultrabeam, setUltrabeam] = useState<{ enabled: boolean; type: string; transport: string; host: string; port: number; com: string; baud: number; follow: boolean; step_khz: number; tx_inhibit: boolean }>({
|
||||
enabled: false, type: 'ultrabeam', transport: 'tcp', host: '', port: 23, com: '', baud: 9600, follow: false, step_khz: 50, tx_inhibit: false,
|
||||
const [ultrabeam, setUltrabeam] = useState<{ enabled: boolean; type: string; transport: string; host: string; port: number; com: string; baud: number; follow: boolean; step_khz: number; tx_inhibit: boolean; freq_min_mhz: number; freq_max_mhz: number }>({
|
||||
enabled: false, type: 'ultrabeam', transport: 'tcp', host: '', port: 23, com: '', baud: 9600, follow: false, step_khz: 50, tx_inhibit: false, freq_min_mhz: 13, freq_max_mhz: 54,
|
||||
});
|
||||
const [ubTesting, setUbTesting] = useState(false);
|
||||
const [ubTest, setUbTest] = useState<{ ok: boolean; msg: string } | null>(null);
|
||||
@@ -2639,6 +2639,22 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{isSteppir && (
|
||||
<div className="border-t border-border/60 pt-3 space-y-1">
|
||||
<div className="flex items-center gap-2 flex-wrap">
|
||||
<Label className="text-sm">{t('hw.steppirRange')}</Label>
|
||||
<input type="number" min={1} max={60} value={ultrabeam.freq_min_mhz}
|
||||
onChange={(e) => setUltrabeam((s) => ({ ...s, freq_min_mhz: parseInt(e.target.value, 10) || 0 }))}
|
||||
className="h-8 w-16 rounded-md border border-input bg-background px-2 text-sm" />
|
||||
<span className="text-xs text-muted-foreground">–</span>
|
||||
<input type="number" min={1} max={60} value={ultrabeam.freq_max_mhz}
|
||||
onChange={(e) => setUltrabeam((s) => ({ ...s, freq_max_mhz: parseInt(e.target.value, 10) || 0 }))}
|
||||
className="h-8 w-16 rounded-md border border-input bg-background px-2 text-sm" />
|
||||
<span className="text-xs text-muted-foreground">MHz</span>
|
||||
</div>
|
||||
<p className="text-xs text-muted-foreground">{t('hw.steppirRangeHint')}</p>
|
||||
</div>
|
||||
)}
|
||||
<div className="border-t border-border/60 pt-3 space-y-1">
|
||||
<label className="flex items-center gap-2 text-sm cursor-pointer">
|
||||
<Checkbox checked={ultrabeam.tx_inhibit} onCheckedChange={(c) => setUltrabeam((s) => ({ ...s, tx_inhibit: !!c }))} />
|
||||
|
||||
Reference in New Issue
Block a user