feat: qrz clickable in cw decoder

This commit is contained in:
2026-06-21 21:57:11 +02:00
parent 725600c341
commit 6ac9783f7c
6 changed files with 29 additions and 28 deletions
+9 -6
View File
@@ -217,7 +217,7 @@ export function FlexPanel() {
}, []);
// PowerGenius XL direct connection (fan mode), independent of the Flex link.
const [pg, setPg] = useState<{ connected: boolean; fan_mode?: string }>({ connected: false });
const [pg, setPg] = useState<{ connected: boolean; fan_mode?: string; host?: string; last_error?: string }>({ connected: false });
useEffect(() => {
let alive = true;
const tick = async () => { try { const s: any = await GetPGXLStatus(); if (alive) setPg(s || { connected: false }); } catch {} };
@@ -441,15 +441,18 @@ export function FlexPanel() {
<span className="text-xs text-muted-foreground">
{st.amp_operate ? 'Amplifier is in line (transmitting through PA).' : 'Amplifier bypassed (standby).'}
</span>
{/* Fan mode — only when the PowerGenius direct connection is up
(configured in Settings → PowerGenius). */}
{pg.connected && (
<label className="flex items-center gap-1.5 text-xs">
{/* Fan mode — shown when the PowerGenius is configured (Settings →
PowerGenius). The dot shows the direct-connection state; the
selector is disabled until connected (hover it for the error). */}
{(pg.host || pg.connected) && (
<label className="flex items-center gap-1.5 text-xs" title={pg.connected ? 'PowerGenius connected' : (pg.last_error || 'PowerGenius offline')}>
<span className={cn('size-1.5 rounded-full', pg.connected ? 'bg-emerald-500 shadow-[0_0_6px_rgba(16,185,129,0.8)]' : 'bg-rose-500')} />
<span className="text-muted-foreground">Fan</span>
<select
disabled={!pg.connected}
value={(pg.fan_mode || 'CONTEST').toUpperCase()}
onChange={(e) => { const v = e.target.value; setPg((s) => ({ ...s, fan_mode: v })); PGXLSetFanMode(v).catch(() => {}); }}
className="h-8 rounded-md border border-orange-300 bg-card px-2 text-xs font-semibold text-orange-800 outline-none focus:border-orange-500"
className="h-8 rounded-md border border-orange-300 bg-card px-2 text-xs font-semibold text-orange-800 outline-none focus:border-orange-500 disabled:opacity-40"
>
<option value="STANDARD">Standard</option>
<option value="CONTEST">Contest</option>
+2 -14
View File
@@ -639,7 +639,7 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
const [antgenius, setAntgenius] = useState<{ enabled: boolean; host: string }>({ enabled: false, host: '' });
// PowerGenius XL (4O3A) amp fan-control settings.
const [pgxl, setPgxl] = useState<{ enabled: boolean; host: string; port: number }>({ enabled: false, host: '', port: 9006 });
const [pgxl, setPgxl] = useState<{ enabled: boolean; host: string; port: number }>({ enabled: false, host: '', port: 9008 });
// WinKeyer CW keyer settings + macro editor.
type WKMac = { label: string; text: string };
@@ -1962,7 +1962,6 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
<>
<SectionHeader
title="Antenna (Ultrabeam)"
hint="OpsLog talks to the Ultrabeam controller over TCP — typically via an RS232↔Ethernet adapter. Enter its IP address and port; the pattern direction (Normal / 180° / Bidirectional) is then controlled from the status bar."
/>
<div className="space-y-4 max-w-xl">
<label className="flex items-center gap-2 text-sm cursor-pointer">
@@ -2024,9 +2023,6 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
{ubTest.msg}
</div>
)}
<p className="text-xs text-muted-foreground">
Once enabled, the antenna's direction control (Normal / 180° / Bidirectional) appears in the bottom status bar, next to CAT and Rotator. Changing the direction re-tunes the elements at the current frequency.
</p>
</div>
</>
);
@@ -2052,11 +2048,7 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
placeholder="192.168.1.60"
className="font-mono"
/>
<p className="text-xs text-muted-foreground">TCP port is fixed at 9007.</p>
</div>
<p className="text-xs text-muted-foreground">
Once enabled, an Antenna Genius button appears in the top bar to show/hide the antenna-switch widget. In the widget, the A and B buttons select that antenna for the matching port; clicking an already-selected port deselects it (sets the port to None).
</p>
</div>
</>
);
@@ -2088,14 +2080,11 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
<Input
type="number" min={1} max={65535}
value={pgxl.port}
onChange={(e) => setPgxl((s) => ({ ...s, port: parseInt(e.target.value) || 9006 }))}
onChange={(e) => setPgxl((s) => ({ ...s, port: parseInt(e.target.value) || 9008 }))}
className="font-mono"
/>
</div>
</div>
<p className="text-xs text-muted-foreground">
Default port is 9006. Once enabled, a fan-mode dropdown (Standard / Contest / Broadcast) appears next to the amplifier Operate button in the FlexRadio tab.
</p>
</div>
</>
);
@@ -2179,7 +2168,6 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
<>
<SectionHeader
title="CW Keyer"
hint="Drive a K1EL WinKeyer (WK1/2/3) over a serial port to send Morse from OpsLog. Enable it, pick the COM port and keying parameters, then connect from the keyer panel (Tools WinKeyer CW keyer)."
/>
<div className="space-y-4 max-w-2xl">
<label className="flex items-center gap-2 text-sm cursor-pointer">