fix(sat): the per-band antennas reach the satellite slices
Settings ▸ FlexRadio stores the band→antenna map keyed by the band name
in capitals — that is what the panel writes and what the entry form reads
back. applySatRadio looked its two bands up through bandForHz, which
returns the band plan's own spelling ("70cm"), so both lookups missed,
both antennas came back empty, and the early return left the pass on
whichever antenna the radio was last used on. An operator with XVTA on
2 m and XVTB on 70 cm had configured exactly the thing being ignored, and
nothing said so: the downlink ran through the wrong transverter in
silence.
The key is now computed by flexBandAntKey, which exists so the next
caller cannot make the same mistake, and a test pins the case in the
direction that broke. Both outcomes are logged — the resolved antennas,
or the bands nothing was configured for — because from the outside a
setting never made and a lookup that missed look identical.
Alongside, three things the same pass made obvious:
- Tracking shows the satellite's own azimuth, elevation, distance and
altitude beside the frequencies. The strip held where the ANTENNA was
pointing but not where the bird was, which is what says whether a pass
is worth calling on. Elevation dims below the horizon so a satellite
followed before its lever cannot be read as workable.
- Both satellite lists in the settings are sorted by name with the
numbers taken as numbers. The available column followed the order
birds.json happens to be written in and the followed column the order
of the clicks, so finding one bird among sixteen meant reading all
sixteen.
- A followed satellite that has since been renamed is resolved through
the plan's aliases. LILACSAT-2 became LO-90, and the followed list is
stored as plain text, so the bird the operator had chosen appeared as
having no elements while the same satellite sat in the available
column under its new name. Resolved in GetSatSettings rather than
satSettings, which is read at startup before the plan is loaded.
This commit is contained in:
@@ -135,3 +135,26 @@ func TestSatSidebands(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The per-band antenna map is keyed by the UPPERCASED band name, because that
|
||||
// is what the settings panel writes. The satellite tracker looked its two bands
|
||||
// up with the band plan's own spelling, matched nothing, and ran the pass on
|
||||
// whichever antenna the radio was last left on — a 70 cm downlink through a 2 m
|
||||
// transverter, with no error anywhere. This pins the contract in the direction
|
||||
// that broke.
|
||||
func TestFlexBandAntKeyIsUppercased(t *testing.T) {
|
||||
for _, c := range []struct {
|
||||
hz int64
|
||||
want string
|
||||
}{
|
||||
{435_400_000, "70CM"}, // an FM bird's downlink
|
||||
{145_950_000, "2M"}, // its uplink
|
||||
{1_269_000_000, "23CM"}, // AO-92's L band
|
||||
{29_450_000, "10M"}, // AO-7 mode A
|
||||
{9_000_000_000, ""}, // nothing in the plan: no key, and no antenna
|
||||
} {
|
||||
if got := flexBandAntKey(c.hz); got != c.want {
|
||||
t.Errorf("flexBandAntKey(%d) = %q, want %q", c.hz, got, c.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user