fix: OmniRig reads VFO A first (FreqA→Freq fallback), fixing IC-7610 CAT

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.
This commit is contained in:
2026-07-20 10:11:10 +02:00
parent 9e4f43f648
commit 9cc72c7575
+11 -22
View File
@@ -87,14 +87,6 @@ func (o *OmniRig) Connect() error {
return nil 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() { func (o *OmniRig) Disconnect() {
if o.rig != nil { if o.rig != nil {
o.rig.Release() o.rig.Release()
@@ -204,23 +196,20 @@ func (o *OmniRig) ReadState() (RigState, error) {
s.FreqHz, s.RxFreqHz = freqB, freqA s.FreqHz, s.RxFreqHz = freqB, freqA
} }
} else { } else {
// Simplex: the operating frequency is OmniRig's generic Freq (the active // Simplex: read VFO A first, fall back to the generic Freq — exactly like
// VFO), like Log4OM. Fall back to the per-VFO value only if Freq is 0. // 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.Split = false
s.RxFreqHz = 0 s.RxFreqHz = 0
s.FreqHz = freqMain switch {
// IC-7610 quirk: OmniRig's generic Freq reports VFO B (its Main/Sub model case freqA != 0:
// 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 {
s.FreqHz = freqA s.FreqHz = freqA
} case freqMain != 0:
if s.FreqHz == 0 { s.FreqHz = freqMain
if s.Vfo == "B" || s.Vfo == "BB" { default:
s.FreqHz = freqB s.FreqHz = freqB
} else {
s.FreqHz = freqA
}
} }
} }
return s, nil return s, nil