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:
+43
-6
@@ -314,7 +314,12 @@ func (a *App) GetSatSettings() (SatSettings, error) {
|
||||
if a.settings == nil {
|
||||
return SatSettings{}, fmt.Errorf("db not initialized")
|
||||
}
|
||||
return a.satSettings(), nil
|
||||
out := a.satSettings()
|
||||
// Resolved HERE and not in satSettings, which is read during startup before
|
||||
// the frequency plan is loaded. Saving the panel writes the resolved list
|
||||
// back, so the rename settles itself the first time anything is changed.
|
||||
out.Favorites = a.satFavorites()
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// SaveSatSettings stores them.
|
||||
@@ -535,9 +540,8 @@ func (a *App) AddSatelliteElements(text string) (int, error) {
|
||||
// configuration problem into a satellite that "does not exist".
|
||||
func (a *App) GetSatelliteBirds() []SatBird {
|
||||
store, birds, _ := a.satParts()
|
||||
set := a.satSettings()
|
||||
fav := map[string]bool{}
|
||||
for _, n := range set.Favorites {
|
||||
for _, n := range a.satFavorites() {
|
||||
fav[strings.ToUpper(n)] = true
|
||||
}
|
||||
|
||||
@@ -665,15 +669,48 @@ func satElement(store *sat.Store, b sat.Bird) (sat.Element, bool) {
|
||||
|
||||
// ── Tracking ────────────────────────────────────────────────────────────────
|
||||
|
||||
// satFavorites is the followed list, with every name resolved to the one the
|
||||
// frequency plan uses now.
|
||||
//
|
||||
// A satellite is renamed when it is granted an OSCAR number — LILACSAT-2
|
||||
// became LO-90 — and the plan carries the old name as an alias. The followed
|
||||
// list, though, is stored as the plain text the operator picked: after such a
|
||||
// rename his own choice was listed as having no elements while the same bird
|
||||
// sat under its new name in the available column, so the satellite he had
|
||||
// chosen had quietly become a stranger.
|
||||
//
|
||||
// Deduplicated on the way out, because an operator who followed both spellings
|
||||
// must not now see the same bird twice.
|
||||
func (a *App) satFavorites() []string {
|
||||
names := a.satSettings().Favorites
|
||||
_, birds, _ := a.satParts()
|
||||
if birds == nil {
|
||||
return names
|
||||
}
|
||||
out := make([]string, 0, len(names))
|
||||
seen := map[string]bool{}
|
||||
for _, n := range names {
|
||||
if b, ok := birds.Find(n); ok {
|
||||
n = b.Name
|
||||
}
|
||||
k := strings.ToUpper(n)
|
||||
if seen[k] {
|
||||
continue
|
||||
}
|
||||
seen[k] = true
|
||||
out = append(out, n)
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// satNames resolves the names the UI asked for, falling back to the favourites
|
||||
// and then to every planned bird we hold elements for.
|
||||
func (a *App) satNames(names []string) []string {
|
||||
if len(names) > 0 {
|
||||
return names
|
||||
}
|
||||
set := a.satSettings()
|
||||
if len(set.Favorites) > 0 {
|
||||
return set.Favorites
|
||||
if favs := a.satFavorites(); len(favs) > 0 {
|
||||
return favs
|
||||
}
|
||||
var out []string
|
||||
for _, b := range a.GetSatelliteBirds() {
|
||||
|
||||
Reference in New Issue
Block a user