fix: the Yaesu panel showed the TRANSMIT frequency as the main VFO under split

Confirmed on the FTDX10: receiving on 14.018.98 and pressing SPLIT put 14.019.98
in the big display with "TX 14.019.98 (0 kHz)" under it. The radio was right —
RX 14.018.98, TX 14.019.98, up 1 kHz on CW — the panel was not.

RigState follows the ADIF convention where freq_hz is the TRANSMIT frequency, so
under split it is the OTHER VFO. Taking it as the main display showed the
operator the frequency they transmit on, and then an offset of that frequency
against itself: zero.

The header now reads the listening frequency (freq_rx_hz when split, freq_hz
otherwise) and the TX line shows the real transmit frequency and offset.
This commit is contained in:
2026-07-29 12:19:49 +02:00
parent c9218310ae
commit 520d17810c
+13 -4
View File
@@ -226,7 +226,12 @@ function Row({ label, children }: { label: string; children: React.ReactNode })
export function YaesuPanel({ onReportRST }: { onReportRST?: (rst: string) => void }) { export function YaesuPanel({ onReportRST }: { onReportRST?: (rst: string) => void }) {
const { t } = useI18n(); const { t } = useI18n();
const [st, setSt] = useState<YaesuState>(ZERO); const [st, setSt] = useState<YaesuState>(ZERO);
// The frequency being LISTENED to. RigState follows ADIF, where freq_hz is the
// TRANSMIT frequency — under split that is the other VFO, so taking it as the
// main display showed the operator the frequency they transmit on and an
// offset of 0 kHz against itself.
const [freqHz, setFreqHz] = useState(0); const [freqHz, setFreqHz] = useState(0);
const [txHz, setTxHz] = useState(0);
const [err, setErr] = useState(''); const [err, setErr] = useState('');
// Optimistic local values for the sliders. Without them a drag fights the // Optimistic local values for the sliders. Without them a drag fights the
@@ -242,7 +247,11 @@ export function YaesuPanel({ onReportRST }: { onReportRST?: (rst: string) => voi
const c = await GetCATState(); const c = await GetCATState();
if (!alive) return; if (!alive) return;
setSt(s); setSt(s);
setFreqHz((c as any)?.freq_hz ?? 0); const cs = c as any;
const tx = cs?.freq_hz ?? 0;
const rx = cs?.split && cs?.freq_rx_hz > 0 ? cs.freq_rx_hz : tx;
setFreqHz(rx);
setTxHz(tx);
// Drop the optimistic overlay once the rig has had time to answer with // Drop the optimistic overlay once the rig has had time to answer with
// the new value — 1.2 s covers the slow-beat settings read. // the new value — 1.2 s covers the slow-beat settings read.
if (Date.now() - localAtRef.current > 1200) setLocal({}); if (Date.now() - localAtRef.current > 1200) setLocal({});
@@ -295,10 +304,10 @@ export function YaesuPanel({ onReportRST }: { onReportRST?: (rst: string) => voi
<div> <div>
<div className="text-[10px] font-bold uppercase tracking-wider text-muted-foreground">{st.model || 'Yaesu'}</div> <div className="text-[10px] font-bold uppercase tracking-wider text-muted-foreground">{st.model || 'Yaesu'}</div>
<div className="text-2xl font-mono tabular-nums font-bold">{fmtVFO(freqHz)}</div> <div className="text-2xl font-mono tabular-nums font-bold">{fmtVFO(freqHz)}</div>
{view.split && ( {view.split && txHz > 0 && (
<div className="text-[11px] font-mono tabular-nums text-warning"> <div className="text-[11px] font-mono tabular-nums text-warning">
{t('yaesu.txOn')} {fmtVFO(view.split_tx_hz)} {t('yaesu.txOn')} {fmtVFO(txHz)}
{view.split_tx_hz && freqHz ? ' (' + (view.split_tx_hz > freqHz ? '+' : '') + Math.round((view.split_tx_hz - freqHz) / 100) / 10 + ' kHz)' : ''} {freqHz > 0 ? ' (' + (txHz > freqHz ? '+' : '') + Math.round((txHz - freqHz) / 100) / 10 + ' kHz)' : ''}
</div> </div>
)} )}
</div> </div>