feat(relays): follow the entry Band selector when there is no CAT link

Relay automatic control and the band-change outbound rows both hang off the rig
state, which is right when there IS a rig: changing Band in the entry strip
pushes a QSY, the new state comes back through the CAT callback, and the relays
follow from there — which is why this works for anyone with rig control.

Without a CAT connection nothing is pushed and nothing comes back, so a station
whose rig OpsLog does not control changed band and the antenna switch sat
exactly where it was. Reported as automatic control not working; it was never
told the band had changed.

The entry selector now says so itself, but only when the CAT push did not
happen, and never when the band or frequency lock is on: a lock means the entry
is deliberately decoupled from the rig, and moving an antenna to match a contact
logged from last year is worse than doing nothing.

The frequency is passed as unknown on that path — a band selector gives a band
and nothing else, and rules written on a frequency RANGE are left alone rather
than evaluated against a made-up dial reading.

The de-duplication of "is this a new band" is now shared by both sources, so a
station that has both does not command its switch twice for one QSY.

Also: the same credit line as the QSL e-mail now closes the default recording
e-mail body, on the same terms — a default in the template, so a stored one is
untouched.
This commit is contained in:
2026-08-16 11:15:56 +02:00
parent c0dc1bfcc4
commit 423cf1f998
8 changed files with 131 additions and 16 deletions
+31
View File
@@ -203,3 +203,34 @@ func (a *App) applyRelayAuto(freqHz int64, band string) {
wruntime.EventsEmit(a.ctx, "station:relay_auto", nil) // nudge the Station Control UI to re-poll
}
}
// EntryBandChanged drives the band-following features from the QSO ENTRY band
// selector, for a station whose rig OpsLog does not control.
//
// Both of them — relay automatic control and the band-change outbound rows —
// hang off the rig state, and that is right when there IS a rig: changing Band
// in the entry strip pushes a QSY to it, the new state comes back through the
// CAT callback, and the relays follow from there. Without a CAT connection
// nothing is pushed and nothing comes back, so an operator with an antenna
// switch and no rig control changed band in OpsLog and watched the switch sit
// exactly where it was. Reported as automatic control not working; it was never
// told the band had changed.
//
// The frontend calls this ONLY when the CAT push did not happen, and never when
// the band or frequency lock is on — a lock means the entry is deliberately
// decoupled from the rig (logging an old contact off-frequency), and moving an
// antenna to match a QSO from last year is worse than doing nothing.
//
// The frequency is passed as unknown, deliberately: a band selector gives a
// band and nothing else, and rules written on a frequency RANGE must be left
// alone rather than evaluated against a made-up dial reading.
func (a *App) EntryBandChanged(band string) {
band = strings.TrimSpace(band)
if band == "" {
return
}
if a.relayAutoOn.Load() {
go a.applyRelayAuto(0, band)
}
a.emitBandChangeTrigger(band, "", 0)
}