feat(lists): a satellite list, offered on the entry form
SAT_NAME is compared character for character by the awards and by LoTW: AO-91 and AO91 are two different satellites to everything downstream, and typing it afresh on every pass is how one of them ends up in a log. So the station keeps its own list (Preferences → Lists → Satellites) and the field offers it, alphabetically — while still accepting anything typed, because a bird worked once and never added to the list must not be impossible to log. Not seeded with a shipped list of two dozen birds: an empty list means this station does not work satellites, and filling the dropdown with names nobody here has heard makes the field harder to use, not easier. Also fixes the RDA district comparison: its conflict list was capped at about six visible rows of a list holding up to two hundred, in a panel that would not scroll to show the rest, and nothing in it could be acted on. Taller, scrolling, and a callsign opens the contact.
This commit is contained in:
@@ -106,6 +106,7 @@ const (
|
||||
keyListsRSTPhone = "lists.rst_phone"
|
||||
keyListsRSTCW = "lists.rst_cw"
|
||||
keyListsRSTDigital = "lists.rst_digital"
|
||||
keyListsSatellites = "lists.satellites" // the satellites this station works (SAT_NAME dropdown)
|
||||
|
||||
keyCATEnabled = "cat.enabled"
|
||||
keyCATBackend = "cat.backend" // "omnirig" | "flex"
|
||||
@@ -139,8 +140,8 @@ const (
|
||||
// choice from whether a field happened to be filled in is how an operator
|
||||
// ends up with a host typed in and a radio that never answers.
|
||||
keyCATKenwoodLink = "cat.kenwood.link"
|
||||
keyCATKenwoodPort = "cat.kenwood.port" // Kenwood CAT serial port (TS-590/890/2000, Elecraft)
|
||||
keyCATKenwoodBaud = "cat.kenwood.baud" // Kenwood CAT baud (TS-590 default 9600, TS-890 115200)
|
||||
keyCATKenwoodPort = "cat.kenwood.port" // Kenwood CAT serial port (TS-590/890/2000, Elecraft)
|
||||
keyCATKenwoodBaud = "cat.kenwood.baud" // Kenwood CAT baud (TS-590 default 9600, TS-890 115200)
|
||||
// One key PER BACKEND, deliberately not shared. A Xiegu fix that reached
|
||||
// into the Yaesu and Kenwood backends is what broke them in 0.22.7/0.22.8;
|
||||
// the rule since is that nothing a backend does may be steered by another
|
||||
@@ -526,6 +527,12 @@ type ListsSettings struct {
|
||||
RSTPhone []string `json:"rst_phone"` // RS reports for phone modes
|
||||
RSTCW []string `json:"rst_cw"` // RST reports for CW/RTTY/PSK
|
||||
RSTDigital []string `json:"rst_digital"` // dB reports for FT8/FT4/JT…
|
||||
// Satellites the station works, offered as a dropdown on the satellite
|
||||
// fields. A list rather than free text because SAT_NAME is matched
|
||||
// character for character by the awards and by LoTW: "AO-91" and "AO91"
|
||||
// are two different satellites to everything downstream, and typing it
|
||||
// afresh on every pass is how one of them appears in a log.
|
||||
Satellites []string `json:"satellites"`
|
||||
}
|
||||
|
||||
var defaultBands = []string{
|
||||
@@ -8059,25 +8066,25 @@ func (a *App) GetCATSettings() (CATSettings, error) {
|
||||
return CATSettings{}, err
|
||||
}
|
||||
out := CATSettings{
|
||||
Enabled: m[keyCATEnabled] == "1",
|
||||
Backend: m[keyCATBackend],
|
||||
OmniRigNum: 1,
|
||||
FlexHost: m[keyCATFlexHost],
|
||||
FlexPort: 4992,
|
||||
FlexSpots: m[keyCATFlexSpots] == "1",
|
||||
FlexDVKDax: m[keyCATFlexDVKDax] == "1",
|
||||
FlexDecodeSpots: m[keyCATFlexDecodeSpots] == "1",
|
||||
FlexDecodeSecs: 120,
|
||||
XieguPort: m[keyCATXieguPort],
|
||||
XieguBaud: 19200,
|
||||
XieguAddr: cat.XieguDefaultAddr,
|
||||
YaesuPort: m[keyCATYaesuPort],
|
||||
YaesuBaud: 38400,
|
||||
KenwoodPort: m[keyCATKenwoodPort],
|
||||
KenwoodHost: m[keyCATKenwoodHost],
|
||||
Enabled: m[keyCATEnabled] == "1",
|
||||
Backend: m[keyCATBackend],
|
||||
OmniRigNum: 1,
|
||||
FlexHost: m[keyCATFlexHost],
|
||||
FlexPort: 4992,
|
||||
FlexSpots: m[keyCATFlexSpots] == "1",
|
||||
FlexDVKDax: m[keyCATFlexDVKDax] == "1",
|
||||
FlexDecodeSpots: m[keyCATFlexDecodeSpots] == "1",
|
||||
FlexDecodeSecs: 120,
|
||||
XieguPort: m[keyCATXieguPort],
|
||||
XieguBaud: 19200,
|
||||
XieguAddr: cat.XieguDefaultAddr,
|
||||
YaesuPort: m[keyCATYaesuPort],
|
||||
YaesuBaud: 38400,
|
||||
KenwoodPort: m[keyCATKenwoodPort],
|
||||
KenwoodHost: m[keyCATKenwoodHost],
|
||||
// An install that predates the setting is read from what it has: a host
|
||||
// filled in meant the bridge, since that is what the old code preferred.
|
||||
KenwoodLink: kenwoodLinkOr(m[keyCATKenwoodLink], m[keyCATKenwoodHost]),
|
||||
KenwoodLink: kenwoodLinkOr(m[keyCATKenwoodLink], m[keyCATKenwoodHost]),
|
||||
KenwoodBaud: 9600,
|
||||
YaesuLowLines: m[keyCATYaesuLowLines] == "1",
|
||||
KenwoodLowLines: m[keyCATKenwoodLowLines] == "1",
|
||||
@@ -15405,6 +15412,9 @@ func (a *App) GetListsSettings() (ListsSettings, error) {
|
||||
if raw, _ := a.settings.Get(a.ctx, keyListsRSTDigital); raw != "" {
|
||||
_ = json.Unmarshal([]byte(raw), &out.RSTDigital)
|
||||
}
|
||||
if raw, _ := a.settings.Get(a.ctx, keyListsSatellites); raw != "" {
|
||||
_ = json.Unmarshal([]byte(raw), &out.Satellites)
|
||||
}
|
||||
if len(out.Bands) == 0 {
|
||||
out.Bands = append([]string(nil), defaultBands...)
|
||||
}
|
||||
@@ -15420,6 +15430,10 @@ func (a *App) GetListsSettings() (ListsSettings, error) {
|
||||
if len(out.RSTDigital) == 0 {
|
||||
out.RSTDigital = append([]string(nil), defaultRSTDigital...)
|
||||
}
|
||||
// Satellites are NOT defaulted to a shipped list. An empty list means the
|
||||
// station does not work satellites, and filling it with two dozen birds
|
||||
// nobody here has heard would make the field harder to use, not easier —
|
||||
// the operator adds the ones they actually work.
|
||||
return out, nil
|
||||
}
|
||||
|
||||
@@ -15459,6 +15473,14 @@ func (a *App) SaveListsSettings(l ListsSettings) error {
|
||||
// cache, so a band ticked here has to reach that cache now — otherwise it
|
||||
// takes effect at the next restart, which looks like the option not working.
|
||||
a.refreshChaseBands()
|
||||
sat, err := json.Marshal(l.Satellites)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := a.settings.Set(a.ctx, keyListsSatellites, string(sat)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user