feat: Yaesu panel — sideband on re-click, split readout, one-touch up 1/up 5

Three corrections from the operator's second pass.

The sideband gesture was wrong: I used double-click, which hides the action.
Clicking a button that is ALREADY active now flips its sideband — CW-U → CW-L →
CW-U. One button, one finger, nothing to discover.

A lit SPLIT chip does not tell an operator anything useful: it says split is on,
not where they transmit. The header now shows the TX frequency and the offset in
kHz whenever split is active.

And the offset that matters is set in one action: up 1 kHz on CW, up 5 kHz on
phone. Doing it by hand means swapping VFOs, retuning and swapping back — exactly
the fumbling a panel exists to remove. Both are offered rather than picked from
the mode, because which one is idiomatic is the operator's call, and the button
turns split on at the same time.

The offset is measured from the RECEIVE frequency and written to the VFO we are
not listening on, so it stays correct when the operator works on VFO B, where the
roles are mirrored.
This commit is contained in:
2026-07-29 11:46:54 +02:00
parent df4155108f
commit 7153768579
9 changed files with 115 additions and 17 deletions
+6
View File
@@ -14985,3 +14985,9 @@ func (a *App) yaesuDo(fn func(cat.YaesuController) error) error {
func (a *App) SetYaesuModeRaw(mode string) error {
return a.yaesuDo(func(y cat.YaesuController) error { return y.SetYaesuModeRaw(mode) })
}
// SetYaesuSplitOffset turns split on with the TX VFO a fixed distance up — the
// classic "listen down, transmit up 5" of a phone pile-up, or up 1 on CW.
func (a *App) SetYaesuSplitOffset(offsetHz int64) error {
return a.yaesuDo(func(y cat.YaesuController) error { return y.SetYaesuSplitOffset(offsetHz) })
}
+2 -2
View File
@@ -3,7 +3,7 @@
"version": "0.21.9",
"date": "2026-07-28",
"en": [
"Yaesu control panel: with the native Yaesu backend, a console tab and Main-view pane give S/PO/SWR meters, band and mode buttons, AF/RF/squelch, AGC, IPO-AMP1-AMP2, a 6/12/18 dB attenuator, NB, DNR, narrow filter, power, mic gain, VOX, split and ATU tune. CW, RTTY, DIGI and PSK show their sideband — double-click a button to switch it.",
"Yaesu control panel: with the native Yaesu backend, a console tab and Main-view pane give S/PO/SWR meters, band and mode buttons, AF/RF/squelch, AGC, IPO-AMP1-AMP2, a 6/12/18 dB attenuator, NB, DNR, narrow filter, power, mic gain, VOX, split and ATU tune. CW, RTTY, DIGI and PSK show their sideband — click an active button again to switch it. Split shows where you transmit, with one-touch up 1 kHz (CW) and up 5 kHz (phone).",
"Native Xiegu CAT (G90, X6100, X6200, X5105): a new backend talks CI-V straight to the radio — frequency, mode, split and PTT. Pick \"Xiegu (native CI-V)\" in Settings → CAT. Untested on a radio so far, feedback welcome.",
"CAT sharing: OpsLog can now serve its rig connection to other programs (Settings → CAT → Share CAT). WSJT-X, JTDX, MSHV or Log4OM connect with rig model \"Hamlib NET rigctl\" at 127.0.0.1:4532 — needed because a native CAT backend holds the radio serial port on its own. Works with every backend, and with both Hamlib command dialects (JTDX names the VFO, MSHV does not).",
"Native Yaesu CAT: a new backend talks to an FTDX10/FTDX101 directly over its serial port, without OmniRig — frequency, mode, VFO A/B, split and PTT. Pick \"Yaesu (native CAT)\" in Settings → CAT. First release, feedback welcome.",
@@ -16,7 +16,7 @@
"CQ and ITU zones you correct by hand in your profile stay corrected. They are derived from cty.dat, which gives the zones of the whole entity — in a country spanning several, the automatic value is wrong and it came back at every restart. They now only fill in when empty, and recompute when the callsign or grid changes."
],
"fr": [
"Panneau de contrôle Yaesu : avec le backend Yaesu natif, un onglet console et un volet de la vue principale offrent les mesures S/PO/ROS, les boutons de bande et de mode, AF/RF/squelch, AGC, IPO-AMP1-AMP2, un atténuateur 6/12/18 dB, NB, DNR, filtre étroit, puissance, gain micro, VOX, split et accord d'antenne. CW, RTTY, DIGI et PSK affichent leur bande latérale — double-cliquez pour en changer.",
"Panneau de contrôle Yaesu : avec le backend Yaesu natif, un onglet console et un volet de la vue principale offrent les mesures S/PO/ROS, les boutons de bande et de mode, AF/RF/squelch, AGC, IPO-AMP1-AMP2, un atténuateur 6/12/18 dB, NB, DNR, filtre étroit, puissance, gain micro, VOX, split et accord d'antenne. CW, RTTY, DIGI et PSK affichent leur bande latérale — recliquez sur le bouton actif pour en changer. Le split indique où vous émettez, avec +1 kHz (CW) et +5 kHz (phonie) en un geste.",
"CAT Xiegu natif (G90, X6100, X6200, X5105) : un nouveau backend dialogue en CI-V directement avec la radio — fréquence, mode, split et PTT. À choisir dans Réglages → CAT sous « Xiegu (CI-V natif) ». Pas encore testé sur une radio, retours bienvenus.",
"Partage du CAT : OpsLog peut désormais servir sa liaison radio aux autres logiciels (Réglages → CAT → Partager le CAT). WSJT-X, JTDX, MSHV ou Log4OM s'y connectent avec le modèle « Hamlib NET rigctl » sur 127.0.0.1:4532 — nécessaire car un backend CAT natif occupe seul le port série. Fonctionne avec tous les backends, et avec les deux dialectes Hamlib (JTDX nomme le VFO, MSHV non).",
"CAT Yaesu natif : un nouveau backend dialogue directement avec un FTDX10/FTDX101 par son port série, sans OmniRig — fréquence, mode, VFO A/B, split et PTT. À choisir dans Réglages → CAT sous « Yaesu (CAT natif) ». Première version, retours bienvenus.",
+28 -6
View File
@@ -5,7 +5,7 @@ import {
SetYaesuPower, SetYaesuMicGain, SetYaesuAFGain, SetYaesuRFGain, SetYaesuSquelch,
SetYaesuAGC, SetYaesuPreamp, SetYaesuAtt, SetYaesuNB, SetYaesuNR, SetYaesuNRLevel,
SetYaesuNarrow, SetYaesuVOX, SetYaesuSplit, SetYaesuBand, TuneYaesuATU,
SetYaesuModeRaw, GetCATState,
SetYaesuModeRaw, SetYaesuSplitOffset, GetCATState,
} from '../../wailsjs/go/main/App';
import { cn } from '@/lib/utils';
import { useI18n } from '@/lib/i18n';
@@ -18,6 +18,7 @@ type YaesuState = {
rf_power: number; mic_gain: number; af_gain: number; rf_gain: number; squelch: number;
agc?: string; preamp: number; att: number;
nb: boolean; nr: boolean; nr_level: number; narrow: boolean; vox: boolean;
split_tx_hz?: number;
};
const ZERO: YaesuState = {
@@ -33,9 +34,10 @@ const ZERO: YaesuState = {
const BANDS = ['160m', '80m', '40m', '30m', '20m', '17m', '15m', '12m', '10m', '6m'];
// Mode buttons. CW, RTTY, DIGI and PSK exist on BOTH sidebands on a Yaesu and
// the operator is the one who knows which they want, so each carries its
// current sideband and DOUBLE-CLICK flips it. SSB picks its sideband from the
// frequency, as the band plan dictates, and AM/FM have none.
// the operator is the one who knows which they want, so each shows its sideband
// and CLICKING AN ACTIVE BUTTON AGAIN flips it: CW-U → CW-L → CW-U. One button,
// one finger, no hidden gesture. SSB takes its sideband from the frequency, as
// the band plan dictates, and AM/FM have none.
//
// PSK rides on the rig's DATA mode, like the other digital modes — the button
// exists because the operator thinks in modes, not in what the radio calls them.
@@ -294,12 +296,27 @@ export function YaesuPanel({ onReportRST }: { onReportRST?: (rst: string) => voi
<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>
{view.split && (
<div className="text-[11px] font-mono tabular-nums text-warning">
{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)' : ''}
</div>
)}
</div>
<div className="flex items-center gap-2">
{st.transmitting && (
<span className="px-2 py-1 rounded-md text-[11px] font-bold bg-destructive text-destructive-foreground">TX</span>
)}
<Chip on={view.split} onClick={() => push('split', !view.split, () => SetYaesuSplit(!view.split))} label="SPLIT" />
{/* The usual pile-up offsets. Which one is idiomatic depends on the
mode — up 5 on phone, up 1 on CW — so both are offered rather than
guessed, and each turns split on in the same action. */}
<button type="button" onClick={() => SetYaesuSplitOffset(1000).catch((e) => setErr(String(e?.message ?? e)))}
title={t('yaesu.splitUpHint')}
className="px-2 py-1 rounded-md text-[11px] font-bold border border-border bg-card text-muted-foreground hover:bg-muted">+1k</button>
<button type="button" onClick={() => SetYaesuSplitOffset(5000).catch((e) => setErr(String(e?.message ?? e)))}
title={t('yaesu.splitUpHint')}
className="px-2 py-1 rounded-md text-[11px] font-bold border border-border bg-card text-muted-foreground hover:bg-muted">+5k</button>
<button type="button" onClick={() => TuneYaesuATU().catch((e) => setErr(String(e?.message ?? e)))}
title={t('yaesu.tuneHint')}
className="px-2 py-1 rounded-md text-[11px] font-bold border border-border bg-card text-muted-foreground hover:bg-muted">
@@ -342,8 +359,13 @@ export function YaesuPanel({ onReportRST }: { onReportRST?: (rst: string) => voi
const flip: 'U' | 'L' = side === 'U' ? 'L' : 'U';
return (
<button key={m.id} type="button"
onClick={() => { if (m.id === 'SSB') { SetYaesuModeRaw(freqHz > 0 && freqHz < 10_000_000 ? 'LSB' : 'USB').catch((e) => setErr(String(e?.message ?? e))); } else { SetYaesuModeRaw(m.rig(side)).catch((e) => setErr(String(e?.message ?? e))); } }}
onDoubleClick={() => { if (m.sideband) SetYaesuModeRaw(m.rig(flip)).catch((e) => setErr(String(e?.message ?? e))); }}
onClick={() => {
// Already on this mode → the click means "the other sideband".
const target = m.id === 'SSB'
? (freqHz > 0 && freqHz < 10_000_000 ? 'LSB' : 'USB')
: m.rig(on && m.sideband ? flip : side);
SetYaesuModeRaw(target).catch((e) => setErr(String(e?.message ?? e)));
}}
title={m.sideband ? t('yaesu.sidebandHint') : undefined}
className={cn('px-2 py-1 rounded-md text-[11px] font-bold border transition-colors',
on ? 'bg-primary border-primary text-primary-foreground' : 'bg-card text-muted-foreground border-border hover:bg-muted')}>
+2 -2
View File
@@ -106,7 +106,7 @@ const en: Dict = {
'settings.pane.map1': 'Map — great-circle + beam', 'settings.pane.map2': 'Map — locator (street)',
'settings.pane.cluster': 'Cluster spots', 'settings.pane.worked': 'Worked before',
'settings.pane.recent': 'Recent QSOs', 'settings.pane.netcontrol': 'Net control',
'settings.pane.flex': 'FlexRadio controls', 'settings.pane.icom': 'Icom console', 'settings.pane.yaesu': 'Yaesu console', 'yaesu.notConnected': 'Yaesu CAT not connected', 'yaesu.meters': 'Meters', 'yaesu.bandMode': 'Band & mode', 'yaesu.receive': 'Receive', 'yaesu.noiseFilter': 'Noise & filter', 'yaesu.transmit': 'Transmit', 'yaesu.refresh': 'Refresh', 'yaesu.tuneHint': 'Start an antenna-tuner cycle', 'yaesu.sToRst': 'Click to fill the RST sent', 'yaesu.sidebandHint': 'Click to select this mode, double-click to switch sideband (U/L)',
'settings.pane.flex': 'FlexRadio controls', 'settings.pane.icom': 'Icom console', 'settings.pane.yaesu': 'Yaesu console', 'yaesu.notConnected': 'Yaesu CAT not connected', 'yaesu.meters': 'Meters', 'yaesu.bandMode': 'Band & mode', 'yaesu.receive': 'Receive', 'yaesu.noiseFilter': 'Noise & filter', 'yaesu.transmit': 'Transmit', 'yaesu.refresh': 'Refresh', 'yaesu.tuneHint': 'Start an antenna-tuner cycle', 'yaesu.sToRst': 'Click to fill the RST sent', 'yaesu.sidebandHint': 'Click to select this mode; click again to switch sideband (U/L)', 'yaesu.splitUpHint': 'Transmit this far above the receive frequency, and turn split on', 'yaesu.txOn': 'TX',
'theme.auto': 'Auto (system)', 'theme.light-warm': 'Warm light', 'theme.light-cool': 'Cool light',
'theme.light-sage': 'Sage light', 'theme.dim-slate': 'Dim slate', 'theme.dark-warm': 'Warm dark',
'theme.dark-graphite': 'Graphite dark', 'theme.high-contrast': 'High contrast',
@@ -518,7 +518,7 @@ const fr: Dict = {
'settings.pane.map1': 'Carte — orthodromie + faisceau', 'settings.pane.map2': 'Carte — locator (rue)',
'settings.pane.cluster': 'Spots cluster', 'settings.pane.worked': 'Déjà contactés',
'settings.pane.recent': 'QSO récents', 'settings.pane.netcontrol': 'Gestion de net',
'settings.pane.flex': 'Contrôles FlexRadio', 'settings.pane.icom': 'Console Icom', 'settings.pane.yaesu': 'Console Yaesu', 'yaesu.notConnected': 'CAT Yaesu non connecté', 'yaesu.meters': 'Mesures', 'yaesu.bandMode': 'Bande et mode', 'yaesu.receive': 'Réception', 'yaesu.noiseFilter': 'Bruit et filtre', 'yaesu.transmit': 'Émission', 'yaesu.refresh': 'Actualiser', 'yaesu.tuneHint': "Lancer un cycle d'accord d'antenne", 'yaesu.sToRst': 'Cliquer pour remplir le RST envoyé', 'yaesu.sidebandHint': 'Cliquer pour choisir ce mode, double-cliquer pour changer de bande latérale (U/L)',
'settings.pane.flex': 'Contrôles FlexRadio', 'settings.pane.icom': 'Console Icom', 'settings.pane.yaesu': 'Console Yaesu', 'yaesu.notConnected': 'CAT Yaesu non connecté', 'yaesu.meters': 'Mesures', 'yaesu.bandMode': 'Bande et mode', 'yaesu.receive': 'Réception', 'yaesu.noiseFilter': 'Bruit et filtre', 'yaesu.transmit': 'Émission', 'yaesu.refresh': 'Actualiser', 'yaesu.tuneHint': "Lancer un cycle d'accord d'antenne", 'yaesu.sToRst': 'Cliquer pour remplir le RST envoyé', 'yaesu.sidebandHint': 'Cliquer pour choisir ce mode ; recliquer pour changer de bande latérale (U/L)', 'yaesu.splitUpHint': "Émettre à cette distance au-dessus de la fréquence de réception, et activer le split", 'yaesu.txOn': 'TX',
'theme.auto': 'Auto (système)', 'theme.light-warm': 'Clair chaud', 'theme.light-cool': 'Clair froid',
'theme.light-sage': 'Clair sauge', 'theme.dim-slate': 'Ardoise tamisé', 'theme.dark-warm': 'Sombre chaud',
'theme.dark-graphite': 'Sombre graphite', 'theme.high-contrast': 'Contraste élevé',
+2
View File
@@ -943,6 +943,8 @@ export function SetYaesuRFGain(arg1:number):Promise<void>;
export function SetYaesuSplit(arg1:boolean):Promise<void>;
export function SetYaesuSplitOffset(arg1:number):Promise<void>;
export function SetYaesuSquelch(arg1:number):Promise<void>;
export function SetYaesuVOX(arg1:boolean):Promise<void>;
+4
View File
@@ -1834,6 +1834,10 @@ export function SetYaesuSplit(arg1) {
return window['go']['main']['App']['SetYaesuSplit'](arg1);
}
export function SetYaesuSplitOffset(arg1) {
return window['go']['main']['App']['SetYaesuSplitOffset'](arg1);
}
export function SetYaesuSquelch(arg1) {
return window['go']['main']['App']['SetYaesuSquelch'](arg1);
}
+2
View File
@@ -1081,6 +1081,7 @@ export namespace cat {
raw_mode?: string;
transmitting: boolean;
split: boolean;
split_tx_hz: number;
s_meter: number;
power_meter: number;
swr_meter: number;
@@ -1110,6 +1111,7 @@ export namespace cat {
this.raw_mode = source["raw_mode"];
this.transmitting = source["transmitting"];
this.split = source["split"];
this.split_tx_hz = source["split_tx_hz"];
this.s_meter = source["s_meter"];
this.power_meter = source["power_meter"];
this.swr_meter = source["swr_meter"];
+12 -3
View File
@@ -93,8 +93,9 @@ type Yaesu struct {
// off rather than invented.
splitCmd string
curFreq int64
curVFO string // "A" or "B"
curFreq int64
curRXFreq int64
curVFO string // "A" or "B"
// Control-panel state and its slow-beat counter — see yaesu_panel.go.
panel YaesuTXState
@@ -210,6 +211,12 @@ func (y *Yaesu) ReadState() (RigState, error) {
s.Vfo = vfo
s.FreqHz, s.RxFreqHz, s.Split = resolveYaesuVFOs(freqA, freqB, vfo, split)
y.curFreq = s.FreqHz
// The frequency being LISTENED to, which is what a split offset is measured
// from — under split that is RxFreqHz, not FreqHz.
y.curRXFreq = s.FreqHz
if s.Split && s.RxFreqHz > 0 {
y.curRXFreq = s.RxFreqHz
}
if r, err := y.ask("MD0;"); err == nil && len(r) >= 4 {
// Keep the RAW mode too: ADIF folds CW-U/CW-L and DATA-U/DATA-L together,
@@ -224,7 +231,9 @@ func (y *Yaesu) ReadState() (RigState, error) {
debugLog.Printf("yaesu: unknown mode reply %q", r)
}
}
y.readPanel(s.Mode, s.Split)
// s.FreqHz is the TX frequency by the ADIF convention, so it IS the split
// transmit frequency when split is on.
y.readPanel(s.Mode, s.Split, s.FreqHz)
return s, nil
}
+57 -4
View File
@@ -34,9 +34,13 @@ type YaesuTXState struct {
Transmitting bool `json:"transmitting"`
Split bool `json:"split"`
SMeter int `json:"s_meter"` // 0-100 (raw 0-255)
PowerMeter int `json:"power_meter"` // 0-100, TX only
SWRMeter int `json:"swr_meter"` // 0-100, TX only
// SplitTXHz is where the rig will TRANSMIT while split — the panel showed a
// lit SPLIT button and nothing else, which does not tell an operator whether
// they are up 1 or up 5.
SplitTXHz int64 `json:"split_tx_hz"`
SMeter int `json:"s_meter"` // 0-100 (raw 0-255)
PowerMeter int `json:"power_meter"` // 0-100, TX only
SWRMeter int `json:"swr_meter"` // 0-100, TX only
RFPower int `json:"rf_power"` // watts
MicGain int `json:"mic_gain"` // 0-100
@@ -72,6 +76,7 @@ type YaesuController interface {
SetYaesuNarrow(bool) error
SetYaesuVOX(bool) error
SetYaesuSplit(bool) error
SetYaesuSplitOffset(int64) error
SetYaesuBand(string) error
SetYaesuModeRaw(string) error
TuneYaesuATU() error
@@ -88,9 +93,13 @@ func (y *Yaesu) YaesuState() YaesuTXState {
// readPanel refreshes the meters, and the settings on the slower beat. Called
// from ReadState with the mutex HELD, so it shares the same serialised link.
func (y *Yaesu) readPanel(mode string, split bool) {
func (y *Yaesu) readPanel(mode string, split bool, txHz int64) {
y.panel.Mode = mode
y.panel.Split = split
y.panel.SplitTXHz = 0
if split {
y.panel.SplitTXHz = txHz
}
// TX state first: which meters mean anything depends on it, and a power
// reading shown while receiving is how a panel lies.
@@ -485,3 +494,47 @@ func yaesuRawModeName(d byte) string {
}
return ""
}
// SetYaesuSplitOffset puts the transmit VFO a fixed distance above the receive
// one and turns split on, in a single action.
//
// This is the split an operator actually uses when working a pile-up: listen on
// the DX, transmit up 5 kHz on phone or up 1 kHz on CW. Doing it by hand means
// swapping VFOs, retuning and swapping back, which is exactly the fumbling a
// panel should remove.
//
// The offset is applied to the RECEIVE frequency and written to the OTHER VFO —
// whichever that is. On VFO B the roles are mirrored, so listening on B writes A.
func (y *Yaesu) SetYaesuSplitOffset(offsetHz int64) error {
y.mu.Lock()
defer y.mu.Unlock()
if y.port == nil {
return fmt.Errorf("yaesu: not connected")
}
rx := y.curRXFreq
if rx <= 0 {
return fmt.Errorf("yaesu: no receive frequency read yet")
}
tx := rx + offsetHz
if tx <= 0 || tx > 999_999_999 {
return fmt.Errorf("yaesu: split frequency %d out of the CAT range", tx)
}
// Write the VFO we are NOT listening on.
cmd := "FB"
if y.curVFO == "B" {
cmd = "FA"
}
if err := y.write(fmt.Sprintf("%s%09d;", cmd, tx)); err != nil {
return err
}
if y.splitCmd == "" {
return fmt.Errorf("yaesu: this rig answered neither ST; nor FT; — split cannot be set")
}
time.Sleep(30 * time.Millisecond)
if err := y.write(fmt.Sprintf("%s1;", y.splitCmd)); err != nil {
return err
}
y.panel.Split = true
y.panel.SplitTXHz = tx
return nil
}