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:
2026-08-25 15:08:48 +02:00
parent ed099a660e
commit df1d2767cd
7 changed files with 275 additions and 38 deletions
+33 -1
View File
@@ -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>
</>
);
+2 -2
View File
@@ -326,7 +326,7 @@ const en: Dict = {
// Section hints (hardware/software panel headers)
'autostart.hint': 'Launch external programs (WSJT-X, JTAlert, rotator control…) when OpsLog starts. A program already running is not started again. Saved per profile.',
'cat.hint': "Reads the rig's frequency / band / mode and pushes them into the entry strip in real time. Use OmniRig (free, any rig) or — for FlexRadio — the native SmartSDR API (no OmniRig needed, real-time, no second-click mode bug).",
'ag2.hint': 'OpsLog talks to the 4O3A Antenna Genius switch over TCP (GSCP protocol). The port is fixed at 9007, so only the device IP is needed. A docked widget then lets you switch antennas per port (A/B).', 'ag2.password': 'Remote password', 'ag2.passwordPh': 'blank on LAN', 'ag2.passwordHint': 'Only needed when reaching the device remotely — it then announces "AG AUTH" and rejects commands until you log in. Leave blank on the local network.',
'ag2.hint': 'OpsLog talks to the 4O3A Antenna Genius switch over TCP (GSCP protocol). The port is fixed at 9007, so only the device IP is needed. A docked widget then lets you switch antennas per port (A/B).', 'ag2.password': 'Remote password', 'ag2.passwordPh': 'blank on LAN', 'ag2.useForMyAnt': 'Use the selected antenna as MY_ANTENNA', 'ag2.useForMyAntHint': 'The antenna selected on the switch, under the name it carries there, is written into every QSO as it is logged — ahead of the band default from Operating conditions. Which port counts is decided by the antenna jack the radio is transmitting on.', 'ag2.ant1Port': 'The radio\u2019s ANT1 jack is wired to', 'ag2.portA': 'Port A', 'ag2.portB': 'Port B', 'ag2.ant1PortHint': 'Station wiring — neither the radio nor the switch can report it. ANT2 then goes to the other port.', 'ag2.passwordHint': 'Only needed when reaching the device remotely — it then announces "AG AUTH" and rejects commands until you log in. Leave blank on the local network.',
'tg2.hint': 'OpsLog talks to the 4O3A Tuner Genius XL over TCP (port fixed at 9010), so only the device IP is needed. A docked widget then shows SWR and forward power and offers Tune, Bypass and Operate/Standby. Control it directly (not through the radio) so OpsLog uses just one of the box\'s connection slots.', 'tg2.enable': 'Enable Tuner Genius control', 'tg2.portHint': 'The TCP port is fixed at 9010 on the device.', 'tg2.password': 'Remote code', 'tg2.passwordPh': 'blank on LAN', 'tg2.passwordHint': 'Only needed when reaching the device remotely — it then announces "AUTH" and rejects commands until you log in. Leave blank on the local network.',
'rot.spidHint': 'Native SPID protocol over the controllers COM port — no PstRotator needed. Pick the dialect above: Rot2Prog answers with azimuth and elevation at 600 baud, Rot1Prog with azimuth only at 1200.', 'rot.spidModel': 'SPID protocol',
'rot.widget': 'Widget', 'rot.compact': 'Compact mode', 'rot.compactHint': 'Show only the dial and the short/long-path azimuths. The quick-turn buttons, the azimuth box and Stop are hidden — turn the antenna from the bearing pill in the entry strip instead.',
@@ -804,7 +804,7 @@ const fr: Dict = {
'bk.lastRun': 'Dernière exécution :', 'bk.never': 'jamais', 'bk.backupNow': 'Sauvegarder maintenant', 'bk.backingUp': 'Sauvegarde…', 'bk.writtenTo': 'Sauvegarde écrite dans',
'autostart.hint': "Lance des programmes externes (WSJT-X, JTAlert, contrôle rotator…) au démarrage d'OpsLog. Un programme déjà lancé n'est pas relancé. Enregistré par profil.",
'cat.hint': "Lit la fréquence / bande / mode du poste et les injecte dans le bandeau de saisie en temps réel. Utilise OmniRig (gratuit, tout poste) ou — pour FlexRadio — l'API native SmartSDR (sans OmniRig, temps réel, sans le bug du mode au 2ᵉ clic).",
'ag2.hint': "OpsLog dialogue avec le switch 4O3A Antenna Genius en TCP (protocole GSCP). Le port est fixé à 9007, seule l'IP de l'appareil est nécessaire. Un widget ancré permet ensuite de commuter les antennes par port (A/B).", 'ag2.password': 'Mot de passe distant', 'ag2.passwordPh': 'vide en LAN', 'ag2.passwordHint': "Nécessaire seulement à distance — l'appareil annonce alors « AG AUTH » et refuse les commandes tant qu'on n'est pas identifié. Laisse vide sur le réseau local.",
'ag2.hint': "OpsLog dialogue avec le switch 4O3A Antenna Genius en TCP (protocole GSCP). Le port est fixé à 9007, seule l'IP de l'appareil est nécessaire. Un widget ancré permet ensuite de commuter les antennes par port (A/B).", 'ag2.password': 'Mot de passe distant', 'ag2.passwordPh': 'vide en LAN', 'ag2.useForMyAnt': "Utiliser l'antenne sélectionnée comme MY_ANTENNA", 'ag2.useForMyAntHint': "L'antenne sélectionnée sur le switch, sous le nom qu'elle y porte, est inscrite dans chaque QSO au moment où il est enregistré — avant l'antenne par défaut des conditions de trafic. C'est la prise d'antenne sur laquelle la radio émet qui décide du port retenu.", 'ag2.ant1Port': 'La prise ANT1 de la radio est câblée sur', 'ag2.portA': 'Port A', 'ag2.portB': 'Port B', 'ag2.ant1PortHint': "Câblage de la station — ni la radio ni le switch ne peuvent le dire. ANT2 va alors sur l'autre port.", 'ag2.passwordHint': "Nécessaire seulement à distance — l'appareil annonce alors « AG AUTH » et refuse les commandes tant qu'on n'est pas identifié. Laisse vide sur le réseau local.",
'tg2.hint': "OpsLog dialogue avec le 4O3A Tuner Genius XL en TCP (port fixé à 9010), seule l'IP de l'appareil est nécessaire. Un widget ancré affiche le ROS et la puissance directe et propose Accord, Bypass et Operate/Standby. Pilotage direct (pas via la radio) pour n'utiliser qu'une des connexions de la boîte.", 'tg2.enable': "Activer le contrôle du Tuner Genius", 'tg2.portHint': "Le port TCP est fixé à 9010 sur l'appareil.", 'tg2.password': 'Code distant', 'tg2.passwordPh': 'vide en LAN', 'tg2.passwordHint': "Nécessaire seulement à distance — l'appareil annonce alors « AUTH » et refuse les commandes tant qu'on n'est pas identifié. Laisse vide sur le réseau local.",
'rot.spidHint': 'Protocole SPID natif sur le port COM du contrôleur — sans PstRotator. Choisissez le dialecte ci-dessus : Rot2Prog répond azimut et élévation à 600 bauds, Rot1Prog azimut seul à 1200.', 'rot.spidModel': 'Protocole SPID',
'rot.widget': 'Widget', 'rot.compact': 'Mode compact', 'rot.compactHint': 'Nafficher que le cadran et les azimuts courte/longue distance. Les boutons de rotation rapide, la case dazimut et Stop sont masqués — tourne lantenne depuis la pastille de cap de la barre de saisie.',
+4
View File
@@ -1738,6 +1738,8 @@ export namespace main {
enabled: boolean;
host: string;
password: string;
use_for_my_antenna: boolean;
ant1_port: number;
static createFrom(source: any = {}) {
return new AntGeniusSettings(source);
@@ -1748,6 +1750,8 @@ export namespace main {
this.enabled = source["enabled"];
this.host = source["host"];
this.password = source["password"];
this.use_for_my_antenna = source["use_for_my_antenna"];
this.ant1_port = source["ant1_port"];
}
}
export class AudioSettings {