fix(cat): choosing a radio switches CAT on, and the log stops lying

A Flex 6700 owner's log: no connection attempt of any kind, and six
saves each answered with

    cat: settings saved, link unchanged - staying connected

His settings were right — FlexRadio selected, 192.168.1.154, port 4992,
and the detector had found and named his radio back at him. What was off
was the master CAT switch, which sits above the radio dropdown.

Three things, because each of them failed him on its own.

The log line was false on both counts: a disabled CAT has the signature
"off", so every save took the unchanged branch and announced a link that
was staying connected when nothing was connected at all. It now says CAT
is switched off, which is the fact he needed and the only place it could
have reached him.

The panel says it too, where he was actually looking: a notice under the
switch while it is off, because everything below it can be perfectly
right and still connect to nothing.

And choosing a radio now ticks the switch. Picking a brand, typing an
address, running a detector and clicking the radio it found are all one
gesture — "connect to this" — and making the operator find a separate
master switch afterwards is a trap. Nothing here ever turns CAT off on
its own; they can still untick it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
2026-09-08 18:52:19 +02:00
co-authored by Claude Opus 5
parent d185b10559
commit 6f1c998a26
4 changed files with 39 additions and 8 deletions
+15 -2
View File
@@ -16352,9 +16352,22 @@ func (a *App) reloadCAT() {
if s.Enabled && s.Backend == "omnirig" && a.cat != nil {
_ = a.cat.OmniRigDo(func(o cat.OmniRigController) error { o.SetCWLower(s.OmniRigCWLower); return nil })
}
// Nothing about the link changed → leave it connected. See catLinkSig.
// Nothing about the link changed → leave it as it is. See catLinkSig.
if sig := catLinkSig(s); sig == a.catSig {
applog.Printf("cat: settings saved, link unchanged — staying connected")
// Which is NOT the same as staying connected.
//
// A disabled CAT has the signature "off", so every save while the master
// switch is off took this branch and announced that the link was
// unchanged and connected — when nothing was connected at all. A Flex
// 6700 owner saved six times, with the right radio, the right address
// and the detector naming his radio back at him, and this line told him
// each time that all was well. It was the one line that could have said
// otherwise.
if !s.Enabled {
applog.Printf("cat: settings saved, but CAT is switched OFF — nothing will connect until you tick it in Settings ▸ CAT")
} else {
applog.Printf("cat: settings saved, link unchanged — staying connected")
}
return
} else {
a.catSig = sig