feat(antgenius): the selected antenna can fill MY_ANTENNA
A station with a switch knows something the log does not: which antenna is actually connected. The working conditions hold what was PLANNED for the band, and stay right until the operator throws the switch — after which every QSO keeps claiming the other antenna. Optional, and off by default: a station that names its antennas differently in the two places would otherwise find its log quietly rewritten. The name written is the one configured on the device, since that is the name the operator gave it and the one they will look for. WHICH PORT is the real problem, and the reason this is not a one-liner. The switch has two, the radio has two jacks, and the QSO went out through one of them; naming the wrong port's antenna is worse than naming the band default, because it looks authoritative. The radio's own TX antenna selection decides, and the jack-to-port wiring is a setting — it is the station's cabling and neither device can report it. When the port cannot be told — a transverter jack, a rig that reports nothing, both switch ports live — nothing is written and the band default stands. Silence beats a confident guess in a field nobody re-checks.
This commit is contained in:
@@ -1543,7 +1543,7 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
|
||||
const [ubTest, setUbTest] = useState<{ ok: boolean; msg: string } | null>(null);
|
||||
|
||||
// Antenna Genius (4O3A) switch settings — TCP port is fixed at 9007.
|
||||
const [antgenius, setAntgenius] = useState<{ enabled: boolean; host: string; password: string }>({ enabled: false, host: '', password: '' });
|
||||
const [antgenius, setAntgenius] = useState<{ enabled: boolean; host: string; password: string; use_for_my_antenna?: boolean; ant1_port?: number }>({ enabled: false, host: '', password: '', use_for_my_antenna: false, ant1_port: 1 });
|
||||
const [tunergenius, setTunergenius] = useState<{ enabled: boolean; host: string; password: string }>({ enabled: false, host: '', password: '' });
|
||||
const [psuCfg, setPsuCfg] = useState<{ enabled: boolean; com_port: string; baud: number; address: number }>({ enabled: false, com_port: '', baud: 9600, address: 1 });
|
||||
|
||||
@@ -3822,6 +3822,38 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">{t('ag2.passwordHint')}</p>
|
||||
</div>
|
||||
|
||||
{/* MY_ANTENNA from the switch.
|
||||
The working conditions hold what was PLANNED for the band; the
|
||||
switch knows what is connected. Off by default: a station that
|
||||
names its antennas differently in the two places would otherwise
|
||||
find its log quietly rewritten. */}
|
||||
<div className="border-t border-border/60 pt-3 space-y-2">
|
||||
<label className="flex items-start gap-2 text-sm cursor-pointer">
|
||||
<Checkbox className="mt-0.5" checked={!!antgenius.use_for_my_antenna}
|
||||
onCheckedChange={(c) => setAntgenius((s: any) => ({ ...s, use_for_my_antenna: !!c }))} />
|
||||
<span>
|
||||
{t('ag2.useForMyAnt')}
|
||||
<span className="block text-xs text-muted-foreground">{t('ag2.useForMyAntHint')}</span>
|
||||
</span>
|
||||
</label>
|
||||
{!!antgenius.use_for_my_antenna && (
|
||||
<div className="pl-6 space-y-1">
|
||||
<Label>{t('ag2.ant1Port')}</Label>
|
||||
<div className="inline-flex rounded-md border border-border overflow-hidden text-xs">
|
||||
{[1, 2].map((n) => (
|
||||
<button key={n} type="button"
|
||||
onClick={() => setAntgenius((s: any) => ({ ...s, ant1_port: n }))}
|
||||
className={cn('px-3 py-1.5 font-medium',
|
||||
(antgenius.ant1_port ?? 1) === n ? 'bg-primary text-primary-foreground' : 'text-muted-foreground hover:bg-muted')}>
|
||||
{n === 1 ? t('ag2.portA') : t('ag2.portB')}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<p className="text-xs text-muted-foreground">{t('ag2.ant1PortHint')}</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user