From 9cc72c75758dae39e9f681e3357b9c7ceb213b69 Mon Sep 17 00:00:00 2001 From: rouggy Date: Mon, 20 Jul 2026 10:11:10 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20OmniRig=20reads=20VFO=20A=20first=20(Fre?= =?UTF-8?q?qA=E2=86=92Freq=20fallback),=20fixing=20IC-7610=20CAT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 7610-only FreqA gate broke CAT on the 7610 when FreqA was momentarily 0. Match DXHunter/WSJT-X: read FreqA first for all rigs, fall back to the generic Freq (IC-9100 etc.), then FreqB. OmniRig's generic Freq maps to VFO B on the 7610, which is why keying off FreqA is correct. --- internal/cat/omnirig.go | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/internal/cat/omnirig.go b/internal/cat/omnirig.go index 3a457f9..00a55a8 100644 --- a/internal/cat/omnirig.go +++ b/internal/cat/omnirig.go @@ -87,14 +87,6 @@ func (o *OmniRig) Connect() error { return nil } -// isIC7610 reports whether the connected rig is an IC-7610. OmniRig's generic -// Freq property reads the wrong VFO on the 7610 (its Main/Sub model confuses the -// stock ini), so we read VFO A explicitly for it instead — matching what Log4OM -// shows. -func (o *OmniRig) isIC7610() bool { - return strings.Contains(strings.ToUpper(o.rigType), "7610") -} - func (o *OmniRig) Disconnect() { if o.rig != nil { o.rig.Release() @@ -204,23 +196,20 @@ func (o *OmniRig) ReadState() (RigState, error) { s.FreqHz, s.RxFreqHz = freqB, freqA } } else { - // Simplex: the operating frequency is OmniRig's generic Freq (the active - // VFO), like Log4OM. Fall back to the per-VFO value only if Freq is 0. + // Simplex: read VFO A first, fall back to the generic Freq — exactly like + // DXHunter/WSJT-X. PM_FREQA rigs (Yaesu, Kenwood) populate FreqA; some + // Icoms (IC-9100 etc.) only populate the generic Freq. On the IC-7610 + // OmniRig's generic Freq reports VFO B (its Main/Sub model confuses the + // stock ini), so keying off FreqA gives the operator the VFO they expect. s.Split = false s.RxFreqHz = 0 - s.FreqHz = freqMain - // IC-7610 quirk: OmniRig's generic Freq reports VFO B (its Main/Sub model - // confuses the stock ini), so OpsLog showed the wrong VFO. Read VFO A - // explicitly for the 7610 — what the operator actually wants to see. - if o.isIC7610() && freqA != 0 { + switch { + case freqA != 0: s.FreqHz = freqA - } - if s.FreqHz == 0 { - if s.Vfo == "B" || s.Vfo == "BB" { - s.FreqHz = freqB - } else { - s.FreqHz = freqA - } + case freqMain != 0: + s.FreqHz = freqMain + default: + s.FreqHz = freqB } } return s, nil