diff --git a/frontend/src/components/YaesuPanel.tsx b/frontend/src/components/YaesuPanel.tsx index 54865c6..d0f4c5b 100644 --- a/frontend/src/components/YaesuPanel.tsx +++ b/frontend/src/components/YaesuPanel.tsx @@ -226,7 +226,12 @@ function Row({ label, children }: { label: string; children: React.ReactNode }) export function YaesuPanel({ onReportRST }: { onReportRST?: (rst: string) => void }) { const { t } = useI18n(); const [st, setSt] = useState(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 [txHz, setTxHz] = useState(0); const [err, setErr] = useState(''); // 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(); if (!alive) return; 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 // the new value — 1.2 s covers the slow-beat settings read. if (Date.now() - localAtRef.current > 1200) setLocal({}); @@ -295,10 +304,10 @@ export function YaesuPanel({ onReportRST }: { onReportRST?: (rst: string) => voi
{st.model || 'Yaesu'}
{fmtVFO(freqHz)}
- {view.split && ( + {view.split && txHz > 0 && (
- {t('yaesu.txOn')} {fmtVFO(view.split_tx_hz)} - {view.split_tx_hz && freqHz ? ' (' + (view.split_tx_hz > freqHz ? '+' : '') + Math.round((view.split_tx_hz - freqHz) / 100) / 10 + ' kHz)' : ''} + {t('yaesu.txOn')} {fmtVFO(txHz)} + {freqHz > 0 ? ' (' + (txHz > freqHz ? '+' : '') + Math.round((txHz - freqHz) / 100) / 10 + ' kHz)' : ''}
)}