fix: CW speed drove the wrong keyer; survey the meters to find the SWR one
Speed: with DTR/RTS line keying the PC does the timing, so the Yaesu console's slider — which sets the rig's internal keyer — changed nothing audible and looked broken. Both entry points now go through one handler that drives the engine actually sending, and additionally sets the rig's own keyer whenever a Yaesu is on CAT, so the radio's front panel shows the same figure. SWR: an operator reads 80 on the bar with a real SWR of 1.1. That is the shape of reading the WRONG METER — ALC, say — not of a scaling error, and which RM index carries which meter is not consistent across the family. Rather than guess again and move the wrong number somewhere else, the first transmission now logs RM1 through RM6 raw, once. The log will say which index is which on this radio, and the mapping can then be corrected as a fact.
This commit is contained in:
+25
-9
@@ -503,6 +503,9 @@ export default function App() {
|
||||
|
||||
// CAT — receives live rig state via Wails events.
|
||||
const [catState, setCatState] = useState<CATState>({ enabled: false, connected: false } as any);
|
||||
// Live copy for callbacks that must not close over a stale snapshot.
|
||||
const catStateRef = useRef(catState);
|
||||
useEffect(() => { catStateRef.current = catState; }, [catState]);
|
||||
// Configured CAT backend ('icom' USB vs 'icom-net'): the live catState.backend
|
||||
// is "icom" for BOTH, so we track the settings value to tell them apart (used to
|
||||
// hide the rig ON/OFF buttons on USB, where the interface is unpowered when the
|
||||
@@ -966,6 +969,25 @@ export default function App() {
|
||||
// auto-call and <LOGQSO> are shared; only the transport differs.
|
||||
const [wkEngine, setWkEngine] = useState<string>('winkeyer');
|
||||
const cwSource: 'winkeyer' | 'icom' | 'flex' | 'yaesu' = wkEngine === 'icom' ? 'icom' : wkEngine === 'flex' ? 'flex' : wkEngine === 'yaesu' ? 'yaesu' : 'winkeyer';
|
||||
// Setting the CW speed has to reach the keyer that is ACTUALLY sending, and
|
||||
// both the CW panel and the Yaesu console can ask for it. With DTR/RTS line
|
||||
// keying the PC does the timing, so the rig's internal keyer speed changes
|
||||
// nothing audible — the Yaesu console's slider looked broken because it drove
|
||||
// that one alone. It now drives both: the rig's keyer for its own front panel,
|
||||
// and the engine doing the work.
|
||||
const setCWSpeedEverywhere = useCallback((w: number) => {
|
||||
setWkWpm(w); saveWk({ wpm: w });
|
||||
const src = cwSourceRef.current;
|
||||
if (src === 'icom') IcomSetKeySpeed(w).catch(() => {});
|
||||
else if (src === 'flex') FlexSetKeySpeed(w).catch(() => {});
|
||||
else if (src === 'yaesu') SetYaesuKeySpeed(w).catch(() => {});
|
||||
else WinkeyerSetSpeed(w).catch(() => {});
|
||||
// The rig's own keyer follows too whenever a Yaesu is on CAT, even when it is
|
||||
// not the sending engine: its front panel and OpsLog then agree.
|
||||
if (src !== 'yaesu' && catStateRef.current?.backend === 'yaesu') {
|
||||
SetYaesuKeySpeed(w).catch(() => {});
|
||||
}
|
||||
}, []);
|
||||
const cwSourceRef = useRef(cwSource);
|
||||
useEffect(() => { cwSourceRef.current = cwSource; }, [cwSource]);
|
||||
// CW break-in (0=OFF, 1=SEMI, 2=FULL) — must be on for the rig's 0x17 keyer to
|
||||
@@ -4295,7 +4317,7 @@ export default function App() {
|
||||
case 'yaesu':
|
||||
return (
|
||||
<div className="h-full w-full min-h-0 rounded-lg overflow-hidden border border-border">
|
||||
<YaesuPanel onReportRST={(r) => { setRstSent(r); rstUserEditedRef.current = true; }} />
|
||||
<YaesuPanel onReportRST={(r) => { setRstSent(r); rstUserEditedRef.current = true; }} onKeySpeed={setCWSpeedEverywhere} />
|
||||
</div>
|
||||
);
|
||||
case 'icom':
|
||||
@@ -5245,13 +5267,7 @@ export default function App() {
|
||||
onRefreshPorts={reloadWkPorts}
|
||||
onConnect={() => WinkeyerConnect().catch((e) => setError(String(e?.message ?? e)))}
|
||||
onDisconnect={() => WinkeyerDisconnect().catch(() => {})}
|
||||
onSetSpeed={(w) => {
|
||||
setWkWpm(w); saveWk({ wpm: w });
|
||||
if (cwSource === 'icom') IcomSetKeySpeed(w).catch(() => {});
|
||||
else if (cwSource === 'flex') FlexSetKeySpeed(w).catch(() => {});
|
||||
else if (cwSource === 'yaesu') SetYaesuKeySpeed(w).catch(() => {});
|
||||
else WinkeyerSetSpeed(w).catch(() => {});
|
||||
}}
|
||||
onSetSpeed={setCWSpeedEverywhere}
|
||||
onSend={wkSend}
|
||||
onSendMacro={wkSendMacro}
|
||||
onStop={() => { stopAutoCall(); stopKeyerTx(); }}
|
||||
@@ -5813,7 +5829,7 @@ export default function App() {
|
||||
{/* Yaesu CAT control panel — only when the CAT backend is a Yaesu. */}
|
||||
{catState.backend === 'yaesu' && (
|
||||
<TabsContent value="yaesu" className="flex-1 min-h-0 p-0">
|
||||
<YaesuPanel onReportRST={(r) => { setRstSent(r); rstUserEditedRef.current = true; }} />
|
||||
<YaesuPanel onReportRST={(r) => { setRstSent(r); rstUserEditedRef.current = true; }} onKeySpeed={setCWSpeedEverywhere} />
|
||||
</TabsContent>
|
||||
)}
|
||||
|
||||
|
||||
@@ -223,7 +223,14 @@ function Row({ label, children }: { label: string; children: React.ReactNode })
|
||||
);
|
||||
}
|
||||
|
||||
export function YaesuPanel({ onReportRST }: { onReportRST?: (rst: string) => void }) {
|
||||
export function YaesuPanel({ onReportRST, onKeySpeed }: {
|
||||
onReportRST?: (rst: string) => void;
|
||||
// Told whenever the operator moves the CW speed here, so the app can keep the
|
||||
// keyer that is ACTUALLY sending in step. With DTR/RTS line keying the PC does
|
||||
// the timing and the rig's internal keyer speed changes nothing audible — the
|
||||
// slider looked broken because it was driving the wrong keyer.
|
||||
onKeySpeed?: (wpm: number) => void;
|
||||
}) {
|
||||
const { t } = useI18n();
|
||||
const [st, setSt] = useState<YaesuState>(ZERO);
|
||||
// The frequency being LISTENED to. RigState follows ADIF, where freq_hz is the
|
||||
@@ -465,7 +472,7 @@ export function YaesuPanel({ onReportRST }: { onReportRST?: (rst: string) => voi
|
||||
<Card icon={Radio} title={t('yaesu.cw')}>
|
||||
<Row label="SPEED">
|
||||
<Slider value={view.key_speed || 20} min={4} max={60} accent="var(--primary)"
|
||||
onChange={(v) => push('key_speed', v, () => SetYaesuKeySpeed(v))} />
|
||||
onChange={(v) => { push('key_speed', v, () => SetYaesuKeySpeed(v)); onKeySpeed?.(v); }} />
|
||||
<span className="w-12 text-right text-xs font-mono tabular-nums text-muted-foreground">{view.key_speed || 20} wpm</span>
|
||||
</Row>
|
||||
<div className="flex items-center gap-2 flex-wrap">
|
||||
|
||||
Reference in New Issue
Block a user