feat(station): MY_IOTA in the station profile
IOTA is an official ADIF field, and almost everything for it was already here: the qso table has carried my_iota since the first migration, the insert and scan handle it, and both ADIF import and export write it. The one missing link was the station profile, so the reference had to be typed on every contact of an island activation, or added afterwards in a bulk edit. Migration 0025 adds the column; it joins my_sota_ref and my_pota_ref in the profile, in the Station Information panel, and in the same stamp-if-empty block that fills the other My* fields on a logged QSO. Uppercased and trimmed on save. ADIF spells it EU-005, and an operator typing "eu-005" would otherwise put a reference no award matcher recognises on every QSO of an activation - the kind of mistake you only find months later.
This commit is contained in:
@@ -541,6 +541,8 @@ type StationSettings struct {
|
||||
MyCountry string `json:"my_country"`
|
||||
MySOTARef string `json:"my_sota_ref"`
|
||||
MyPOTARef string `json:"my_pota_ref"`
|
||||
// MyIOTA is the island the station operates FROM (ADIF MY_IOTA), e.g. EU-005.
|
||||
MyIOTA string `json:"my_iota"`
|
||||
}
|
||||
|
||||
// LookupSettings is the JSON shape exchanged with the frontend.
|
||||
@@ -3033,6 +3035,9 @@ func (a *App) applyStationDefaults(q *qso.QSO, includeIdentity bool) {
|
||||
if q.MyPOTARef == "" {
|
||||
q.MyPOTARef = p.MyPOTARef
|
||||
}
|
||||
if q.MyIOTA == "" {
|
||||
q.MyIOTA = p.MyIOTA
|
||||
}
|
||||
// MY_NAME = the operator's personal name (profile OpName, e.g. "Greg") — stamped
|
||||
// like the other My* fields so every QSO carries it, not just those edited by hand.
|
||||
if q.MyName == "" {
|
||||
@@ -13464,6 +13469,7 @@ func (a *App) GetStationSettings() (StationSettings, error) {
|
||||
MyCountry: p.MyCountry,
|
||||
MySOTARef: p.MySOTARef,
|
||||
MyPOTARef: p.MyPOTARef,
|
||||
MyIOTA: p.MyIOTA,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -13561,6 +13567,10 @@ func (a *App) SaveStationSettings(s StationSettings) error {
|
||||
p.MyCountry = s.MyCountry
|
||||
p.MySOTARef = s.MySOTARef
|
||||
p.MyPOTARef = s.MyPOTARef
|
||||
// Uppercased on the way in: ADIF spells it EU-005, and an operator typing
|
||||
// "eu-005" would otherwise put a reference no award matcher recognises on
|
||||
// every QSO of an activation.
|
||||
p.MyIOTA = strings.ToUpper(strings.TrimSpace(s.MyIOTA))
|
||||
return a.profiles.Save(a.ctx, &p)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user