fix: recognise the microwave bands — 10 GHz resolved to no band at all
Reported on 3 cm. cat.BandFromHz stopped at 23 cm, so a 10 GHz frequency came back EMPTY — and an empty band is not cosmetic: the QSO is logged without one, counts in no award slot, and exports with no BAND field. The low end was short too (2190m / 630m / 560m). Four band tables had to be extended because four exist: the CAT one, the award plan in app.go, the cluster spot classifier, and the frontend's. Plus the places that LIST bands — the QSO editor and award-definition pickers (you could not set 3 cm by hand either), the statistics axis, and the award band ORDER, where a missing band sorts to the end instead of in frequency order. Ranges and names are ADIF 3.1.7, which is what an export has to carry. A test now pins one frequency per band across the Go tables and asserts they agree — that is what was missing, four hand-maintained copies with nothing checking them. It also pins that an out-of-band frequency stays empty rather than snapping to the nearest band, which would file a QSO under a band the operator never used.
This commit is contained in:
@@ -776,6 +776,14 @@ func stateUserEqual(a, b RigState) bool {
|
||||
func BandFromHz(hz int64) string {
|
||||
mhz := float64(hz) / 1_000_000
|
||||
switch {
|
||||
// LF / MF, below 160 m. An operator on 630 m had their band come back empty,
|
||||
// which then cost them the band on the QSO and in every award count.
|
||||
case mhz >= 0.1357 && mhz <= 0.1378:
|
||||
return "2190m"
|
||||
case mhz >= 0.472 && mhz <= 0.479:
|
||||
return "630m"
|
||||
case mhz >= 0.501 && mhz <= 0.504:
|
||||
return "560m"
|
||||
case mhz >= 1.8 && mhz <= 2.0:
|
||||
return "160m"
|
||||
case mhz >= 3.5 && mhz <= 4.0:
|
||||
@@ -810,6 +818,30 @@ func BandFromHz(hz int64) string {
|
||||
return "33cm"
|
||||
case mhz >= 1240.0 && mhz <= 1300.0:
|
||||
return "23cm"
|
||||
// Microwave. The table used to stop at 23 cm, so 10 GHz — a band people
|
||||
// actually work, and spot — resolved to an empty band: no band on the QSO, no
|
||||
// band-slot, nothing in the awards. Ranges and names are the ADIF 3.1.7 ones,
|
||||
// which is what an export has to carry.
|
||||
case mhz >= 2300.0 && mhz <= 2450.0:
|
||||
return "13cm"
|
||||
case mhz >= 3300.0 && mhz <= 3500.0:
|
||||
return "9cm"
|
||||
case mhz >= 5650.0 && mhz <= 5925.0:
|
||||
return "6cm"
|
||||
case mhz >= 10000.0 && mhz <= 10500.0:
|
||||
return "3cm"
|
||||
case mhz >= 24000.0 && mhz <= 24250.0:
|
||||
return "1.25cm"
|
||||
case mhz >= 47000.0 && mhz <= 47200.0:
|
||||
return "6mm"
|
||||
case mhz >= 75500.0 && mhz <= 81000.0:
|
||||
return "4mm"
|
||||
case mhz >= 119980.0 && mhz <= 123000.0:
|
||||
return "2.5mm"
|
||||
case mhz >= 134000.0 && mhz <= 149000.0:
|
||||
return "2mm"
|
||||
case mhz >= 241000.0 && mhz <= 250000.0:
|
||||
return "1mm"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user