fix: OmniRig spot-click didn't QSY Yaesu/Kenwood rigs (FT-891)
Confirmed from an FT-891 CAT log: OpsLog tuned via OmniRig's SetSimplexMode, which returned OK on every spot click but never moved the VFO (readback stayed put), while SetMode on the same .ini worked — so the CAT link was healthy and only the frequency write was a no-op. SetSimplexMode was chosen because Icoms accept direct FreqA writes but don't move; Yaesu/Kenwood are the opposite. Now, for non-Icom rigs (or if SetSimplexMode errors), also write the VFO frequency property (FreqA/Freq) directly, which does move them. Icom keeps the SetSimplexMode-only path so the Main/Sub VFO isn't nudged by a direct write.
This commit is contained in:
+15
-4
@@ -267,12 +267,23 @@ func (o *OmniRig) SetFrequency(hz int64) error {
|
||||
// method (RX=TX=freq, simplex). It works on rigs — notably Icom (IC-9100) —
|
||||
// where direct FreqA/FreqB writes are accepted but never move the radio.
|
||||
// Clearing split is the right thing when tuning to a spot anyway.
|
||||
simplexOK := false
|
||||
if _, err := oleutil.CallMethod(o.rig, "SetSimplexMode", int32(hz32)); err == nil {
|
||||
simplexOK = true
|
||||
debugLog.Printf("OmniRig.SetFrequency: SetSimplexMode(%d) OK", hz32)
|
||||
} else {
|
||||
debugLog.Printf("OmniRig.SetFrequency: SetSimplexMode unavailable (%v) — using property writes", err)
|
||||
// Fallback: write the active VFO's property AND the generic Freq
|
||||
// (always — some .ini honour only one, and split here is often misread).
|
||||
debugLog.Printf("OmniRig.SetFrequency: SetSimplexMode unavailable (%v)", err)
|
||||
}
|
||||
|
||||
// On Yaesu / Kenwood (and anything non-Icom), SetSimplexMode frequently returns
|
||||
// OK but is a SILENT NO-OP — the rig never moves. Confirmed on an FT-891 over
|
||||
// OmniRig: every spot click logged "SetSimplexMode OK" yet FreqA stayed put,
|
||||
// while SetMode on the same .ini worked fine (so the CAT link is healthy).
|
||||
// Writing the VFO frequency PROPERTY directly DOES move them, so also do that
|
||||
// here. It is skipped on Icom, where the direct write is the unreliable one and
|
||||
// could nudge the wrong Main/Sub VFO — there SetSimplexMode is authoritative.
|
||||
isIcom := strings.HasPrefix(strings.ToUpper(strings.TrimSpace(rigType)), "IC")
|
||||
if !isIcom || !simplexOK {
|
||||
prop := "FreqA"
|
||||
switch vfo {
|
||||
case "B", "BB", "BA":
|
||||
@@ -287,7 +298,7 @@ func (o *OmniRig) SetFrequency(hz int64) error {
|
||||
okAny = true
|
||||
}
|
||||
}
|
||||
if !okAny {
|
||||
if !simplexOK && !okAny {
|
||||
return fmt.Errorf("OmniRig: no writable frequency property for this rig")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user