chore: release v0.27.12
This commit is contained in:
+73
-13
@@ -17,6 +17,7 @@ import (
|
||||
const (
|
||||
keyWsjtHighlight = "udp.wsjt.highlight"
|
||||
keyWsjtFollowMode = "udp.wsjt.followmode" // spot clicks switch the decoder's mode
|
||||
keyWsjtHLWorked = "udp.wsjt.highlight_worked"
|
||||
)
|
||||
|
||||
// wsjtModes are the modes a Configure message can meaningfully ask for — the
|
||||
@@ -60,8 +61,55 @@ var (
|
||||
hlNewBand = udp.RGB{R: 226, G: 122, B: 24} // orange
|
||||
hlWhite = udp.RGB{R: 255, G: 255, B: 255}
|
||||
hlBlack = udp.RGB{R: 20, G: 20, B: 20}
|
||||
// Worked already, on this band and in this mode. Grey on purpose, and the
|
||||
// only DIM colour of the four: the others say "look at this", and this one
|
||||
// says the opposite — it has to recede, not compete with them.
|
||||
hlWorked = udp.RGB{R: 75, G: 85, B: 99}
|
||||
hlWorkedFg = udp.RGB{R: 203, G: 213, B: 225}
|
||||
)
|
||||
|
||||
// GetWsjtHighlightWorked reports whether stations already worked on this band
|
||||
// and mode are greyed out as well.
|
||||
//
|
||||
// Its own switch, and off by default. The other three verdicts pick out a
|
||||
// handful of decodes in a period; this one can match most of them on a
|
||||
// well-filled log, and a screen where nearly every line is coloured has stopped
|
||||
// saying anything. It is worth having only for an operator who wants the dupes
|
||||
// struck out rather than the catches picked out.
|
||||
func (a *App) GetWsjtHighlightWorked() bool {
|
||||
return a.settingOr(keyWsjtHLWorked, "0") == "1"
|
||||
}
|
||||
|
||||
// SetWsjtHighlightWorked flips it, and repaints.
|
||||
//
|
||||
// Turning it OFF has to clear what it painted: those callsigns keep their grey
|
||||
// in the decoder's window otherwise, and nothing would ever say another word
|
||||
// about them — the de-duplication remembers that they were already told.
|
||||
func (a *App) SetWsjtHighlightWorked(on bool) {
|
||||
v := "0"
|
||||
if on {
|
||||
v = "1"
|
||||
}
|
||||
a.setSetting(keyWsjtHLWorked, v)
|
||||
a.wsjtHLWorkedOn.Store(on)
|
||||
a.clearWsjtHighlights()
|
||||
applog.Printf("wsjt highlight: worked stations %v", on)
|
||||
}
|
||||
|
||||
// clearWsjtHighlights wipes every instruction OpsLog installed, in every
|
||||
// running decoder, and forgets what it had said.
|
||||
func (a *App) clearWsjtHighlights() {
|
||||
if a.udp == nil {
|
||||
return
|
||||
}
|
||||
for _, inst := range a.udp.Instances() {
|
||||
_ = a.udp.SendClearHighlights(inst)
|
||||
}
|
||||
a.wsjtHLMu.Lock()
|
||||
a.wsjtHLSent = map[string]string{}
|
||||
a.wsjtHLMu.Unlock()
|
||||
}
|
||||
|
||||
// GetWsjtHighlight reports whether decode highlighting is on.
|
||||
func (a *App) GetWsjtHighlight() bool {
|
||||
return a.settingOr(keyWsjtHighlight, "0") == "1"
|
||||
@@ -77,13 +125,8 @@ func (a *App) SetWsjtHighlight(on bool) {
|
||||
}
|
||||
a.setSetting(keyWsjtHighlight, v)
|
||||
a.wsjtHighlightOn.Store(on)
|
||||
if !on && a.udp != nil {
|
||||
for _, inst := range a.udp.Instances() {
|
||||
_ = a.udp.SendClearHighlights(inst)
|
||||
}
|
||||
a.wsjtHLMu.Lock()
|
||||
a.wsjtHLSent = map[string]string{}
|
||||
a.wsjtHLMu.Unlock()
|
||||
if !on {
|
||||
a.clearWsjtHighlights()
|
||||
applog.Printf("wsjt highlight: off — cleared in every instance")
|
||||
}
|
||||
}
|
||||
@@ -92,12 +135,14 @@ func (a *App) SetWsjtHighlight(on bool) {
|
||||
// it, when the option is on and the verdict is worth a colour. De-duplicated
|
||||
// per instance+call+verdict: a station CQing all evening is decoded four times
|
||||
// a minute, and the instruction only needs to be said once.
|
||||
func (a *App) maybeHighlightDecode(instance, call, band string) {
|
||||
func (a *App) maybeHighlightDecode(instance, call, band, mode string) {
|
||||
if !a.wsjtHighlightOn.Load() || a.udp == nil || call == "" || instance == "" {
|
||||
return
|
||||
}
|
||||
bg, fg, verdict := a.decodeHighlightVerdict(call, band)
|
||||
key := instance + "|" + strings.ToUpper(call) + "|" + band
|
||||
bg, fg, verdict := a.decodeHighlightVerdict(call, band, mode)
|
||||
// The MODE is part of the key: one receiver can be handed FT8 and FT4 in
|
||||
// the same session, and the verdict on a callsign is not the same in both.
|
||||
key := instance + "|" + strings.ToUpper(call) + "|" + band + "|" + strings.ToUpper(mode)
|
||||
a.wsjtHLMu.Lock()
|
||||
if a.wsjtHLSent == nil {
|
||||
a.wsjtHLSent = map[string]string{}
|
||||
@@ -124,9 +169,11 @@ func (a *App) maybeHighlightDecode(instance, call, band string) {
|
||||
}
|
||||
|
||||
// decodeHighlightVerdict ranks a callsign: watchlist beats new-DXCC beats
|
||||
// new-band; anything else is "no colour". The empty verdict doubles as the
|
||||
// clear signal in maybeHighlightDecode.
|
||||
func (a *App) decodeHighlightVerdict(call, band string) (bg, fg *udp.RGB, verdict string) {
|
||||
// new-band, and "already worked here" comes last of all — it is the only
|
||||
// verdict that says do NOT call, so anything worth calling for outranks it.
|
||||
// Anything else is "no colour", and the empty verdict doubles as the clear
|
||||
// signal in maybeHighlightDecode.
|
||||
func (a *App) decodeHighlightVerdict(call, band, mode string) (bg, fg *udp.RGB, verdict string) {
|
||||
if a.watchlist != nil {
|
||||
if _, ok := a.watchlist.Match(call); ok {
|
||||
c := hlWatchlist
|
||||
@@ -151,5 +198,18 @@ func (a *App) decodeHighlightVerdict(call, band string) (bg, fg *udp.RGB, verdic
|
||||
}
|
||||
}
|
||||
}
|
||||
// Worked already, this exact callsign on this band in this mode — a dupe,
|
||||
// judged by the same ledger and the same digital-mode grouping the cluster
|
||||
// uses, so the two windows cannot disagree about what "worked" means.
|
||||
if a.wsjtHLWorkedOn.Load() && band != "" && mode != "" {
|
||||
m := strings.ToUpper(strings.TrimSpace(mode))
|
||||
if c.normMode != nil {
|
||||
m = c.normMode(m)
|
||||
}
|
||||
if _, ok := c.workedCallSlots[strings.ToUpper(call)+"|"+strings.ToLower(band)+"|"+m]; ok {
|
||||
bgc, fgc := hlWorked, hlWorkedFg
|
||||
return &bgc, &fgc, "worked"
|
||||
}
|
||||
}
|
||||
return nil, nil, ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user