chore: release v0.26.2
This commit is contained in:
@@ -55,6 +55,7 @@ import (
|
|||||||
"hamlog/internal/psu"
|
"hamlog/internal/psu"
|
||||||
"hamlog/internal/qslcard"
|
"hamlog/internal/qslcard"
|
||||||
"hamlog/internal/qso"
|
"hamlog/internal/qso"
|
||||||
|
"hamlog/internal/rda"
|
||||||
"hamlog/internal/relaydev"
|
"hamlog/internal/relaydev"
|
||||||
"hamlog/internal/rigctld"
|
"hamlog/internal/rigctld"
|
||||||
"hamlog/internal/rotator/dcu1"
|
"hamlog/internal/rotator/dcu1"
|
||||||
@@ -1745,6 +1746,11 @@ func (a *App) shutdown(ctx context.Context) {
|
|||||||
if !a.shuttingDown {
|
if !a.shuttingDown {
|
||||||
a.maybeShutdownBackup()
|
a.maybeShutdownBackup()
|
||||||
}
|
}
|
||||||
|
// Before the hardware and the databases: a program asked to close with
|
||||||
|
// OpsLog should get its request while everything is still up, not after the
|
||||||
|
// logger has spent seconds tearing down ports.
|
||||||
|
applog.Printf("shutdown: closing autostart programs")
|
||||||
|
a.CloseAutostartPrograms()
|
||||||
applog.Printf("shutdown: stopping UDP")
|
applog.Printf("shutdown: stopping UDP")
|
||||||
if a.udp != nil {
|
if a.udp != nil {
|
||||||
a.udp.StopAll()
|
a.udp.StopAll()
|
||||||
@@ -3635,7 +3641,8 @@ func (a *App) SaveAwardDefs(defs []award.Def) error {
|
|||||||
if a.settings == nil {
|
if a.settings == nil {
|
||||||
return fmt.Errorf("db not initialized")
|
return fmt.Errorf("db not initialized")
|
||||||
}
|
}
|
||||||
markUserEdited(defs, a.awardDefs())
|
prev := a.awardDefs()
|
||||||
|
markUserEdited(defs, prev)
|
||||||
b, err := json.Marshal(defs)
|
b, err := json.Marshal(defs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -3644,10 +3651,55 @@ func (a *App) SaveAwardDefs(defs []award.Def) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
go a.mirrorAwardsToFolder(defs)
|
go a.mirrorAwardsToFolder(defs)
|
||||||
|
// A change that only alters HOW a match is written — reference, description
|
||||||
|
// or both in the grid column — cannot change WHICH QSOs match. Recomputing
|
||||||
|
// every award for every contact then produces a known answer at the cost of
|
||||||
|
// reading the whole logbook, and the operator waits minutes to see a column
|
||||||
|
// they expected to change at once.
|
||||||
|
if codes, ok := relabelOnly(prev, defs); ok {
|
||||||
|
a.recomputeAwardRefsForCodesAsync(codes)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
a.recomputeAwardRefsAsync() // definitions changed → refresh every row's award_refs
|
a.recomputeAwardRefsAsync() // definitions changed → refresh every row's award_refs
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// relabelOnly reports whether the only difference between two definition sets is
|
||||||
|
// the RefDisplay of some awards, and names them.
|
||||||
|
//
|
||||||
|
// Conservative by construction: it compares the two definitions with RefDisplay
|
||||||
|
// blanked out, so ANY other difference — a new field, a pattern, a band, an
|
||||||
|
// award added or removed — fails the test and the full recompute runs. A wrong
|
||||||
|
// "yes" here would leave stale references in the log, which is far worse than a
|
||||||
|
// slow save.
|
||||||
|
func relabelOnly(prev, next []award.Def) ([]string, bool) {
|
||||||
|
if len(prev) != len(next) {
|
||||||
|
return nil, false
|
||||||
|
}
|
||||||
|
byCode := map[string]award.Def{}
|
||||||
|
for _, d := range prev {
|
||||||
|
byCode[strings.ToUpper(strings.TrimSpace(d.Code))] = d
|
||||||
|
}
|
||||||
|
var codes []string
|
||||||
|
for _, n := range next {
|
||||||
|
o, ok := byCode[strings.ToUpper(strings.TrimSpace(n.Code))]
|
||||||
|
if !ok {
|
||||||
|
return nil, false
|
||||||
|
}
|
||||||
|
if n.RefDisplay != o.RefDisplay {
|
||||||
|
codes = append(codes, strings.ToUpper(strings.TrimSpace(n.Code)))
|
||||||
|
}
|
||||||
|
a, b := n, o
|
||||||
|
a.RefDisplay, b.RefDisplay = "", ""
|
||||||
|
ja, err1 := json.Marshal(a)
|
||||||
|
jb, err2 := json.Marshal(b)
|
||||||
|
if err1 != nil || err2 != nil || string(ja) != string(jb) {
|
||||||
|
return nil, false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return codes, len(codes) > 0
|
||||||
|
}
|
||||||
|
|
||||||
// mirrorAwards refreshes the awards folder from the database.
|
// mirrorAwards refreshes the awards folder from the database.
|
||||||
//
|
//
|
||||||
// It is called from EVERY path that can change an award — the definitions AND the
|
// It is called from EVERY path that can change an award — the definitions AND the
|
||||||
@@ -5103,8 +5155,13 @@ func (a *App) RecomputeAllAwardRefs() (int, error) {
|
|||||||
ac := a.newAwardMatCtx()
|
ac := a.newAwardMatCtx()
|
||||||
// Collect updates during the scan; DON'T write mid-iteration (a nested query on
|
// Collect updates during the scan; DON'T write mid-iteration (a nested query on
|
||||||
// the same connection can deadlock SQLite / trip MySQL "commands out of sync").
|
// the same connection can deadlock SQLite / trip MySQL "commands out of sync").
|
||||||
|
//
|
||||||
|
// The LEAN projection: award computation reads twenty-seven columns and the
|
||||||
|
// full record has a hundred and fifty. It used to take the whole row only
|
||||||
|
// because it needed award_refs to compare against, which the projection now
|
||||||
|
// carries — on a remote MySQL that was most of the wait.
|
||||||
changes := map[int64]string{}
|
changes := map[int64]string{}
|
||||||
err := a.qso.IterateAll(a.ctx, func(q qso.QSO) error {
|
err := a.qso.IterateForAwards(a.ctx, func(q qso.QSO) error {
|
||||||
if js := a.awardRefsJSONFor(ac, q); js != q.AwardRefs {
|
if js := a.awardRefsJSONFor(ac, q); js != q.AwardRefs {
|
||||||
changes[q.ID] = js
|
changes[q.ID] = js
|
||||||
}
|
}
|
||||||
@@ -5119,6 +5176,96 @@ func (a *App) RecomputeAllAwardRefs() (int, error) {
|
|||||||
return len(changes), nil
|
return len(changes), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RecomputeAwardRefsForCode refreshes the stored label of ONE award, on the rows
|
||||||
|
// that already carry it.
|
||||||
|
//
|
||||||
|
// For a change that cannot alter which QSOs match — switching the grid column
|
||||||
|
// between the reference, its description and both — recomputing every award for
|
||||||
|
// every QSO is work with a known answer. This does the only part that can
|
||||||
|
// differ: it recomputes that one award for the rows whose award_refs already
|
||||||
|
// mention it, and merges the result into their stored object, leaving every
|
||||||
|
// other award's label exactly as it was.
|
||||||
|
func (a *App) RecomputeAwardRefsForCode(code string) (int, error) {
|
||||||
|
if a.qso == nil {
|
||||||
|
return 0, fmt.Errorf("db not initialized")
|
||||||
|
}
|
||||||
|
code = strings.ToUpper(strings.TrimSpace(code))
|
||||||
|
if code == "" {
|
||||||
|
return 0, nil
|
||||||
|
}
|
||||||
|
// One definition, so award.Compute does not re-run twenty awards per row.
|
||||||
|
full := a.newAwardMatCtx()
|
||||||
|
one := full
|
||||||
|
one.defs = nil
|
||||||
|
for _, d := range full.defs {
|
||||||
|
if strings.EqualFold(d.Code, code) {
|
||||||
|
one.defs = []award.Def{d}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(one.defs) == 0 {
|
||||||
|
return 0, nil // award gone — a full recompute will clear the stale label
|
||||||
|
}
|
||||||
|
changes := map[int64]string{}
|
||||||
|
err := a.qso.IterateForAwardsWithRef(a.ctx, code, func(q qso.QSO) error {
|
||||||
|
var stored map[string]string
|
||||||
|
if strings.TrimSpace(q.AwardRefs) != "" {
|
||||||
|
if err := json.Unmarshal([]byte(q.AwardRefs), &stored); err != nil {
|
||||||
|
return nil // unreadable value — leave it for the full recompute
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if stored == nil {
|
||||||
|
stored = map[string]string{}
|
||||||
|
}
|
||||||
|
fresh := a.awardRefLabels(one, q)
|
||||||
|
if fresh[code] == stored[code] {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if lbl := fresh[code]; lbl != "" {
|
||||||
|
stored[code] = lbl
|
||||||
|
} else {
|
||||||
|
delete(stored, code)
|
||||||
|
}
|
||||||
|
if len(stored) == 0 {
|
||||||
|
changes[q.ID] = ""
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
b, err := json.Marshal(stored)
|
||||||
|
if err != nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
changes[q.ID] = string(b)
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
if err := a.qso.SetAwardRefsBatch(a.ctx, changes); err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
return len(changes), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// recomputeAwardRefsForCodesAsync relabels a few awards and tells the frontend,
|
||||||
|
// the cheap counterpart of recomputeAwardRefsAsync.
|
||||||
|
func (a *App) recomputeAwardRefsForCodesAsync(codes []string) {
|
||||||
|
go func() {
|
||||||
|
total := 0
|
||||||
|
for _, c := range codes {
|
||||||
|
n, err := a.RecomputeAwardRefsForCode(c)
|
||||||
|
if err != nil {
|
||||||
|
applog.Printf("award_refs: relabel of %s failed: %v", c, err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
applog.Printf("award_refs: %s relabelled on %d QSO(s)", c, n)
|
||||||
|
total += n
|
||||||
|
}
|
||||||
|
if a.ctx != nil {
|
||||||
|
wruntime.EventsEmit(a.ctx, "awards:recomputed", total)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
|
||||||
// recomputeAwardRefsAsync runs a full recompute off the UI goroutine and, when
|
// recomputeAwardRefsAsync runs a full recompute off the UI goroutine and, when
|
||||||
// done, tells the frontend to reload so the refreshed award columns show. Used
|
// done, tells the frontend to reload so the refreshed award columns show. Used
|
||||||
// wherever the set of matches could shift for MANY rows at once: an award
|
// wherever the set of matches could shift for MANY rows at once: an award
|
||||||
@@ -7519,6 +7666,19 @@ func (a *App) lookupCallsign(callsign string, force bool, qsoDate string) (looku
|
|||||||
if r.IOTA == "" && r.DXCC != 0 {
|
if r.IOTA == "" && r.DXCC != 0 {
|
||||||
r.IOTA = awardref.IOTAForDXCC(r.DXCC)
|
r.IOTA = awardref.IOTAForDXCC(r.DXCC)
|
||||||
}
|
}
|
||||||
|
// The Russian district, from the offline database, for the DAY of the QSO.
|
||||||
|
//
|
||||||
|
// It overrides what a callbook said rather than filling a blank, which is the
|
||||||
|
// opposite of every other enrichment here — and deliberately. HamQTH carries
|
||||||
|
// the district a station operates from TODAY and nothing more; this database
|
||||||
|
// carries dated activity records, so on a contact from an expedition or from
|
||||||
|
// a station that has since moved it is right where the callbook is wrong.
|
||||||
|
// For everyone else the two agree.
|
||||||
|
if when := lookupWhen(qsoDate); r.DXCC == 15 || r.DXCC == 54 || r.DXCC == 126 {
|
||||||
|
if m, ok := rda.Lookup(callsign, when); ok {
|
||||||
|
r.RDA = m.District
|
||||||
|
}
|
||||||
|
}
|
||||||
// Custom outbound rows bound to a lookup. After the enrichment, so a
|
// Custom outbound rows bound to a lookup. After the enrichment, so a
|
||||||
// template sees the same grid and county the entry panel is about to show —
|
// template sees the same grid and county the entry panel is about to show —
|
||||||
// two answers for one callsign is how a rotator ends up pointed elsewhere
|
// two answers for one callsign is how a rotator ends up pointed elsewhere
|
||||||
@@ -11492,6 +11652,100 @@ func (a *App) BackfillUSCounties() (BackfillUSCountiesResult, error) {
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// BackfillRDAResult reports what a district backfill did.
|
||||||
|
type BackfillRDAResult struct {
|
||||||
|
Scanned int `json:"scanned"` // Russian QSOs examined
|
||||||
|
Dated int `json:"dated"` // filled from an activity record covering the QSO day
|
||||||
|
Current int `json:"current"` // filled from the callsign's current district (no history)
|
||||||
|
Unknown int `json:"unknown"` // callsign not in the database, or no record for that day
|
||||||
|
Skipped int `json:"skipped"` // already carried an RDA reference — never overwritten
|
||||||
|
}
|
||||||
|
|
||||||
|
// BackfillRDA stamps the Russian District on existing QSOs from the offline RDA
|
||||||
|
// database, which is the one source that knows WHERE a callsign was on a GIVEN
|
||||||
|
// DAY rather than only where it is now.
|
||||||
|
//
|
||||||
|
// useCurrent decides what happens for the 43 294 callsigns the database records
|
||||||
|
// with a district and no history at all. With it off, only a dated activity
|
||||||
|
// record covering the QSO's own day is written — every stamp is then a fact.
|
||||||
|
// With it on, a callsign the database knows of no move for also gets its
|
||||||
|
// district; that is true for the great majority of stations and an assumption
|
||||||
|
// for the rest, which is why it is the operator's decision and not ours.
|
||||||
|
//
|
||||||
|
// An existing reference is never overwritten. A district assigned by hand, or
|
||||||
|
// read from the far end at the time, outranks any database.
|
||||||
|
func (a *App) BackfillRDA(useCurrent bool) (BackfillRDAResult, error) {
|
||||||
|
var res BackfillRDAResult
|
||||||
|
if a.qso == nil {
|
||||||
|
return res, fmt.Errorf("db not initialized")
|
||||||
|
}
|
||||||
|
rows, err := a.qso.List(a.ctx, qso.ListFilter{Limit: 1_000_000})
|
||||||
|
if err != nil {
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
|
for i := range rows {
|
||||||
|
q := &rows[i]
|
||||||
|
// The three entities the award covers. Filtering on DXCC rather than on
|
||||||
|
// the callsign shape keeps a Russian station worked under a foreign
|
||||||
|
// prefix out, which is right: the database files them by callsign and a
|
||||||
|
// non-Russian one is not in it.
|
||||||
|
if q.DXCC == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
switch *q.DXCC {
|
||||||
|
case 15, 54, 126:
|
||||||
|
default:
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
res.Scanned++
|
||||||
|
if strings.TrimSpace(manualRefFor(q.Extras[award.ManualRefsKey], "RDA")) != "" {
|
||||||
|
res.Skipped++
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
m, ok := rda.Lookup(q.Callsign, q.QSODate)
|
||||||
|
if !ok || (!m.Dated && !useCurrent) {
|
||||||
|
res.Unknown++
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if q.Extras == nil {
|
||||||
|
q.Extras = map[string]string{}
|
||||||
|
}
|
||||||
|
q.Extras[award.ManualRefsKey] = setOverrideRef(q.Extras[award.ManualRefsKey], "RDA", m.District)
|
||||||
|
if err := a.qso.Update(a.ctx, *q); err != nil {
|
||||||
|
applog.Printf("rda backfill: update qso %d failed: %v", q.ID, err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if m.Dated {
|
||||||
|
res.Dated++
|
||||||
|
} else {
|
||||||
|
res.Current++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
applog.Printf("rda backfill: %d Russian QSOs — %d dated, %d current, %d unknown, %d already set",
|
||||||
|
res.Scanned, res.Dated, res.Current, res.Unknown, res.Skipped)
|
||||||
|
if res.Dated+res.Current > 0 {
|
||||||
|
a.invalidateAwardStats()
|
||||||
|
}
|
||||||
|
return res, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// RDADatabaseCount is how many callsigns the embedded district database holds,
|
||||||
|
// so the panel offering the backfill can say what it is about to use.
|
||||||
|
func (a *App) RDADatabaseCount() int { return rda.Count() }
|
||||||
|
|
||||||
|
// manualRefFor returns the reference already assigned to one award code in a
|
||||||
|
// "CODE@REF;CODE@REF" override string, or "".
|
||||||
|
func manualRefFor(existing, code string) string {
|
||||||
|
for _, entry := range strings.Split(existing, ";") {
|
||||||
|
entry = strings.TrimSpace(entry)
|
||||||
|
at := strings.IndexByte(entry, '@')
|
||||||
|
if at > 0 && strings.EqualFold(strings.TrimSpace(entry[:at]), code) {
|
||||||
|
return strings.TrimSpace(entry[at+1:])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
// DownloadConfirmations pulls confirmed QSOs from a service and updates the
|
// DownloadConfirmations pulls confirmed QSOs from a service and updates the
|
||||||
// matching local QSOs' received status. LoTW only for now (the canonical
|
// matching local QSOs' received status. LoTW only for now (the canonical
|
||||||
// confirmation system); runs in the background emitting the same
|
// confirmation system); runs in the background emitting the same
|
||||||
@@ -14490,6 +14744,33 @@ func catLinkSig(s CATSettings) string {
|
|||||||
}, "|")
|
}, "|")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// catShareKeyed reports whether the running share server is holding the rig
|
||||||
|
// keyed for a client.
|
||||||
|
func (a *App) catShareKeyed() bool {
|
||||||
|
if a.catShare != nil && a.catShare.Keyed() {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return a.catShareTCI != nil && a.catShareTCI.Keyed()
|
||||||
|
}
|
||||||
|
|
||||||
|
// reloadCATShareWhenUnkeyed waits for the transmission to end, then applies the
|
||||||
|
// change. Bounded, because a rig left keyed by a client that went away must not
|
||||||
|
// postpone the operator's setting for ever — after a minute the change wins and
|
||||||
|
// the emergency unkey in Stop() covers the radio.
|
||||||
|
func (a *App) reloadCATShareWhenUnkeyed(s CATSettings) {
|
||||||
|
for i := 0; i < 120; i++ { // 120 × 500 ms = 1 minute
|
||||||
|
time.Sleep(500 * time.Millisecond)
|
||||||
|
if !a.catShareKeyed() {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// The signature was already recorded by the caller, so clear it: this IS the
|
||||||
|
// rebuild it stood for, and leaving it set would make the call below a no-op.
|
||||||
|
a.catShareSig = ""
|
||||||
|
applog.Printf("cat share: transmission over — applying the deferred rebuild")
|
||||||
|
a.reloadCATShare(s)
|
||||||
|
}
|
||||||
|
|
||||||
// catShareSig does the same for the shared-CAT server: which protocol, which
|
// catShareSig does the same for the shared-CAT server: which protocol, which
|
||||||
// port, on or off. Restarting it is what actually disconnects WSJT-X.
|
// port, on or off. Restarting it is what actually disconnects WSJT-X.
|
||||||
func catShareSig(s CATSettings) string {
|
func catShareSig(s CATSettings) string {
|
||||||
@@ -14939,6 +15220,13 @@ func (a *App) ActivateProfile(id int64) error {
|
|||||||
// stays as-is (the operator connects it explicitly). The frontend reloads its
|
// stays as-is (the operator connects it explicitly). The frontend reloads its
|
||||||
// panels via profile:changed.
|
// panels via profile:changed.
|
||||||
func (a *App) reloadAfterProfileSwitch() {
|
func (a *App) reloadAfterProfileSwitch() {
|
||||||
|
// Logged because this rebuilds EVERY settings-dependent subsystem, and a
|
||||||
|
// shared operator's log showed it running 54 times in one session — each one
|
||||||
|
// dropping WSJT-X's rigctl connection, three of them while the rig was
|
||||||
|
// keyed. The teardown itself is now guarded (see catLinkSig), but a re-apply
|
||||||
|
// arriving every few minutes still means something is asking for it, and
|
||||||
|
// nothing in the log said so.
|
||||||
|
applog.Printf("profile: re-applying every subsystem for the active profile")
|
||||||
a.reloadLookupProviders()
|
a.reloadLookupProviders()
|
||||||
if a.extsvc != nil {
|
if a.extsvc != nil {
|
||||||
a.extsvc.SetConfig(a.loadExternalServices())
|
a.extsvc.SetConfig(a.loadExternalServices())
|
||||||
@@ -19181,6 +19469,20 @@ func (a *App) reloadCATShare(s CATSettings) {
|
|||||||
} else {
|
} else {
|
||||||
a.catShareSig = sig
|
a.catShareSig = sig
|
||||||
}
|
}
|
||||||
|
// NEVER while the rig is transmitting.
|
||||||
|
//
|
||||||
|
// Everything above decides that the server genuinely has to be rebuilt; this
|
||||||
|
// decides WHEN. Closing the socket mid-over is the one moment it costs
|
||||||
|
// something: WSJT-X is inside a run of Hamlib calls — VFO, split, PTT, which
|
||||||
|
// with Fake It all land at the start of a transmission — and an operator's
|
||||||
|
// log showed it happening three times in a session, followed by wsjtx.exe
|
||||||
|
// dying on a null pointer. The transmission is seconds long; the new port
|
||||||
|
// can wait for it.
|
||||||
|
if a.catShareKeyed() {
|
||||||
|
applog.Printf("cat share: rebuild deferred — the rig is transmitting")
|
||||||
|
go a.reloadCATShareWhenUnkeyed(s)
|
||||||
|
return
|
||||||
|
}
|
||||||
// Always tear down first: the port — or the protocol — may have changed, and
|
// Always tear down first: the port — or the protocol — may have changed, and
|
||||||
// a listener bound to the old one would keep answering while the client is
|
// a listener bound to the old one would keep answering while the client is
|
||||||
// told to use the new.
|
// told to use the new.
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"sync"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"hamlog/internal/applog"
|
"hamlog/internal/applog"
|
||||||
@@ -26,6 +28,12 @@ type AutostartProgram struct {
|
|||||||
Path string `json:"path"`
|
Path string `json:"path"`
|
||||||
Args string `json:"args"`
|
Args string `json:"args"`
|
||||||
Enabled bool `json:"enabled"`
|
Enabled bool `json:"enabled"`
|
||||||
|
// CloseOnExit asks for this program to be closed when OpsLog closes.
|
||||||
|
//
|
||||||
|
// Per program and not one switch for the list, because the answer differs
|
||||||
|
// inside one station: an operator wants WSJT-X gone with the logger and the
|
||||||
|
// rotator controller left running.
|
||||||
|
CloseOnExit bool `json:"close_on_exit,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// AutostartLaunchResult reports what happened for one program when launching.
|
// AutostartLaunchResult reports what happened for one program when launching.
|
||||||
@@ -106,6 +114,52 @@ func (a *App) LaunchAutostartProgram(id string) (AutostartLaunchResult, error) {
|
|||||||
return AutostartLaunchResult{}, fmt.Errorf("program %q not found", id)
|
return AutostartLaunchResult{}, fmt.Errorf("program %q not found", id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// launched remembers the process id of every program OPSLOG started, keyed by
|
||||||
|
// program id.
|
||||||
|
//
|
||||||
|
// Only what we started is ever closed. A copy of WSJT-X the operator opened
|
||||||
|
// themselves — before OpsLog, for something else entirely — is theirs, and
|
||||||
|
// closing it because a logger happened to quit would be taking a decision that
|
||||||
|
// was never asked for. That is also why "already running" stores nothing.
|
||||||
|
var launched = struct {
|
||||||
|
sync.Mutex
|
||||||
|
pid map[string]int
|
||||||
|
}{pid: map[string]int{}}
|
||||||
|
|
||||||
|
// CloseAutostartPrograms closes the programs marked "close with OpsLog" — the
|
||||||
|
// ones OpsLog itself launched this session.
|
||||||
|
//
|
||||||
|
// A polite close, never a kill: taskkill without /F posts WM_CLOSE, so WSJT-X
|
||||||
|
// writes its settings and its log the way it would if the operator had clicked
|
||||||
|
// the cross. Forcing it would lose exactly the state an operator cares about,
|
||||||
|
// and a program that ignores a close request is entitled to.
|
||||||
|
func (a *App) CloseAutostartPrograms() {
|
||||||
|
progs, _ := a.GetAutostartPrograms()
|
||||||
|
for _, p := range progs {
|
||||||
|
if !p.CloseOnExit {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
launched.Lock()
|
||||||
|
pid, ok := launched.pid[p.ID]
|
||||||
|
delete(launched.pid, p.ID)
|
||||||
|
launched.Unlock()
|
||||||
|
if !ok || pid <= 0 {
|
||||||
|
continue // not started by us this session — not ours to close
|
||||||
|
}
|
||||||
|
name := strings.TrimSpace(p.Name)
|
||||||
|
if name == "" {
|
||||||
|
name = filepath.Base(p.Path)
|
||||||
|
}
|
||||||
|
cmd := exec.Command("taskkill", "/PID", strconv.Itoa(pid))
|
||||||
|
cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true, CreationFlags: 0x08000000}
|
||||||
|
if out, err := cmd.CombinedOutput(); err != nil {
|
||||||
|
applog.Printf("autostart: could not close %s (pid %d): %v — %s", name, pid, err, strings.TrimSpace(string(out)))
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
applog.Printf("autostart: asked %s (pid %d) to close", name, pid)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// launchProgram starts one program unless its executable is already running.
|
// launchProgram starts one program unless its executable is already running.
|
||||||
func launchProgram(p AutostartProgram, running map[string]bool) AutostartLaunchResult {
|
func launchProgram(p AutostartProgram, running map[string]bool) AutostartLaunchResult {
|
||||||
res := AutostartLaunchResult{ID: p.ID, Name: p.Name}
|
res := AutostartLaunchResult{ID: p.ID, Name: p.Name}
|
||||||
@@ -131,6 +185,13 @@ func launchProgram(p AutostartProgram, running map[string]bool) AutostartLaunchR
|
|||||||
res.Status, res.Message = "error", err.Error()
|
res.Status, res.Message = "error", err.Error()
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
// Remembered so it can be closed again on exit, if asked. Recorded BEFORE
|
||||||
|
// the wait goroutine, which releases the handle.
|
||||||
|
if cmd.Process != nil {
|
||||||
|
launched.Lock()
|
||||||
|
launched.pid[p.ID] = cmd.Process.Pid
|
||||||
|
launched.Unlock()
|
||||||
|
}
|
||||||
// Don't wait on the child — it runs independently of OpsLog. Release the
|
// Don't wait on the child — it runs independently of OpsLog. Release the
|
||||||
// handle so we don't accumulate zombies.
|
// handle so we don't accumulate zombies.
|
||||||
go func() { _ = cmd.Wait() }()
|
go func() { _ = cmd.Wait() }()
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"hamlog/internal/award"
|
||||||
|
)
|
||||||
|
|
||||||
|
// relabelOnly decides whether a save can take the cheap path. A wrong "yes"
|
||||||
|
// leaves stale references in the log, so every case that is not purely a
|
||||||
|
// display change must fall through to the full recompute.
|
||||||
|
func TestRelabelOnly(t *testing.T) {
|
||||||
|
base := []award.Def{
|
||||||
|
{Code: "DDFM", Field: "note", RefDisplay: "ref", Valid: true},
|
||||||
|
{Code: "IOTA", Field: "iota", RefDisplay: "", Valid: true},
|
||||||
|
}
|
||||||
|
cp := func() []award.Def { out := make([]award.Def, len(base)); copy(out, base); return out }
|
||||||
|
|
||||||
|
// The case this exists for: one award's column switches to the description.
|
||||||
|
next := cp()
|
||||||
|
next[0].RefDisplay = "name"
|
||||||
|
codes, ok := relabelOnly(base, next)
|
||||||
|
if !ok || len(codes) != 1 || codes[0] != "DDFM" {
|
||||||
|
t.Errorf("display-only change = (%v, %v), want ([DDFM], true)", codes, ok)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Two at once is still a relabel.
|
||||||
|
next = cp()
|
||||||
|
next[0].RefDisplay = "both"
|
||||||
|
next[1].RefDisplay = "name"
|
||||||
|
if codes, ok := relabelOnly(base, next); !ok || len(codes) != 2 {
|
||||||
|
t.Errorf("two display changes = (%v, %v), want two codes", codes, ok)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Nothing changed: no relabel to do, and no full recompute claimed either.
|
||||||
|
if codes, ok := relabelOnly(base, cp()); ok || codes != nil {
|
||||||
|
t.Errorf("identical definitions must not report a relabel, got (%v, %v)", codes, ok)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Anything that can change WHICH QSOs match must fail the test.
|
||||||
|
for name, mutate := range map[string]func([]award.Def){
|
||||||
|
"field": func(d []award.Def) { d[0].Field = "comment" },
|
||||||
|
"pattern": func(d []award.Def) { d[0].Pattern = `\d{2}` },
|
||||||
|
"exact": func(d []award.Def) { d[0].ExactMatch = true },
|
||||||
|
"validity": func(d []award.Def) { d[0].ValidFrom = "2020-01-01" },
|
||||||
|
"dxcc": func(d []award.Def) { d[0].DXCCFilter = []int{227} },
|
||||||
|
"disabled": func(d []award.Def) { d[0].Valid = false },
|
||||||
|
"or rule": func(d []award.Def) { d[0].OrRules = []award.OrRule{{Field: "qth"}} },
|
||||||
|
"with disp": func(d []award.Def) { d[0].RefDisplay = "name"; d[0].Field = "comment" },
|
||||||
|
} {
|
||||||
|
n := cp()
|
||||||
|
mutate(n)
|
||||||
|
if _, ok := relabelOnly(base, n); ok {
|
||||||
|
t.Errorf("%s: took the relabel path — stale references would stay in the log", name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// An award added or removed changes the set, never a relabel.
|
||||||
|
if _, ok := relabelOnly(base, append(cp(), award.Def{Code: "WWFF"})); ok {
|
||||||
|
t.Errorf("an added award must force a full recompute")
|
||||||
|
}
|
||||||
|
if _, ok := relabelOnly(base, cp()[:1]); ok {
|
||||||
|
t.Errorf("a removed award must force a full recompute")
|
||||||
|
}
|
||||||
|
}
|
||||||
+28
-2
@@ -8,7 +8,20 @@
|
|||||||
"Grid squares map: the world is drawn once instead of repeating east and west, it can be zoomed out far enough to hold Greenland and Antarctica at the same time, and the space beside the planet is the panel's own background instead of a wall of grey \"map data not yet available\" tiles.",
|
"Grid squares map: the world is drawn once instead of repeating east and west, it can be zoomed out far enough to hold Greenland and Antarctica at the same time, and the space beside the planet is the panel's own background instead of a wall of grey \"map data not yet available\" tiles.",
|
||||||
"Grid squares map: All, Phone and CW join Digital and FTx in the mode filter.",
|
"Grid squares map: All, Phone and CW join Digital and FTx in the mode filter.",
|
||||||
"Motorised antenna over serial: the COM port is now picked from a list of the ports actually present, with a refresh button — and still accepts one typed by hand, for an adapter that is not plugged in yet.",
|
"Motorised antenna over serial: the COM port is now picked from a list of the ports actually present, with a refresh button — and still accepts one typed by hand, for an adapter that is not plugged in yet.",
|
||||||
"Awards: choosing \"no field\" now clears the fallback searches with it. They kept running on their own fields while the panel no longer showed them, so an award declared to match nothing still found references."
|
"Awards: choosing \"no field\" now clears the fallback searches with it. They kept running on their own fields while the panel no longer showed them, so an award declared to match nothing still found references.",
|
||||||
|
"Callbook lookup now reads the Russian district (RDA) from HamQTH and fills it as the contact's RDA reference. Only on the QSO being typed, never on one already logged: the callbook gives the district a station operates from today, and stamping that on an older contact would rewrite a correct entry into a false one.",
|
||||||
|
"FlexRadio: when the meters stay dead, the log now says why. The meter stream is UDP sent from the radio to OpsLog, and a firewall blocking it leaves a perfectly healthy TCP link with meters at zero and no explanation — the line names the port and what to allow.",
|
||||||
|
"The Russian district database is now built in: 58 188 callsigns, with the dated periods each operated from each district. It fills the RDA reference while you type a Russian callsign — for the day of the contact, not for today — and Settings → Awards fills it on every Russian QSO already in the log. A reference you assigned by hand is never overwritten.",
|
||||||
|
"New Settings → Maintenance → Databases: every reference database OpsLog keeps on disk on its own line — country file, Club Log exceptions, LoTW users, Super Check Partial, US counties, Russian districts — plus one line per updatable award reference list (IOTA, POTA, SOTA, WWFF). Each says what it holds and when it was refreshed. The updaters were scattered across the Awards manager and three settings pages before. Tools no longer carries \"Refresh cty.dat\" and \"Download reference lists\" — both are lines on that page now.",
|
||||||
|
"FT decodes: the auto-call no longer offers a SOTA criterion. It was declared and translated but could never be ticked, and a decode carries no summit reference for it to test — a setting that promised something the feature cannot do.",
|
||||||
|
"Auto-call: the slot criterion is named \"a new slot (band+mode never worked together)\" — the same word the cluster and the decodes panel already badge it with. \"A new band+mode slot\" read as \"a new band AND a new mode\", which is the one thing it is not.",
|
||||||
|
"Voice keyer: typing a callsign stops the auto-CQ. It stopped the CW auto-call and left the voice keyer calling CQ over the station that had just answered — the reason to stop has nothing to do with Morse, so both engines now stop on the same event.",
|
||||||
|
"The motorised antenna (Ultrabeam / SteppIR) now has a docked widget of its own, with a dish icon beside the entry strip: pattern (Normal / 180° / Bi), band buttons, ±25 kHz nudge and Retract — what you touch between contacts. Tracking, its mode and step, and the per-element lengths stay in the Station Control tab, where they are set once. The icon pulses amber while the elements travel.",
|
||||||
|
"FT decodes: a station with a compound callsign is no longer invisible. FT8 sends such a call as a hash, printed between angle brackets — \"F4BPO <ZA/IW2JOP> -24\" — and every decode carrying one was discarded as unparseable, including the reply telling you that station had answered. The two-message form (\"… RR73; … <call> -08\") is read correctly too.",
|
||||||
|
"The log now records when a profile re-applies every subsystem. That rebuild is what dropped WSJT-X's CAT connection — an operator's log showed it happening 54 times in one session, three of them while the rig was keyed — and nothing said it was happening at all.",
|
||||||
|
"The shared CAT server is never torn down while the rig is transmitting. A rebuild that really is needed now waits for the over to end — closing the socket mid-transmission is what left WSJT-X inside a run of Hamlib calls with nothing at the other end.",
|
||||||
|
"Autostart: a program can be closed when OpsLog closes. Per program, so the rotator controller can stay while WSJT-X goes, and only ever a polite close — the way clicking its cross would — of a program OpsLog itself started.",
|
||||||
|
"Awards: switching a column between the reference and its description is now immediate. It rebuilt every award for every contact in the log — work with a known answer, since a relabel cannot change which QSOs match. Only that award is recomputed, and only on the rows that already carry it. The full recompute also reads twenty-seven columns per QSO instead of a hundred and fifty."
|
||||||
],
|
],
|
||||||
"fr": [
|
"fr": [
|
||||||
"Enregistrer les préférences ne coupe plus la radio. La liaison CAT — et le serveur CAT partagé auquel WSJT-X et JTDX se connectent — n'est reconstruite que si la connexion elle-même a changé, si bien qu'un Enregistrer en plein QSO ne les éjecte plus avec une erreur. C'est ce même redémarrage qui effaçait les spots du panadapter FlexRadio à chaque enregistrement.",
|
"Enregistrer les préférences ne coupe plus la radio. La liaison CAT — et le serveur CAT partagé auquel WSJT-X et JTDX se connectent — n'est reconstruite que si la connexion elle-même a changé, si bien qu'un Enregistrer en plein QSO ne les éjecte plus avec une erreur. C'est ce même redémarrage qui effaçait les spots du panadapter FlexRadio à chaque enregistrement.",
|
||||||
@@ -16,7 +29,20 @@
|
|||||||
"Carte des carrés locator : le monde est dessiné une seule fois au lieu de se répéter d'est en ouest, le zoom arrière descend assez bas pour tenir le Groenland et l'Antarctique en même temps, et l'espace à côté de la planète est le fond du panneau au lieu d'un mur de tuiles grises « map data not yet available ».",
|
"Carte des carrés locator : le monde est dessiné une seule fois au lieu de se répéter d'est en ouest, le zoom arrière descend assez bas pour tenir le Groenland et l'Antarctique en même temps, et l'espace à côté de la planète est le fond du panneau au lieu d'un mur de tuiles grises « map data not yet available ».",
|
||||||
"Carte des carrés locator : Tout, Phonie et CW rejoignent Numérique et FTx dans le filtre de mode.",
|
"Carte des carrés locator : Tout, Phonie et CW rejoignent Numérique et FTx dans le filtre de mode.",
|
||||||
"Antenne motorisée en liaison série : le port COM se choisit maintenant dans la liste des ports réellement présents, avec un bouton d'actualisation — et accepte toujours une saisie à la main, pour un adaptateur qui n'est pas encore branché.",
|
"Antenne motorisée en liaison série : le port COM se choisit maintenant dans la liste des ports réellement présents, avec un bouton d'actualisation — et accepte toujours une saisie à la main, pour un adaptateur qui n'est pas encore branché.",
|
||||||
"Diplômes : choisir « aucun champ » efface désormais les recherches de repli avec lui. Elles continuaient de tourner sur leurs propres champs alors que le panneau ne les affichait plus, si bien qu'un diplôme déclaré ne rien reconnaître trouvait quand même des références."
|
"Diplômes : choisir « aucun champ » efface désormais les recherches de repli avec lui. Elles continuaient de tourner sur leurs propres champs alors que le panneau ne les affichait plus, si bien qu'un diplôme déclaré ne rien reconnaître trouvait quand même des références.",
|
||||||
|
"La recherche callbook lit désormais le district russe (RDA) chez HamQTH et le renseigne comme référence RDA du contact. Uniquement sur le QSO en cours de saisie, jamais sur un QSO déjà journalisé : le callbook donne le district d'où la station émet aujourd'hui, et l'appliquer à un contact ancien transformerait une entrée correcte en entrée fausse.",
|
||||||
|
"FlexRadio : quand les mesures restent mortes, le journal dit maintenant pourquoi. Le flux de mesures est un envoi UDP de la radio vers OpsLog, et un pare-feu qui le bloque laisse une liaison TCP parfaitement saine avec des aiguilles à zéro et aucune explication — la ligne nomme le port et ce qu'il faut autoriser.",
|
||||||
|
"La base des districts russes est désormais intégrée : 58 188 indicatifs, avec les périodes datées passées dans chaque district. Elle renseigne la référence RDA pendant que tu tapes un indicatif russe — pour le jour du contact, pas pour aujourd'hui — et Réglages → Diplômes la renseigne sur tous les QSO russes déjà journalisés. Une référence attribuée à la main n'est jamais écrasée.",
|
||||||
|
"Nouveau Réglages → Maintenance → Bases de données : chaque base de référence qu'OpsLog garde sur disque a sa ligne — fichier pays, exceptions Club Log, utilisateurs LoTW, Super Check Partial, comtés US, districts russes — plus une ligne par liste de références de diplôme actualisable (IOTA, POTA, SOTA, WWFF). Chacune dit ce qu'elle contient et sa dernière actualisation. Les mises à jour étaient jusqu'ici dispersées entre le gestionnaire de diplômes et trois pages de réglages. Le menu Outils ne porte plus « Refresh cty.dat » ni « Download reference lists » — les deux sont des lignes de cette page.",
|
||||||
|
"Décodages FT : l'appel automatique ne propose plus de critère SOTA. Il était déclaré et traduit mais impossible à cocher, et un décodage ne porte aucune référence de sommet à tester — un réglage qui promettait ce que la fonction ne sait pas faire.",
|
||||||
|
"Appel automatique : le critère de slot s'appelle désormais « un nouveau slot (bande+mode jamais faits ensemble) » — le mot que le cluster et le panneau des décodages emploient déjà sur leur pastille. « Un nouveau couple bande+mode » se lisait comme « une nouvelle bande ET un nouveau mode », ce qu'il n'est justement pas.",
|
||||||
|
"Manipulateur vocal : taper un indicatif arrête l'appel automatique. Il arrêtait l'auto-call CW et laissait le DVK appeler CQ par-dessus la station qui venait de répondre — la raison de s'arrêter n'a rien à voir avec la télégraphie, les deux moteurs s'arrêtent donc sur le même événement.",
|
||||||
|
"L'antenne motorisée (Ultrabeam / SteppIR) a désormais son widget ancré, avec une icône de parabole à côté de la barre de saisie : diagramme (Normal / 180° / Bi), boutons de bande, décalage ±25 kHz et Rétracter — ce qu'on touche entre deux contacts. Le suivi, son mode et son pas, ainsi que les longueurs d'éléments restent dans l'onglet Station, où ils se règlent une fois pour toutes. L'icône clignote en ambre pendant que les éléments se déplacent.",
|
||||||
|
"Décodages FT : une station à indicatif composé n'est plus invisible. Le FT8 transmet un tel indicatif sous forme de hachage, affiché entre chevrons — « F4BPO <ZA/IW2JOP> -24 » — et tout décodage en contenant un était jeté comme illisible, y compris la réponse qui t'annonçait que cette station t'avait répondu. La forme à deux messages (« … RR73; … <indicatif> -08 ») est également lue correctement.",
|
||||||
|
"Le journal enregistre désormais quand un profil ré-applique tous ses sous-systèmes. C'est cette reconstruction qui coupait la liaison CAT de WSJT-X — le journal d'un opérateur en montre 54 dans une seule session, dont trois pendant que la radio émettait — et rien n'indiquait qu'elle avait lieu.",
|
||||||
|
"Le serveur CAT partagé n'est plus jamais démonté pendant que la radio émet. Une reconstruction réellement nécessaire attend la fin de l'émission — fermer la socket en pleine transmission, c'est ce qui laissait WSJT-X au milieu d'une série d'appels Hamlib sans personne à l'autre bout.",
|
||||||
|
"Démarrage auto : un programme peut être fermé à la fermeture d'OpsLog. Au cas par cas, pour que le contrôleur de rotor reste pendant que WSJT-X s'en va, et toujours une demande de fermeture polie — comme un clic sur sa croix — d'un programme lancé par OpsLog lui-même.",
|
||||||
|
"Diplômes : basculer une colonne entre la référence et sa description est désormais immédiat. L'opération reconstruisait tous les diplômes de tous les contacts du journal — un travail au résultat connu d'avance, puisqu'un changement d'étiquette ne change pas quels QSO correspondent. Seul ce diplôme est recalculé, et seulement sur les lignes qui le portent déjà. Le recalcul complet lit aussi vingt-sept colonnes par QSO au lieu de cent cinquante."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
+74
-50
@@ -1,7 +1,7 @@
|
|||||||
import { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
import { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||||
import {
|
import {
|
||||||
Activity, AlertCircle, Antenna, Bell, Check, CheckCircle2, ChevronDown, Clock, CloudOff, Compass, Database, Ear, Eraser, Flame, Gauge, Hash, Loader2, Lock,
|
Activity, AlertCircle, Antenna, Bell, Check, CheckCircle2, ChevronDown, Clock, CloudOff, Compass, Database, Ear, Eraser, Flame, Gauge, Hash, Loader2, Lock,
|
||||||
Maximize2, Minimize2, Mic, MessageSquare, Pencil, Radar, Radio, RadioTower, RefreshCw, Satellite, Send, Settings, SlidersHorizontal, SpellCheck, Square, Terminal, Trash2, Unlock, X, Zap,
|
Maximize2, Minimize2, Mic, MessageSquare, Pencil, Radar, Radio, RadioTower, RefreshCw, Satellite, Send, SatelliteDish, Settings, SlidersHorizontal, SpellCheck, Square, Terminal, Trash2, Unlock, X, Zap,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -20,7 +20,6 @@ import {
|
|||||||
RotatorGoToPath,
|
RotatorGoToPath,
|
||||||
GetCATState, SetCATFrequency, SetCATMode, SwitchCATRig, EntryBandChanged, FlexApplyBandAntenna, FlexApplyBandPower,
|
GetCATState, SetCATFrequency, SetCATMode, SwitchCATRig, EntryBandChanged, FlexApplyBandAntenna, FlexApplyBandPower,
|
||||||
GetSecretStatus, UnlockSecrets,
|
GetSecretStatus, UnlockSecrets,
|
||||||
RefreshCtyDat, DownloadAllReferenceLists,
|
|
||||||
RotatorGoTo, RotatorStop, SetActiveRotor,
|
RotatorGoTo, RotatorStop, SetActiveRotor,
|
||||||
GetDBConnectionInfo, GetLogbookRevision,
|
GetDBConnectionInfo, GetLogbookRevision,
|
||||||
GetUltrabeamStatus, SetUltrabeamDirection, UILog,
|
GetUltrabeamStatus, SetUltrabeamDirection, UILog,
|
||||||
@@ -56,7 +55,7 @@ import {
|
|||||||
QSLViaRepairStatus, RepairQSLVia, DismissQSLViaRepair,
|
QSLViaRepairStatus, RepairQSLVia, DismissQSLViaRepair,
|
||||||
} from '../wailsjs/go/main/App';
|
} from '../wailsjs/go/main/App';
|
||||||
import { Combobox } from '@/components/ui/combobox';
|
import { Combobox } from '@/components/ui/combobox';
|
||||||
import { applyAwardRefs, parseAwardRefs as parseManualRefs, spotRefList , withIOTARef } from '@/lib/awardRefs';
|
import { applyAwardRefs, parseAwardRefs as parseManualRefs, spotRefList , withIOTARef, withRDARef } from '@/lib/awardRefs';
|
||||||
import { EventsOn, BrowserOpenURL, WindowMinimise, WindowToggleMaximise, WindowIsMaximised, Quit } from '../wailsjs/runtime/runtime';
|
import { EventsOn, BrowserOpenURL, WindowMinimise, WindowToggleMaximise, WindowIsMaximised, Quit } from '../wailsjs/runtime/runtime';
|
||||||
import type { adif as adifModels, lookup as lookupModels, cat as catModels } from '../wailsjs/go/models';
|
import type { adif as adifModels, lookup as lookupModels, cat as catModels } from '../wailsjs/go/models';
|
||||||
import type { QSOForm, WorkedBeforeView, StationSettingsForm, ListsSettingsForm, ModePresetForm } from '@/types';
|
import type { QSOForm, WorkedBeforeView, StationSettingsForm, ListsSettingsForm, ModePresetForm } from '@/types';
|
||||||
@@ -80,6 +79,7 @@ import { FlexPanel } from '@/components/FlexPanel';
|
|||||||
import { IcomPanel } from '@/components/IcomPanel';
|
import { IcomPanel } from '@/components/IcomPanel';
|
||||||
import { YaesuPanel } from '@/components/YaesuPanel';
|
import { YaesuPanel } from '@/components/YaesuPanel';
|
||||||
import { AntGeniusPanel, type AGStatus } from '@/components/AntGeniusPanel';
|
import { AntGeniusPanel, type AGStatus } from '@/components/AntGeniusPanel';
|
||||||
|
import { MotorAntennaWidget, type AntStatus } from '@/components/MotorAntennaWidget';
|
||||||
import { TunerGeniusPanel, type TGStatus } from '@/components/TunerGeniusPanel';
|
import { TunerGeniusPanel, type TGStatus } from '@/components/TunerGeniusPanel';
|
||||||
import { AmpWidget } from '@/components/AmpWidget';
|
import { AmpWidget } from '@/components/AmpWidget';
|
||||||
import { ScpPanel, type ScpResult } from '@/components/ScpPanel';
|
import { ScpPanel, type ScpResult } from '@/components/ScpPanel';
|
||||||
@@ -598,7 +598,14 @@ export default function App() {
|
|||||||
return () => { window.clearTimeout(t); off(); };
|
return () => { window.clearTimeout(t); off(); };
|
||||||
}, [callsign]);
|
}, [callsign]);
|
||||||
const [rotatorHeading, setRotatorHeading] = useState<{ enabled: boolean; ok: boolean; azimuth: number }>({ enabled: false, ok: false, azimuth: 0 });
|
const [rotatorHeading, setRotatorHeading] = useState<{ enabled: boolean; ok: boolean; azimuth: number }>({ enabled: false, ok: false, azimuth: 0 });
|
||||||
const [ubStatus, setUbStatus] = useState<{ enabled: boolean; connected: boolean; direction: number; moving: boolean }>({ enabled: false, connected: false, direction: 0, moving: false });
|
// The FULL antenna status, not the four fields the beam overlay needed: the
|
||||||
|
// docked widget shows frequency, bands and tracking too, and polling the same
|
||||||
|
// controller twice for two shapes of the same answer is how the two views end
|
||||||
|
// up disagreeing. One poll, one object.
|
||||||
|
const [ubStatus, setUbStatus] = useState<AntStatus>({
|
||||||
|
enabled: false, type: '', connected: false, direction: 0, frequency: 0, moving: false, elements: [],
|
||||||
|
});
|
||||||
|
const [showMotorAnt, setShowMotorAnt] = useState(() => localStorage.getItem('opslog.showMotorAnt') === '1');
|
||||||
const [agStatus, setAgStatus] = useState<AGStatus>({ connected: false, port_a: 0, port_b: 0, antennas: [] });
|
const [agStatus, setAgStatus] = useState<AGStatus>({ connected: false, port_a: 0, port_b: 0, antennas: [] });
|
||||||
const [agEnabled, setAgEnabled] = useState(false);
|
const [agEnabled, setAgEnabled] = useState(false);
|
||||||
const [tgStatus, setTgStatus] = useState<TGStatus>({ connected: false });
|
const [tgStatus, setTgStatus] = useState<TGStatus>({ connected: false });
|
||||||
@@ -2129,8 +2136,6 @@ export default function App() {
|
|||||||
}
|
}
|
||||||
}, [updateInfo]);
|
}, [updateInfo]);
|
||||||
const [deletingAll, setDeletingAll] = useState(false);
|
const [deletingAll, setDeletingAll] = useState(false);
|
||||||
const [ctyRefreshing, setCtyRefreshing] = useState(false);
|
|
||||||
const [refsDownloading, setRefsDownloading] = useState(false);
|
|
||||||
|
|
||||||
// === ADIF ===
|
// === ADIF ===
|
||||||
const [importing, setImporting] = useState(false);
|
const [importing, setImporting] = useState(false);
|
||||||
@@ -2759,7 +2764,14 @@ export default function App() {
|
|||||||
// open, and every poll opens and closes the port.
|
// open, and every poll opens and closes the port.
|
||||||
useEffect(() => subscribeRotorHeading((h) => setRotatorHeading(h as any)), []);
|
useEffect(() => subscribeRotorHeading((h) => setRotatorHeading(h as any)), []);
|
||||||
|
|
||||||
// Poll the Ultrabeam antenna for its connection + pattern direction.
|
// Poll the motorised antenna: connection, pattern, frequency, tracking.
|
||||||
|
//
|
||||||
|
// pokeUbStatus re-reads it NOW rather than waiting for the next tick, so a
|
||||||
|
// button in the docked widget shows its effect immediately instead of three
|
||||||
|
// seconds later — long enough to press it a second time.
|
||||||
|
const pokeUbStatus = useCallback(async () => {
|
||||||
|
try { const s: any = await GetUltrabeamStatus(); if (s) setUbStatus(s); } catch { /* transient */ }
|
||||||
|
}, []);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let alive = true;
|
let alive = true;
|
||||||
const tick = async () => {
|
const tick = async () => {
|
||||||
@@ -4405,7 +4417,13 @@ export default function App() {
|
|||||||
// previous contact with the call, so the island appeared for stations
|
// previous contact with the call, so the island appeared for stations
|
||||||
// already in the log and never for the new one on the island — which is
|
// already in the log and never for the new one on the island — which is
|
||||||
// the entire point of the feature.
|
// the entire point of the feature.
|
||||||
award_refs: withIOTARef(d.award_refs ?? '', String((r as any)?.iota ?? '')),
|
// The island, then the Russian district — both from the callbook, both
|
||||||
|
// only ever applied to the contact being typed. See withRDARef for why
|
||||||
|
// that restriction is the whole design.
|
||||||
|
award_refs: withRDARef(
|
||||||
|
withIOTARef(d.award_refs ?? '', String((r as any)?.iota ?? '')),
|
||||||
|
String((r as any)?.rda ?? ''),
|
||||||
|
),
|
||||||
}));
|
}));
|
||||||
// Backfill anything the provider didn't supply from the last time we worked
|
// Backfill anything the provider didn't supply from the last time we worked
|
||||||
// this call (call not found on QRZ/HamQTH, or lookup off → cty.dat only).
|
// this call (call not found on QRZ/HamQTH, or lookup off → cty.dat only).
|
||||||
@@ -4481,11 +4499,21 @@ export default function App() {
|
|||||||
// the first keystroke, so we only abort once.)
|
// the first keystroke, so we only abort once.)
|
||||||
if (v.trim() !== '') {
|
if (v.trim() !== '') {
|
||||||
// Someone answered: on the FIRST character of a new call (the field was
|
// Someone answered: on the FIRST character of a new call (the field was
|
||||||
// empty), abort whatever CW is being sent — a single macro OR an auto-call
|
// empty), abort whatever is being sent — a single macro OR an auto-call
|
||||||
// CQ loop — routed to the ACTIVE engine (was WinKeyer-only, so a Flex CWX /
|
// CQ loop — routed to the ACTIVE engine (was WinKeyer-only, so a Flex CWX /
|
||||||
// Icom macro kept keying over the answering station).
|
// Icom macro kept keying over the answering station).
|
||||||
if (callsignValRef.current.trim() === '') stopKeyerTx();
|
//
|
||||||
|
// The VOICE keyer gets the same treatment, and did not: typing a callsign
|
||||||
|
// stopped the CW auto-call and left the DVK cheerfully calling CQ over the
|
||||||
|
// station that had just answered. Nothing about the reason is specific to
|
||||||
|
// Morse — it is "somebody is there, stop calling" — so both engines stop
|
||||||
|
// on the same event.
|
||||||
|
if (callsignValRef.current.trim() === '') {
|
||||||
|
stopKeyerTx();
|
||||||
|
DVKStop().catch(() => { /* nothing playing */ });
|
||||||
|
}
|
||||||
stopAutoCall();
|
stopAutoCall();
|
||||||
|
stopDvkAutoCq();
|
||||||
}
|
}
|
||||||
// No-op guard: external apps (MSHV/WSJT-X) re-broadcast the same DX call
|
// No-op guard: external apps (MSHV/WSJT-X) re-broadcast the same DX call
|
||||||
// on every status packet. If it matches what's already in the entry,
|
// on every status packet. If it matches what's already in the entry,
|
||||||
@@ -4629,11 +4657,10 @@ export default function App() {
|
|||||||
{ type: 'item', label: t('tools.alerts'), action: 'tools.alerts' },
|
{ type: 'item', label: t('tools.alerts'), action: 'tools.alerts' },
|
||||||
{ type: 'separator' },
|
{ type: 'separator' },
|
||||||
{ type: 'item', label: t('tools.duplicates'), action: 'tools.duplicates', disabled: total === 0 },
|
{ type: 'item', label: t('tools.duplicates'), action: 'tools.duplicates', disabled: total === 0 },
|
||||||
{ type: 'separator' },
|
// The two maintenance entries that used to sit here — refresh cty.dat and
|
||||||
// Maintenance — bumped here while we only have one entry. Will move
|
// download the reference lists — moved to Settings → Maintenance →
|
||||||
// to a Tools → Maintenance submenu once Clublog + LoTW refresh land.
|
// Databases, where every other database already lives. One place to look
|
||||||
{ type: 'item', label: ctyRefreshing ? 'Refreshing cty.dat…' : 'Refresh cty.dat', action: 'tools.refreshCty', disabled: ctyRefreshing },
|
// beats two, and the Tools menu is for what you DO with the log.
|
||||||
{ type: 'item', label: refsDownloading ? 'Downloading reference lists…' : 'Download reference lists (IOTA/POTA/WWFF/SOTA)', action: 'tools.downloadRefs', disabled: refsDownloading },
|
|
||||||
]},
|
]},
|
||||||
{ name: 'help', label: t('menu.help'), items: [
|
{ name: 'help', label: t('menu.help'), items: [
|
||||||
{ type: 'item', label: t('whatsnew.title'), action: 'help.whatsnew' },
|
{ type: 'item', label: t('whatsnew.title'), action: 'help.whatsnew' },
|
||||||
@@ -4649,7 +4676,7 @@ export default function App() {
|
|||||||
{ type: 'separator' },
|
{ type: 'separator' },
|
||||||
{ type: 'item', label: t('help.about'), action: 'help.about' },
|
{ type: 'item', label: t('help.about'), action: 'help.about' },
|
||||||
]},
|
]},
|
||||||
], [total, selectedId, selectedIds, ctyRefreshing, refsDownloading, exporting, wkEnabled, dvkEnabled, cwEnabled, netEnabled, contestTabEnabled, smtpConfigured, sendingLog, t]);
|
], [total, selectedId, selectedIds, exporting, wkEnabled, dvkEnabled, cwEnabled, netEnabled, contestTabEnabled, smtpConfigured, sendingLog, t]);
|
||||||
|
|
||||||
function handleMenu(action: string) {
|
function handleMenu(action: string) {
|
||||||
switch (action) {
|
switch (action) {
|
||||||
@@ -4677,8 +4704,6 @@ export default function App() {
|
|||||||
case 'tools.contest': setContestTabEnabled((v) => { const nv = !v; if (nv) setActiveTab('contest'); else setActiveTab((tb) => (tb === 'contest' ? 'recent' : tb)); return nv; }); break;
|
case 'tools.contest': setContestTabEnabled((v) => { const nv = !v; if (nv) setActiveTab('contest'); else setActiveTab((tb) => (tb === 'contest' ? 'recent' : tb)); return nv; }); break;
|
||||||
case 'tools.alerts': setAlertsOpen(true); break;
|
case 'tools.alerts': setAlertsOpen(true); break;
|
||||||
case 'tools.duplicates': setShowDuplicates(true); break;
|
case 'tools.duplicates': setShowDuplicates(true); break;
|
||||||
case 'tools.refreshCty': refreshCtyDat(); break;
|
|
||||||
case 'tools.downloadRefs': downloadRefs(); break;
|
|
||||||
case 'help.about': setShowAbout(true); checkUpdateNow(); break;
|
case 'help.about': setShowAbout(true); checkUpdateNow(); break;
|
||||||
case 'help.log': setShowLogViewer(true); break;
|
case 'help.log': setShowLogViewer(true); break;
|
||||||
case 'help.whatsnew': GetChangelog().then((e: any) => { if (Array.isArray(e) && e.length) setWhatsNew(e); else showToast(t('whatsnew.none')); }).catch(() => {}); break;
|
case 'help.whatsnew': GetChangelog().then((e: any) => { if (Array.isArray(e) && e.length) setWhatsNew(e); else showToast(t('whatsnew.none')); }).catch(() => {}); break;
|
||||||
@@ -4703,37 +4728,6 @@ export default function App() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function downloadRefs() {
|
|
||||||
if (refsDownloading) return;
|
|
||||||
setRefsDownloading(true);
|
|
||||||
setError('');
|
|
||||||
try {
|
|
||||||
const summary = await DownloadAllReferenceLists();
|
|
||||||
showToast(`Reference lists updated — ${summary}`);
|
|
||||||
} catch (e: any) {
|
|
||||||
setError(`Reference download failed: ${String(e?.message ?? e)}`);
|
|
||||||
} finally {
|
|
||||||
setRefsDownloading(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function refreshCtyDat() {
|
|
||||||
if (ctyRefreshing) return;
|
|
||||||
setCtyRefreshing(true);
|
|
||||||
setError('');
|
|
||||||
try {
|
|
||||||
const info = await RefreshCtyDat();
|
|
||||||
// Use the regular error banner area for a brief success note — keeps
|
|
||||||
// us from pulling in a toast system just for one maintenance action.
|
|
||||||
setError(`cty.dat refreshed — ${info.entities} entities loaded`);
|
|
||||||
setTimeout(() => setError((e) => e.startsWith('cty.dat refreshed') ? '' : e), 4000);
|
|
||||||
} catch (e: any) {
|
|
||||||
setError(`cty.dat refresh failed: ${String(e?.message ?? e)}`);
|
|
||||||
} finally {
|
|
||||||
setCtyRefreshing(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
function onKey(e: KeyboardEvent) {
|
function onKey(e: KeyboardEvent) {
|
||||||
const tag = (e.target as HTMLElement)?.tagName;
|
const tag = (e.target as HTMLElement)?.tagName;
|
||||||
@@ -6157,6 +6151,25 @@ export default function App() {
|
|||||||
>
|
>
|
||||||
<Compass className="size-4" />
|
<Compass className="size-4" />
|
||||||
</button>
|
</button>
|
||||||
|
{ubStatus.enabled && (
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() => { const v = !showMotorAnt; setShowMotorAnt(v); writeUiPref('opslog.showMotorAnt', v ? '1' : '0'); }}
|
||||||
|
title={showMotorAnt ? t('station.motorWidgetHide') : t('station.motorWidgetShow')}
|
||||||
|
className={cn(
|
||||||
|
'relative inline-flex items-center justify-center size-7 rounded-md border transition-colors',
|
||||||
|
showMotorAnt ? 'border-success-border bg-success-muted text-success-muted-foreground hover:bg-success-muted'
|
||||||
|
: 'border-border text-muted-foreground hover:bg-muted',
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<SatelliteDish className="size-4" />
|
||||||
|
{/* Amber while the elements travel: on a SteppIR that is also
|
||||||
|
when transmitting is a bad idea, so it is worth seeing from
|
||||||
|
the icon without opening the widget. */}
|
||||||
|
{ubStatus.moving && <span className="absolute -top-0.5 -right-0.5 size-2 rounded-full bg-warning animate-pulse" />}
|
||||||
|
{!ubStatus.moving && showMotorAnt && ubStatus.connected && <span className="absolute -top-0.5 -right-0.5 size-2 rounded-full bg-success" />}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
{agEnabled && (
|
{agEnabled && (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@@ -6788,7 +6801,7 @@ export default function App() {
|
|||||||
{/* Reserved free space to the right. The WinKeyer CW keyer and/or the
|
{/* Reserved free space to the right. The WinKeyer CW keyer and/or the
|
||||||
Digital Voice Keyer take this slot when enabled (Log4OM-style);
|
Digital Voice Keyer take this slot when enabled (Log4OM-style);
|
||||||
otherwise it shows the QRZ profile photo. */}
|
otherwise it shows the QRZ profile photo. */}
|
||||||
{!compact && (chatShown || wkEnabled || dvkEnabled || lookupResult?.image_url || (showRotor && (rotatorHeading.enabled || dxPath)) || (showAntGenius && agEnabled) || (showTuner && tgEnabled) || (showAmpWidget && ampSts.length > 0) || (showScp && scpEnabled) || (chaseNewOn && showChaseNew) || (showLiveStations && dbConn?.backend === 'mysql')) && (
|
{!compact && (chatShown || wkEnabled || dvkEnabled || lookupResult?.image_url || (showRotor && (rotatorHeading.enabled || dxPath)) || (showMotorAnt && ubStatus.enabled) || (showAntGenius && agEnabled) || (showTuner && tgEnabled) || (showAmpWidget && ampSts.length > 0) || (showScp && scpEnabled) || (chaseNewOn && showChaseNew) || (showLiveStations && dbConn?.backend === 'mysql')) && (
|
||||||
// relative + absolute inner (like the F1-F5 panel): a taller widget (e.g.
|
// relative + absolute inner (like the F1-F5 panel): a taller widget (e.g.
|
||||||
// the DVK with Auto CQ) can't grow the row — the row height stays set by
|
// the DVK with Auto CQ) can't grow the row — the row height stays set by
|
||||||
// the entry strip and each widget fills that height, scrolling inside.
|
// the entry strip and each widget fills that height, scrolling inside.
|
||||||
@@ -6872,6 +6885,17 @@ export default function App() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
{showMotorAnt && ubStatus.enabled && (
|
||||||
|
<div className="w-[230px] shrink-0 min-h-0">
|
||||||
|
<MotorAntennaWidget
|
||||||
|
ant={ubStatus}
|
||||||
|
refetch={pokeUbStatus}
|
||||||
|
t={t}
|
||||||
|
essentialsOnly
|
||||||
|
onClose={() => { setShowMotorAnt(false); writeUiPref('opslog.showMotorAnt', '0'); }}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
{showAntGenius && agEnabled && (
|
{showAntGenius && agEnabled && (
|
||||||
<div className="w-[230px] shrink-0 min-h-0">
|
<div className="w-[230px] shrink-0 min-h-0">
|
||||||
<AntGeniusPanel
|
<AntGeniusPanel
|
||||||
|
|||||||
@@ -0,0 +1,298 @@
|
|||||||
|
// MotorAntennaWidget — the Ultrabeam / SteppIR control, in one place.
|
||||||
|
//
|
||||||
|
// Lives in its own file because it is shown in TWO: the Station Control tab and
|
||||||
|
// the dock beside the entry strip. Two copies of a control that keys hardware is
|
||||||
|
// how one of them quietly stops matching the other — a pattern button that sets
|
||||||
|
// a different direction, a band list that tunes somewhere else.
|
||||||
|
import { useCallback, useEffect, useState } from 'react';
|
||||||
|
import { ArrowDownToLine, ChevronDown, ChevronUp, Loader2, Minus, Plus, RefreshCw, Antenna as AntennaIcon, X } from 'lucide-react';
|
||||||
|
import { cn } from '@/lib/utils';
|
||||||
|
import {
|
||||||
|
SetUltrabeamDirection, UltrabeamRetract, MotorSetElement, MotorReadElements,
|
||||||
|
MotorTuneKHz, MotorNudgeKHz, SetMotorFollow,
|
||||||
|
} from '../../wailsjs/go/main/App';
|
||||||
|
|
||||||
|
export type AntStatus = { enabled: boolean; type: string; connected: boolean; direction: number; frequency: number; moving: boolean; elements: number[]; follow?: boolean; step_khz?: number; track_mode?: string; bands?: string[]; band_freqs?: Record<string, number> };
|
||||||
|
|
||||||
|
// Where each band button points the antenna.
|
||||||
|
//
|
||||||
|
// Not the arithmetic centre of the band. An antenna is tuned for where people
|
||||||
|
// actually work: 20 m centres on 14175 but nobody lives there, and 10 m spans
|
||||||
|
// 1.7 MHz of which the top half is empty. These are the points that leave the
|
||||||
|
// elements closest to right for the whole band, and one nudge away from the rest.
|
||||||
|
const ANT_BAND_KHZ: Record<string, number> = {
|
||||||
|
'40m': 7100, '30m': 10125, '20m': 14150, '17m': 18110,
|
||||||
|
'15m': 21150, '12m': 24930, '10m': 28400, '6m': 50150,
|
||||||
|
};
|
||||||
|
|
||||||
|
// NUDGE_KHZ is the up/down step. 25 kHz because that is also the finest tracking
|
||||||
|
// threshold: a nudge smaller than the tracking step would be undone by the next
|
||||||
|
// poll while tracking is on.
|
||||||
|
const NUDGE_KHZ = 25;
|
||||||
|
|
||||||
|
// bandOfKHz names the band a frequency sits in, so a band button can light up
|
||||||
|
// when the ANTENNA is already there. Deliberately generous at the edges: the
|
||||||
|
// antenna's reported frequency is where it was commanded, which can sit slightly
|
||||||
|
// outside the allocation.
|
||||||
|
function bandOfKHz(khz: number): string {
|
||||||
|
const edges: [number, number, string][] = [
|
||||||
|
[6900, 7300, '40m'], [10050, 10200, '30m'], [13900, 14400, '20m'],
|
||||||
|
[18000, 18200, '17m'], [20900, 21500, '15m'], [24800, 25000, '12m'],
|
||||||
|
[27900, 29800, '10m'], [49900, 50600, '6m'],
|
||||||
|
];
|
||||||
|
for (const [lo, hi, b] of edges) if (khz >= lo && khz <= hi) return b;
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// MotorAntennaWidget controls a motorized antenna (Ultrabeam / SteppIR) from the
|
||||||
|
// Station Control tab: pattern (Normal / 180° / Bi), Retract, and — Ultrabeam
|
||||||
|
// only — per-element length adjustment. Heading/state is polled by the panel.
|
||||||
|
const ELEMENT_STEP = 2; // the physical console adjusts 2 mm per press
|
||||||
|
|
||||||
|
// elementName maps an element index to a ham-radio name: 0 = reflector,
|
||||||
|
// 1 = driven element, then Director 1, 2, 3…
|
||||||
|
function elementName(i: number, t: (k: string, v?: any) => string): string {
|
||||||
|
if (i === 0) return t('station.reflector');
|
||||||
|
if (i === 1) return t('station.driven');
|
||||||
|
return `${t('station.director')} ${i - 1}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function MotorAntennaWidget({ ant, refetch, t, onClose, essentialsOnly }: {
|
||||||
|
ant: AntStatus;
|
||||||
|
refetch: () => void;
|
||||||
|
t: (k: string, v?: any) => string;
|
||||||
|
// onClose adds the dock's close button. The Station Control tab passes none:
|
||||||
|
// there the widget is a tile in a grid, and a tile that closes itself would
|
||||||
|
// leave a hole the operator cannot fill back in.
|
||||||
|
onClose?: () => void;
|
||||||
|
// essentialsOnly drops what an operator sets once and then leaves alone:
|
||||||
|
// tracking with its mode and step, and the per-element lengths. They belong in
|
||||||
|
// Station Control, where there is room to think; in the dock they are height
|
||||||
|
// spent on controls nobody touches between contacts, pushing the ones they do
|
||||||
|
// touch — pattern, bands, nudge — off the bottom.
|
||||||
|
essentialsOnly?: boolean;
|
||||||
|
}) {
|
||||||
|
const [err, setErr] = useState('');
|
||||||
|
const [lengths, setLengths] = useState<number[]>([]); // current element lengths (mm), from ReadElements
|
||||||
|
const [reading, setReading] = useState(false);
|
||||||
|
const [busyEl, setBusyEl] = useState<number | null>(null);
|
||||||
|
const [editingEl, setEditingEl] = useState<number | null>(null); // element whose mm is being typed
|
||||||
|
const [editVal, setEditVal] = useState('');
|
||||||
|
const run = (p: Promise<any>) => p.then(refetch).catch((e) => setErr(String(e?.message ?? e)));
|
||||||
|
const isUB = ant.type !== 'steppir';
|
||||||
|
|
||||||
|
const readLengths = useCallback(async () => {
|
||||||
|
setReading(true); setErr('');
|
||||||
|
try { setLengths(((await MotorReadElements()) ?? []) as number[]); }
|
||||||
|
catch (e: any) { setErr(String(e?.message ?? e)); }
|
||||||
|
finally { setReading(false); }
|
||||||
|
}, []);
|
||||||
|
// Read the current lengths once when the Ultrabeam widget mounts/connects, so
|
||||||
|
// +/- starts from the real values rather than blind.
|
||||||
|
useEffect(() => { if (isUB && ant.connected) readLengths(); }, [isUB, ant.connected, readLengths]);
|
||||||
|
|
||||||
|
// Send an absolute length to one element and remember it as the new baseline.
|
||||||
|
const setLen = async (i: number, mm: number) => {
|
||||||
|
const next = Math.max(0, Math.round(mm));
|
||||||
|
const prev = lengths[i] ?? 0;
|
||||||
|
setBusyEl(i); setErr('');
|
||||||
|
setLengths((ls) => { const c = [...ls]; c[i] = next; return c; }); // optimistic
|
||||||
|
try { await MotorSetElement(i, next); refetch(); }
|
||||||
|
catch (e: any) {
|
||||||
|
// Rejected by the controller — most often the element is at its travel
|
||||||
|
// limit for this band (extending on a low band). Revert the optimistic
|
||||||
|
// value so the display stays truthful, and explain the likely cause when
|
||||||
|
// the failed move was an extension.
|
||||||
|
setLengths((ls) => { const c = [...ls]; c[i] = prev; return c; });
|
||||||
|
setErr(next > prev ? t('station.atMax') : String(e?.message ?? e));
|
||||||
|
}
|
||||||
|
finally { setBusyEl(null); }
|
||||||
|
};
|
||||||
|
// Nudge one element by ±2 mm from its current known length.
|
||||||
|
const nudge = (i: number, delta: number) => setLen(i, (lengths[i] ?? 0) + delta);
|
||||||
|
// Commit a typed exact length (click on the mm value). Lets the operator fix
|
||||||
|
// the baseline when the auto-read is off, so +/- then work reliably.
|
||||||
|
const commitEdit = (i: number) => {
|
||||||
|
const v = parseInt(editVal, 10);
|
||||||
|
setEditingEl(null);
|
||||||
|
if (!isNaN(v) && v >= 0 && v !== lengths[i]) setLen(i, v);
|
||||||
|
};
|
||||||
|
const dirs: [number, string][] = [[0, 'N'], [1, '180°'], [2, t('station.bi')]];
|
||||||
|
return (
|
||||||
|
<div className="rounded-xl border border-border bg-card shadow-sm overflow-hidden h-full flex flex-col min-h-0">
|
||||||
|
<div className="flex items-center gap-2 px-2 py-1.5 border-b border-border/60 bg-muted/30 shrink-0">
|
||||||
|
<AntennaIcon className="size-4 text-primary" />
|
||||||
|
<div className="min-w-0">
|
||||||
|
<div className="text-sm font-semibold truncate">{isUB ? 'Ultrabeam' : 'SteppIR'}</div>
|
||||||
|
{ant.frequency > 0 && <div className="text-[10px] text-muted-foreground font-mono">{(ant.frequency / 1000).toFixed(3)} MHz</div>}
|
||||||
|
</div>
|
||||||
|
{ant.moving && <span className="ml-auto text-[10px] font-semibold text-warning animate-pulse">{t('station.moving')}</span>}
|
||||||
|
<span className={cn('size-2 rounded-full shrink-0', ant.moving ? '' : 'ml-auto', ant.connected ? 'bg-success' : 'bg-muted-foreground/40')}
|
||||||
|
title={ant.connected ? t('station.online') : t('station.offline')} />
|
||||||
|
{onClose && (
|
||||||
|
<button type="button" onClick={onClose} title={t('station.hideWidget')}
|
||||||
|
className="text-muted-foreground hover:text-foreground shrink-0">
|
||||||
|
<X className="size-3.5" />
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div className="p-2 space-y-2 flex-1 min-h-0 overflow-auto">
|
||||||
|
<div>
|
||||||
|
{/* No heading: N / 180° / Bi say what they are, and in a docked widget
|
||||||
|
a line of height costs more than the word explains. */}
|
||||||
|
<div className="flex gap-1">
|
||||||
|
{dirs.map(([d, lbl]) => (
|
||||||
|
<button key={d} type="button" disabled={!ant.connected}
|
||||||
|
onClick={() => run(SetUltrabeamDirection(d))}
|
||||||
|
className={cn('flex-1 rounded-md border py-1 text-xs font-semibold transition-colors disabled:opacity-40',
|
||||||
|
ant.direction === d ? 'bg-primary text-primary-foreground border-primary' : 'border-border hover:bg-muted')}>
|
||||||
|
{lbl}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/* Bands, then a nudge, then tracking — in the order an operator uses
|
||||||
|
them: get to the band, fine-tune inside it, decide whether the
|
||||||
|
antenna should follow the rig from here. */}
|
||||||
|
<div>
|
||||||
|
<div className="text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-0.5">{t('station.bands')}</div>
|
||||||
|
<div className="grid grid-cols-5 gap-1">
|
||||||
|
{(ant.bands ?? []).map((b: string) => {
|
||||||
|
// Where this band tunes is resolved by the backend — the operator's
|
||||||
|
// per-band choice from Settings, or the default. ANT_BAND_KHZ is only
|
||||||
|
// the floor for a status poll that hasn't landed yet.
|
||||||
|
const khz = ant.band_freqs?.[b] || ANT_BAND_KHZ[b];
|
||||||
|
if (!khz) return null;
|
||||||
|
// "On this band" from the antenna's own frequency, not the rig's:
|
||||||
|
// the widget must show where the ANTENNA is, which is the whole
|
||||||
|
// reason for tuning it by hand.
|
||||||
|
const here = ant.frequency > 0 && bandOfKHz(ant.frequency) === b;
|
||||||
|
return (
|
||||||
|
<button key={b} type="button" disabled={!ant.connected}
|
||||||
|
onClick={() => run(MotorTuneKHz(khz))}
|
||||||
|
title={`${(khz / 1000).toFixed(3)} MHz`}
|
||||||
|
className={cn('rounded-md border py-0.5 text-[11px] font-mono font-semibold transition-colors disabled:opacity-40',
|
||||||
|
here ? 'bg-primary text-primary-foreground border-primary' : 'border-border hover:bg-muted')}>
|
||||||
|
{b}
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="flex items-center gap-1">
|
||||||
|
<button type="button" disabled={!ant.connected}
|
||||||
|
onClick={() => run(MotorNudgeKHz(-NUDGE_KHZ))}
|
||||||
|
title={t('station.nudgeDown', { n: NUDGE_KHZ })}
|
||||||
|
className="flex-1 flex items-center justify-center gap-1 rounded-md border border-border py-1 text-xs font-semibold hover:bg-muted disabled:opacity-40">
|
||||||
|
<ChevronDown className="size-3.5" /> {NUDGE_KHZ}
|
||||||
|
</button>
|
||||||
|
<button type="button" disabled={!ant.connected}
|
||||||
|
onClick={() => run(MotorNudgeKHz(NUDGE_KHZ))}
|
||||||
|
title={t('station.nudgeUp', { n: NUDGE_KHZ })}
|
||||||
|
className="flex-1 flex items-center justify-center gap-1 rounded-md border border-border py-1 text-xs font-semibold hover:bg-muted disabled:opacity-40">
|
||||||
|
<ChevronUp className="size-3.5" /> {NUDGE_KHZ}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Tracking. Here rather than only in Settings because it is an operating
|
||||||
|
decision — off to park the antenna, on to resume — not something set
|
||||||
|
up once. Mode and step only show when tracking is on: settings for
|
||||||
|
something switched off are questions the operator cannot act on. And
|
||||||
|
the step only shows in step mode, where it is the one thing it means. */}
|
||||||
|
{!essentialsOnly && (
|
||||||
|
<div className="space-y-1.5">
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<button type="button"
|
||||||
|
onClick={() => run(SetMotorFollow(!ant.follow, 0, ''))}
|
||||||
|
className={cn('flex-1 rounded-md border py-1 text-xs font-semibold transition-colors',
|
||||||
|
ant.follow ? 'bg-success-muted text-success-muted-foreground border-success-border' : 'border-border hover:bg-muted')}>
|
||||||
|
{ant.follow ? t('station.trackOn') : t('station.trackOff')}
|
||||||
|
</button>
|
||||||
|
{ant.follow && (ant.track_mode || 'step') === 'step' && (
|
||||||
|
<select
|
||||||
|
value={String(ant.step_khz || 50)}
|
||||||
|
onChange={(e) => run(SetMotorFollow(true, parseInt(e.target.value, 10), ''))}
|
||||||
|
className="h-[30px] rounded-md border border-border bg-background px-1 text-xs font-mono"
|
||||||
|
title={t('station.trackStepTip')}
|
||||||
|
>
|
||||||
|
{[25, 50, 100].map((s) => <option key={s} value={s}>{s} kHz</option>)}
|
||||||
|
</select>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{ant.follow && (
|
||||||
|
<select
|
||||||
|
value={ant.track_mode || 'step'}
|
||||||
|
onChange={(e) => run(SetMotorFollow(true, 0, e.target.value))}
|
||||||
|
className="w-full h-[30px] rounded-md border border-border bg-background px-1.5 text-xs"
|
||||||
|
title={t('station.trackModeTip')}
|
||||||
|
>
|
||||||
|
<option value="always" title={t('station.trackAlwaysTip')}>{t('station.trackAlways')}</option>
|
||||||
|
<option value="step" title={t('station.trackStepTipMode')}>{t('station.trackStep')}</option>
|
||||||
|
<option value="band" title={t('station.trackBandTip')}>{t('station.trackBand')}</option>
|
||||||
|
</select>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<button type="button" disabled={!ant.connected}
|
||||||
|
onClick={() => run(UltrabeamRetract())}
|
||||||
|
className="w-full flex items-center justify-center gap-1.5 rounded-md border border-warning-border bg-warning-muted text-warning-muted-foreground py-1 text-xs font-semibold hover:brightness-95 disabled:opacity-40">
|
||||||
|
<ArrowDownToLine className="size-3.5" /> {t('station.retract')}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
{isUB && !essentialsOnly && (
|
||||||
|
<div>
|
||||||
|
<div className="flex items-center gap-2 mb-1.5">
|
||||||
|
<span className="text-[10px] font-semibold uppercase tracking-wider text-muted-foreground">{t('station.elements')}</span>
|
||||||
|
<button type="button" onClick={readLengths} disabled={!ant.connected || reading}
|
||||||
|
className="text-[10px] text-primary hover:underline inline-flex items-center gap-1 disabled:opacity-40" title={t('station.readLengths')}>
|
||||||
|
<RefreshCw className={cn('size-3', reading && 'animate-spin')} /> {t('station.read')}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
{lengths.length === 0 ? (
|
||||||
|
<p className="text-[11px] text-muted-foreground">{t('station.noLengths')}</p>
|
||||||
|
) : (
|
||||||
|
<div className="space-y-1.5">
|
||||||
|
{/* The READ_BANDS reply is undocumented and its 16-bit parse picks
|
||||||
|
up structural bytes past the real data (varying by band), which
|
||||||
|
made 6+ bogus "elements" appear. Ultrabeam beams are 3-element,
|
||||||
|
and ModifyElement addresses elements 0..2 — so show just those. */}
|
||||||
|
{lengths.map((mm, i) => ({ mm, i })).slice(0, 3).map(({ mm, i }) => (
|
||||||
|
<div key={i} className="flex items-center gap-2">
|
||||||
|
<span className="text-xs w-20 shrink-0 text-muted-foreground truncate">{elementName(i, t)}</span>
|
||||||
|
<button type="button" disabled={!ant.connected || busyEl !== null}
|
||||||
|
onClick={() => nudge(i, -ELEMENT_STEP)}
|
||||||
|
className="flex items-center justify-center size-7 rounded-md border border-border hover:bg-muted disabled:opacity-40 shrink-0">
|
||||||
|
<Minus className="size-3.5" />
|
||||||
|
</button>
|
||||||
|
{editingEl === i ? (
|
||||||
|
<input autoFocus type="number" value={editVal}
|
||||||
|
onChange={(e) => setEditVal(e.target.value)}
|
||||||
|
onBlur={() => commitEdit(i)}
|
||||||
|
onKeyDown={(e) => { if (e.key === 'Enter') commitEdit(i); if (e.key === 'Escape') setEditingEl(null); }}
|
||||||
|
className="text-sm font-mono font-bold flex-1 min-w-0 text-center tabular-nums bg-transparent border border-primary rounded px-1" />
|
||||||
|
) : (
|
||||||
|
<span className="text-sm font-mono font-bold flex-1 min-w-0 text-center tabular-nums cursor-pointer hover:underline"
|
||||||
|
title={t('station.setExactLen')}
|
||||||
|
onClick={() => { setEditingEl(i); setEditVal(String(mm)); }}>
|
||||||
|
{busyEl === i ? <Loader2 className="size-3.5 animate-spin inline" /> : `${mm} mm`}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
<button type="button" disabled={!ant.connected || busyEl !== null}
|
||||||
|
onClick={() => nudge(i, ELEMENT_STEP)}
|
||||||
|
className="flex items-center justify-center size-7 rounded-md border border-border hover:bg-muted disabled:opacity-40 shrink-0">
|
||||||
|
<Plus className="size-3.5" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<p className="text-[10px] text-muted-foreground mt-1">{t('station.elementsHint')}</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{err && <div className="text-[11px] text-destructive break-words">{err}</div>}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -47,7 +47,8 @@ import {
|
|||||||
TestLoTWUpload, ListTQSLStationLocations,
|
TestLoTWUpload, ListTQSLStationLocations,
|
||||||
DownloadLoTWUsers, GetLoTWUsersStatus,
|
DownloadLoTWUsers, GetLoTWUsersStatus,
|
||||||
GetScpStatus, SetScpEnabled, DownloadScp,
|
GetScpStatus, SetScpEnabled, DownloadScp,
|
||||||
DownloadULSCounties, ULSStatus, BackfillUSCounties,
|
DownloadULSCounties, ULSStatus, BackfillUSCounties, BackfillRDA, RDADatabaseCount,
|
||||||
|
GetCtyDatInfo, RefreshCtyDat, GetAwardReferenceMeta, UpdateAwardReferenceList,
|
||||||
ComputeStationInfo,
|
ComputeStationInfo,
|
||||||
GetUIPref, SetUIPref,
|
GetUIPref, SetUIPref,
|
||||||
GetFlexState, GetFlexBandAntennas, SaveFlexBandAntennas, GetFlexBandPower, SaveFlexBandPower,
|
GetFlexState, GetFlexBandAntennas, SaveFlexBandAntennas, GetFlexBandPower, SaveFlexBandPower,
|
||||||
@@ -203,6 +204,7 @@ type SectionId =
|
|||||||
| 'database'
|
| 'database'
|
||||||
| 'autostart'
|
| 'autostart'
|
||||||
| 'uscounties'
|
| 'uscounties'
|
||||||
|
| 'databases'
|
||||||
| 'awards'
|
| 'awards'
|
||||||
| 'cat'
|
| 'cat'
|
||||||
| 'ftx'
|
| 'ftx'
|
||||||
@@ -320,6 +322,15 @@ function buildTree(flexAvailable: boolean, t: (k: string) => string): TreeNode[]
|
|||||||
{ kind: 'item', label: t('sec.autostart'), id: 'autostart' },
|
{ kind: 'item', label: t('sec.autostart'), id: 'autostart' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
// Maintenance is about DATA rather than settings: nothing in here changes
|
||||||
|
// how OpsLog behaves, it refreshes what it knows. That is why the reference
|
||||||
|
// lists moved out of the Awards manager — an operator updating SOTA is not
|
||||||
|
// editing an award, and had to open one to do it.
|
||||||
|
kind: 'group', label: t('nav.maintenance'), icon: Database, defaultOpen: true, children: [
|
||||||
|
{ kind: 'item', label: t('sec.databases'), id: 'databases' },
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
kind: 'group', label: t('nav.hardware'), icon: Server, defaultOpen: true, children: hardware,
|
kind: 'group', label: t('nav.hardware'), icon: Server, defaultOpen: true, children: hardware,
|
||||||
},
|
},
|
||||||
@@ -335,6 +346,7 @@ const SECTION_KEY: Partial<Record<SectionId, string>> = {
|
|||||||
foldersync: 'sec.foldersync',
|
foldersync: 'sec.foldersync',
|
||||||
webpublish: 'sec.webpublish',
|
webpublish: 'sec.webpublish',
|
||||||
uscounties: 'sec.uscounties',
|
uscounties: 'sec.uscounties',
|
||||||
|
databases: 'sec.databases',
|
||||||
awards: 'sec.awards', cat: 'sec.cat', rotator: 'sec.rotator', winkeyer: 'sec.winkeyer', antenna: 'sec.antenna',
|
awards: 'sec.awards', cat: 'sec.cat', rotator: 'sec.rotator', winkeyer: 'sec.winkeyer', antenna: 'sec.antenna',
|
||||||
antgenius: 'sec.antgenius', tunergenius: 'sec.tunergenius', pgxl: 'sec.pgxl', flex: 'sec.flex', audio: 'sec.audio', general: 'sec.general', email: 'sec.email',
|
antgenius: 'sec.antgenius', tunergenius: 'sec.tunergenius', pgxl: 'sec.pgxl', flex: 'sec.flex', audio: 'sec.audio', general: 'sec.general', email: 'sec.email',
|
||||||
relayauto: 'sec.relayauto',
|
relayauto: 'sec.relayauto',
|
||||||
@@ -628,6 +640,19 @@ function AutostartPanelComponent() {
|
|||||||
<Input className="h-8 font-mono text-xs" value={p.args} placeholder="optional command-line arguments"
|
<Input className="h-8 font-mono text-xs" value={p.args} placeholder="optional command-line arguments"
|
||||||
onChange={(e) => patch(p.id, { args: e.target.value })} />
|
onChange={(e) => patch(p.id, { args: e.target.value })} />
|
||||||
</div>
|
</div>
|
||||||
|
{/* Only what OpsLog started is ever closed — a copy the operator
|
||||||
|
opened themselves is theirs. The hint says so, because the
|
||||||
|
difference is invisible from here. */}
|
||||||
|
<label className="flex items-start gap-2 text-xs cursor-pointer">
|
||||||
|
<Checkbox className="mt-0.5" checked={!!(p as any).close_on_exit}
|
||||||
|
onCheckedChange={(c) => patch(p.id, { close_on_exit: !!c } as any)} />
|
||||||
|
<span>
|
||||||
|
Close it when OpsLog closes{' '}
|
||||||
|
<span className="text-muted-foreground">
|
||||||
|
(asks it to close, the way clicking its cross would — and only if OpsLog started it)
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
{launchMsg[p.id] && <div className="text-xs text-muted-foreground pl-[86px]">{launchMsg[p.id]}</div>}
|
{launchMsg[p.id] && <div className="text-xs text-muted-foreground pl-[86px]">{launchMsg[p.id]}</div>}
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
@@ -1720,6 +1745,45 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
|
|||||||
try { await DownloadULSCounties(); }
|
try { await DownloadULSCounties(); }
|
||||||
catch (e: any) { setUlsBusy(false); setUlsProgress(null); setUlsMsg({ ok: false, text: String(e?.message ?? e) }); }
|
catch (e: any) { setUlsBusy(false); setUlsProgress(null); setUlsMsg({ ok: false, text: String(e?.message ?? e) }); }
|
||||||
};
|
};
|
||||||
|
// cty.dat is not downloaded by OpsLog — it is shipped and reloaded from disk —
|
||||||
|
// so the page reports it rather than offering a button it cannot honour.
|
||||||
|
const [ctyInfo, setCtyInfo] = useState<{ entities: number; file_mod_time?: string }>({ entities: 0 });
|
||||||
|
const [ctyBusy, setCtyBusy] = useState(false);
|
||||||
|
useEffect(() => { GetCtyDatInfo().then((i) => setCtyInfo(i as any)).catch(() => {}); }, []);
|
||||||
|
const refreshCty = async () => {
|
||||||
|
setCtyBusy(true);
|
||||||
|
try { const i: any = await RefreshCtyDat(); setCtyInfo(i); } catch { /* the line keeps its old count */ }
|
||||||
|
finally { setCtyBusy(false); }
|
||||||
|
};
|
||||||
|
// Award reference lists, and which of them have an online updater.
|
||||||
|
const [refMeta, setRefMeta] = useState<Array<{ code: string; count: number; updated_at?: string; can_update: boolean }>>([]);
|
||||||
|
const [refBusy, setRefBusy] = useState('');
|
||||||
|
const [refMsg, setRefMsg] = useState('');
|
||||||
|
const reloadRefMeta = () => { GetAwardReferenceMeta().then((m) => setRefMeta((m ?? []) as any)).catch(() => {}); };
|
||||||
|
useEffect(reloadRefMeta, []);
|
||||||
|
const updateRefList = async (code: string) => {
|
||||||
|
setRefBusy(code); setRefMsg('');
|
||||||
|
try { const m: any = await UpdateAwardReferenceList(code); setRefMsg(t('db.refUpdated', { code, n: m?.count ?? 0 })); reloadRefMeta(); }
|
||||||
|
catch (e: any) { setRefMsg(String(e?.message ?? e)); }
|
||||||
|
finally { setRefBusy(''); }
|
||||||
|
};
|
||||||
|
// A date for a person: the day, not the timestamp the backend stores.
|
||||||
|
const fmtDay = (v?: string) => (v ? String(v).slice(0, 10) : '—');
|
||||||
|
const [rdaCount, setRdaCount] = useState(0);
|
||||||
|
const [rdaBusy, setRdaBusy] = useState(false);
|
||||||
|
const [rdaUseCurrent, setRdaUseCurrent] = useState(true);
|
||||||
|
const [rdaMsg, setRdaMsg] = useState<string | null>(null);
|
||||||
|
useEffect(() => { RDADatabaseCount().then((n) => setRdaCount(Number(n) || 0)).catch(() => {}); }, []);
|
||||||
|
const runRDABackfill = async () => {
|
||||||
|
setRdaBusy(true); setRdaMsg(null);
|
||||||
|
try {
|
||||||
|
const r: any = await BackfillRDA(rdaUseCurrent);
|
||||||
|
setRdaMsg(t('rda.backfillDone', {
|
||||||
|
d: r?.dated ?? 0, c: r?.current ?? 0, u: r?.unknown ?? 0, k: r?.skipped ?? 0, s: r?.scanned ?? 0,
|
||||||
|
}));
|
||||||
|
} catch (e: any) { setRdaMsg(String(e?.message ?? e)); }
|
||||||
|
finally { setRdaBusy(false); }
|
||||||
|
};
|
||||||
const runBackfill = async () => {
|
const runBackfill = async () => {
|
||||||
setBackfillBusy(true); setBackfillMsg(null);
|
setBackfillBusy(true); setBackfillMsg(null);
|
||||||
try { const r: any = await BackfillUSCounties(); setBackfillMsg(t('uscty.backfillDone', { c: r?.county ?? 0, g: r?.grid ?? 0, s: r?.scanned ?? 0 })); }
|
try { const r: any = await BackfillUSCounties(); setBackfillMsg(t('uscty.backfillDone', { c: r?.county ?? 0, g: r?.grid ?? 0, s: r?.scanned ?? 0 })); }
|
||||||
@@ -6914,6 +6978,141 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// One line per database: what it holds, when it was refreshed, and the button
|
||||||
|
// that refreshes it. Every one of these already had an updater somewhere —
|
||||||
|
// buried in the Awards manager, in a corner of the Lookup page, behind the
|
||||||
|
// US Counties section — and an operator wanting them all current had to know
|
||||||
|
// where each one lived. The point of this page is that they are in one place,
|
||||||
|
// named, with their own line.
|
||||||
|
function DatabasesPanel() {
|
||||||
|
const rows: Array<{
|
||||||
|
key: string; name: string; detail: string; busy: boolean; run?: () => void; note?: string;
|
||||||
|
}> = [
|
||||||
|
{
|
||||||
|
key: 'cty', name: t('db.cty'),
|
||||||
|
detail: ctyInfo?.entities ? t('db.ctyDetail', { n: ctyInfo.entities, d: fmtDay(ctyInfo.file_mod_time) }) : t('db.never'),
|
||||||
|
busy: ctyBusy, run: refreshCty,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'clublog', name: t('db.clublog'),
|
||||||
|
detail: clubInfo?.count ? t('db.clublogDetail', { n: clubInfo.count, d: clubInfo.date || '—' }) : t('db.never'),
|
||||||
|
busy: clubBusy,
|
||||||
|
run: () => { setClubBusy(true); setClubErr(''); DownloadClublogCty().then((i) => setClubInfo(i as ClubInfo)).catch((e: any) => setClubErr(String(e?.message ?? e))).finally(() => setClubBusy(false)); },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'lotw', name: t('db.lotwUsers'),
|
||||||
|
detail: lotwUsers?.count ? t('db.lotwDetail', { n: lotwUsers.count, d: fmtDay(lotwUsers.updated) }) : t('db.never'),
|
||||||
|
busy: lotwUsersBusy, run: downloadLotwUsers,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'scp', name: t('db.scp'),
|
||||||
|
detail: scp?.count ? t('db.scpDetail', { n: scp.count, d: fmtDay(scp.updated) }) : t('db.never'),
|
||||||
|
busy: scpBusy, run: downloadScp,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'uls', name: t('db.uls'),
|
||||||
|
detail: ulsStatus?.count ? t('db.ulsDetail', { n: ulsStatus.count, d: fmtDay(ulsStatus.updated_at) }) : t('db.never'),
|
||||||
|
busy: ulsBusy, run: downloadUls,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'rda', name: t('db.rda'),
|
||||||
|
detail: t('db.rdaDetail', { n: rdaCount.toLocaleString() }),
|
||||||
|
busy: false, note: t('db.rdaNote'),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
return (
|
||||||
|
<div className="space-y-4 max-w-3xl">
|
||||||
|
<SectionHeader title={t('sec.databases')} hint={t('db.hint')} />
|
||||||
|
<div className="rounded-md border border-border divide-y divide-border">
|
||||||
|
{rows.map((r) => (
|
||||||
|
<div key={r.key} className="flex items-center gap-3 p-3">
|
||||||
|
<div className="min-w-0 flex-1">
|
||||||
|
<div className="text-sm font-medium">{r.name}</div>
|
||||||
|
<div className="text-[11px] text-muted-foreground">{r.detail}</div>
|
||||||
|
</div>
|
||||||
|
{r.run ? (
|
||||||
|
<Button size="sm" variant="secondary" onClick={r.run} disabled={r.busy}>
|
||||||
|
{r.busy ? <Loader2 className="size-3.5 animate-spin mr-1.5" /> : null}
|
||||||
|
{t('db.update')}
|
||||||
|
</Button>
|
||||||
|
) : (
|
||||||
|
<span className="text-[11px] text-muted-foreground italic shrink-0">{r.note}</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* The award reference lists. Their own block because they are one kind
|
||||||
|
of thing with one updater each, and because the list depends on which
|
||||||
|
awards are defined — a shared WAPC brought in by an operator appears
|
||||||
|
here the day it can be updated. */}
|
||||||
|
<div className="space-y-2">
|
||||||
|
<div className="text-xs font-medium">{t('db.refLists')}</div>
|
||||||
|
<p className="text-[11px] text-muted-foreground">{t('db.refListsHint')}</p>
|
||||||
|
<div className="rounded-md border border-border divide-y divide-border">
|
||||||
|
{refMeta.filter((m) => m.can_update).map((m) => (
|
||||||
|
<div key={m.code} className="flex items-center gap-3 p-3">
|
||||||
|
<div className="min-w-0 flex-1">
|
||||||
|
<div className="text-sm font-medium font-mono">{m.code}</div>
|
||||||
|
<div className="text-[11px] text-muted-foreground">
|
||||||
|
{m.count ? t('db.refDetail', { n: m.count, d: fmtDay(m.updated_at) }) : t('db.never')}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Button size="sm" variant="secondary" disabled={refBusy === m.code}
|
||||||
|
onClick={() => updateRefList(m.code)}>
|
||||||
|
{refBusy === m.code ? <Loader2 className="size-3.5 animate-spin mr-1.5" /> : null}
|
||||||
|
{t('db.update')}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
{refMeta.filter((m) => m.can_update).length === 0 && (
|
||||||
|
<div className="p-3 text-[11px] text-muted-foreground">{t('db.noRefLists')}</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{refMsg && <p className="text-[11px] text-muted-foreground">{refMsg}</p>}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Russian districts: the offline RDA database and the backfill it feeds.
|
||||||
|
//
|
||||||
|
// Its own section rather than a corner of the Awards manager: it is a
|
||||||
|
// database and a bulk operation on the log, which is what every other item in
|
||||||
|
// this part of the sidebar is.
|
||||||
|
function RDAPanel() {
|
||||||
|
return (
|
||||||
|
<div className="space-y-4 max-w-2xl">
|
||||||
|
<SectionHeader title={t('sec.rda')} hint={t('rda.hint')} />
|
||||||
|
<div className="rounded-md border border-border p-3 space-y-1">
|
||||||
|
<div className="text-xs font-medium">{t('rda.dbTitle')}</div>
|
||||||
|
<p className="text-[11px] text-muted-foreground leading-relaxed">
|
||||||
|
{t('rda.dbCount', { n: rdaCount.toLocaleString() })}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className="rounded-md border border-border p-3 space-y-2">
|
||||||
|
<div className="text-xs font-medium">{t('rda.backfillTitle')}</div>
|
||||||
|
<p className="text-[11px] text-muted-foreground leading-relaxed">{t('rda.backfillIntro')}</p>
|
||||||
|
{/* The choice is the whole point of the panel, so it is a checkbox and
|
||||||
|
not a hidden default: a dated record is a fact, a current district
|
||||||
|
on a ten-year-old QSO is an assumption. */}
|
||||||
|
<label className="flex items-start gap-2 text-xs cursor-pointer">
|
||||||
|
<Checkbox checked={rdaUseCurrent} className="mt-0.5" onCheckedChange={(c) => setRdaUseCurrent(!!c)} />
|
||||||
|
<span>{t('rda.useCurrent')} <span className="text-muted-foreground">{t('rda.useCurrentHint')}</span></span>
|
||||||
|
</label>
|
||||||
|
<div className="flex items-center gap-3">
|
||||||
|
<Button size="sm" variant="secondary" onClick={runRDABackfill} disabled={rdaBusy}>
|
||||||
|
{rdaBusy ? <Loader2 className="size-3.5 animate-spin mr-1.5" /> : null}
|
||||||
|
{t('rda.backfillRun')}
|
||||||
|
</Button>
|
||||||
|
{rdaMsg && <span className="text-xs text-muted-foreground">{rdaMsg}</span>}
|
||||||
|
</div>
|
||||||
|
<p className="text-[11px] text-muted-foreground">{t('rda.neverOverwrites')}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Map sections to their content + icon (for placeholder).
|
// Map sections to their content + icon (for placeholder).
|
||||||
const PANELS: Record<SectionId, () => JSX.Element> = {
|
const PANELS: Record<SectionId, () => JSX.Element> = {
|
||||||
general: GeneralPanel,
|
general: GeneralPanel,
|
||||||
@@ -6940,8 +7139,9 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
|
|||||||
backup: BackupPanel,
|
backup: BackupPanel,
|
||||||
database: DatabasePanel,
|
database: DatabasePanel,
|
||||||
uscounties: USCountiesPanel,
|
uscounties: USCountiesPanel,
|
||||||
|
databases: DatabasesPanel,
|
||||||
autostart: () => <AutostartPanelComponent />,
|
autostart: () => <AutostartPanelComponent />,
|
||||||
awards: () => <AwardsSelectionPanel profile={activeProfile ?? undefined} />,
|
awards: () => (<div className="space-y-6"><AwardsSelectionPanel profile={activeProfile ?? undefined} /><RDAPanel /></div>),
|
||||||
cat: CATPanel,
|
cat: CATPanel,
|
||||||
rotator: RotatorPanel,
|
rotator: RotatorPanel,
|
||||||
winkeyer: WinkeyerPanel,
|
winkeyer: WinkeyerPanel,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { Label } from '@/components/ui/label';
|
|||||||
import { Checkbox } from '@/components/ui/checkbox';
|
import { Checkbox } from '@/components/ui/checkbox';
|
||||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
|
import { MotorAntennaWidget, type AntStatus } from '@/components/MotorAntennaWidget';
|
||||||
import { useI18n } from '@/lib/i18n';
|
import { useI18n } from '@/lib/i18n';
|
||||||
import { writeUiPref } from '@/lib/uiPref';
|
import { writeUiPref } from '@/lib/uiPref';
|
||||||
import { subscribeRotorHeading, pokeRotorHeading } from '@/lib/rotorHeading';
|
import { subscribeRotorHeading, pokeRotorHeading } from '@/lib/rotorHeading';
|
||||||
@@ -185,267 +186,6 @@ function RotatorWidget({ hd, refetch, centerLat, centerLon, bearing, t }: Rotato
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
type AntStatus = { enabled: boolean; type: string; connected: boolean; direction: number; frequency: number; moving: boolean; elements: number[]; follow?: boolean; step_khz?: number; track_mode?: string; bands?: string[]; band_freqs?: Record<string, number> };
|
|
||||||
|
|
||||||
// Where each band button points the antenna.
|
|
||||||
//
|
|
||||||
// Not the arithmetic centre of the band. An antenna is tuned for where people
|
|
||||||
// actually work: 20 m centres on 14175 but nobody lives there, and 10 m spans
|
|
||||||
// 1.7 MHz of which the top half is empty. These are the points that leave the
|
|
||||||
// elements closest to right for the whole band, and one nudge away from the rest.
|
|
||||||
const ANT_BAND_KHZ: Record<string, number> = {
|
|
||||||
'40m': 7100, '30m': 10125, '20m': 14150, '17m': 18110,
|
|
||||||
'15m': 21150, '12m': 24930, '10m': 28400, '6m': 50150,
|
|
||||||
};
|
|
||||||
|
|
||||||
// NUDGE_KHZ is the up/down step. 25 kHz because that is also the finest tracking
|
|
||||||
// threshold: a nudge smaller than the tracking step would be undone by the next
|
|
||||||
// poll while tracking is on.
|
|
||||||
const NUDGE_KHZ = 25;
|
|
||||||
|
|
||||||
// bandOfKHz names the band a frequency sits in, so a band button can light up
|
|
||||||
// when the ANTENNA is already there. Deliberately generous at the edges: the
|
|
||||||
// antenna's reported frequency is where it was commanded, which can sit slightly
|
|
||||||
// outside the allocation.
|
|
||||||
function bandOfKHz(khz: number): string {
|
|
||||||
const edges: [number, number, string][] = [
|
|
||||||
[6900, 7300, '40m'], [10050, 10200, '30m'], [13900, 14400, '20m'],
|
|
||||||
[18000, 18200, '17m'], [20900, 21500, '15m'], [24800, 25000, '12m'],
|
|
||||||
[27900, 29800, '10m'], [49900, 50600, '6m'],
|
|
||||||
];
|
|
||||||
for (const [lo, hi, b] of edges) if (khz >= lo && khz <= hi) return b;
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
// MotorAntennaWidget controls a motorized antenna (Ultrabeam / SteppIR) from the
|
|
||||||
// Station Control tab: pattern (Normal / 180° / Bi), Retract, and — Ultrabeam
|
|
||||||
// only — per-element length adjustment. Heading/state is polled by the panel.
|
|
||||||
const ELEMENT_STEP = 2; // the physical console adjusts 2 mm per press
|
|
||||||
|
|
||||||
// elementName maps an element index to a ham-radio name: 0 = reflector,
|
|
||||||
// 1 = driven element, then Director 1, 2, 3…
|
|
||||||
function elementName(i: number, t: (k: string, v?: any) => string): string {
|
|
||||||
if (i === 0) return t('station.reflector');
|
|
||||||
if (i === 1) return t('station.driven');
|
|
||||||
return `${t('station.director')} ${i - 1}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
function MotorAntennaWidget({ ant, refetch, t }: { ant: AntStatus; refetch: () => void; t: (k: string, v?: any) => string }) {
|
|
||||||
const [err, setErr] = useState('');
|
|
||||||
const [lengths, setLengths] = useState<number[]>([]); // current element lengths (mm), from ReadElements
|
|
||||||
const [reading, setReading] = useState(false);
|
|
||||||
const [busyEl, setBusyEl] = useState<number | null>(null);
|
|
||||||
const [editingEl, setEditingEl] = useState<number | null>(null); // element whose mm is being typed
|
|
||||||
const [editVal, setEditVal] = useState('');
|
|
||||||
const run = (p: Promise<any>) => p.then(refetch).catch((e) => setErr(String(e?.message ?? e)));
|
|
||||||
const isUB = ant.type !== 'steppir';
|
|
||||||
|
|
||||||
const readLengths = useCallback(async () => {
|
|
||||||
setReading(true); setErr('');
|
|
||||||
try { setLengths(((await MotorReadElements()) ?? []) as number[]); }
|
|
||||||
catch (e: any) { setErr(String(e?.message ?? e)); }
|
|
||||||
finally { setReading(false); }
|
|
||||||
}, []);
|
|
||||||
// Read the current lengths once when the Ultrabeam widget mounts/connects, so
|
|
||||||
// +/- starts from the real values rather than blind.
|
|
||||||
useEffect(() => { if (isUB && ant.connected) readLengths(); }, [isUB, ant.connected, readLengths]);
|
|
||||||
|
|
||||||
// Send an absolute length to one element and remember it as the new baseline.
|
|
||||||
const setLen = async (i: number, mm: number) => {
|
|
||||||
const next = Math.max(0, Math.round(mm));
|
|
||||||
const prev = lengths[i] ?? 0;
|
|
||||||
setBusyEl(i); setErr('');
|
|
||||||
setLengths((ls) => { const c = [...ls]; c[i] = next; return c; }); // optimistic
|
|
||||||
try { await MotorSetElement(i, next); refetch(); }
|
|
||||||
catch (e: any) {
|
|
||||||
// Rejected by the controller — most often the element is at its travel
|
|
||||||
// limit for this band (extending on a low band). Revert the optimistic
|
|
||||||
// value so the display stays truthful, and explain the likely cause when
|
|
||||||
// the failed move was an extension.
|
|
||||||
setLengths((ls) => { const c = [...ls]; c[i] = prev; return c; });
|
|
||||||
setErr(next > prev ? t('station.atMax') : String(e?.message ?? e));
|
|
||||||
}
|
|
||||||
finally { setBusyEl(null); }
|
|
||||||
};
|
|
||||||
// Nudge one element by ±2 mm from its current known length.
|
|
||||||
const nudge = (i: number, delta: number) => setLen(i, (lengths[i] ?? 0) + delta);
|
|
||||||
// Commit a typed exact length (click on the mm value). Lets the operator fix
|
|
||||||
// the baseline when the auto-read is off, so +/- then work reliably.
|
|
||||||
const commitEdit = (i: number) => {
|
|
||||||
const v = parseInt(editVal, 10);
|
|
||||||
setEditingEl(null);
|
|
||||||
if (!isNaN(v) && v >= 0 && v !== lengths[i]) setLen(i, v);
|
|
||||||
};
|
|
||||||
const dirs: [number, string][] = [[0, 'N'], [1, '180°'], [2, t('station.bi')]];
|
|
||||||
return (
|
|
||||||
<div className="rounded-xl border border-border bg-card shadow-sm overflow-hidden h-full">
|
|
||||||
<div className="flex items-center gap-2 px-3 py-2 border-b border-border/60 bg-muted/30">
|
|
||||||
<AntennaIcon className="size-4 text-primary" />
|
|
||||||
<div className="min-w-0">
|
|
||||||
<div className="text-sm font-semibold truncate">{isUB ? 'Ultrabeam' : 'SteppIR'}</div>
|
|
||||||
{ant.frequency > 0 && <div className="text-[10px] text-muted-foreground font-mono">{(ant.frequency / 1000).toFixed(3)} MHz</div>}
|
|
||||||
</div>
|
|
||||||
{ant.moving && <span className="ml-auto text-[10px] font-semibold text-warning animate-pulse">{t('station.moving')}</span>}
|
|
||||||
<span className={cn('size-2 rounded-full shrink-0', ant.moving ? '' : 'ml-auto', ant.connected ? 'bg-success' : 'bg-muted-foreground/40')}
|
|
||||||
title={ant.connected ? t('station.online') : t('station.offline')} />
|
|
||||||
</div>
|
|
||||||
<div className="p-3 space-y-3">
|
|
||||||
<div>
|
|
||||||
<div className="text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-1">{t('station.pattern')}</div>
|
|
||||||
<div className="flex gap-1">
|
|
||||||
{dirs.map(([d, lbl]) => (
|
|
||||||
<button key={d} type="button" disabled={!ant.connected}
|
|
||||||
onClick={() => run(SetUltrabeamDirection(d))}
|
|
||||||
className={cn('flex-1 rounded-md border py-1.5 text-xs font-semibold transition-colors disabled:opacity-40',
|
|
||||||
ant.direction === d ? 'bg-primary text-primary-foreground border-primary' : 'border-border hover:bg-muted')}>
|
|
||||||
{lbl}
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{/* Bands, then a nudge, then tracking — in the order an operator uses
|
|
||||||
them: get to the band, fine-tune inside it, decide whether the
|
|
||||||
antenna should follow the rig from here. */}
|
|
||||||
<div>
|
|
||||||
<div className="text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-1">{t('station.bands')}</div>
|
|
||||||
<div className="grid grid-cols-5 gap-1">
|
|
||||||
{(ant.bands ?? []).map((b: string) => {
|
|
||||||
// Where this band tunes is resolved by the backend — the operator's
|
|
||||||
// per-band choice from Settings, or the default. ANT_BAND_KHZ is only
|
|
||||||
// the floor for a status poll that hasn't landed yet.
|
|
||||||
const khz = ant.band_freqs?.[b] || ANT_BAND_KHZ[b];
|
|
||||||
if (!khz) return null;
|
|
||||||
// "On this band" from the antenna's own frequency, not the rig's:
|
|
||||||
// the widget must show where the ANTENNA is, which is the whole
|
|
||||||
// reason for tuning it by hand.
|
|
||||||
const here = ant.frequency > 0 && bandOfKHz(ant.frequency) === b;
|
|
||||||
return (
|
|
||||||
<button key={b} type="button" disabled={!ant.connected}
|
|
||||||
onClick={() => run(MotorTuneKHz(khz))}
|
|
||||||
title={`${(khz / 1000).toFixed(3)} MHz`}
|
|
||||||
className={cn('rounded-md border py-1 text-[11px] font-mono font-semibold transition-colors disabled:opacity-40',
|
|
||||||
here ? 'bg-primary text-primary-foreground border-primary' : 'border-border hover:bg-muted')}>
|
|
||||||
{b}
|
|
||||||
</button>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="flex items-center gap-1">
|
|
||||||
<button type="button" disabled={!ant.connected}
|
|
||||||
onClick={() => run(MotorNudgeKHz(-NUDGE_KHZ))}
|
|
||||||
title={t('station.nudgeDown', { n: NUDGE_KHZ })}
|
|
||||||
className="flex-1 flex items-center justify-center gap-1 rounded-md border border-border py-1.5 text-xs font-semibold hover:bg-muted disabled:opacity-40">
|
|
||||||
<ChevronDown className="size-3.5" /> {NUDGE_KHZ}
|
|
||||||
</button>
|
|
||||||
<button type="button" disabled={!ant.connected}
|
|
||||||
onClick={() => run(MotorNudgeKHz(NUDGE_KHZ))}
|
|
||||||
title={t('station.nudgeUp', { n: NUDGE_KHZ })}
|
|
||||||
className="flex-1 flex items-center justify-center gap-1 rounded-md border border-border py-1.5 text-xs font-semibold hover:bg-muted disabled:opacity-40">
|
|
||||||
<ChevronUp className="size-3.5" /> {NUDGE_KHZ}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Tracking. Here rather than only in Settings because it is an operating
|
|
||||||
decision — off to park the antenna, on to resume — not something set
|
|
||||||
up once. Mode and step only show when tracking is on: settings for
|
|
||||||
something switched off are questions the operator cannot act on. And
|
|
||||||
the step only shows in step mode, where it is the one thing it means. */}
|
|
||||||
<div className="space-y-1.5">
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<button type="button"
|
|
||||||
onClick={() => run(SetMotorFollow(!ant.follow, 0, ''))}
|
|
||||||
className={cn('flex-1 rounded-md border py-1.5 text-xs font-semibold transition-colors',
|
|
||||||
ant.follow ? 'bg-success-muted text-success-muted-foreground border-success-border' : 'border-border hover:bg-muted')}>
|
|
||||||
{ant.follow ? t('station.trackOn') : t('station.trackOff')}
|
|
||||||
</button>
|
|
||||||
{ant.follow && (ant.track_mode || 'step') === 'step' && (
|
|
||||||
<select
|
|
||||||
value={String(ant.step_khz || 50)}
|
|
||||||
onChange={(e) => run(SetMotorFollow(true, parseInt(e.target.value, 10), ''))}
|
|
||||||
className="h-[30px] rounded-md border border-border bg-background px-1 text-xs font-mono"
|
|
||||||
title={t('station.trackStepTip')}
|
|
||||||
>
|
|
||||||
{[25, 50, 100].map((s) => <option key={s} value={s}>{s} kHz</option>)}
|
|
||||||
</select>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
{ant.follow && (
|
|
||||||
<select
|
|
||||||
value={ant.track_mode || 'step'}
|
|
||||||
onChange={(e) => run(SetMotorFollow(true, 0, e.target.value))}
|
|
||||||
className="w-full h-[30px] rounded-md border border-border bg-background px-1.5 text-xs"
|
|
||||||
title={t('station.trackModeTip')}
|
|
||||||
>
|
|
||||||
<option value="always" title={t('station.trackAlwaysTip')}>{t('station.trackAlways')}</option>
|
|
||||||
<option value="step" title={t('station.trackStepTipMode')}>{t('station.trackStep')}</option>
|
|
||||||
<option value="band" title={t('station.trackBandTip')}>{t('station.trackBand')}</option>
|
|
||||||
</select>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button type="button" disabled={!ant.connected}
|
|
||||||
onClick={() => run(UltrabeamRetract())}
|
|
||||||
className="w-full flex items-center justify-center gap-1.5 rounded-md border border-warning-border bg-warning-muted text-warning-muted-foreground py-1.5 text-xs font-semibold hover:brightness-95 disabled:opacity-40">
|
|
||||||
<ArrowDownToLine className="size-3.5" /> {t('station.retract')}
|
|
||||||
</button>
|
|
||||||
|
|
||||||
{isUB && (
|
|
||||||
<div>
|
|
||||||
<div className="flex items-center gap-2 mb-1.5">
|
|
||||||
<span className="text-[10px] font-semibold uppercase tracking-wider text-muted-foreground">{t('station.elements')}</span>
|
|
||||||
<button type="button" onClick={readLengths} disabled={!ant.connected || reading}
|
|
||||||
className="text-[10px] text-primary hover:underline inline-flex items-center gap-1 disabled:opacity-40" title={t('station.readLengths')}>
|
|
||||||
<RefreshCw className={cn('size-3', reading && 'animate-spin')} /> {t('station.read')}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
{lengths.length === 0 ? (
|
|
||||||
<p className="text-[11px] text-muted-foreground">{t('station.noLengths')}</p>
|
|
||||||
) : (
|
|
||||||
<div className="space-y-1.5">
|
|
||||||
{/* The READ_BANDS reply is undocumented and its 16-bit parse picks
|
|
||||||
up structural bytes past the real data (varying by band), which
|
|
||||||
made 6+ bogus "elements" appear. Ultrabeam beams are 3-element,
|
|
||||||
and ModifyElement addresses elements 0..2 — so show just those. */}
|
|
||||||
{lengths.map((mm, i) => ({ mm, i })).slice(0, 3).map(({ mm, i }) => (
|
|
||||||
<div key={i} className="flex items-center gap-2">
|
|
||||||
<span className="text-xs w-20 shrink-0 text-muted-foreground truncate">{elementName(i, t)}</span>
|
|
||||||
<button type="button" disabled={!ant.connected || busyEl !== null}
|
|
||||||
onClick={() => nudge(i, -ELEMENT_STEP)}
|
|
||||||
className="flex items-center justify-center size-7 rounded-md border border-border hover:bg-muted disabled:opacity-40 shrink-0">
|
|
||||||
<Minus className="size-3.5" />
|
|
||||||
</button>
|
|
||||||
{editingEl === i ? (
|
|
||||||
<input autoFocus type="number" value={editVal}
|
|
||||||
onChange={(e) => setEditVal(e.target.value)}
|
|
||||||
onBlur={() => commitEdit(i)}
|
|
||||||
onKeyDown={(e) => { if (e.key === 'Enter') commitEdit(i); if (e.key === 'Escape') setEditingEl(null); }}
|
|
||||||
className="text-sm font-mono font-bold flex-1 min-w-0 text-center tabular-nums bg-transparent border border-primary rounded px-1" />
|
|
||||||
) : (
|
|
||||||
<span className="text-sm font-mono font-bold flex-1 min-w-0 text-center tabular-nums cursor-pointer hover:underline"
|
|
||||||
title={t('station.setExactLen')}
|
|
||||||
onClick={() => { setEditingEl(i); setEditVal(String(mm)); }}>
|
|
||||||
{busyEl === i ? <Loader2 className="size-3.5 animate-spin inline" /> : `${mm} mm`}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
<button type="button" disabled={!ant.connected || busyEl !== null}
|
|
||||||
onClick={() => nudge(i, ELEMENT_STEP)}
|
|
||||||
className="flex items-center justify-center size-7 rounded-md border border-border hover:bg-muted disabled:opacity-40 shrink-0">
|
|
||||||
<Plus className="size-3.5" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
<p className="text-[10px] text-muted-foreground mt-1">{t('station.elementsHint')}</p>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{err && <div className="text-[11px] text-destructive break-words">{err}</div>}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function StationControlPanel({ centerLat, centerLon, bearing }: RotatorProps) {
|
export function StationControlPanel({ centerLat, centerLon, bearing }: RotatorProps) {
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|||||||
@@ -15,7 +15,10 @@ export type AutoCallCriteria = {
|
|||||||
grid: boolean; // square wanted under the grid scope
|
grid: boolean; // square wanted under the grid scope
|
||||||
county: boolean; // US county never worked
|
county: boolean; // US county never worked
|
||||||
pota: boolean; // park never worked
|
pota: boolean; // park never worked
|
||||||
sota: boolean; // summit never worked (spot-tagged only)
|
// No SOTA here, though the shape invites it: a decode carries no summit
|
||||||
|
// reference and the backend publishes no "new summit" flag, so a criterion
|
||||||
|
// for it could never be true. It WAS declared, translated and impossible to
|
||||||
|
// tick — a field that lies about what the feature can do.
|
||||||
pfx: boolean; // CQ WPX prefix never worked
|
pfx: boolean; // CQ WPX prefix never worked
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -35,7 +38,7 @@ export type AutoCallSettings = {
|
|||||||
|
|
||||||
export const emptyCriteria: AutoCallCriteria = {
|
export const emptyCriteria: AutoCallCriteria = {
|
||||||
dxcc: false, band: false, mode: false, slot: false,
|
dxcc: false, band: false, mode: false, slot: false,
|
||||||
grid: false, county: false, pota: false, sota: false, pfx: false,
|
grid: false, county: false, pota: false, pfx: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const defaultAutoCall: AutoCallSettings = {
|
export const defaultAutoCall: AutoCallSettings = {
|
||||||
|
|||||||
@@ -205,6 +205,24 @@ export function spotRefList(byCode: Record<string, string>, fieldOf: Record<stri
|
|||||||
// A reference the operator typed or picked wins. A callbook entry can be years
|
// A reference the operator typed or picked wins. A callbook entry can be years
|
||||||
// old, and the operator in front of the radio has just been told where the
|
// old, and the operator in front of the radio has just been told where the
|
||||||
// station is.
|
// station is.
|
||||||
|
// withRDARef adds a Russian district from the callbook to an entry's award
|
||||||
|
// references, on the same terms as the island above.
|
||||||
|
//
|
||||||
|
// HamQTH publishes the district a station operates from TODAY. That is the
|
||||||
|
// right answer for the contact being typed and the wrong one for any other, so
|
||||||
|
// this is only ever called on the entry — never on a QSO already in the log.
|
||||||
|
// A station can move district; stamping today's on last year's contact turns a
|
||||||
|
// correct entry into a false one, and nothing downstream could tell.
|
||||||
|
export function withRDARef(awardRefs: string, rda: string): string {
|
||||||
|
const ref = (rda || '').trim().toUpperCase();
|
||||||
|
// Two letters, a hyphen, two digits. Anything else is not a district.
|
||||||
|
if (!/^[A-Z]{2}-\d{2}$/.test(ref)) return awardRefs;
|
||||||
|
const byCode = parseAwardRefs(awardRefs);
|
||||||
|
if ((byCode['RDA'] ?? '').trim() !== '') return awardRefs; // already set: leave it
|
||||||
|
const sep = awardRefs.trim() === '' ? '' : ';';
|
||||||
|
return awardRefs + sep + 'RDA@' + ref;
|
||||||
|
}
|
||||||
|
|
||||||
export function withIOTARef(awardRefs: string, iota: string): string {
|
export function withIOTARef(awardRefs: string, iota: string): string {
|
||||||
const ref = (iota || '').trim().toUpperCase();
|
const ref = (iota || '').trim().toUpperCase();
|
||||||
// EU-048: two letters, a hyphen, three digits. Anything else is not an IOTA
|
// EU-048: two letters, a hyphen, three digits. Anything else is not an IOTA
|
||||||
|
|||||||
@@ -148,9 +148,9 @@ const en: Dict = {
|
|||||||
'dec.empty': 'Nothing decoded yet. Decodes arrive from WSJT-X, JTDX or MSHV over the inbound UDP link (Settings -> UDP).',
|
'dec.empty': 'Nothing decoded yet. Decodes arrive from WSJT-X, JTDX or MSHV over the inbound UDP link (Settings -> UDP).',
|
||||||
'dec.emptyFiltered': 'No decode matches these filters.',
|
'dec.emptyFiltered': 'No decode matches these filters.',
|
||||||
'sec.email': 'E-mail (SMTP)', 'sec.lookup': 'Callsign Lookup',
|
'sec.email': 'E-mail (SMTP)', 'sec.lookup': 'Callsign Lookup',
|
||||||
'sec.ftx': 'FTx decodes', 'ftx.hint': 'What OpsLog does on its own with the digital decode stream.', 'ftx.enable': 'Auto-call', 'ftx.enableHint': 'answer a decode without clicking it', 'ftx.callWhen': 'Call a station that is:', 'ftx.watch': 'Watch list', 'ftx.watchHint': 'One callsign per line, wildcards allowed (4S7*, */P). A watched station is answered ahead of the criteria above.', 'ftx.watchOnlyIf': 'but only if it is also:', 'ftx.cooldown': 'Ignore a callsign for', 'ftx.warn': 'This keys your transmitter without asking. It answers CQ only, never while you are already transmitting, one station at a time, and every call is written to the log file with its reason. Halt stops it.', 'ftx.c_dxcc': 'a new DXCC entity', 'ftx.c_band': 'a new band for the entity', 'ftx.c_mode': 'a new mode for the entity', 'ftx.c_slot': 'a new band+mode slot', 'ftx.c_grid': 'a new grid square', 'ftx.c_county': 'a new US county', 'ftx.c_pota': 'a new POTA park', 'ftx.c_sota': 'a new SOTA summit', 'ftx.c_pfx': 'a new WPX prefix',
|
'sec.ftx': 'FTx decodes', 'ftx.hint': 'What OpsLog does on its own with the digital decode stream.', 'ftx.enable': 'Auto-call', 'ftx.enableHint': 'answer a decode without clicking it', 'ftx.callWhen': 'Call a station that is:', 'ftx.watch': 'Watch list', 'ftx.watchHint': 'One callsign per line, wildcards allowed (4S7*, */P). A watched station is answered ahead of the criteria above.', 'ftx.watchOnlyIf': 'but only if it is also:', 'ftx.cooldown': 'Ignore a callsign for', 'ftx.warn': 'This keys your transmitter without asking. It answers CQ only, never while you are already transmitting, one station at a time, and every call is written to the log file with its reason. Halt stops it.', 'ftx.c_dxcc': 'a new DXCC entity', 'ftx.c_band': 'a new band for the entity', 'ftx.c_mode': 'a new mode for the entity', 'ftx.c_slot': 'a new slot (band+mode never worked together)', 'ftx.c_grid': 'a new grid square', 'ftx.c_county': 'a new US county', 'ftx.c_pota': 'a new POTA park', 'ftx.c_pfx': 'a new WPX prefix',
|
||||||
'sec.bands': 'Bands', 'sec.modes': 'Modes & default RST', 'sec.cluster': 'DX Cluster',
|
'sec.bands': 'Bands', 'sec.modes': 'Modes & default RST', 'sec.cluster': 'DX Cluster',
|
||||||
'sec.udp': 'Connections', 'sec.database': 'Database', 'sec.autostart': 'Autostart', 'sec.backup': 'Database backup', 'sec.uscounties': 'US Counties',
|
'sec.udp': 'Connections', 'sec.database': 'Database', 'sec.autostart': 'Autostart', 'sec.backup': 'Database backup', 'sec.uscounties': 'US Counties', 'nav.maintenance': 'Maintenance', 'sec.databases': 'Databases', 'db.hint': 'The reference data OpsLog keeps on disk. One line each, with what it holds and when it was last refreshed.', 'db.update': 'Update', 'db.never': 'never downloaded', 'db.cty': 'Country file (cty.dat)', 'db.ctyDetail': '{n} entities · file dated {d}', 'db.clublog': 'Club Log country exceptions', 'db.clublogDetail': '{n} exceptions · {d}', 'db.lotwUsers': 'LoTW users', 'db.lotwDetail': '{n} callsigns · {d}', 'db.scp': 'Super Check Partial (MASTER.SCP)', 'db.scpDetail': '{n} callsigns · {d}', 'db.uls': 'US counties (FCC ULS)', 'db.ulsDetail': '{n} callsigns · {d}', 'db.rda': 'Russian districts (RDA)', 'db.rdaDetail': '{n} callsigns, with their dated activity periods', 'db.rdaNote': 'built in', 'db.refLists': 'Award reference lists', 'db.refListsHint': 'Only the awards with an online source appear here; the others are shipped or edited by hand.', 'db.refDetail': '{n} references · {d}', 'db.refUpdated': '{code}: {n} references.', 'db.noRefLists': 'No award has an online reference list.', 'sec.rda': 'Russian districts (RDA)', 'rda.hint': 'The offline district database, and the one bulk operation it feeds.', 'rda.dbTitle': 'District database', 'rda.dbCount': '{n} Russian callsigns, each with the district it operates from and, where it moved, the dated periods it operated from each one. Built into OpsLog — nothing to download.', 'rda.backfillTitle': 'Fill the district on existing QSOs', 'rda.backfillIntro': 'Goes through every contact with a Russian entity and assigns its RDA reference, using the district the station was in ON THE DAY of the contact.', 'rda.useCurrent': 'Also use the current district for stations with no recorded history', 'rda.useCurrentHint': '(true for the great majority — the database records a history precisely for the callsigns that moved — but it is an assumption, not a dated fact)', 'rda.backfillRun': 'Fill districts', 'rda.backfillDone': '{s} Russian QSOs — {d} from a dated record, {c} from the current district, {u} unknown, {k} already had one.', 'rda.neverOverwrites': 'A reference you assigned by hand is never overwritten.',
|
||||||
'sec.webpublish': 'Web publishing', 'wpub.hint': 'Publishes your log as a file for a website: a standalone HTML page or a CSV, written locally and optionally uploaded by FTP. It is refreshed when you log a QSO and, if you set an interval, on a timer.', 'wpub.enable': 'Publish the log to a file', 'wpub.fileSection': 'The file', 'wpub.format': 'Format', 'wpub.formatHtml': 'HTML page', 'wpub.formatCsv': 'CSV', 'wpub.folder': 'Output folder', 'wpub.browse': 'Browse…', 'wpub.fileName': 'File name', 'wpub.title': 'Page title', 'wpub.titlePh': 'blank = your callsign', 'wpub.count': 'Last N QSOs', 'wpub.every': 'Refresh every', 'wpub.everyHint': 'minutes — 0 = only when a QSO is logged', 'wpub.columns': 'Columns', 'wpub.columnsCount': '{n} of {total} chosen', 'wpub.columnsPick': 'Choose columns…', 'wpub.columnsSearch': 'Search a field…', 'wpub.removeColumn': 'Click to remove', 'wpub.columnsHint': 'Click to add or remove. The order shown here is the order in the file.', 'wpub.ftpEnable': 'Upload by FTP', 'wpub.ftpHost': 'Server / port', 'wpub.ftpUser': 'User', 'wpub.ftpPassword': 'Password', 'wpub.ftpFolder': 'Remote folder', 'wpub.ftpFileName': 'Remote file name', 'wpub.ftpTls': 'Use TLS (FTPS)', 'wpub.publishNow': 'Publish now', 'wpub.testFtp': 'Test connection', 'wpub.lastRun': 'Last run:', 'sec.adifmon': 'ADIF monitor',
|
'sec.webpublish': 'Web publishing', 'wpub.hint': 'Publishes your log as a file for a website: a standalone HTML page or a CSV, written locally and optionally uploaded by FTP. It is refreshed when you log a QSO and, if you set an interval, on a timer.', 'wpub.enable': 'Publish the log to a file', 'wpub.fileSection': 'The file', 'wpub.format': 'Format', 'wpub.formatHtml': 'HTML page', 'wpub.formatCsv': 'CSV', 'wpub.folder': 'Output folder', 'wpub.browse': 'Browse…', 'wpub.fileName': 'File name', 'wpub.title': 'Page title', 'wpub.titlePh': 'blank = your callsign', 'wpub.count': 'Last N QSOs', 'wpub.every': 'Refresh every', 'wpub.everyHint': 'minutes — 0 = only when a QSO is logged', 'wpub.columns': 'Columns', 'wpub.columnsCount': '{n} of {total} chosen', 'wpub.columnsPick': 'Choose columns…', 'wpub.columnsSearch': 'Search a field…', 'wpub.removeColumn': 'Click to remove', 'wpub.columnsHint': 'Click to add or remove. The order shown here is the order in the file.', 'wpub.ftpEnable': 'Upload by FTP', 'wpub.ftpHost': 'Server / port', 'wpub.ftpUser': 'User', 'wpub.ftpPassword': 'Password', 'wpub.ftpFolder': 'Remote folder', 'wpub.ftpFileName': 'Remote file name', 'wpub.ftpTls': 'Use TLS (FTPS)', 'wpub.publishNow': 'Publish now', 'wpub.testFtp': 'Test connection', 'wpub.lastRun': 'Last run:', 'sec.adifmon': 'ADIF monitor',
|
||||||
'sec.foldersync': 'Sync across PCs', 'sync.hint': 'Point every OpsLog at the SAME folder — one your PCs already synchronise (Seafile, OneDrive, Dropbox, a NAS share). Each machine writes what it logs there and reads the others; the databases themselves are never shared.', 'sync.enable': 'Keep my contacts in step across my PCs', 'sync.machine': 'This PC', 'sync.folder': 'Folder', 'sync.choose': 'Choose…', 'sync.state': 'State', 'sync.thisPc': 'This PC', 'sync.lastSync': 'Last check', 'sync.sent': 'Sent', 'sync.received': 'Received', 'sync.never': 'never', 'sync.noPeers': 'No other PC has written to this folder yet.', 'sync.behind': 'new contacts waiting', 'sync.now': 'Synchronise now', 'sync.applied': '{n} change(s) taken from the folder.', 'sync.saved': 'Saved.',
|
'sec.foldersync': 'Sync across PCs', 'sync.hint': 'Point every OpsLog at the SAME folder — one your PCs already synchronise (Seafile, OneDrive, Dropbox, a NAS share). Each machine writes what it logs there and reads the others; the databases themselves are never shared.', 'sync.enable': 'Keep my contacts in step across my PCs', 'sync.machine': 'This PC', 'sync.folder': 'Folder', 'sync.choose': 'Choose…', 'sync.state': 'State', 'sync.thisPc': 'This PC', 'sync.lastSync': 'Last check', 'sync.sent': 'Sent', 'sync.received': 'Received', 'sync.never': 'never', 'sync.noPeers': 'No other PC has written to this folder yet.', 'sync.behind': 'new contacts waiting', 'sync.now': 'Synchronise now', 'sync.applied': '{n} change(s) taken from the folder.', 'sync.saved': 'Saved.',
|
||||||
'adifmon.hint': 'Watch external ADIF files and import new QSOs automatically — e.g. fldigi logging RTTY, or N1MM/VarAC. Imported QSOs are enriched, de-duplicated and uploaded to your external services just like a QSO logged here.',
|
'adifmon.hint': 'Watch external ADIF files and import new QSOs automatically — e.g. fldigi logging RTTY, or N1MM/VarAC. Imported QSOs are enriched, de-duplicated and uploaded to your external services just like a QSO logged here.',
|
||||||
@@ -193,7 +193,7 @@ const en: Dict = {
|
|||||||
'uscty.backfillDone': '{s} US QSOs scanned · {c} counties, {g} grids filled.',
|
'uscty.backfillDone': '{s} US QSOs scanned · {c} counties, {g} grids filled.',
|
||||||
'station.typeHttpGen': 'HTTP relay (home-made / generic)', 'station.onPattern': 'ON URL pattern', 'station.offPattern': 'OFF URL pattern', 'station.insecureTls': 'Accept a self-signed certificate', 'station.insecureTlsHint': 'A relay board on your own network signs its own certificate, which nothing can verify. Leave this off for a board reached over the internet through a proxy: there the certificate is real, and checking it is what protects the link.', 'station.patternHint': 'Optional, http or https. {relay} is the relay number — {relay-1} if the board counts from zero. {value} is that relay\'s label below, so …/relay?on={value} with relay 1 named Ant1 sends …/relay?on=Ant1. Leave both blank if every relay has its own full URL.', 'station.perRelayUrls': 'Per-relay URLs (optional)', 'station.perRelayHint': 'Filled in here, these win over the patterns — for a switch whose channels have nothing in common. {relay} and {value} work here too. State is remembered, not read back: after a restart every relay is re-commanded once.', 'station.onUrlPh': 'ON URL', 'station.offUrlPh': 'OFF URL',
|
'station.typeHttpGen': 'HTTP relay (home-made / generic)', 'station.onPattern': 'ON URL pattern', 'station.offPattern': 'OFF URL pattern', 'station.insecureTls': 'Accept a self-signed certificate', 'station.insecureTlsHint': 'A relay board on your own network signs its own certificate, which nothing can verify. Leave this off for a board reached over the internet through a proxy: there the certificate is real, and checking it is what protects the link.', 'station.patternHint': 'Optional, http or https. {relay} is the relay number — {relay-1} if the board counts from zero. {value} is that relay\'s label below, so …/relay?on={value} with relay 1 named Ant1 sends …/relay?on=Ant1. Leave both blank if every relay has its own full URL.', 'station.perRelayUrls': 'Per-relay URLs (optional)', 'station.perRelayHint': 'Filled in here, these win over the patterns — for a switch whose channels have nothing in common. {relay} and {value} work here too. State is remembered, not read back: after a restart every relay is re-commanded once.', 'station.onUrlPh': 'ON URL', 'station.offUrlPh': 'OFF URL',
|
||||||
'station.valueNeedsLabels': 'A URL above uses {value}, which sends the relay’s label — name every relay you switch that way, or its URL goes out with an empty value.',
|
'station.valueNeedsLabels': 'A URL above uses {value}, which sends the relay’s label — name every relay you switch that way, or its URL goes out with an empty value.',
|
||||||
'station.title': 'Station Control', 'station.rotator': 'Rotator', 'station.rotateTo': 'Rotate to {az}°', 'station.rotatorNoRead': 'No heading read', 'station.bands': 'Bands', 'station.nudgeUp': 'Up {n} kHz', 'station.nudgeDown': 'Down {n} kHz', 'station.trackOn': 'Tracking on', 'station.trackOff': 'Tracking off', 'station.trackStepTip': 'Re-tune only when the rig has moved this far', 'station.trackModeTip': 'When the antenna is allowed to re-tune', 'station.trackAlways': 'Every frequency change', 'station.trackStep': 'Past a step', 'station.trackBand': 'Band change only', 'station.trackAlwaysTip': 'Follow every frequency change. Best resonance, but the motors run constantly — and on a SteppIR every move blocks transmit while the elements travel.', 'station.trackStepTipMode': 'Re-tune only once the rig has moved further than the step. Follows a QSY, ignores tuning around.', 'station.trackBandTip': 'Re-tune only when the band changes. The motors move a few times a day and are left alone within a band.', 'station.pattern': 'Pattern', 'station.bi': 'Bi', 'station.retract': 'Retract elements', 'station.moving': 'MOVING', 'station.elements': 'Elements (mm)', 'station.read': 'Read', 'station.readLengths': 'Read current element lengths from the controller', 'station.noLengths': 'Lengths unknown — click Read to fetch them from the controller.', 'station.element': 'Element', 'station.reflector': 'Reflector', 'station.driven': 'Driven', 'station.director': 'Dir', 'station.set': 'Set', 'station.elementsHint': 'Each press lengthens/shortens the element by 2 mm (like the physical console). Verify which element responds on your antenna.', 'station.setExactLen': 'Click to type the exact current length (fixes the baseline if the auto-read is off).', 'station.atMax': 'Controller refused — the element is likely at its maximum length for this band, so it can\'t extend further.', 'station.go': 'Go', 'station.stop': 'Stop', 'station.dragHint': 'Drag the grip handle on the left of a panel to move it. Pick a column count to lay them out in a grid.', 'station.dragMove': 'Drag to move this panel', 'station.colsAuto': 'Auto', 'station.addDevice': 'Add device', 'station.editDevice': 'Edit device', 'station.empty': 'No relay boards yet. Add a WebSwitch 1216H or a KMTronic 8-relay board to control your station power and accessories.', 'station.online': 'Online', 'station.offline': 'Offline', 'station.edit': 'Edit', 'station.delete': 'Delete', 'station.relay': 'Relay', 'station.on': 'ON', 'station.off': 'OFF', 'station.type': 'Device type', 'station.name': 'Name', 'station.host': 'Host / IP', 'station.hostHint': 'LAN IP for local use. To reach the board from OUTSIDE, put a full URL here — e.g. https://relay.yourdomain.com — pointing at a reverse proxy (Nginx Proxy Manager…) that fronts the board’s HTTP port.', 'station.user': 'Username', 'station.pass': 'Password', 'station.optional': 'optional', 'station.ftdiSerial': 'FTDI serial number', 'station.detect': 'Detect', 'station.ftdiHint': 'The Denkovi board is driven via FTDI bit-bang (not the COM port). Pick its serial (e.g. DAE0006K). Needs the FTDI D2XX driver installed.', 'station.channels': 'Relays', 'station.comPort': 'COM port', 'station.noPorts': 'No ports found', 'station.usbRelayHint': 'Cheap USB-serial relay boards (CH340/LCUS) using the A0 command protocol. If yours does not switch, tell me its model / command set.', 'station.labels': 'Relay labels', 'station.cancel': 'Cancel', 'station.save': 'Save', 'station.test': 'Test connection', 'station.testOk': 'Connected — {n} relays', 'station.testFail': 'Not connected', 'station.detectNone': 'No FTDI board found — check the cable and that the D2XX driver is installed.', 'station.detectFound': '{n} board(s) detected.',
|
'station.title': 'Station Control', 'station.rotator': 'Rotator', 'station.rotateTo': 'Rotate to {az}°', 'station.rotatorNoRead': 'No heading read', 'station.bands': 'Bands', 'station.nudgeUp': 'Up {n} kHz', 'station.nudgeDown': 'Down {n} kHz', 'station.trackOn': 'Tracking on', 'station.trackOff': 'Tracking off', 'station.trackStepTip': 'Re-tune only when the rig has moved this far', 'station.trackModeTip': 'When the antenna is allowed to re-tune', 'station.trackAlways': 'Every frequency change', 'station.trackStep': 'Past a step', 'station.trackBand': 'Band change only', 'station.trackAlwaysTip': 'Follow every frequency change. Best resonance, but the motors run constantly — and on a SteppIR every move blocks transmit while the elements travel.', 'station.trackStepTipMode': 'Re-tune only once the rig has moved further than the step. Follows a QSY, ignores tuning around.', 'station.trackBandTip': 'Re-tune only when the band changes. The motors move a few times a day and are left alone within a band.', 'station.pattern': 'Pattern', 'station.bi': 'Bi', 'station.motorWidgetShow': 'Motorised antenna · click to show', 'station.motorWidgetHide': 'Motorised antenna — shown · click to hide', 'station.hideWidget': 'Hide this widget', 'station.retract': 'Retract elements', 'station.moving': 'MOVING', 'station.elements': 'Elements (mm)', 'station.read': 'Read', 'station.readLengths': 'Read current element lengths from the controller', 'station.noLengths': 'Lengths unknown — click Read to fetch them from the controller.', 'station.element': 'Element', 'station.reflector': 'Reflector', 'station.driven': 'Driven', 'station.director': 'Dir', 'station.set': 'Set', 'station.elementsHint': 'Each press lengthens/shortens the element by 2 mm (like the physical console). Verify which element responds on your antenna.', 'station.setExactLen': 'Click to type the exact current length (fixes the baseline if the auto-read is off).', 'station.atMax': 'Controller refused — the element is likely at its maximum length for this band, so it can\'t extend further.', 'station.go': 'Go', 'station.stop': 'Stop', 'station.dragHint': 'Drag the grip handle on the left of a panel to move it. Pick a column count to lay them out in a grid.', 'station.dragMove': 'Drag to move this panel', 'station.colsAuto': 'Auto', 'station.addDevice': 'Add device', 'station.editDevice': 'Edit device', 'station.empty': 'No relay boards yet. Add a WebSwitch 1216H or a KMTronic 8-relay board to control your station power and accessories.', 'station.online': 'Online', 'station.offline': 'Offline', 'station.edit': 'Edit', 'station.delete': 'Delete', 'station.relay': 'Relay', 'station.on': 'ON', 'station.off': 'OFF', 'station.type': 'Device type', 'station.name': 'Name', 'station.host': 'Host / IP', 'station.hostHint': 'LAN IP for local use. To reach the board from OUTSIDE, put a full URL here — e.g. https://relay.yourdomain.com — pointing at a reverse proxy (Nginx Proxy Manager…) that fronts the board’s HTTP port.', 'station.user': 'Username', 'station.pass': 'Password', 'station.optional': 'optional', 'station.ftdiSerial': 'FTDI serial number', 'station.detect': 'Detect', 'station.ftdiHint': 'The Denkovi board is driven via FTDI bit-bang (not the COM port). Pick its serial (e.g. DAE0006K). Needs the FTDI D2XX driver installed.', 'station.channels': 'Relays', 'station.comPort': 'COM port', 'station.noPorts': 'No ports found', 'station.usbRelayHint': 'Cheap USB-serial relay boards (CH340/LCUS) using the A0 command protocol. If yours does not switch, tell me its model / command set.', 'station.labels': 'Relay labels', 'station.cancel': 'Cancel', 'station.save': 'Save', 'station.test': 'Test connection', 'station.testOk': 'Connected — {n} relays', 'station.testFail': 'Not connected', 'station.detectNone': 'No FTDI board found — check the cable and that the D2XX driver is installed.', 'station.detectFound': '{n} board(s) detected.',
|
||||||
'awards.followHint': 'Awards shown in the Awards tab. Leave the right side empty to show them all.', 'awards.available': 'All awards', 'awards.followed': 'Followed', 'awards.search': 'Filter…', 'awards.addAll': 'Add all', 'awards.clear': 'Clear', 'awards.allTracked': 'All awards are followed.', 'awards.noneFollowed': 'Nothing followed yet — the Awards tab shows all.',
|
'awards.followHint': 'Awards shown in the Awards tab. Leave the right side empty to show them all.', 'awards.available': 'All awards', 'awards.followed': 'Followed', 'awards.search': 'Filter…', 'awards.addAll': 'Add all', 'awards.clear': 'Clear', 'awards.allTracked': 'All awards are followed.', 'awards.noneFollowed': 'Nothing followed yet — the Awards tab shows all.',
|
||||||
'sec.awards': 'Awards', 'sec.cat': 'CAT interface', 'sec.rotator': 'Rotator', 'sec.winkeyer': 'CW Keyer',
|
'sec.awards': 'Awards', 'sec.cat': 'CAT interface', 'sec.rotator': 'Rotator', 'sec.winkeyer': 'CW Keyer',
|
||||||
'sec.antenna': 'Ultrabeam / Steppir', 'sec.antgenius': 'Antenna Genius', 'sec.tunergenius': 'Tuner Genius', 'sec.pgxl': 'Amplifier', 'sec.psu': 'Power supply',
|
'sec.antenna': 'Ultrabeam / Steppir', 'sec.antgenius': 'Antenna Genius', 'sec.tunergenius': 'Tuner Genius', 'sec.pgxl': 'Amplifier', 'sec.psu': 'Power supply',
|
||||||
@@ -635,9 +635,9 @@ const fr: Dict = {
|
|||||||
'dec.empty': "Aucun decode pour l'instant. Ils arrivent de WSJT-X, JTDX ou MSHV par le lien UDP entrant (Reglages -> UDP).",
|
'dec.empty': "Aucun decode pour l'instant. Ils arrivent de WSJT-X, JTDX ou MSHV par le lien UDP entrant (Reglages -> UDP).",
|
||||||
'dec.emptyFiltered': 'Aucun decode ne correspond a ces filtres.',
|
'dec.emptyFiltered': 'Aucun decode ne correspond a ces filtres.',
|
||||||
'sec.email': 'E-mail (SMTP)', 'sec.lookup': "Recherche d'indicatif",
|
'sec.email': 'E-mail (SMTP)', 'sec.lookup': "Recherche d'indicatif",
|
||||||
'sec.ftx': 'Décodages FTx', 'ftx.hint': 'Ce qu’OpsLog fait de lui-même avec le flux de décodages numériques.', 'ftx.enable': 'Appel automatique', 'ftx.enableHint': 'répondre à un décodage sans cliquer', 'ftx.callWhen': 'Appeler une station qui est :', 'ftx.watch': 'Liste de surveillance', 'ftx.watchHint': 'Un indicatif par ligne, jokers acceptés (4S7*, */P). Une station surveillée est appelée avant les critères ci-dessus.', 'ftx.watchOnlyIf': 'mais seulement si elle est aussi :', 'ftx.cooldown': 'Ignorer un indicatif pendant', 'ftx.warn': 'Ceci met ton émetteur en marche sans te demander. Uniquement sur un CQ, jamais pendant que tu émets déjà, une station à la fois, et chaque appel est écrit dans le journal avec sa raison. Stop l’interrompt.', 'ftx.c_dxcc': 'une nouvelle entité DXCC', 'ftx.c_band': 'une nouvelle bande pour l’entité', 'ftx.c_mode': 'un nouveau mode pour l’entité', 'ftx.c_slot': 'un nouveau couple bande+mode', 'ftx.c_grid': 'un nouveau carré locator', 'ftx.c_county': 'un nouveau comté US', 'ftx.c_pota': 'un nouveau parc POTA', 'ftx.c_sota': 'un nouveau sommet SOTA', 'ftx.c_pfx': 'un nouveau préfixe WPX',
|
'sec.ftx': 'Décodages FTx', 'ftx.hint': 'Ce qu’OpsLog fait de lui-même avec le flux de décodages numériques.', 'ftx.enable': 'Appel automatique', 'ftx.enableHint': 'répondre à un décodage sans cliquer', 'ftx.callWhen': 'Appeler une station qui est :', 'ftx.watch': 'Liste de surveillance', 'ftx.watchHint': 'Un indicatif par ligne, jokers acceptés (4S7*, */P). Une station surveillée est appelée avant les critères ci-dessus.', 'ftx.watchOnlyIf': 'mais seulement si elle est aussi :', 'ftx.cooldown': 'Ignorer un indicatif pendant', 'ftx.warn': 'Ceci met ton émetteur en marche sans te demander. Uniquement sur un CQ, jamais pendant que tu émets déjà, une station à la fois, et chaque appel est écrit dans le journal avec sa raison. Stop l’interrompt.', 'ftx.c_dxcc': 'une nouvelle entité DXCC', 'ftx.c_band': 'une nouvelle bande pour l’entité', 'ftx.c_mode': 'un nouveau mode pour l’entité', 'ftx.c_slot': 'un nouveau slot (bande+mode jamais faits ensemble)', 'ftx.c_grid': 'un nouveau carré locator', 'ftx.c_county': 'un nouveau comté US', 'ftx.c_pota': 'un nouveau parc POTA', 'ftx.c_pfx': 'un nouveau préfixe WPX',
|
||||||
'sec.bands': 'Bandes', 'sec.modes': 'Modes & RST par défaut', 'sec.cluster': 'DX Cluster',
|
'sec.bands': 'Bandes', 'sec.modes': 'Modes & RST par défaut', 'sec.cluster': 'DX Cluster',
|
||||||
'sec.udp': 'Connexions', 'sec.database': 'Base de données', 'sec.autostart': 'Démarrage auto', 'sec.backup': 'Sauvegarde base', 'sec.uscounties': 'Comtés US',
|
'sec.udp': 'Connexions', 'sec.database': 'Base de données', 'sec.autostart': 'Démarrage auto', 'sec.backup': 'Sauvegarde base', 'sec.uscounties': 'Comtés US', 'nav.maintenance': 'Maintenance', 'sec.databases': 'Bases de données', 'db.hint': 'Les données de référence qu’OpsLog garde sur disque. Une ligne chacune, avec ce qu’elle contient et sa dernière actualisation.', 'db.update': 'Mettre à jour', 'db.never': 'jamais téléchargée', 'db.cty': 'Fichier pays (cty.dat)', 'db.ctyDetail': '{n} entités · fichier daté du {d}', 'db.clublog': 'Exceptions pays Club Log', 'db.clublogDetail': '{n} exceptions · {d}', 'db.lotwUsers': 'Utilisateurs LoTW', 'db.lotwDetail': '{n} indicatifs · {d}', 'db.scp': 'Super Check Partial (MASTER.SCP)', 'db.scpDetail': '{n} indicatifs · {d}', 'db.uls': 'Comtés US (FCC ULS)', 'db.ulsDetail': '{n} indicatifs · {d}', 'db.rda': 'Districts russes (RDA)', 'db.rdaDetail': '{n} indicatifs, avec leurs périodes d’activité datées', 'db.rdaNote': 'intégrée', 'db.refLists': 'Listes de références des diplômes', 'db.refListsHint': 'Seuls les diplômes ayant une source en ligne apparaissent ici ; les autres sont livrés ou édités à la main.', 'db.refDetail': '{n} références · {d}', 'db.refUpdated': '{code} : {n} références.', 'db.noRefLists': 'Aucun diplôme n’a de liste de références en ligne.', 'sec.rda': 'Districts russes (RDA)', 'rda.hint': 'La base de districts hors ligne, et l’unique opération de masse qu’elle alimente.', 'rda.dbTitle': 'Base des districts', 'rda.dbCount': '{n} indicatifs russes, chacun avec le district d’où il émet et, pour ceux qui ont déménagé, les périodes datées passées dans chacun. Intégrée à OpsLog — rien à télécharger.', 'rda.backfillTitle': 'Renseigner le district sur les QSO existants', 'rda.backfillIntro': 'Parcourt tous les contacts avec une entité russe et attribue leur référence RDA, en utilisant le district où se trouvait la station LE JOUR du contact.', 'rda.useCurrent': 'Utiliser aussi le district actuel pour les stations sans historique connu', 'rda.useCurrentHint': '(vrai pour la grande majorité — la base enregistre un historique justement pour les indicatifs qui ont bougé — mais c’est une supposition, pas un fait daté)', 'rda.backfillRun': 'Renseigner les districts', 'rda.backfillDone': '{s} QSO russes — {d} depuis une période datée, {c} depuis le district actuel, {u} inconnus, {k} en avaient déjà un.', 'rda.neverOverwrites': 'Une référence attribuée à la main n’est jamais écrasée.',
|
||||||
'sec.webpublish': 'Publication web', 'wpub.hint': "Publie ton journal dans un fichier destiné à un site web : une page HTML autonome ou un CSV, écrit en local et envoyé par FTP si tu le souhaites. Il est rafraîchi à chaque QSO enregistré et, si tu règles un intervalle, périodiquement.", 'wpub.enable': 'Publier le journal dans un fichier', 'wpub.fileSection': 'Le fichier', 'wpub.format': 'Format', 'wpub.formatHtml': 'Page HTML', 'wpub.formatCsv': 'CSV', 'wpub.folder': 'Dossier de sortie', 'wpub.browse': 'Parcourir…', 'wpub.fileName': 'Nom du fichier', 'wpub.title': 'Titre de la page', 'wpub.titlePh': 'vide = ton indicatif', 'wpub.count': 'N derniers QSO', 'wpub.every': 'Rafraîchir toutes les', 'wpub.everyHint': 'minutes — 0 = seulement à chaque QSO', 'wpub.columns': 'Colonnes', 'wpub.columnsCount': '{n} sur {total} choisis', 'wpub.columnsPick': 'Choisir les colonnes…', 'wpub.columnsSearch': 'Chercher un champ…', 'wpub.removeColumn': 'Cliquer pour retirer', 'wpub.columnsHint': 'Clique pour ajouter ou retirer. L ordre affiché ici est celui du fichier.', 'wpub.ftpEnable': 'Envoyer par FTP', 'wpub.ftpHost': 'Serveur / port', 'wpub.ftpUser': 'Utilisateur', 'wpub.ftpPassword': 'Mot de passe', 'wpub.ftpFolder': 'Dossier distant', 'wpub.ftpFileName': 'Nom du fichier distant', 'wpub.ftpTls': 'Utiliser TLS (FTPS)', 'wpub.publishNow': 'Publier maintenant', 'wpub.testFtp': 'Tester la connexion', 'wpub.lastRun': 'Dernière exécution :', 'sec.adifmon': 'Moniteur ADIF',
|
'sec.webpublish': 'Publication web', 'wpub.hint': "Publie ton journal dans un fichier destiné à un site web : une page HTML autonome ou un CSV, écrit en local et envoyé par FTP si tu le souhaites. Il est rafraîchi à chaque QSO enregistré et, si tu règles un intervalle, périodiquement.", 'wpub.enable': 'Publier le journal dans un fichier', 'wpub.fileSection': 'Le fichier', 'wpub.format': 'Format', 'wpub.formatHtml': 'Page HTML', 'wpub.formatCsv': 'CSV', 'wpub.folder': 'Dossier de sortie', 'wpub.browse': 'Parcourir…', 'wpub.fileName': 'Nom du fichier', 'wpub.title': 'Titre de la page', 'wpub.titlePh': 'vide = ton indicatif', 'wpub.count': 'N derniers QSO', 'wpub.every': 'Rafraîchir toutes les', 'wpub.everyHint': 'minutes — 0 = seulement à chaque QSO', 'wpub.columns': 'Colonnes', 'wpub.columnsCount': '{n} sur {total} choisis', 'wpub.columnsPick': 'Choisir les colonnes…', 'wpub.columnsSearch': 'Chercher un champ…', 'wpub.removeColumn': 'Cliquer pour retirer', 'wpub.columnsHint': 'Clique pour ajouter ou retirer. L ordre affiché ici est celui du fichier.', 'wpub.ftpEnable': 'Envoyer par FTP', 'wpub.ftpHost': 'Serveur / port', 'wpub.ftpUser': 'Utilisateur', 'wpub.ftpPassword': 'Mot de passe', 'wpub.ftpFolder': 'Dossier distant', 'wpub.ftpFileName': 'Nom du fichier distant', 'wpub.ftpTls': 'Utiliser TLS (FTPS)', 'wpub.publishNow': 'Publier maintenant', 'wpub.testFtp': 'Tester la connexion', 'wpub.lastRun': 'Dernière exécution :', 'sec.adifmon': 'Moniteur ADIF',
|
||||||
'sec.foldersync': 'Synchro entre PC', 'sync.hint': 'Fais pointer chaque OpsLog vers le MÊME dossier — un dossier que tes PC synchronisent déjà (Seafile, OneDrive, Dropbox, un partage NAS). Chaque machine y écrit ce qu’elle enregistre et lit celui des autres ; les bases de données, elles, ne sont jamais partagées.', 'sync.enable': 'Garder mes contacts à jour sur tous mes PC', 'sync.machine': 'Ce PC', 'sync.folder': 'Dossier', 'sync.choose': 'Choisir…', 'sync.state': 'État', 'sync.thisPc': 'Ce PC', 'sync.lastSync': 'Dernière vérification', 'sync.sent': 'Envoyés', 'sync.received': 'Reçus', 'sync.never': 'jamais', 'sync.noPeers': 'Aucun autre PC n’a encore écrit dans ce dossier.', 'sync.behind': 'nouveaux contacts en attente', 'sync.now': 'Synchroniser maintenant', 'sync.applied': '{n} changement(s) repris du dossier.', 'sync.saved': 'Enregistré.',
|
'sec.foldersync': 'Synchro entre PC', 'sync.hint': 'Fais pointer chaque OpsLog vers le MÊME dossier — un dossier que tes PC synchronisent déjà (Seafile, OneDrive, Dropbox, un partage NAS). Chaque machine y écrit ce qu’elle enregistre et lit celui des autres ; les bases de données, elles, ne sont jamais partagées.', 'sync.enable': 'Garder mes contacts à jour sur tous mes PC', 'sync.machine': 'Ce PC', 'sync.folder': 'Dossier', 'sync.choose': 'Choisir…', 'sync.state': 'État', 'sync.thisPc': 'Ce PC', 'sync.lastSync': 'Dernière vérification', 'sync.sent': 'Envoyés', 'sync.received': 'Reçus', 'sync.never': 'jamais', 'sync.noPeers': 'Aucun autre PC n’a encore écrit dans ce dossier.', 'sync.behind': 'nouveaux contacts en attente', 'sync.now': 'Synchroniser maintenant', 'sync.applied': '{n} changement(s) repris du dossier.', 'sync.saved': 'Enregistré.',
|
||||||
'adifmon.hint': "Surveille des fichiers ADIF externes et importe les nouveaux QSO automatiquement — ex. fldigi en RTTY, ou N1MM/VarAC. Les QSO importés sont enrichis, dédoublonnés et envoyés à tes services externes comme un QSO loggé ici.",
|
'adifmon.hint': "Surveille des fichiers ADIF externes et importe les nouveaux QSO automatiquement — ex. fldigi en RTTY, ou N1MM/VarAC. Les QSO importés sont enrichis, dédoublonnés et envoyés à tes services externes comme un QSO loggé ici.",
|
||||||
@@ -680,7 +680,7 @@ const fr: Dict = {
|
|||||||
'uscty.backfillDone': '{s} QSO US analysés · {c} comtés, {g} locators remplis.',
|
'uscty.backfillDone': '{s} QSO US analysés · {c} comtés, {g} locators remplis.',
|
||||||
'station.typeHttpGen': 'Relais HTTP (fait main / générique)', 'station.onPattern': 'Modèle d’URL ON', 'station.offPattern': 'Modèle d’URL OFF', 'station.insecureTls': 'Accepter un certificat auto-signé', 'station.insecureTlsHint': 'Une carte relais sur ton propre réseau signe elle-même son certificat, que rien ne peut vérifier. Laisse décoché pour une carte atteinte par internet à travers un proxy : là le certificat est réel, et le vérifier est ce qui protège la liaison.', 'station.patternHint': 'Optionnel, http ou https. {relay} est le numéro du relais — {relay-1} si la carte compte à partir de zéro. {value} est le libellé de ce relais ci-dessous : …/relay?on={value} avec le relais 1 nommé Ant1 envoie …/relay?on=Ant1. Laisse les deux vides si chaque relais a sa propre URL complète.', 'station.perRelayUrls': 'URL par relais (optionnel)', 'station.perRelayHint': 'Renseignées ici, elles l’emportent sur les modèles — pour un commutateur dont les voies n’ont rien en commun. {relay} et {value} fonctionnent aussi ici. L’état est mémorisé, pas relu : après un redémarrage chaque relais est recommandé une fois.', 'station.onUrlPh': 'URL ON', 'station.offUrlPh': 'URL OFF',
|
'station.typeHttpGen': 'Relais HTTP (fait main / générique)', 'station.onPattern': 'Modèle d’URL ON', 'station.offPattern': 'Modèle d’URL OFF', 'station.insecureTls': 'Accepter un certificat auto-signé', 'station.insecureTlsHint': 'Une carte relais sur ton propre réseau signe elle-même son certificat, que rien ne peut vérifier. Laisse décoché pour une carte atteinte par internet à travers un proxy : là le certificat est réel, et le vérifier est ce qui protège la liaison.', 'station.patternHint': 'Optionnel, http ou https. {relay} est le numéro du relais — {relay-1} si la carte compte à partir de zéro. {value} est le libellé de ce relais ci-dessous : …/relay?on={value} avec le relais 1 nommé Ant1 envoie …/relay?on=Ant1. Laisse les deux vides si chaque relais a sa propre URL complète.', 'station.perRelayUrls': 'URL par relais (optionnel)', 'station.perRelayHint': 'Renseignées ici, elles l’emportent sur les modèles — pour un commutateur dont les voies n’ont rien en commun. {relay} et {value} fonctionnent aussi ici. L’état est mémorisé, pas relu : après un redémarrage chaque relais est recommandé une fois.', 'station.onUrlPh': 'URL ON', 'station.offUrlPh': 'URL OFF',
|
||||||
'station.valueNeedsLabels': 'Une URL ci-dessus utilise {value}, qui envoie le libellé du relais — nomme chaque relais commuté ainsi, sinon son URL part avec une valeur vide.',
|
'station.valueNeedsLabels': 'Une URL ci-dessus utilise {value}, qui envoie le libellé du relais — nomme chaque relais commuté ainsi, sinon son URL part avec une valeur vide.',
|
||||||
'station.title': 'Contrôle station', 'station.rotator': 'Rotator', 'station.rotateTo': 'Tourner vers {az}°', 'station.rotatorNoRead': 'Azimut non lu', 'station.bands': 'Bandes', 'station.nudgeUp': 'Monter de {n} kHz', 'station.nudgeDown': 'Descendre de {n} kHz', 'station.trackOn': 'Suivi actif', 'station.trackOff': 'Suivi inactif', 'station.trackStepTip': 'Ne réaccorder que si le rig a bougé d au moins ça', 'station.trackModeTip': "Quand l'antenne a le droit de se réaccorder", 'station.trackAlways': 'À chaque changement', 'station.trackStep': 'Au-delà d un pas', 'station.trackBand': 'Changement de bande', 'station.trackAlwaysTip': "Suivre chaque changement de fréquence. Résonance idéale, mais les moteurs tournent en permanence — et sur une SteppIR chaque déplacement bloque l'émission le temps du mouvement.", 'station.trackStepTipMode': "Ne réaccorder qu'une fois le rig sorti du pas. Suit un QSY, ignore la recherche autour.", 'station.trackBandTip': "Ne réaccorder qu'au changement de bande. Les moteurs bougent quelques fois par jour et restent tranquilles dans une bande.", 'station.pattern': 'Diagramme', 'station.bi': 'Bi', 'station.retract': 'Rétracter les éléments', 'station.moving': 'EN MOUVEMENT', 'station.elements': 'Éléments (mm)', 'station.read': 'Lire', 'station.readLengths': 'Lire les longueurs actuelles depuis le contrôleur', 'station.noLengths': 'Longueurs inconnues — clique sur Lire pour les récupérer depuis le contrôleur.', 'station.element': 'Élément', 'station.reflector': 'Réflecteur', 'station.driven': 'Radiateur', 'station.director': 'Dir', 'station.set': 'Régler', 'station.elementsHint': "Chaque appui allonge/raccourcit l'élément de 2 mm (comme le pupitre). Vérifie quel élément répond sur ton antenne.", 'station.setExactLen': "Clique pour taper la longueur actuelle exacte (recale la base si la lecture auto est fausse).", 'station.atMax': "Refusé par le contrôleur — l'élément est probablement en butée (longueur max pour cette bande), il ne peut plus s'allonger.", 'station.go': 'Aller', 'station.stop': 'Stop', 'station.dragHint': 'Glisse la poignée à gauche d un panneau pour le déplacer. Choisis un nombre de colonnes pour la disposition.', 'station.dragMove': 'Glisser pour déplacer ce panneau', 'station.colsAuto': 'Auto', 'station.addDevice': 'Ajouter un appareil', 'station.editDevice': "Modifier l'appareil", 'station.empty': "Aucune carte relais. Ajoute un WebSwitch 1216H ou une carte KMTronic 8 relais pour piloter l'alimentation et les accessoires de ta station.", 'station.online': 'En ligne', 'station.offline': 'Hors ligne', 'station.edit': 'Modifier', 'station.delete': 'Supprimer', 'station.relay': 'Relais', 'station.on': 'ON', 'station.off': 'OFF', 'station.type': "Type d'appareil", 'station.name': 'Nom', 'station.host': 'Hôte / IP', 'station.hostHint': "IP du LAN en local. Pour joindre la carte depuis L'EXTÉRIEUR, saisis une URL complète ici — ex. https://relais.tondomaine.com — pointant vers un reverse proxy (Nginx Proxy Manager…) qui expose le port HTTP de la carte.", 'station.user': "Nom d'utilisateur", 'station.pass': 'Mot de passe', 'station.optional': 'optionnel', 'station.ftdiSerial': 'Numéro de série FTDI', 'station.detect': 'Détecter', 'station.ftdiHint': "La carte Denkovi se pilote en FTDI bit-bang (pas via le port COM). Choisis son numéro de série (ex. DAE0006K). Nécessite le driver FTDI D2XX installé.", 'station.channels': 'Relais', 'station.comPort': 'Port COM', 'station.noPorts': 'Aucun port', 'station.usbRelayHint': "Cartes USB-série bon marché (CH340/LCUS) protocole A0. Si la tienne ne commute pas, donne-moi le modèle / jeu de commandes.", 'station.labels': 'Libellés des relais', 'station.cancel': 'Annuler', 'station.save': 'Enregistrer', 'station.test': 'Tester la connexion', 'station.testOk': 'Connecté — {n} relais', 'station.testFail': 'Non connecté', 'station.detectNone': 'Aucune carte FTDI trouvée — vérifie le câble et que le driver D2XX est installé.', 'station.detectFound': '{n} carte(s) détectée(s).',
|
'station.title': 'Contrôle station', 'station.rotator': 'Rotator', 'station.rotateTo': 'Tourner vers {az}°', 'station.rotatorNoRead': 'Azimut non lu', 'station.bands': 'Bandes', 'station.nudgeUp': 'Monter de {n} kHz', 'station.nudgeDown': 'Descendre de {n} kHz', 'station.trackOn': 'Suivi actif', 'station.trackOff': 'Suivi inactif', 'station.trackStepTip': 'Ne réaccorder que si le rig a bougé d au moins ça', 'station.trackModeTip': "Quand l'antenne a le droit de se réaccorder", 'station.trackAlways': 'À chaque changement', 'station.trackStep': 'Au-delà d un pas', 'station.trackBand': 'Changement de bande', 'station.trackAlwaysTip': "Suivre chaque changement de fréquence. Résonance idéale, mais les moteurs tournent en permanence — et sur une SteppIR chaque déplacement bloque l'émission le temps du mouvement.", 'station.trackStepTipMode': "Ne réaccorder qu'une fois le rig sorti du pas. Suit un QSY, ignore la recherche autour.", 'station.trackBandTip': "Ne réaccorder qu'au changement de bande. Les moteurs bougent quelques fois par jour et restent tranquilles dans une bande.", 'station.pattern': 'Diagramme', 'station.bi': 'Bi', 'station.motorWidgetShow': 'Antenne motorisée · cliquer pour afficher', 'station.motorWidgetHide': 'Antenne motorisée — affichée · cliquer pour masquer', 'station.hideWidget': 'Masquer ce widget', 'station.retract': 'Rétracter les éléments', 'station.moving': 'EN MOUVEMENT', 'station.elements': 'Éléments (mm)', 'station.read': 'Lire', 'station.readLengths': 'Lire les longueurs actuelles depuis le contrôleur', 'station.noLengths': 'Longueurs inconnues — clique sur Lire pour les récupérer depuis le contrôleur.', 'station.element': 'Élément', 'station.reflector': 'Réflecteur', 'station.driven': 'Radiateur', 'station.director': 'Dir', 'station.set': 'Régler', 'station.elementsHint': "Chaque appui allonge/raccourcit l'élément de 2 mm (comme le pupitre). Vérifie quel élément répond sur ton antenne.", 'station.setExactLen': "Clique pour taper la longueur actuelle exacte (recale la base si la lecture auto est fausse).", 'station.atMax': "Refusé par le contrôleur — l'élément est probablement en butée (longueur max pour cette bande), il ne peut plus s'allonger.", 'station.go': 'Aller', 'station.stop': 'Stop', 'station.dragHint': 'Glisse la poignée à gauche d un panneau pour le déplacer. Choisis un nombre de colonnes pour la disposition.', 'station.dragMove': 'Glisser pour déplacer ce panneau', 'station.colsAuto': 'Auto', 'station.addDevice': 'Ajouter un appareil', 'station.editDevice': "Modifier l'appareil", 'station.empty': "Aucune carte relais. Ajoute un WebSwitch 1216H ou une carte KMTronic 8 relais pour piloter l'alimentation et les accessoires de ta station.", 'station.online': 'En ligne', 'station.offline': 'Hors ligne', 'station.edit': 'Modifier', 'station.delete': 'Supprimer', 'station.relay': 'Relais', 'station.on': 'ON', 'station.off': 'OFF', 'station.type': "Type d'appareil", 'station.name': 'Nom', 'station.host': 'Hôte / IP', 'station.hostHint': "IP du LAN en local. Pour joindre la carte depuis L'EXTÉRIEUR, saisis une URL complète ici — ex. https://relais.tondomaine.com — pointant vers un reverse proxy (Nginx Proxy Manager…) qui expose le port HTTP de la carte.", 'station.user': "Nom d'utilisateur", 'station.pass': 'Mot de passe', 'station.optional': 'optionnel', 'station.ftdiSerial': 'Numéro de série FTDI', 'station.detect': 'Détecter', 'station.ftdiHint': "La carte Denkovi se pilote en FTDI bit-bang (pas via le port COM). Choisis son numéro de série (ex. DAE0006K). Nécessite le driver FTDI D2XX installé.", 'station.channels': 'Relais', 'station.comPort': 'Port COM', 'station.noPorts': 'Aucun port', 'station.usbRelayHint': "Cartes USB-série bon marché (CH340/LCUS) protocole A0. Si la tienne ne commute pas, donne-moi le modèle / jeu de commandes.", 'station.labels': 'Libellés des relais', 'station.cancel': 'Annuler', 'station.save': 'Enregistrer', 'station.test': 'Tester la connexion', 'station.testOk': 'Connecté — {n} relais', 'station.testFail': 'Non connecté', 'station.detectNone': 'Aucune carte FTDI trouvée — vérifie le câble et que le driver D2XX est installé.', 'station.detectFound': '{n} carte(s) détectée(s).',
|
||||||
'awards.followHint': 'Diplômes affichés dans l’onglet Awards. Laisse la colonne de droite vide pour tous les afficher.', 'awards.available': 'Tous les diplômes', 'awards.followed': 'Suivis', 'awards.search': 'Filtrer…', 'awards.addAll': 'Tout ajouter', 'awards.clear': 'Vider', 'awards.allTracked': 'Tous les diplômes sont suivis.', 'awards.noneFollowed': 'Aucun pour l’instant — l’onglet Awards les montre tous.',
|
'awards.followHint': 'Diplômes affichés dans l’onglet Awards. Laisse la colonne de droite vide pour tous les afficher.', 'awards.available': 'Tous les diplômes', 'awards.followed': 'Suivis', 'awards.search': 'Filtrer…', 'awards.addAll': 'Tout ajouter', 'awards.clear': 'Vider', 'awards.allTracked': 'Tous les diplômes sont suivis.', 'awards.noneFollowed': 'Aucun pour l’instant — l’onglet Awards les montre tous.',
|
||||||
'sec.awards': 'Diplômes', 'sec.cat': 'Interface CAT', 'sec.rotator': 'Rotator', 'sec.winkeyer': 'Manipulateur CW',
|
'sec.awards': 'Diplômes', 'sec.cat': 'Interface CAT', 'sec.rotator': 'Rotator', 'sec.winkeyer': 'Manipulateur CW',
|
||||||
'sec.antenna': 'Antenne motorisée', 'sec.antgenius': 'Antenna Genius', 'sec.tunergenius': 'Tuner Genius', 'sec.pgxl': 'Amplificateur', 'sec.psu': 'Alimentation',
|
'sec.antenna': 'Antenne motorisée', 'sec.antgenius': 'Antenna Genius', 'sec.tunergenius': 'Tuner Genius', 'sec.pgxl': 'Amplificateur', 'sec.psu': 'Alimentation',
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Single source of truth for the app version shown in the UI (header + About).
|
// Single source of truth for the app version shown in the UI (header + About).
|
||||||
// Bump this on a release (the release script updates it alongside telemetry.go).
|
// Bump this on a release (the release script updates it alongside telemetry.go).
|
||||||
export const APP_VERSION = '0.26.1';
|
export const APP_VERSION = '0.26.2';
|
||||||
|
|
||||||
// Author / credits, shown in Help -> About.
|
// Author / credits, shown in Help -> About.
|
||||||
export const APP_AUTHOR = 'F4BPO';
|
export const APP_AUTHOR = 'F4BPO';
|
||||||
|
|||||||
Vendored
+8
@@ -93,6 +93,8 @@ export function AwardsFolder():Promise<string>;
|
|||||||
|
|
||||||
export function BackfillDistances():Promise<main.BackfillDistancesResult>;
|
export function BackfillDistances():Promise<main.BackfillDistancesResult>;
|
||||||
|
|
||||||
|
export function BackfillRDA(arg1:boolean):Promise<main.BackfillRDAResult>;
|
||||||
|
|
||||||
export function BackfillUSCounties():Promise<main.BackfillUSCountiesResult>;
|
export function BackfillUSCounties():Promise<main.BackfillUSCountiesResult>;
|
||||||
|
|
||||||
export function BandSlotQSOs(arg1:string,arg2:number,arg3:string,arg4:string):Promise<Array<qso.QSO>>;
|
export function BandSlotQSOs(arg1:string,arg2:number,arg3:string,arg4:string):Promise<Array<qso.QSO>>;
|
||||||
@@ -115,6 +117,8 @@ export function CheckForUpdate():Promise<main.UpdateInfo>;
|
|||||||
|
|
||||||
export function ClearLookupCache():Promise<void>;
|
export function ClearLookupCache():Promise<void>;
|
||||||
|
|
||||||
|
export function CloseAutostartPrograms():Promise<void>;
|
||||||
|
|
||||||
export function ClusterSpotStatuses(arg1:Array<main.SpotQuery>):Promise<Array<main.SpotStatus>>;
|
export function ClusterSpotStatuses(arg1:Array<main.SpotQuery>):Promise<Array<main.SpotStatus>>;
|
||||||
|
|
||||||
export function ComputeQSOAwardRefs(arg1:qso.QSO):Promise<Array<main.QSOAwardRef>>;
|
export function ComputeQSOAwardRefs(arg1:qso.QSO):Promise<Array<main.QSOAwardRef>>;
|
||||||
@@ -863,8 +867,12 @@ export function QSOAudioStop():Promise<boolean>;
|
|||||||
|
|
||||||
export function QuitApp():Promise<void>;
|
export function QuitApp():Promise<void>;
|
||||||
|
|
||||||
|
export function RDADatabaseCount():Promise<number>;
|
||||||
|
|
||||||
export function RecomputeAllAwardRefs():Promise<number>;
|
export function RecomputeAllAwardRefs():Promise<number>;
|
||||||
|
|
||||||
|
export function RecomputeAwardRefsForCode(arg1:string):Promise<number>;
|
||||||
|
|
||||||
export function RefreshCtyDat():Promise<main.CtyDatInfo>;
|
export function RefreshCtyDat():Promise<main.CtyDatInfo>;
|
||||||
|
|
||||||
export function RefreshSolar():Promise<void>;
|
export function RefreshSolar():Promise<void>;
|
||||||
|
|||||||
@@ -126,6 +126,10 @@ export function BackfillDistances() {
|
|||||||
return window['go']['main']['App']['BackfillDistances']();
|
return window['go']['main']['App']['BackfillDistances']();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function BackfillRDA(arg1) {
|
||||||
|
return window['go']['main']['App']['BackfillRDA'](arg1);
|
||||||
|
}
|
||||||
|
|
||||||
export function BackfillUSCounties() {
|
export function BackfillUSCounties() {
|
||||||
return window['go']['main']['App']['BackfillUSCounties']();
|
return window['go']['main']['App']['BackfillUSCounties']();
|
||||||
}
|
}
|
||||||
@@ -170,6 +174,10 @@ export function ClearLookupCache() {
|
|||||||
return window['go']['main']['App']['ClearLookupCache']();
|
return window['go']['main']['App']['ClearLookupCache']();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function CloseAutostartPrograms() {
|
||||||
|
return window['go']['main']['App']['CloseAutostartPrograms']();
|
||||||
|
}
|
||||||
|
|
||||||
export function ClusterSpotStatuses(arg1) {
|
export function ClusterSpotStatuses(arg1) {
|
||||||
return window['go']['main']['App']['ClusterSpotStatuses'](arg1);
|
return window['go']['main']['App']['ClusterSpotStatuses'](arg1);
|
||||||
}
|
}
|
||||||
@@ -1666,10 +1674,18 @@ export function QuitApp() {
|
|||||||
return window['go']['main']['App']['QuitApp']();
|
return window['go']['main']['App']['QuitApp']();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function RDADatabaseCount() {
|
||||||
|
return window['go']['main']['App']['RDADatabaseCount']();
|
||||||
|
}
|
||||||
|
|
||||||
export function RecomputeAllAwardRefs() {
|
export function RecomputeAllAwardRefs() {
|
||||||
return window['go']['main']['App']['RecomputeAllAwardRefs']();
|
return window['go']['main']['App']['RecomputeAllAwardRefs']();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function RecomputeAwardRefsForCode(arg1) {
|
||||||
|
return window['go']['main']['App']['RecomputeAwardRefsForCode'](arg1);
|
||||||
|
}
|
||||||
|
|
||||||
export function RefreshCtyDat() {
|
export function RefreshCtyDat() {
|
||||||
return window['go']['main']['App']['RefreshCtyDat']();
|
return window['go']['main']['App']['RefreshCtyDat']();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1445,6 +1445,7 @@ export namespace lookup {
|
|||||||
qsl_via?: string;
|
qsl_via?: string;
|
||||||
web?: string;
|
web?: string;
|
||||||
iota?: string;
|
iota?: string;
|
||||||
|
rda?: string;
|
||||||
zip?: string;
|
zip?: string;
|
||||||
image_url?: string;
|
image_url?: string;
|
||||||
source: string;
|
source: string;
|
||||||
@@ -1475,6 +1476,7 @@ export namespace lookup {
|
|||||||
this.qsl_via = source["qsl_via"];
|
this.qsl_via = source["qsl_via"];
|
||||||
this.web = source["web"];
|
this.web = source["web"];
|
||||||
this.iota = source["iota"];
|
this.iota = source["iota"];
|
||||||
|
this.rda = source["rda"];
|
||||||
this.zip = source["zip"];
|
this.zip = source["zip"];
|
||||||
this.image_url = source["image_url"];
|
this.image_url = source["image_url"];
|
||||||
this.source = source["source"];
|
this.source = source["source"];
|
||||||
@@ -1734,6 +1736,7 @@ export namespace main {
|
|||||||
path: string;
|
path: string;
|
||||||
args: string;
|
args: string;
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
|
close_on_exit?: boolean;
|
||||||
|
|
||||||
static createFrom(source: any = {}) {
|
static createFrom(source: any = {}) {
|
||||||
return new AutostartProgram(source);
|
return new AutostartProgram(source);
|
||||||
@@ -1746,6 +1749,7 @@ export namespace main {
|
|||||||
this.path = source["path"];
|
this.path = source["path"];
|
||||||
this.args = source["args"];
|
this.args = source["args"];
|
||||||
this.enabled = source["enabled"];
|
this.enabled = source["enabled"];
|
||||||
|
this.close_on_exit = source["close_on_exit"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export class AwardExplain {
|
export class AwardExplain {
|
||||||
@@ -1955,6 +1959,26 @@ export namespace main {
|
|||||||
this.no_grid = source["no_grid"];
|
this.no_grid = source["no_grid"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
export class BackfillRDAResult {
|
||||||
|
scanned: number;
|
||||||
|
dated: number;
|
||||||
|
current: number;
|
||||||
|
unknown: number;
|
||||||
|
skipped: number;
|
||||||
|
|
||||||
|
static createFrom(source: any = {}) {
|
||||||
|
return new BackfillRDAResult(source);
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor(source: any = {}) {
|
||||||
|
if ('string' === typeof source) source = JSON.parse(source);
|
||||||
|
this.scanned = source["scanned"];
|
||||||
|
this.dated = source["dated"];
|
||||||
|
this.current = source["current"];
|
||||||
|
this.unknown = source["unknown"];
|
||||||
|
this.skipped = source["skipped"];
|
||||||
|
}
|
||||||
|
}
|
||||||
export class BackfillUSCountiesResult {
|
export class BackfillUSCountiesResult {
|
||||||
scanned: number;
|
scanned: number;
|
||||||
county: number;
|
county: number;
|
||||||
|
|||||||
@@ -2163,6 +2163,34 @@ func (f *Flex) startMeters(conn net.Conn) {
|
|||||||
debugLog.Printf("Flex: meters UDP local=:%d punch→%s", port, raddr)
|
debugLog.Printf("Flex: meters UDP local=:%d punch→%s", port, raddr)
|
||||||
go f.udpReader(uc)
|
go f.udpReader(uc)
|
||||||
go f.udpKeepalive(uc, raddr)
|
go f.udpKeepalive(uc, raddr)
|
||||||
|
go f.udpWatchdog(uc)
|
||||||
|
}
|
||||||
|
|
||||||
|
// udpWatchdog says so when the meter stream never arrives.
|
||||||
|
//
|
||||||
|
// The meters come over VITA-49 on a UDP socket the radio sends TO US; the TCP
|
||||||
|
// side can be perfectly healthy — handshake, slices, spots, everything — while
|
||||||
|
// not one datagram gets through. On Windows that is almost always the firewall
|
||||||
|
// refusing inbound UDP for a program it has not been asked about, and the only
|
||||||
|
// symptom is meters that stay at zero. Nothing said so: an operator saw a
|
||||||
|
// connected radio with dead meters and no reason anywhere.
|
||||||
|
//
|
||||||
|
// Five seconds is far longer than the stream's own 40 frames a second needs.
|
||||||
|
func (f *Flex) udpWatchdog(uc *net.UDPConn) {
|
||||||
|
time.Sleep(5 * time.Second)
|
||||||
|
f.mu.Lock()
|
||||||
|
cur, seen := f.udpConn, f.vitaSeen
|
||||||
|
port := 0
|
||||||
|
if uc.LocalAddr() != nil {
|
||||||
|
port = uc.LocalAddr().(*net.UDPAddr).Port
|
||||||
|
}
|
||||||
|
f.mu.Unlock()
|
||||||
|
if cur != uc || seen > 0 {
|
||||||
|
return // reconnected in the meantime, or the stream is flowing
|
||||||
|
}
|
||||||
|
debugLog.Printf("Flex: NO meter data after 5s — the radio's VITA-49 stream is not reaching UDP port %d. "+
|
||||||
|
"The TCP link is fine, so this is almost always a firewall: allow OpsLog.exe inbound UDP "+
|
||||||
|
"(Windows Defender Firewall → Allow an app), or open port %d for %s", port, port, f.host)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *Flex) udpReader(uc *net.UDPConn) {
|
func (f *Flex) udpReader(uc *net.UDPConn) {
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package udp
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
// A compound or non-standard callsign does not fit in a 77-bit FT8 message, so
|
||||||
|
// it travels as a hash and is printed between angle brackets. Those decodes
|
||||||
|
// used to be discarded whole — including the one message an operator is waiting
|
||||||
|
// for, the reply that says a station answered them.
|
||||||
|
func TestWsjtSenderHashedCallsign(t *testing.T) {
|
||||||
|
for _, c := range []struct {
|
||||||
|
msg, call string
|
||||||
|
cq bool
|
||||||
|
grid string
|
||||||
|
}{
|
||||||
|
// The reply that went missing: the sender is the bracketed call.
|
||||||
|
{"F4BPO <ZA/IW2JOP> -24", "ZA/IW2JOP", false, ""},
|
||||||
|
{"F4BPO <ZA/IW2JOP> R-14", "ZA/IW2JOP", false, ""},
|
||||||
|
// The other way round: we are the hashed one, the sender is plain.
|
||||||
|
{"<ZA/IW2JOP> F4BPO R-14", "F4BPO", false, ""},
|
||||||
|
// A CQ from a hashed call, with and without a grid.
|
||||||
|
{"CQ <ZA/IW2JOP> KM09", "ZA/IW2JOP", true, "KM09"},
|
||||||
|
{"CQ <ZA/IW2JOP>", "ZA/IW2JOP", true, ""},
|
||||||
|
{"CQ DX <ZA/IW2JOP> KM09", "ZA/IW2JOP", true, "KM09"},
|
||||||
|
// The compound form: one station signs off with another while answering a
|
||||||
|
// third. The sender is after the semicolon — reading from the left names
|
||||||
|
// OK1UA, who did not send it.
|
||||||
|
{"OK1UA RR73; DH1HRN <ZA/IW2JOP> -08", "ZA/IW2JOP", false, ""},
|
||||||
|
{"K1ABC RR73; W9XYZ <KH1/KH7Z> -08", "KH1/KH7Z", false, ""},
|
||||||
|
// Unchanged: the ordinary forms.
|
||||||
|
{"F4BPO W6YGO R-03", "W6YGO", false, ""},
|
||||||
|
{"CQ N2BJ EN61", "N2BJ", true, "EN61"},
|
||||||
|
// A hash the receiver could not resolve is NOT a callsign, and must not
|
||||||
|
// become one.
|
||||||
|
{"F4BPO <...> -24", "", false, ""},
|
||||||
|
} {
|
||||||
|
call, cq, grid := wsjtSender(c.msg)
|
||||||
|
if call != c.call || cq != c.cq || grid != c.grid {
|
||||||
|
t.Errorf("wsjtSender(%q) = (%q, %v, %q), want (%q, %v, %q)",
|
||||||
|
c.msg, call, cq, grid, c.call, c.cq, c.grid)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -372,8 +372,29 @@ func ParseWSJT(pkt []byte) (WSJTEvent, bool, error) {
|
|||||||
// third slot, never a locator.
|
// third slot, never a locator.
|
||||||
//
|
//
|
||||||
// Returns "" for free-text / telemetry / hashed-call messages we can't resolve.
|
// Returns "" for free-text / telemetry / hashed-call messages we can't resolve.
|
||||||
|
// unbracket strips the angle brackets FT8 puts around a HASHED callsign.
|
||||||
|
//
|
||||||
|
// A compound or non-standard call does not fit in a 77-bit message, so the
|
||||||
|
// protocol sends a hash of it and the receiving software prints what it
|
||||||
|
// resolved between angle brackets: "F4BPO <ZA/IW2JOP> -24". The brackets are
|
||||||
|
// notation, not part of the callsign — but every character test here rejected
|
||||||
|
// them, so the whole decode was thrown away as unparseable. Every reply from a
|
||||||
|
// station with a compound call was invisible: precisely the stations worth
|
||||||
|
// seeing, and precisely the message that says one of them answered you.
|
||||||
|
func unbracket(s string) string {
|
||||||
|
return strings.TrimSuffix(strings.TrimPrefix(s, "<"), ">")
|
||||||
|
}
|
||||||
|
|
||||||
func wsjtSender(message string) (call string, isCQ bool, grid string) {
|
func wsjtSender(message string) (call string, isCQ bool, grid string) {
|
||||||
f := strings.Fields(strings.ToUpper(strings.TrimSpace(message)))
|
msg := strings.ToUpper(strings.TrimSpace(message))
|
||||||
|
// The compound form — "OK1UA RR73; DH1HRN <ZA/IW2JOP> -08" — is one station
|
||||||
|
// signing off with another while answering a third. The sender is in the
|
||||||
|
// part AFTER the semicolon; reading the line from the left names OK1UA, who
|
||||||
|
// did not send it.
|
||||||
|
if i := strings.LastIndexByte(msg, ';'); i >= 0 {
|
||||||
|
msg = strings.TrimSpace(msg[i+1:])
|
||||||
|
}
|
||||||
|
f := strings.Fields(msg)
|
||||||
if len(f) == 0 {
|
if len(f) == 0 {
|
||||||
return "", false, ""
|
return "", false, ""
|
||||||
}
|
}
|
||||||
@@ -381,11 +402,11 @@ func wsjtSender(message string) (call string, isCQ bool, grid string) {
|
|||||||
// Skip an optional modifier after CQ (DX / a region like NA / a zone like
|
// Skip an optional modifier after CQ (DX / a region like NA / a zone like
|
||||||
// 020) — it never looks like a callsign (no letter+digit mix).
|
// 020) — it never looks like a callsign (no letter+digit mix).
|
||||||
idx := 1
|
idx := 1
|
||||||
if len(f) > 2 && !looksLikeCall(f[1]) {
|
if len(f) > 2 && !looksLikeCall(unbracket(f[1])) {
|
||||||
idx = 2
|
idx = 2
|
||||||
}
|
}
|
||||||
if idx < len(f) {
|
if idx < len(f) {
|
||||||
c := f[idx]
|
c := unbracket(f[idx])
|
||||||
// A GRID sitting in the callsign slot means the real call was
|
// A GRID sitting in the callsign slot means the real call was
|
||||||
// unparseable and the skip above went one word too far. JN36 has letters
|
// unparseable and the skip above went one word too far. JN36 has letters
|
||||||
// and digits and passes every shape test there is, so without this the
|
// and digits and passes every shape test there is, so without this the
|
||||||
@@ -411,11 +432,13 @@ func wsjtSender(message string) (call string, isCQ bool, grid string) {
|
|||||||
//
|
//
|
||||||
// isGridField is what keeps the reports and sign-offs out: -05, R-05, RRR,
|
// isGridField is what keeps the reports and sign-offs out: -05, R-05, RRR,
|
||||||
// 73 and RR73 all fail it, on length, charset or by name.
|
// 73 and RR73 all fail it, on length, charset or by name.
|
||||||
if len(f) >= 2 && looksLikeCall(f[1]) {
|
if len(f) >= 2 {
|
||||||
if len(f) >= 3 && isGridField(f[2]) {
|
if c := unbracket(f[1]); looksLikeCall(c) {
|
||||||
return f[1], false, f[2]
|
if len(f) >= 3 && isGridField(f[2]) {
|
||||||
|
return c, false, f[2]
|
||||||
|
}
|
||||||
|
return c, false, ""
|
||||||
}
|
}
|
||||||
return f[1], false, ""
|
|
||||||
}
|
}
|
||||||
return "", false, ""
|
return "", false, ""
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
@@ -142,6 +143,7 @@ func parseHamQTHSearch(body []byte) (Result, error) {
|
|||||||
QSLVia: s.QSLVia,
|
QSLVia: s.QSLVia,
|
||||||
Web: s.Web,
|
Web: s.Web,
|
||||||
ImageURL: s.Picture,
|
ImageURL: s.Picture,
|
||||||
|
RDA: rdaRef(s.Oblast, s.District),
|
||||||
}
|
}
|
||||||
r.Lat, _ = strconv.ParseFloat(s.Latitude, 64)
|
r.Lat, _ = strconv.ParseFloat(s.Latitude, 64)
|
||||||
r.Lon, _ = strconv.ParseFloat(s.Longitude, 64)
|
r.Lon, _ = strconv.ParseFloat(s.Longitude, 64)
|
||||||
@@ -151,6 +153,27 @@ func parseHamQTHSearch(body []byte) (Result, error) {
|
|||||||
return r, nil
|
return r, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// rdaRefRe matches a Russian district reference: two letters, a hyphen, two
|
||||||
|
// digits. Searched for rather than anchored, because the field is filled by
|
||||||
|
// hand and arrives as "KE-29", "KE-29 Kemerovskaya obl." or with stray spaces
|
||||||
|
// depending on which editor the operator used.
|
||||||
|
var rdaRefRe = regexp.MustCompile(`\b([A-Z]{2}-[0-9]{2})\b`)
|
||||||
|
|
||||||
|
// rdaRef extracts a district reference from HamQTH's oblast/district fields.
|
||||||
|
//
|
||||||
|
// Strict about the SHAPE and silent otherwise: a value that is not a district
|
||||||
|
// reference — an oblast name, a postal code, free text — must yield nothing.
|
||||||
|
// Writing it into the award anyway would create a reference no list contains,
|
||||||
|
// which counts for zero and has to be found and removed by hand later.
|
||||||
|
func rdaRef(fields ...string) string {
|
||||||
|
for _, f := range fields {
|
||||||
|
if m := rdaRefRe.FindStringSubmatch(strings.ToUpper(strings.TrimSpace(f))); m != nil {
|
||||||
|
return m[1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
func (h *HamQTH) get(ctx context.Context, u string) ([]byte, error) {
|
func (h *HamQTH) get(ctx context.Context, u string) ([]byte, error) {
|
||||||
req, err := http.NewRequestWithContext(ctx, "GET", u, nil)
|
req, err := http.NewRequestWithContext(ctx, "GET", u, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -191,15 +214,19 @@ type hamqthSearch struct {
|
|||||||
AdrCountry string `xml:"adr_country"`
|
AdrCountry string `xml:"adr_country"`
|
||||||
USState string `xml:"us_state"`
|
USState string `xml:"us_state"`
|
||||||
USCounty string `xml:"us_county"`
|
USCounty string `xml:"us_county"`
|
||||||
Grid string `xml:"grid"`
|
// Oblast is HamQTH's Russian district field; District is its generic one.
|
||||||
Latitude string `xml:"latitude"`
|
// Both are read because operators fill whichever their editor showed them.
|
||||||
Longitude string `xml:"longitude"`
|
Oblast string `xml:"oblast"`
|
||||||
DXCC string `xml:"adif"` // HamQTH exposes the ADIF/DXCC number under <adif>
|
District string `xml:"district"`
|
||||||
CQ string `xml:"cq"`
|
Grid string `xml:"grid"`
|
||||||
ITU string `xml:"itu"`
|
Latitude string `xml:"latitude"`
|
||||||
Continent string `xml:"continent"`
|
Longitude string `xml:"longitude"`
|
||||||
Email string `xml:"email"`
|
DXCC string `xml:"adif"` // HamQTH exposes the ADIF/DXCC number under <adif>
|
||||||
QSLVia string `xml:"qsl_via"`
|
CQ string `xml:"cq"`
|
||||||
|
ITU string `xml:"itu"`
|
||||||
|
Continent string `xml:"continent"`
|
||||||
|
Email string `xml:"email"`
|
||||||
|
QSLVia string `xml:"qsl_via"`
|
||||||
// AdrName is the full postal name. Many records carry it and no <name> at
|
// AdrName is the full postal name. Many records carry it and no <name> at
|
||||||
// all, so building the name from <nick> + <name> silently kept the first
|
// all, so building the name from <nick> + <name> silently kept the first
|
||||||
// name and dropped the rest.
|
// name and dropped the rest.
|
||||||
|
|||||||
@@ -45,6 +45,17 @@ type Result struct {
|
|||||||
// and nothing used to read it — and since no live activation feed exists for
|
// and nothing used to read it — and since no live activation feed exists for
|
||||||
// IOTA the way it does for POTA, the callbook record is the practical source.
|
// IOTA the way it does for POTA, the callbook record is the practical source.
|
||||||
IOTA string `json:"iota,omitempty"`
|
IOTA string `json:"iota,omitempty"`
|
||||||
|
// RDA is the Russian District Award reference (KE-29). HamQTH publishes it
|
||||||
|
// as <oblast>, described in their own documentation as "something like
|
||||||
|
// district (Russian stations)"; QRZ.com has no equivalent — its county and
|
||||||
|
// state fields are USA-only.
|
||||||
|
//
|
||||||
|
// It is the CURRENT district, which is why it may only ever be applied to a
|
||||||
|
// contact being made now. A Russian station can move, and stamping today's
|
||||||
|
// district on a three-year-old QSO rewrites a correct contact into a wrong
|
||||||
|
// one. DXLab solves the general case with dated activity records; we solve
|
||||||
|
// the case that matters by never dating anything but the present.
|
||||||
|
RDA string `json:"rda,omitempty"`
|
||||||
// Zip is the postal code. HamQTH and QRZ both send one.
|
// Zip is the postal code. HamQTH and QRZ both send one.
|
||||||
Zip string `json:"zip,omitempty"`
|
Zip string `json:"zip,omitempty"`
|
||||||
ImageURL string `json:"image_url,omitempty"` // profile picture URL
|
ImageURL string `json:"image_url,omitempty"` // profile picture URL
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package lookup
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
// The district only ever reaches the log if it has the RIGHT SHAPE. HamQTH's
|
||||||
|
// oblast field is filled by hand, so it arrives in whatever form the operator's
|
||||||
|
// editor encouraged — and anything that is not a district reference must yield
|
||||||
|
// nothing at all rather than a reference no list contains.
|
||||||
|
func TestRDARef(t *testing.T) {
|
||||||
|
for _, c := range []struct{ in, want string }{
|
||||||
|
{"KE-29", "KE-29"},
|
||||||
|
{"ke-29", "KE-29"},
|
||||||
|
{" KE-29 ", "KE-29"},
|
||||||
|
{"KE-29 Kemerovskaya obl.", "KE-29"},
|
||||||
|
{"Kemerovskaya obl. (KE-29)", "KE-29"},
|
||||||
|
{"", ""},
|
||||||
|
{"Kemerovskaya oblast", ""}, // a name, not a reference
|
||||||
|
{"KE", ""}, // the oblast alone carries no district
|
||||||
|
{"KE-1", ""}, // one digit is not an RDA
|
||||||
|
{"KE-291", ""}, // three digits is not one either
|
||||||
|
{"650000", ""}, // a postal code
|
||||||
|
{"EU-064", ""}, // an IOTA reference in the wrong field
|
||||||
|
} {
|
||||||
|
if got := rdaRef(c.in); got != c.want {
|
||||||
|
t.Errorf("rdaRef(%q) = %q, want %q", c.in, got, c.want)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// oblast wins over district; an empty first field falls through to the next.
|
||||||
|
if got := rdaRef("", "MO-19"); got != "MO-19" {
|
||||||
|
t.Errorf("fallback to district = %q, want MO-19", got)
|
||||||
|
}
|
||||||
|
if got := rdaRef("KE-29", "MO-19"); got != "KE-29" {
|
||||||
|
t.Errorf("oblast must win, got %q", got)
|
||||||
|
}
|
||||||
|
}
|
||||||
+38
-2
@@ -2301,7 +2301,7 @@ func (r *Repo) IterateAll(ctx context.Context, fn func(QSO) error) error {
|
|||||||
const awardCols = `id, callsign, qso_date, band, freq_hz, mode, ` +
|
const awardCols = `id, callsign, qso_date, band, freq_hz, mode, ` +
|
||||||
`grid, vucc_grids, country, state, cnty, cont, cqz, ituz, dxcc, iota, sota_ref, pota_ref, ` +
|
`grid, vucc_grids, country, state, cnty, cont, cqz, ituz, dxcc, iota, sota_ref, pota_ref, ` +
|
||||||
`name, qth, address, comment, notes, ` +
|
`name, qth, address, comment, notes, ` +
|
||||||
`qsl_rcvd, lotw_rcvd, eqsl_rcvd, extras_json`
|
`qsl_rcvd, lotw_rcvd, eqsl_rcvd, extras_json, award_refs`
|
||||||
|
|
||||||
// IterateForAwards streams a lightweight projection of every QSO — only the
|
// IterateForAwards streams a lightweight projection of every QSO — only the
|
||||||
// fields award computation reads (see awardCols). All other QSO fields are left
|
// fields award computation reads (see awardCols). All other QSO fields are left
|
||||||
@@ -2326,6 +2326,37 @@ func (r *Repo) IterateForAwards(ctx context.Context, fn func(QSO) error) error {
|
|||||||
return rows.Err()
|
return rows.Err()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IterateForAwardsWithRef streams only the QSOs whose stored award_refs already
|
||||||
|
// mention one award code.
|
||||||
|
//
|
||||||
|
// For a change that RELABELS an award rather than re-matching it — the grid
|
||||||
|
// column switching from the reference to its description — the rows that can
|
||||||
|
// possibly change are exactly these. On a 30 000-QSO log with 2 488 French
|
||||||
|
// departments in it, that is the difference between reading the whole logbook
|
||||||
|
// and reading a twelfth of it.
|
||||||
|
//
|
||||||
|
// Matched with LIKE on the JSON key, which is exact enough: award_refs is a
|
||||||
|
// compact object written by us, so a code appears as "DDFM": and nowhere else.
|
||||||
|
func (r *Repo) IterateForAwardsWithRef(ctx context.Context, code string, fn func(QSO) error) error {
|
||||||
|
like := "%\"" + strings.ToUpper(strings.TrimSpace(code)) + "\":%"
|
||||||
|
rows, err := r.db.QueryContext(ctx,
|
||||||
|
`SELECT `+awardCols+` FROM qso WHERE award_refs LIKE ? ORDER BY qso_date ASC, id ASC`, like)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("query qso (awards, one code): %w", err)
|
||||||
|
}
|
||||||
|
defer rows.Close()
|
||||||
|
for rows.Next() {
|
||||||
|
q, err := scanAwardQSO(rows)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := fn(q); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rows.Err()
|
||||||
|
}
|
||||||
|
|
||||||
// scanAwardQSO reads one row produced by awardCols into a QSO, populating only
|
// scanAwardQSO reads one row produced by awardCols into a QSO, populating only
|
||||||
// the award-relevant fields. Column order MUST match awardCols.
|
// the award-relevant fields. Column order MUST match awardCols.
|
||||||
func scanAwardQSO(s scanner) (QSO, error) {
|
func scanAwardQSO(s scanner) (QSO, error) {
|
||||||
@@ -2341,16 +2372,21 @@ func scanAwardQSO(s scanner) (QSO, error) {
|
|||||||
comment, notes sql.NullString
|
comment, notes sql.NullString
|
||||||
qslRcvd, lotwRcvd, eqslRcvd sql.NullString
|
qslRcvd, lotwRcvd, eqslRcvd sql.NullString
|
||||||
extrasJSON sql.NullString
|
extrasJSON sql.NullString
|
||||||
|
awardRefs sql.NullString
|
||||||
)
|
)
|
||||||
if err := s.Scan(
|
if err := s.Scan(
|
||||||
&q.ID, &q.Callsign, &qsoDateStr, &q.Band, &freqHz, &q.Mode,
|
&q.ID, &q.Callsign, &qsoDateStr, &q.Band, &freqHz, &q.Mode,
|
||||||
&grid, &vucc, &country, &state, &cnty, &cont, &cqz, &ituz, &dxcc, &iotaRef, &sota, &pota,
|
&grid, &vucc, &country, &state, &cnty, &cont, &cqz, &ituz, &dxcc, &iotaRef, &sota, &pota,
|
||||||
&name, &qth, &address, &comment, ¬es,
|
&name, &qth, &address, &comment, ¬es,
|
||||||
&qslRcvd, &lotwRcvd, &eqslRcvd, &extrasJSON,
|
&qslRcvd, &lotwRcvd, &eqslRcvd, &extrasJSON, &awardRefs,
|
||||||
); err != nil {
|
); err != nil {
|
||||||
return QSO{}, fmt.Errorf("scan qso (awards): %w", err)
|
return QSO{}, fmt.Errorf("scan qso (awards): %w", err)
|
||||||
}
|
}
|
||||||
q.QSODate = parseTimeLoose(qsoDateStr)
|
q.QSODate = parseTimeLoose(qsoDateStr)
|
||||||
|
// award_refs rides along so a recompute can compare what it produced against
|
||||||
|
// what is stored WITHOUT falling back to the full-record scan — the whole
|
||||||
|
// point of this projection.
|
||||||
|
q.AwardRefs = awardRefs.String
|
||||||
if freqHz.Valid {
|
if freqHz.Valid {
|
||||||
v := freqHz.Int64
|
v := freqHz.Int64
|
||||||
q.FreqHz = &v
|
q.FreqHz = &v
|
||||||
|
|||||||
@@ -0,0 +1,189 @@
|
|||||||
|
// Package rda resolves a Russian callsign to the RDA district it operated from
|
||||||
|
// ON A GIVEN DAY.
|
||||||
|
//
|
||||||
|
// # Why the day matters
|
||||||
|
//
|
||||||
|
// A Russian station can move district, and an expedition operates from a dozen
|
||||||
|
// in a fortnight. Asking "which district is this callsign in?" therefore has no
|
||||||
|
// single answer, and answering it with today's district would rewrite a correct
|
||||||
|
// three-year-old contact into a false one — silently, with nothing downstream
|
||||||
|
// able to tell. Every lookup here takes a date for that reason.
|
||||||
|
//
|
||||||
|
// # The data
|
||||||
|
//
|
||||||
|
// Compiled from RDA.mdb, the reference database distributed for the award
|
||||||
|
// (58 188 callsigns). Two shapes live in its RDA column and they mean different
|
||||||
|
// things:
|
||||||
|
//
|
||||||
|
// KK-08 the district the station operates from,
|
||||||
|
// with no history — the compiler knows of
|
||||||
|
// no change for this call
|
||||||
|
// <2021-07-29,2021-07-29,TO-16>… dated activity records, one per period
|
||||||
|
//
|
||||||
|
// 43 294 callsigns are of the first kind and 14 894 of the second. A dated
|
||||||
|
// record covering the QSO day is an ANSWER; a bare current district is an
|
||||||
|
// assumption, true for a station that never moved and wrong for one that did.
|
||||||
|
// Lookup reports which it gave, and the caller decides whether an assumption is
|
||||||
|
// good enough — see Match.Dated.
|
||||||
|
//
|
||||||
|
// # Regenerating
|
||||||
|
//
|
||||||
|
// There is no updater: the source is an Access database, and reading one needs
|
||||||
|
// cgo, which this project does not use. It is converted once, by hand, and the
|
||||||
|
// result embedded. To redo it with a newer RDA.mdb (PowerShell, needs the ACE
|
||||||
|
// OLEDB provider that ships with Office):
|
||||||
|
//
|
||||||
|
// $conn = New-Object System.Data.OleDb.OleDbConnection(
|
||||||
|
// "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=RDA.mdb;")
|
||||||
|
// SELECT CallSign, RDA, DXCCID FROM [RDACallsigns] ORDER BY CallSign
|
||||||
|
//
|
||||||
|
// writing one line per callsign as
|
||||||
|
//
|
||||||
|
// CALL;DXCC;CURRENT;YYYYMMDD,YYYYMMDD,DIST;YYYYMMDD,YYYYMMDD,DIST…
|
||||||
|
//
|
||||||
|
// where CURRENT may be empty, then gzip it to rdadb.txt.gz.
|
||||||
|
package rda
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bufio"
|
||||||
|
"compress/gzip"
|
||||||
|
"embed"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
"sync"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:embed rdadb.txt.gz
|
||||||
|
var files embed.FS
|
||||||
|
|
||||||
|
// span is one dated activity record: the district, and the inclusive day range
|
||||||
|
// it applies to as YYYYMMDD integers (comparing those is comparing dates, with
|
||||||
|
// no timezone to get wrong).
|
||||||
|
type span struct {
|
||||||
|
from, to uint32
|
||||||
|
district string
|
||||||
|
}
|
||||||
|
|
||||||
|
type entry struct {
|
||||||
|
dxcc int
|
||||||
|
current string // district with no history; "" when only dated records exist
|
||||||
|
spans []span
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
once sync.Once
|
||||||
|
byCal map[string]entry
|
||||||
|
loadN int
|
||||||
|
)
|
||||||
|
|
||||||
|
// Match is what a lookup found.
|
||||||
|
type Match struct {
|
||||||
|
// District is the RDA reference, e.g. "KE-29".
|
||||||
|
District string
|
||||||
|
// Dated is true when a dated activity record covered the day asked for.
|
||||||
|
//
|
||||||
|
// False means the district came from the callsign's CURRENT entry, which
|
||||||
|
// carries no dates at all. For the great majority of stations that is the
|
||||||
|
// same thing — the database records a history precisely for the ones that
|
||||||
|
// moved — but it is an assumption and not a fact, and a caller writing into
|
||||||
|
// a log years old should be told which of the two it is getting.
|
||||||
|
Dated bool
|
||||||
|
// DXCC is the entity the database files the callsign under (15, 54 or 126).
|
||||||
|
DXCC int
|
||||||
|
}
|
||||||
|
|
||||||
|
func load() {
|
||||||
|
byCal = make(map[string]entry, 60000)
|
||||||
|
f, err := files.Open("rdadb.txt.gz")
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer f.Close()
|
||||||
|
zr, err := gzip.NewReader(f)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer zr.Close()
|
||||||
|
sc := bufio.NewScanner(zr)
|
||||||
|
sc.Buffer(make([]byte, 0, 64*1024), 1024*1024) // one expedition's history is long
|
||||||
|
for sc.Scan() {
|
||||||
|
line := strings.TrimSpace(sc.Text())
|
||||||
|
if line == "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
parts := strings.Split(line, ";")
|
||||||
|
if len(parts) < 3 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
e := entry{current: parts[2]}
|
||||||
|
e.dxcc, _ = strconv.Atoi(parts[1])
|
||||||
|
for _, p := range parts[3:] {
|
||||||
|
f := strings.Split(p, ",")
|
||||||
|
if len(f) != 3 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
from, err1 := strconv.ParseUint(f[0], 10, 32)
|
||||||
|
to, err2 := strconv.ParseUint(f[1], 10, 32)
|
||||||
|
if err1 != nil || err2 != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
e.spans = append(e.spans, span{from: uint32(from), to: uint32(to), district: f[2]})
|
||||||
|
}
|
||||||
|
byCal[parts[0]] = e
|
||||||
|
loadN++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Count returns how many callsigns the database holds (0 before the first use).
|
||||||
|
func Count() int {
|
||||||
|
once.Do(load)
|
||||||
|
return loadN
|
||||||
|
}
|
||||||
|
|
||||||
|
// Lookup resolves a callsign on a given day.
|
||||||
|
//
|
||||||
|
// The match is EXACT on the callsign, deliberately. A suffix is not decoration:
|
||||||
|
// RA3YG/P is somewhere other than RA3YG by definition, and quietly falling back
|
||||||
|
// to the base call would answer with the home district for a contact made from
|
||||||
|
// a field — which is the precise error this package exists to avoid.
|
||||||
|
func Lookup(call string, day time.Time) (Match, bool) {
|
||||||
|
once.Do(load)
|
||||||
|
c := strings.ToUpper(strings.TrimSpace(call))
|
||||||
|
if c == "" {
|
||||||
|
return Match{}, false
|
||||||
|
}
|
||||||
|
e, ok := byCal[c]
|
||||||
|
if !ok {
|
||||||
|
return Match{}, false
|
||||||
|
}
|
||||||
|
d := ymd(day)
|
||||||
|
// A dated record wins whenever one covers the day. Several can overlap — an
|
||||||
|
// expedition working two districts in a day — and the FIRST is taken rather
|
||||||
|
// than a guess between them: the database lists them in the order its
|
||||||
|
// compiler recorded them, and inventing a tie-break here would be inventing
|
||||||
|
// data.
|
||||||
|
if d != 0 {
|
||||||
|
for _, s := range e.spans {
|
||||||
|
if d >= s.from && d <= s.to {
|
||||||
|
return Match{District: s.district, Dated: true, DXCC: e.dxcc}, true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if e.current != "" {
|
||||||
|
return Match{District: e.current, Dated: false, DXCC: e.dxcc}, true
|
||||||
|
}
|
||||||
|
// Dated records exist but none covers this day. That is an answer in itself
|
||||||
|
// — the station was somewhere the database does not know about — and it is
|
||||||
|
// reported as "not found" rather than by handing back a neighbouring period.
|
||||||
|
return Match{}, false
|
||||||
|
}
|
||||||
|
|
||||||
|
// ymd turns a time into YYYYMMDD, or 0 for the zero time.
|
||||||
|
func ymd(t time.Time) uint32 {
|
||||||
|
if t.IsZero() {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
t = t.UTC()
|
||||||
|
return uint32(t.Year())*10000 + uint32(t.Month())*100 + uint32(t.Day())
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package rda
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
func day(s string) time.Time {
|
||||||
|
t, err := time.Parse("2006-01-02", s)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
return t
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestLoad(t *testing.T) {
|
||||||
|
if n := Count(); n < 50000 {
|
||||||
|
t.Fatalf("loaded %d callsigns, want the whole database (~58k)", n)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// A station with no history: the current district, reported as an assumption.
|
||||||
|
func TestCurrentDistrict(t *testing.T) {
|
||||||
|
m, ok := Lookup("R0AA", day("2020-05-01"))
|
||||||
|
if !ok || m.District != "KK-08" {
|
||||||
|
t.Fatalf("R0AA = %+v ok=%v, want KK-08", m, ok)
|
||||||
|
}
|
||||||
|
if m.Dated {
|
||||||
|
t.Errorf("a district with no date range must not be reported as dated")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// An expedition: the day decides, and a day outside every period is NOT
|
||||||
|
// answered with a neighbouring one.
|
||||||
|
func TestDatedDistrict(t *testing.T) {
|
||||||
|
m, ok := Lookup("4K4/EK250RA", day("1991-09-15"))
|
||||||
|
if !ok || m.District != "CK-05" || !m.Dated {
|
||||||
|
t.Fatalf("got %+v ok=%v, want CK-05 dated", m, ok)
|
||||||
|
}
|
||||||
|
m, ok = Lookup("4K4/EK250RA", day("1991-08-07"))
|
||||||
|
if !ok || m.District != "CK-08" {
|
||||||
|
t.Fatalf("got %+v ok=%v, want CK-08 on the one-day period", m, ok)
|
||||||
|
}
|
||||||
|
if _, ok := Lookup("4K4/EK250RA", day("2020-01-01")); ok {
|
||||||
|
t.Errorf("a day outside every recorded period must find nothing")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// The callsign is matched exactly: a suffix means somewhere else.
|
||||||
|
func TestExactCallsign(t *testing.T) {
|
||||||
|
if _, ok := Lookup("R0AA/P", day("2020-05-01")); ok {
|
||||||
|
t.Errorf("R0AA/P must not resolve to R0AA's district")
|
||||||
|
}
|
||||||
|
if _, ok := Lookup("", day("2020-05-01")); ok {
|
||||||
|
t.Errorf("an empty callsign must find nothing")
|
||||||
|
}
|
||||||
|
if _, ok := Lookup("F4BPO", day("2020-05-01")); ok {
|
||||||
|
t.Errorf("a non-Russian callsign must find nothing")
|
||||||
|
}
|
||||||
|
// Case and stray spaces are the operator's, not the data's.
|
||||||
|
if m, ok := Lookup(" r0aa ", day("2020-05-01")); !ok || m.District != "KK-08" {
|
||||||
|
t.Errorf("lookup must be case- and space-insensitive, got %+v ok=%v", m, ok)
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -187,6 +187,13 @@ func (s *Server) selfTest() {
|
|||||||
// what Stop() does on every settings save. Seen in the field: a K3 sat in
|
// what Stop() does on every settings save. Seen in the field: a K3 sat in
|
||||||
// transmit for 29 s, until the CAT link happened to be rebuilt.
|
// transmit for 29 s, until the CAT link happened to be rebuilt.
|
||||||
//
|
//
|
||||||
|
// Keyed reports whether a client currently has the rig transmitting.
|
||||||
|
//
|
||||||
|
// Asked before the server is torn down: pulling the socket out from under
|
||||||
|
// WSJT-X mid-over is the one moment that costs a QSO — and, on the log that
|
||||||
|
// prompted this, sometimes the whole application.
|
||||||
|
func (s *Server) Keyed() bool { return s.ptt.Load() }
|
||||||
|
|
||||||
// Swap makes this once-only, so the Stop() path and the per-connection defer it
|
// Swap makes this once-only, so the Stop() path and the per-connection defer it
|
||||||
// triggers can both call it without double-unkeying.
|
// triggers can both call it without double-unkeying.
|
||||||
func (s *Server) releasePTT(why string) {
|
func (s *Server) releasePTT(why string) {
|
||||||
|
|||||||
@@ -190,6 +190,14 @@ func (s *Server) Start() error {
|
|||||||
// pttKnown is cleared whatever happens: after an emergency unkey the radio's
|
// pttKnown is cleared whatever happens: after an emergency unkey the radio's
|
||||||
// state is a guess, and the next command must reach it rather than be dismissed
|
// state is a guess, and the next command must reach it rather than be dismissed
|
||||||
// as a repeat.
|
// as a repeat.
|
||||||
|
// Keyed reports whether a client currently has the rig transmitting. See the
|
||||||
|
// rigctld server's own Keyed for why the caller wants to know.
|
||||||
|
func (s *Server) Keyed() bool {
|
||||||
|
s.mu.Lock()
|
||||||
|
defer s.mu.Unlock()
|
||||||
|
return s.ptt
|
||||||
|
}
|
||||||
|
|
||||||
func (s *Server) releasePTT(why string) {
|
func (s *Server) releasePTT(why string) {
|
||||||
s.mu.Lock()
|
s.mu.Lock()
|
||||||
keyed := s.ptt
|
keyed := s.ptt
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
// appVersion is stamped on every heartbeat (and could feed the About box).
|
// appVersion is stamped on every heartbeat (and could feed the About box).
|
||||||
appVersion = "0.26.1"
|
appVersion = "0.26.2"
|
||||||
|
|
||||||
// posthogHost is the PostHog ingestion endpoint. EU cloud by default; change
|
// posthogHost is the PostHog ingestion endpoint. EU cloud by default; change
|
||||||
// to https://us.i.posthog.com for a US project.
|
// to https://us.i.posthog.com for a US project.
|
||||||
|
|||||||
Reference in New Issue
Block a user