fix(bandopen): honour the operator's band selection

The chips in Settings only ever shaped the PSK Reporter SUBSCRIPTION. Neither
feed path checked them: both asked bandopen.Watched, which says which bands the
detector is capable of and knows nothing about the selection. So the cluster
path announced every watched band regardless, and widening the subscription to
"+" for grid chasing let PSK Reporter do the same — a station with only 6 m
ticked got 10 m and 2 m badges.

The selection is now cached beside the on/off flag and checked on both paths,
and unticking a band puts its badge out: badges fade on a timer fed by spots
the detector no longer looks at, so it would otherwise stay lit until a
restart.
This commit is contained in:
2026-08-12 17:25:16 +02:00
parent 7d33379fe1
commit 4f3c3edaee
4 changed files with 105 additions and 7 deletions
+3 -2
View File
@@ -20,9 +20,9 @@ import (
"hamlog/internal/applog"
"hamlog/internal/bandopen"
"hamlog/internal/cluster"
"hamlog/internal/geo"
"hamlog/internal/gridcache"
"hamlog/internal/cluster"
"hamlog/internal/pskr"
)
@@ -129,6 +129,7 @@ func (a *App) startBandOpenFeed() {
}
s := a.GetBandOpenSettings()
a.bandOpen.on.Store(s.Enabled)
a.setBandOpenBands(s.Bands)
if !s.Enabled {
// Put out whatever is currently lit. Leaving the badges up would keep
// announcing an opening from a watch that is now off, and they only fade
@@ -204,7 +205,7 @@ func (a *App) startBandOpenFeed() {
// so it does the least possible: the detector's own window and de-duplication
// by callsign are what turn that flood into one announcement.
func (a *App) feedBandOpen(s pskr.Spot) {
if !bandopen.Watched(s.Band) {
if !a.bandOpenWanted(s.Band) {
return
}
a.bandOpen.mu.Lock()