diff --git a/core/bandmap/bandmap.go b/core/bandmap/bandmap.go index a1c86e9..4039aa9 100644 --- a/core/bandmap/bandmap.go +++ b/core/bandmap/bandmap.go @@ -13,7 +13,7 @@ import ( const ( // DefaultUpdatePeriod: the bandmap is updated with this period - DefaultUpdatePeriod time.Duration = 1 * time.Second + DefaultUpdatePeriod time.Duration = 5 * time.Second // DefaultMaximumAge of entries in the bandmap // entries that were not seen within this period are removed from the bandmap DefaultMaximumAge time.Duration = 10 * time.Minute @@ -197,6 +197,10 @@ func (m *Bandmap) VFOFrequencyChanged(frequency core.Frequency) { func (m *Bandmap) VFOBandChanged(band core.Band) { m.do <- func() { + if band == m.activeBand { + return + } + if m.activeBand == m.visibleBand { m.visibleBand = band } @@ -207,6 +211,10 @@ func (m *Bandmap) VFOBandChanged(band core.Band) { func (m *Bandmap) VFOModeChanged(mode core.Mode) { m.do <- func() { + if m.activeMode == mode { + return + } + m.activeMode = mode m.update() } diff --git a/ui/spotsTableView.go b/ui/spotsTableView.go index 3385072..5b87198 100644 --- a/ui/spotsTableView.go +++ b/ui/spotsTableView.go @@ -3,7 +3,6 @@ package ui import ( "fmt" "log" - "math" "strings" "time" @@ -149,8 +148,8 @@ func (v *spotsView) fillEntryToTableRow(row *gtk.TreeIter, entry core.BandmapEnt spotColumnBackground, }, []any{ - formatSpotFrequency(entry.Frequency, entry.ProximityFactor(v.currentFrame.Frequency), entry.OnFrequency(v.currentFrame.Frequency)), - formatSpotCall(entry.Call, entry.ProximityFactor(v.currentFrame.Frequency), entry.OnFrequency(v.currentFrame.Frequency)), + formatSpotFrequency(entry.Frequency), + formatSpotCall(entry.Call), entry.Quality.Tag(), entry.Info.ExchangeText, formatPoints(entry.Info.Points, entry.Info.Duplicate, 1), @@ -165,24 +164,12 @@ func (v *spotsView) fillEntryToTableRow(row *gtk.TreeIter, entry core.BandmapEnt ) } -func formatSpotFrequency(frequency core.Frequency, proximity float64, onFrequency bool) string { - size := 100 + math.Abs(proximity)*30 - result := fmt.Sprintf("%.2f kHz", size, frequency/1000) - if onFrequency { - return fmt.Sprintf("%s", result) - } - - return result +func formatSpotFrequency(frequency core.Frequency) string { + return fmt.Sprintf("%.2f kHz", frequency/1000) } -func formatSpotCall(call callsign.Callsign, proximity float64, onFrequency bool) string { - size := 100 + math.Abs(proximity)*30 - result := fmt.Sprintf("%s", size, call) - if onFrequency { - return fmt.Sprintf("%s", result) - } - - return result +func formatSpotCall(call callsign.Callsign) string { + return call.String() } func formatPoints(value int, duplicate bool, threshold int) string { @@ -238,8 +225,8 @@ func (v *spotsView) updateHighlightedColumns(entry core.BandmapEntry) error { spotColumnWeightedValue, }, []any{ - formatSpotFrequency(entry.Frequency, entry.ProximityFactor(v.currentFrame.Frequency), entry.OnFrequency(v.currentFrame.Frequency)), - formatSpotCall(entry.Call, entry.ProximityFactor(v.currentFrame.Frequency), entry.OnFrequency(v.currentFrame.Frequency)), + formatSpotFrequency(entry.Frequency), + formatSpotCall(entry.Call), entry.Quality.Tag(), formatSpotAge(entry.LastHeard), fmt.Sprintf("%.1f", entry.Info.WeightedValue),