fix: PGXL meters/auth/fan, TCI spots+click, PTT-over-CAT, CW <LOGQSO>

- PGXL: remote AUTH password; direct-link meter fallback (VITA-first) with
  250 ms poll + peak-hold; fan mode uses bare "fanmode=" (was ignored).
- TCI: spot colour sent as decimal ARGB (ExpertSDR dropped the hex string);
  spot click handled via CLICKED_ON_SPOT / RX_CLICKED_ON_SPOT to fill the entry.
- FlexRadio: clicking an OpsLog spot on the panadapter now applies the mode too.
- Filter presets: the trash icon deletes again (Radix pointer-down intercept).
- PTT hotkey: keys over CAT when a backend is active (was hijacked by a stale
  Audio-tab RTS/DTR serial setting); AltGr keys allowed; presses logged.
- CW macro <LOGQSO>: logs after the preceding CW is sent, not on the first letter.
This commit is contained in:
2026-08-04 15:55:10 +02:00
parent b3fdd0b7fa
commit 18f9b915c5
12 changed files with 277 additions and 81 deletions
+36 -30
View File
@@ -1945,15 +1945,23 @@ export default function App() {
const down = (e: KeyboardEvent) => {
const cfg = pttHotkeyRef.current;
if (!cfg.enabled || !cfg.code || e.code !== cfg.code) return;
if (e.ctrlKey || e.altKey || e.metaKey) return; // plain key only
// Allow AltGr (Ctrl+Alt together) — French/other layouts need it to reach
// keys like "\" — but never hijack a real Ctrl- or Win-shortcut.
if (e.metaKey || (e.ctrlKey && !e.altKey)) return;
e.preventDefault();
if (e.repeat) return;
// Surface the result: this feature was impossible to diagnose because every
// error was swallowed. The line names the key, the action and any failure.
const fail = (err: any) => { UILog(`ptt hotkey: ${e.code} FAILED: ${err}`).catch(() => {}); };
if (cfg.toggle) {
pttToggledRef.current = !pttToggledRef.current;
(pttToggledRef.current ? PTTHotkeyDown() : PTTHotkeyUp())?.catch?.(() => {});
const on = pttToggledRef.current;
UILog(`ptt hotkey: ${e.code} toggle → ${on ? 'KEY' : 'UNKEY'}`).catch(() => {});
(on ? PTTHotkeyDown() : PTTHotkeyUp())?.catch?.(fail);
} else if (!pttHeldRef.current) {
pttHeldRef.current = true;
PTTHotkeyDown().catch(() => {});
UILog(`ptt hotkey: ${e.code} down → KEY`).catch(() => {});
PTTHotkeyDown().catch(fail);
}
};
const up = (e: KeyboardEvent) => {
@@ -2837,36 +2845,34 @@ export default function App() {
const sendFn = cwSourceRef.current === 'flex' ? FlexSendCW : cwSourceRef.current === 'icom' ? IcomSendCW : cwSourceRef.current === 'yaesu' ? YaesuSendCW : null;
if (sendFn) await sendFn(keyed).catch((e) => setError(String(e?.message ?? e)));
else await WinkeyerSend(keyed).catch((e) => setError(String(e?.message ?? e)));
// Only WAIT for the CW to finish on the FINAL segment — auto-call needs the
// send done before its gap+resend. A segment a <LOGQSO> follows is NOT waited
// on: the keyer has already buffered the CW, so logging happens AT ONCE and
// never interrupts what's being sent. (Gating the log on a CW-length ESTIMATE
// made <LOGQSO> log up to ~10s late when the estimate ran long.)
if (isLast) {
if (isRig) {
await waitMs(Math.round(estimateCwMs(resolved, wkWpm)) + 600);
} else {
// WinKeyer / serial keyer: the message takes AT LEAST its own length to
// send, so the estimate is a floor and the busy signal only extends it.
//
// Waiting on busy alone made the auto-call gap start early: busy travels
// from the keyer to this window as an event, and if it had not arrived
// and cleared within the one-second start window the wait simply ended.
// A 6 s gap then ran from the START of the CQ — about 2 s of silence
// after a 4 s call, which is what an operator hears as "clearly not 6".
const estMs = Math.round(estimateCwMs(resolved, wkWpm));
const started = Date.now();
const capMs = Math.round(estMs * 1.4) + 2500;
const deadline = started + capMs;
// The message's own duration, first — this is the part that must not be skipped.
while (Date.now() - started < estMs && !aborted()) await sleep(50);
// Then let a still-sending keyer finish (slow link, long buffer), capped.
while (wkBusyRef.current && !aborted() && Date.now() < deadline) await sleep(50);
}
// WAIT for THIS segment's CW to finish before moving on — so a <LOGQSO>
// that follows logs AFTER the text before it (e.g. "TU") has actually been
// sent, not the instant it's buffered into the keyer. Buffering then logging
// "at once" made a macro ending in "TU <LOGQSO>" log on the very first
// letter. Auto-call also needs the send finished before its gap+resend.
if (isRig) {
await waitMs(Math.round(estimateCwMs(resolved, wkWpm)) + 600);
} else {
// WinKeyer / serial keyer: the message takes AT LEAST its own length to
// send, so the estimate is a floor and the busy signal only extends it.
//
// Waiting on busy alone made the auto-call gap start early: busy travels
// from the keyer to this window as an event, and if it had not arrived
// and cleared within the one-second start window the wait simply ended.
// A 6 s gap then ran from the START of the CQ — about 2 s of silence
// after a 4 s call, which is what an operator hears as "clearly not 6".
const estMs = Math.round(estimateCwMs(resolved, wkWpm));
const started = Date.now();
const capMs = Math.round(estMs * 1.4) + 2500;
const deadline = started + capMs;
// The message's own duration, first — this is the part that must not be skipped.
while (Date.now() - started < estMs && !aborted()) await sleep(50);
// Then let a still-sending keyer finish (slow link, long buffer), capped.
while (wkBusyRef.current && !aborted() && Date.now() < deadline) await sleep(50);
}
}
if (aborted()) return; // aborted while this segment was sending → don't log
if (logAfter) void save(); // log NOW — the buffered CW keeps sending
if (logAfter) void save(); // the preceding CW has finished → log at the token's spot
}
}
// stopAutoCall cancels any running auto-call loop.
+9 -2
View File
@@ -189,13 +189,20 @@ function AmpBlock({ amp, flex, showName, t }: {
const txing = typeof flex?.transmitting === 'boolean'
? flex.transmitting
: fwd ? flexW >= 1 : /TRANSMIT/i.test(pg.state || '');
// Prefer the radio's VITA meter stream when it is actually flowing (local or
// over a VPN) — it is fast and matches SmartSDR. Fall back to the amp's OWN
// link only when the radio isn't streaming its meters (a remote link without
// the VITA path), so the reading survives but is naturally slower.
const liveW = flexW > 0 ? flexW : (pg.connected ? Number(pg.fwd_w) || 0 : 0);
const fwdW = hold('fwd', txing ? liveW : 0, txing);
const id = meter(/^ID$|current/i);
// Live drain current, for the same reason: peak_id latches like peak_w.
// Live drain current, same source preference. peak_id latches like peak_w, so
// use the instantaneous 'id' and gate it on the radio's transmit flag.
const idA = id ? Number(id.value) : (txing ? Number(pg.id) || undefined : 0);
const temp = meter(/temp/i);
const tempC = pg.temperature > 0 ? pg.temperature : (temp ? temp.value : undefined);
// VITA temp matches SmartSDR (the amp's direct link exposes a different sensor
// that can read ~10°C higher); fall back to the direct temp when no VITA.
const tempC = temp ? temp.value : (pg.temperature > 0 ? pg.temperature : undefined);
return (
<div className="h-full flex flex-col gap-1.5">
+8 -1
View File
@@ -234,7 +234,14 @@ export function FilterBuilder({ open, initial, onApply, onClose }: Props) {
<SelectItem key={n} value={n}>
<span className="inline-flex items-center gap-2">
{n}
<Trash2 className="size-3 text-muted-foreground hover:text-destructive" onClick={(e) => { e.stopPropagation(); deletePreset(n); }} />
{/* Radix SelectItem selects on pointer-up, so an onClick here
fires too late — the menu has already loaded the preset and
closed. Intercept pointer-down (preventDefault stops Radix
claiming it) and delete there instead. */}
<Trash2
className="size-3 text-muted-foreground hover:text-destructive"
onPointerDown={(e) => { e.preventDefault(); e.stopPropagation(); deletePreset(n); }}
/>
</span>
</SelectItem>
))}
+31 -8
View File
@@ -328,7 +328,10 @@ export function FlexPanel({ onCWSpeed, onReportRST }: { onCWSpeed?: (wpm: number
// longer and the meters visibly trail the end of a transmission, which reads
// as the app lagging rather than as a peak being held.
const peak = useRef<Record<string, { v: number; t: number }>>({});
const peakHold = (key: string, val: number, windowMs = 1000) => {
const peakHold = (key: string, val: number, windowMs = 1000, live = true) => {
// live=false throws the held value away at once (e.g. the carrier dropped),
// so the meter falls immediately instead of coasting for the window.
if (!live) { delete peak.current[key]; return val; }
const now = Date.now();
const p = peak.current[key];
if (!p || val >= p.v || now - p.t > windowMs) { peak.current[key] = { v: val, t: now }; return val; }
@@ -362,7 +365,7 @@ export function FlexPanel({ onCWSpeed, onReportRST }: { onCWSpeed?: (wpm: number
let alive = true;
const tick = async () => { try { const s: any = await GetPGXLStatus(); if (alive) setPg(s || { connected: false }); } catch {} };
tick();
const id = window.setInterval(tick, 2000);
const id = window.setInterval(tick, 250); // match the amp's 250 ms poll so the card catches every envelope peak
return () => { alive = false; window.clearInterval(id); };
}, []);
@@ -1114,11 +1117,32 @@ export function FlexPanel({ onCWSpeed, onReportRST }: { onCWSpeed?: (wpm: number
{/* Amplifier meters (FWD / ID / TEMP) — moved here from the Meters card
and shown compact so they sit with the amp controls. */}
{(() => {
// Prefer the radio's VITA amp meters when they are flowing (local or
// over a VPN) — fast, and the same values SmartSDR shows (incl. the
// right temperature sensor). Fall back to the amp's OWN link only when
// the radio isn't streaming them (a remote link without VITA).
const meters = st.meters || [];
const dbmToW = (d: number) => Math.pow(10, (d - 30) / 10);
const amp = meters.filter((m) => (m.src || '').toUpperCase().includes('AMP')
&& !/^(RL|DRV)$/i.test((m.name || '').trim()));
if (off || amp.length === 0) return null;
if (off || amp.length === 0) {
const P = pg as any;
if (!P.connected) return null;
// Direct-link fallback: a 500 ms poll samples the SSB envelope at
// random points, so peak-hold it (live=txing drops it the instant
// PTT releases). The LDMOS pair can pull well past 25 A → 50 A scale.
const txing = typeof st.transmitting === 'boolean' ? st.transmitting : /TRANSMIT/i.test(P.state || '');
const w = txing ? Math.round(Number(P.fwd_w) || 0) : 0;
const idA = txing ? Number(P.id) || 0 : 0;
const temp = Number(P.temperature) || 0;
return (
<div className="grid grid-cols-2 sm:grid-cols-3 gap-2 mt-2 pt-2 border-t border-border/50">
<MeterBar label={t('ampw.pwr')} value={peakHold('pgw', w, 2500, txing)} unit="W" lo={0} hi={2000} accent="#dc2626" />
<MeterBar label={t('ampw.id')} value={peakHold('pgid', idA, 2500, txing)} unit="A" lo={0} hi={50} accent="#16a34a" />
<MeterBar label={t('ampw.temp')} value={temp} unit="°C" lo={0} hi={80} accent="#ea580c" />
</div>
);
}
// Power comes from the radio's meter stream and nothing else. The
// amplifier also reports a "peakfwd", and using it was a mistake
// twice over: it is a latched maximum that is never reset, and it
@@ -1133,14 +1157,13 @@ export function FlexPanel({ onCWSpeed, onReportRST }: { onCWSpeed?: (wpm: number
}
const acc = /temp|degc|degf/i.test(`${m.unit}${m.name}`) ? '#ea580c' : /volt/i.test(m.unit || '') ? '#2563eb' : '#16a34a';
// Drain current (ID): the PGXL reports a full-scale far too small
// for this meter (~3 A), so 1.5 A pinned the bar near half. The
// value itself is fine — only the bar's range was wrong. Give it a
// fixed 25 A scale (the PGXL's LDMOS pair tops out around 20 A), and
// only override an unusable reported range, not a sane one.
// for this meter, so it pinned the bar. Give it a fixed 50 A scale
// (the LDMOS pair can pull ~45-50 A near full output), overriding an
// unusable reported range but keeping a sane one.
let lo = m.lo, hi = m.hi;
if (/amp/i.test(m.unit || '') || /^ID$|current/i.test(m.name || '')) {
lo = 0;
hi = m.hi >= 25 ? m.hi : 25;
hi = m.hi >= 50 ? m.hi : 50;
}
return <MeterBar key={m.id} label={m.name || `AMP ${m.id}`} value={peakHold(`amp${m.id}`, m.value)} unit={m.unit} lo={lo} hi={hi} accent={acc} />;
})}
+12
View File
@@ -3273,6 +3273,18 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
</div>
</div>
)}
{/* PowerGenius XL asks for a remote-access code when reached from
outside the LAN (banner "V… AUTH"), like the Tuner/Antenna Genius.
Blank on the LAN. */}
{isPGXL && (
<div className="space-y-1 max-w-xs">
<Label>{t('amp.password')}</Label>
<Input type="password" value={(amp as any).password ?? ''}
onChange={(e) => patchAmp(i, { password: e.target.value } as any)}
placeholder={t('amp.passwordPh')} className="font-mono" />
<p className="text-[11px] text-muted-foreground">{t('amp.passwordHint')}</p>
</div>
)}
{/* Band-follow, for any amp that takes its band from a transceiver
CAT link (ACOM and SPE both do) never PowerGenius, which is
+2 -2
View File
@@ -188,7 +188,7 @@ const en: Dict = {
'gen.showBeam': 'Show the antenna beam heading on the Main map',
'gen.startEqEnd': 'QSO start time = end time', 'gen.startEqEndHint': '(matches LoTW when you call a while)',
'gen.showQsoRate': 'Show QSO rate in the header', 'gen.showQsoRateHint': '(QSOs/hour, projected from the last 10 / 60 min)',
'gen.lookupOnBlur': 'Look up the callsign only after leaving the field', 'gen.lookupOnBlurHint': '(not while typing)', 'amp.hint': 'Configure one or several amplifiers — each panel card has a dropdown to pick which one it shows.', 'amp.none': 'No amplifier configured yet.', 'amp.namePh': 'Name (e.g. SPE left)', 'amp.remove': 'Remove this amplifier', 'amp.add': 'Add amplifier', 'amp.freqOut': 'Send the frequency to the amplifier (band follow)', 'amp.freqPort': 'CAT/AUX COM port', 'amp.freqBroadcast': 'Also send unprompted', 'amp.freqPollOnly': 'No — answer the amplifier only', 'amp.freqEvery': 'Yes, every {ms} ms', 'amp.freqHint': 'OpsLog pretends to be a transceiver on this second port, in Kenwood format: set the amplifier to that command set (set 5 on an ACOM) at the same baud rate, and put it in OPERATE — in standby it acknowledges but does not switch band. An amplifier that POLLS (ACOM) needs nothing more; one that only LISTENS to the CAT line of the radio hears nothing unless you also turn on the unprompted send.',
'gen.lookupOnBlur': 'Look up the callsign only after leaving the field', 'gen.lookupOnBlurHint': '(not while typing)', 'amp.hint': 'Configure one or several amplifiers — each panel card has a dropdown to pick which one it shows.', 'amp.none': 'No amplifier configured yet.', 'amp.namePh': 'Name (e.g. SPE left)', 'amp.remove': 'Remove this amplifier', 'amp.add': 'Add amplifier', 'amp.password': 'Remote code', 'amp.passwordPh': 'blank on LAN', 'amp.passwordHint': 'PowerGenius XL only: needed when reaching the amp remotely — it then announces "AUTH" and rejects every command ("Unauthorized") until you log in. Leave blank on the local network.', 'amp.freqOut': 'Send the frequency to the amplifier (band follow)', 'amp.freqPort': 'CAT/AUX COM port', 'amp.freqBroadcast': 'Also send unprompted', 'amp.freqPollOnly': 'No — answer the amplifier only', 'amp.freqEvery': 'Yes, every {ms} ms', 'amp.freqHint': 'OpsLog pretends to be a transceiver on this second port, in Kenwood format: set the amplifier to that command set (set 5 on an ACOM) at the same baud rate, and put it in OPERATE — in standby it acknowledges but does not switch band. An amplifier that POLLS (ACOM) needs nothing more; one that only LISTENS to the CAT line of the radio hears nothing unless you also turn on the unprompted send.',
'gen.groupDigital': 'Group digital modes as one (DXCC-style)', 'gen.groupDigitalHint': '(matrix badges + cluster: FT8/FT4/RTTY… count as a single Digital mode; off = each digital mode is its own slot)',
// Password encryption
'gen.pwEnc': 'Password encryption',
@@ -604,7 +604,7 @@ const fr: Dict = {
'gen.showBeam': 'Afficher le cap de l\'antenne sur la carte principale',
'gen.startEqEnd': 'Heure de début du QSO = heure de fin', 'gen.startEqEndHint': '(correspond à LoTW quand tu appelles un moment)',
'gen.showQsoRate': 'Afficher le rythme QSO dans la barre du haut', 'gen.showQsoRateHint': '(QSO/heure, projeté sur les 10 / 60 dernières min)',
'gen.lookupOnBlur': 'Rechercher l\'indicatif seulement après avoir quitté le champ', 'gen.lookupOnBlurHint': '(pas pendant la saisie)', 'amp.hint': 'Configurez un ou plusieurs amplificateurs — chaque carte de panneau a une liste déroulante pour choisir lequel afficher.', 'amp.none': 'Aucun amplificateur configuré.', 'amp.namePh': 'Nom (p. ex. SPE gauche)', 'amp.remove': 'Supprimer cet amplificateur', 'amp.add': 'Ajouter un amplificateur', 'amp.freqOut': "Envoyer la fréquence à l'amplificateur (suivi de bande)", 'amp.freqPort': 'Port COM CAT/AUX', 'amp.freqBroadcast': 'Envoyer aussi sans être interrogé', 'amp.freqPollOnly': "Non — répondre seulement à l'amplificateur", 'amp.freqEvery': 'Oui, toutes les {ms} ms', 'amp.freqHint': "OpsLog se fait passer pour un transceiver sur ce second port, au format Kenwood : réglez l'amplificateur sur ce jeu de commandes (le jeu 5 sur un ACOM) à la même vitesse, et mettez-le en OPERATE — en veille il acquitte mais ne change pas de bande. Un amplificateur qui INTERROGE (ACOM) n'a besoin de rien de plus ; un amplificateur qui se contente d'ÉCOUTER la liaison CAT de la radio n'entendra rien tant que l'envoi spontané n'est pas activé.",
'gen.lookupOnBlur': 'Rechercher l\'indicatif seulement après avoir quitté le champ', 'gen.lookupOnBlurHint': '(pas pendant la saisie)', 'amp.hint': 'Configurez un ou plusieurs amplificateurs — chaque carte de panneau a une liste déroulante pour choisir lequel afficher.', 'amp.none': 'Aucun amplificateur configuré.', 'amp.namePh': 'Nom (p. ex. SPE gauche)', 'amp.remove': 'Supprimer cet amplificateur', 'amp.add': 'Ajouter un amplificateur', 'amp.password': 'Code distant', 'amp.passwordPh': 'vide en LAN', 'amp.passwordHint': "PowerGenius XL uniquement : nécessaire pour joindre l'ampli à distance — il annonce alors « AUTH » et refuse toute commande (« Unauthorized ») tant qu'on n'est pas identifié. Laisse vide sur le réseau local.", 'amp.freqOut': "Envoyer la fréquence à l'amplificateur (suivi de bande)", 'amp.freqPort': 'Port COM CAT/AUX', 'amp.freqBroadcast': 'Envoyer aussi sans être interrogé', 'amp.freqPollOnly': "Non — répondre seulement à l'amplificateur", 'amp.freqEvery': 'Oui, toutes les {ms} ms', 'amp.freqHint': "OpsLog se fait passer pour un transceiver sur ce second port, au format Kenwood : réglez l'amplificateur sur ce jeu de commandes (le jeu 5 sur un ACOM) à la même vitesse, et mettez-le en OPERATE — en veille il acquitte mais ne change pas de bande. Un amplificateur qui INTERROGE (ACOM) n'a besoin de rien de plus ; un amplificateur qui se contente d'ÉCOUTER la liaison CAT de la radio n'entendra rien tant que l'envoi spontané n'est pas activé.",
'gen.groupDigital': 'Regrouper les modes digitaux en un seul (style DXCC)', 'gen.groupDigitalHint': '(badges de la matrice + cluster : FT8/FT4/RTTY… comptent comme un seul mode Digital ; décoché = chaque mode digital est un slot distinct)',
// Chiffrement des mots de passe
'gen.pwEnc': 'Chiffrement des mots de passe',
+2
View File
@@ -1520,6 +1520,7 @@ export namespace main {
transport: string;
host: string;
port: number;
password: string;
com_port: string;
baud: number;
freq_out: boolean;
@@ -1540,6 +1541,7 @@ export namespace main {
this.transport = source["transport"];
this.host = source["host"];
this.port = source["port"];
this.password = source["password"];
this.com_port = source["com_port"];
this.baud = source["baud"];
this.freq_out = source["freq_out"];