9 Commits
32 changed files with 2023 additions and 123 deletions
+251 -12
View File
@@ -41,12 +41,14 @@ import (
"hamlog/internal/netctl"
"hamlog/internal/operating"
"hamlog/internal/pota"
"hamlog/internal/lotwusers"
"hamlog/internal/powergenius"
"hamlog/internal/profile"
"hamlog/internal/qslcard"
"hamlog/internal/qso"
"hamlog/internal/rotator/pst"
"hamlog/internal/settings"
"hamlog/internal/solar"
"hamlog/internal/ultrabeam"
"hamlog/internal/winkeyer"
@@ -87,6 +89,8 @@ const (
keyCATFlexHost = "cat.flex.host" // FlexRadio IP (native backend)
keyCATFlexPort = "cat.flex.port" // FlexRadio TCP port (default 4992)
keyCATFlexSpots = "cat.flex.spots" // push cluster spots to the panadapter
keyCATFlexDecodeSpots = "cat.flex.decode_spots" // push WSJT-X decodes (heard stations) to the panadapter
keyCATFlexDecodeSecs = "cat.flex.decode_secs" // decode spot display duration (seconds) before auto-removal
keyCATPollMs = "cat.poll_ms"
keyCATDelayMs = "cat.delay_ms" // pause between commands
keyCATDigitalDefault = "cat.digital_default" // mode to use when CAT reports DATA
@@ -275,6 +279,8 @@ type CATSettings struct {
FlexHost string `json:"flex_host"` // FlexRadio IP (native backend)
FlexPort int `json:"flex_port"` // FlexRadio TCP port (default 4992)
FlexSpots bool `json:"flex_spots"` // push cluster spots to the panadapter
FlexDecodeSpots bool `json:"flex_decode_spots"` // push WSJT-X decodes (heard stations) to the panadapter
FlexDecodeSecs int `json:"flex_decode_secs"` // decode spot display duration (s) before removal (default 120)
IcomPort string `json:"icom_port"` // Icom USB CI-V serial port (e.g. COM5)
IcomBaud int `json:"icom_baud"` // Icom CI-V baud (default 115200)
IcomAddr int `json:"icom_addr"` // Icom CI-V address, decimal (IC-7610 = 152)
@@ -420,6 +426,8 @@ type App struct {
pgxl *powergenius.Client // PowerGenius XL (4O3A) amp fan control (TCP); nil when disabled
audioMgr *audio.Manager
qsoRec *audio.Recorder // continuous QSO recorder (rolling pre-roll)
solar *solar.Manager // live space-weather (SFI/SSN/A/K) for the header + QSO stamping
lotwUsers *lotwusers.Manager // LoTW user-activity list (badge next to the callsign)
// NET Control: persistent net definitions/rosters (global JSON) + the live
// session (in-memory only — active stations currently in QSO).
@@ -449,6 +457,8 @@ type App struct {
dbBackend string // "sqlite" | "mysql" — the logbook backend actually opened at startup
dbBackendErr string // non-empty when a configured MySQL backend failed and we fell back to SQLite
catFlexSpots bool // push cluster spots to the FlexRadio panadapter
catFlexDecodeSpots bool // push WSJT-X decodes (heard stations) to the panadapter
catFlexDecodeSecs int // decode spot display duration (seconds)
liveActMu sync.Mutex // guards the entry-strip activity reported for live status
liveFreqHz int64 // last freq/band/mode the UI reported (fallback when CAT is off)
liveBand string
@@ -766,8 +776,38 @@ func (a *App) startup(ctx context.Context) {
// cty.dat lacks (DXpeditions). Loaded from cache if present; downloaded on
// demand. Resolution applied only when the user enables it.
a.clublog = clublog.NewManager(clublogAppAPIKey, dataDir)
// LoTW user-activity list (who's a LoTW user + last upload). Loads the cached
// CSV if present, and auto-downloads in the background when it's missing or
// older than a DAY — the list carries each station's last-upload date, so a
// stale cache would misreport recency (a station that uploaded 2 days ago must
// show as recent, which only works if we refresh roughly daily). Manual
// refresh is in Settings → LoTW.
a.lotwUsers = lotwusers.NewManager(dataDir)
go func() {
if err := a.clublog.EnsureLoaded(); err == nil {
if a.lotwUsers.Count() == 0 || time.Since(a.lotwUsers.Updated()) > 24*time.Hour {
if n, err := a.lotwUsers.Download(context.Background()); err == nil {
applog.Printf("lotwusers: auto-downloaded %d LoTW users", n)
if a.ctx != nil {
wruntime.EventsEmit(a.ctx, "lotwusers:updated")
}
} else {
applog.Printf("lotwusers: auto-download failed: %v", err)
}
}
}()
go func() {
_ = a.clublog.EnsureLoaded()
// Auto-refresh a missing/stale country file (ClubLog adds date-ranged
// exceptions constantly — e.g. event calls like IR0WWA get new SARDINIA
// periods). Without this a stale cache resolves recent event QSOs to the
// base country. Best-effort; the on-disk copy still serves if it fails.
if a.clublog.NeedsRefresh(3 * 24 * time.Hour) {
if err := a.clublog.Download(context.Background()); err != nil {
applog.Printf("clublog: auto-refresh failed: %v", err)
}
}
if a.clublog.Loaded() {
d, n := a.clublog.Info()
fmt.Printf("OpsLog: clublog cty.xml loaded — %d exceptions (%s)\n", n, d)
}
@@ -874,6 +914,16 @@ func (a *App) startup(ctx context.Context) {
},
)
// Live space-weather (solar flux, sunspots, A/K indices) for the header strip
// and per-QSO stamping. Refreshes in the background; pushes a UI event on each
// update so the strip re-reads.
a.solar = solar.NewManager(func() {
if a.ctx != nil {
wruntime.EventsEmit(a.ctx, "solar:update")
}
})
a.solar.Start()
// Digital Voice Keyer + QSO recorder (WASAPI). Idle until used.
a.audioMgr = audio.NewManager(func() {
st := a.dvkStatus()
@@ -1116,6 +1166,9 @@ func (a *App) shutdown(ctx context.Context) {
if a.udp != nil {
a.udp.StopAll()
}
if a.solar != nil {
a.solar.Stop()
}
// Stop CAT so the backend disconnects cleanly. Critical for the Icom network
// backend: without this the rig never gets a disconnect and holds its single
// control session for minutes, refusing every new login (even from the Icom
@@ -1643,6 +1696,7 @@ func (a *App) AddQSO(q qso.QSO) (id int64, err error) {
a.applyClublogException(&q, false) // override entity for date-ranged DXpeditions
a.refineDistrictZones(&q) // W6 → CQ3/ITU6 for zone-split countries
a.applyQSLDefaults(&q)
a.applySolar(&q) // stamp SFI / A / K (and SSN as an extra) from live space-weather
// Fill the contacted operator's e-mail from the (cached) lookup so the
// recording can be auto-sent. Cheap: the entry already looked the call up.
if strings.TrimSpace(q.Email) == "" && a.lookup != nil {
@@ -1666,6 +1720,94 @@ func (a *App) AddQSO(q qso.QSO) (id int64, err error) {
return id, err
}
// applySolar stamps the current space-weather onto a QSO before it's saved: the
// standard ADIF SFI / A_INDEX / K_INDEX fields (only when the QSO doesn't already
// carry them), and the sunspot number as an APP_OPSLOG_SSN extra (SSN has no
// standard ADIF field). No-op when the feed hasn't loaded yet.
func (a *App) applySolar(q *qso.QSO) {
if a.solar == nil {
return
}
d := a.solar.Get()
if !d.OK {
return
}
if q.SFI == nil {
if v, err := strconv.ParseFloat(strings.TrimSpace(d.SFI), 64); err == nil {
q.SFI = &v
}
}
if q.AIndex == nil {
if v, err := strconv.ParseFloat(strings.TrimSpace(d.AIndex), 64); err == nil {
q.AIndex = &v
}
}
if q.KIndex == nil {
if v, err := strconv.ParseFloat(strings.TrimSpace(d.KIndex), 64); err == nil {
q.KIndex = &v
}
}
if ssn := strings.TrimSpace(d.SSN); ssn != "" {
if q.Extras == nil {
q.Extras = map[string]string{}
}
if _, ok := q.Extras["APP_OPSLOG_SSN"]; !ok {
q.Extras["APP_OPSLOG_SSN"] = ssn
}
}
}
// GetSolarData returns the latest space-weather snapshot for the header strip.
func (a *App) GetSolarData() solar.Data {
if a.solar == nil {
return solar.Data{}
}
return a.solar.Get()
}
// RefreshSolar forces an immediate re-fetch of the space-weather feed.
func (a *App) RefreshSolar() {
if a.solar != nil {
go a.solar.Refresh()
}
}
// LoTWUserInfo reports whether a callsign is a LoTW user and how recently it
// uploaded — drives the colour-coded LoTW badge in the entry strip.
func (a *App) LoTWUserInfo(callsign string) lotwusers.Info {
if a.lotwUsers == nil {
return lotwusers.Info{DaysAgo: -1}
}
return a.lotwUsers.Lookup(callsign)
}
// LoTWUsersStatus is the loaded-list summary for Settings (count + last refresh).
type LoTWUsersStatus struct {
Count int `json:"count"`
Updated string `json:"updated,omitempty"` // RFC3339, empty if never
}
// GetLoTWUsersStatus returns how many LoTW callsigns are loaded and when.
func (a *App) GetLoTWUsersStatus() LoTWUsersStatus {
if a.lotwUsers == nil {
return LoTWUsersStatus{}
}
st := LoTWUsersStatus{Count: a.lotwUsers.Count()}
if u := a.lotwUsers.Updated(); !u.IsZero() {
st.Updated = u.UTC().Format(time.RFC3339)
}
return st
}
// DownloadLoTWUsers fetches ARRL's LoTW user-activity list and caches it.
// Returns the number of callsigns loaded.
func (a *App) DownloadLoTWUsers() (int, error) {
if a.lotwUsers == nil {
return 0, fmt.Errorf("not initialized")
}
return a.lotwUsers.Download(a.ctx)
}
// StationInfoComputed bundles the data we resolve live from the
// profile's callsign + grid: country, ARRL DXCC#, CQ zone, ITU zone,
// lat/lon. Used by the Settings UI to show the "what will be stamped on
@@ -4324,7 +4466,7 @@ func (a *App) GetCATSettings() (CATSettings, error) {
if a.settings == nil {
return CATSettings{Backend: "omnirig", OmniRigNum: 1, PollMs: 250}, fmt.Errorf("db not initialized")
}
m, err := a.settings.GetMany(a.ctx, keyCATEnabled, keyCATBackend, keyCATOmniRigNum, keyCATFlexHost, keyCATFlexPort, keyCATFlexSpots, keyCATIcomPort, keyCATIcomBaud, keyCATIcomAddr, keyCATIcomNetHost, keyCATIcomNetUser, keyCATIcomNetPass, keyCATIcomNetAudio, keyCATTCIHost, keyCATTCIPort, keyCATTCISpots, keyCATPollMs, keyCATDelayMs, keyCATDigitalDefault)
m, err := a.settings.GetMany(a.ctx, keyCATEnabled, keyCATBackend, keyCATOmniRigNum, keyCATFlexHost, keyCATFlexPort, keyCATFlexSpots, keyCATFlexDecodeSpots, keyCATFlexDecodeSecs, keyCATIcomPort, keyCATIcomBaud, keyCATIcomAddr, keyCATIcomNetHost, keyCATIcomNetUser, keyCATIcomNetPass, keyCATIcomNetAudio, keyCATTCIHost, keyCATTCIPort, keyCATTCISpots, keyCATPollMs, keyCATDelayMs, keyCATDigitalDefault)
if err != nil {
return CATSettings{}, err
}
@@ -4335,6 +4477,8 @@ func (a *App) GetCATSettings() (CATSettings, error) {
FlexHost: m[keyCATFlexHost],
FlexPort: 4992,
FlexSpots: m[keyCATFlexSpots] == "1",
FlexDecodeSpots: m[keyCATFlexDecodeSpots] == "1",
FlexDecodeSecs: 120,
IcomPort: m[keyCATIcomPort],
IcomBaud: 115200,
IcomAddr: 0x98, // IC-7610 default
@@ -4352,6 +4496,9 @@ func (a *App) GetCATSettings() (CATSettings, error) {
if n, _ := strconv.Atoi(m[keyCATFlexPort]); n > 0 && n <= 65535 {
out.FlexPort = n
}
if n, _ := strconv.Atoi(m[keyCATFlexDecodeSecs]); n >= 10 && n <= 3600 {
out.FlexDecodeSecs = n
}
if n, _ := strconv.Atoi(m[keyCATTCIPort]); n > 0 && n <= 65535 {
out.TCIPort = n
}
@@ -4413,6 +4560,13 @@ func (a *App) SaveCATSettings(s CATSettings) error {
if s.FlexSpots {
flexSpots = "1"
}
flexDecodeSpots := "0"
if s.FlexDecodeSpots {
flexDecodeSpots = "1"
}
if s.FlexDecodeSecs < 10 || s.FlexDecodeSecs > 3600 {
s.FlexDecodeSecs = 120
}
tciSpots := "0"
if s.TCISpots {
tciSpots = "1"
@@ -4431,6 +4585,8 @@ func (a *App) SaveCATSettings(s CATSettings) error {
keyCATFlexHost: strings.TrimSpace(s.FlexHost),
keyCATFlexPort: strconv.Itoa(s.FlexPort),
keyCATFlexSpots: flexSpots,
keyCATFlexDecodeSpots: flexDecodeSpots,
keyCATFlexDecodeSecs: strconv.Itoa(s.FlexDecodeSecs),
keyCATIcomPort: strings.TrimSpace(s.IcomPort),
keyCATIcomBaud: strconv.Itoa(s.IcomBaud),
keyCATIcomAddr: strconv.Itoa(s.IcomAddr),
@@ -5504,7 +5660,20 @@ func (a *App) applyClublogException(q *qso.QSO, force bool) bool {
}
e, ok := a.clublog.Resolve(q.Callsign, date)
if !ok {
return false
// No exception COVERS this QSO's date. If the call nonetheless HAS a
// date-ranged exception (e.g. G1T = Scotland only from 2024-02-21), then
// cty.dat's date-blind "=G1T → Scotland" override is WRONG for an older
// QSO — resolve it by ClubLog's date-aware PREFIX table instead (G1 →
// England for a 2012 contact). Ordinary calls (no exception) are left to
// cty.dat.
if a.clublog.HasException(q.Callsign) {
if pe, pok := a.clublog.ResolvePrefix(q.Callsign, date); pok {
e, ok = pe, true
}
}
if !ok {
return false
}
}
q.Country = titleEntity(e.Entity)
if e.Cont != "" {
@@ -6672,12 +6841,14 @@ func (a *App) runDownloadConfirmations(svc extsvc.Service, cfg extsvc.ExternalSe
} else {
emit(fmt.Sprintf("Downloading all LoTW confirmations for %s…", callLabel))
}
emit(fmt.Sprintf("Window: since=%q → resolved=%q (scope owncall=%q)", since, sinceDate, ownCall))
adifText, err := extsvc.DownloadLoTWConfirmations(ctx, nil, cfg.LoTW, sinceDate, ownCall)
if err != nil {
emit("Download failed: " + err.Error())
done(matched, total)
return
}
emit(fmt.Sprintf("LoTW returned %d KB of ADIF", len(adifText)/1024))
keyIDs, kerr := a.qso.DedupeKeyIDs(ctx)
if kerr != nil {
emit("Error reading local log: " + kerr.Error())
@@ -6800,7 +6971,14 @@ func (a *App) runDownloadConfirmations(svc extsvc.Service, cfg extsvc.ExternalSe
}
emit("ADIF head: " + snip)
}
keyIDs, _ := a.qso.DedupeKeyIDs(ctx)
// Scope to THIS profile's / forced callsign so a QRZ logbook holding
// several of the operator's calls (F4BPO, TM2Q…) only confirms/adds QSOs
// for the active call. Windowed + phone-mode-tolerant matching (same as
// eQSL/LoTW).
qrzOwner := a.uploadOwnerCall(extsvc.ServiceQRZ)
mIdx, _ := a.qso.BuildMatchIndex(ctx, qrzOwner)
const qrzMatchWindow = 10 * time.Minute
qrzSkippedOtherCall := 0
// QRZ confirmations are QRZ-specific (not award-valid), so NEW is
// judged only against other QRZ confirmations.
sets, _ := a.qso.ConfirmedSlots(ctx, []string{"qrzcom_qso_download_status"})
@@ -6837,6 +7015,13 @@ func (a *App) runDownloadConfirmations(svc extsvc.Service, cfg extsvc.ExternalSe
if sinceDate != "" && !q.QSODate.IsZero() && q.QSODate.UTC().Format("2006-01-02") < sinceDate {
return nil
}
// Skip a QSO logged under a DIFFERENT one of the operator's callsigns.
if qrzOwner != "" {
if rc := strings.ToUpper(strings.TrimSpace(rec["station_callsign"])); rc != "" && rc != qrzOwner {
qrzSkippedOtherCall++
return nil
}
}
total++
date := rec["qrzcom_qso_download_date"]
if date == "" {
@@ -6845,8 +7030,7 @@ func (a *App) runDownloadConfirmations(svc extsvc.Service, cfg extsvc.ExternalSe
a.enrichContactedFromCty(&q)
line := fmt.Sprintf("Callsign: %s Date: %s Band: %s Mode: %s",
q.Callsign, q.QSODate.UTC().Format("2006-01-02 15:04"), q.Band, q.Mode)
key := qso.DedupeKey(q.Callsign, q.QSODate.UTC().Format("2006-01-02T15:04"), q.Band, q.Mode)
id, found := keyIDs[key]
id, found := mIdx.Match(q.Callsign, q.Band, q.Mode, q.QSODate.UTC(), qrzMatchWindow)
switch {
case found:
if alreadyQrz[id] {
@@ -6860,8 +7044,11 @@ func (a *App) runDownloadConfirmations(svc extsvc.Service, cfg extsvc.ExternalSe
q.QRZComUploadStatus = "Y"
q.QRZComDownloadStatus = "Y"
q.QRZComDownloadDate = date
if q.StationCallsign == "" {
q.StationCallsign = qrzOwner
}
if newID, e := a.qso.Add(ctx, q); e == nil {
keyIDs[key] = newID
mIdx.Add(q.Callsign, q.Band, q.Mode, q.QSODate.UTC(), newID)
added++
emit(line + " ### ADDED ###")
}
@@ -6904,6 +7091,9 @@ func (a *App) runDownloadConfirmations(svc extsvc.Service, cfg extsvc.ExternalSe
sort.Strings(keys)
emit(fmt.Sprintf("Parsed %d record(s). Fields seen: %s", parsed, strings.Join(keys, ", ")))
emit(fmt.Sprintf("Confirmed %d, added %d (of %d returned)", matched, added, total))
if qrzSkippedOtherCall > 0 {
emit(fmt.Sprintf("Skipped %d QSO(s) logged under another of your callsigns (scoped to %s).", qrzSkippedOtherCall, qrzOwner))
}
// (last-download date already stored right after the fetch above)
case extsvc.ServiceEQSL:
@@ -6919,12 +7109,23 @@ func (a *App) runDownloadConfirmations(svc extsvc.Service, cfg extsvc.ExternalSe
done(matched, total)
return
}
keyIDs, kerr := a.qso.DedupeKeyIDs(ctx)
// Scope everything to THIS profile's / forced callsign so an eQSL account
// holding several of the operator's calls (F4BPO, TM2Q…) only confirms/adds
// QSOs for the active call.
eqslOwner := a.uploadOwnerCall(extsvc.ServiceEQSL)
// Tolerant match index: an eQSL confirmation carries the OTHER station's
// logged time, often a minute or two off ours — so we match within a
// ±10-minute window. The mode must still match, except the phone sidebands
// SSB/USB/LSB are treated as one (a station may confirm USB where we logged
// SSB); FT8/FT4/CW/… stay exact.
mIdx, kerr := a.qso.BuildMatchIndex(ctx, eqslOwner)
if kerr != nil {
emit("Error reading local log: " + kerr.Error())
done(matched, total)
return
}
const eqslMatchWindow = 10 * time.Minute
skippedOtherCall := 0
// eQSL confirmations aren't ARRL-award-valid (only LoTW + paper QSL are),
// so NEW is judged only against other eQSL confirmations.
sets, _ := a.qso.ConfirmedSlots(ctx, []string{"eqsl_rcvd"})
@@ -6935,6 +7136,15 @@ func (a *App) runDownloadConfirmations(svc extsvc.Service, cfg extsvc.ExternalSe
if !ok {
return nil
}
// Skip a confirmation logged under a DIFFERENT one of the operator's
// callsigns (the eQSL account may hold several) — it belongs to that
// call's log, not this one.
if eqslOwner != "" {
if rc := strings.ToUpper(strings.TrimSpace(rec["station_callsign"])); rc != "" && rc != eqslOwner {
skippedOtherCall++
return nil
}
}
total++
// eQSL stamps the confirmation date in QSLRDATE (fall back to today).
date := rec["qslrdate"]
@@ -6942,8 +7152,8 @@ func (a *App) runDownloadConfirmations(svc extsvc.Service, cfg extsvc.ExternalSe
date = time.Now().UTC().Format("20060102")
}
a.enrichContactedFromCty(&q)
key := qso.DedupeKey(q.Callsign, q.QSODate.UTC().Format("2006-01-02T15:04"), q.Band, q.Mode)
if id, found := keyIDs[key]; found {
id, found := mIdx.Match(q.Callsign, q.Band, q.Mode, q.QSODate.UTC(), eqslMatchWindow)
if found {
if e := a.qso.MarkEQSLConfirmed(ctx, id, date); e == nil {
matched++
}
@@ -6951,8 +7161,11 @@ func (a *App) runDownloadConfirmations(svc extsvc.Service, cfg extsvc.ExternalSe
q.EQSLSent = "Y"
q.EQSLRcvd = "Y"
q.EQSLRcvdDate = date
if q.StationCallsign == "" {
q.StationCallsign = eqslOwner // stamp the active call on adds
}
if newID, e := a.qso.Add(ctx, q); e == nil {
keyIDs[key] = newID
mIdx.Add(q.Callsign, q.Band, q.Mode, q.QSODate.UTC(), newID)
added++
}
} else {
@@ -6993,6 +7206,9 @@ func (a *App) runDownloadConfirmations(svc extsvc.Service, cfg extsvc.ExternalSe
for _, u := range unmatched {
emit(" ⚠ no local QSO for: " + u)
}
if skippedOtherCall > 0 {
emit(fmt.Sprintf("Skipped %d confirmation(s) logged under another of your callsigns (scoped to %s).", skippedOtherCall, eqslOwner))
}
if a.settings != nil {
a.setSetting(a.profileScope()+keyExtEQSLLastDownload, time.Now().UTC().Format("2006-01-02"))
}
@@ -7244,7 +7460,10 @@ func (a *App) uploadOwnerCall(svc extsvc.Service) string {
case extsvc.ServiceHRDLog:
owner = cfg.HRDLog.Callsign
case extsvc.ServiceEQSL:
owner = cfg.EQSL.Username
// eQSL has no Force-callsign field; its Username is just the account login
// (which may hold several of the operator's calls). Scope by the ACTIVE
// PROFILE's callsign instead — the operating identity — via the fallback
// below, so a download on the F4BPO profile only touches F4BPO QSOs.
}
owner = strings.ToUpper(strings.TrimSpace(owner))
if owner == "" && a.profiles != nil {
@@ -7656,6 +7875,24 @@ func (a *App) consumeUDPEvents() {
continue
}
switch {
case ev.DecodeCall != "":
// A WSJT-X decode (heard station). Render it on the FlexRadio
// panadapter when the option is on; green + SNR comment, auto-expiring
// after the configured duration. De-duped per call in the Flex backend.
if a.catFlexDecodeSpots && a.cat != nil {
secs := a.catFlexDecodeSecs
if secs <= 0 {
secs = 120
}
a.cat.SendSpot(cat.SpotInfo{
FreqHz: ev.DecodeFreqHz,
Callsign: ev.DecodeCall,
Mode: ev.Mode,
Color: "#FF34C759", // green — distinct from cluster orange
Comment: fmt.Sprintf("%s %+ddB", ev.Mode, ev.DecodeSNR),
LifetimeSec: secs,
})
}
case ev.LoggedADIF != "":
applog.Printf("udp: emit udp:logged_qso (%d bytes ADIF)\n", len(ev.LoggedADIF))
wruntime.EventsEmit(a.ctx, "udp:logged_qso", map[string]any{
@@ -8767,6 +9004,8 @@ func (a *App) reloadCAT() {
a.cat.SetPollInterval(time.Duration(s.PollMs) * time.Millisecond)
a.cat.SetCommandDelay(time.Duration(s.DelayMs) * time.Millisecond)
a.catFlexSpots = s.Enabled && ((s.Backend == "flex" && s.FlexSpots) || (s.Backend == "tci" && s.TCISpots))
a.catFlexDecodeSpots = s.Enabled && s.Backend == "flex" && s.FlexDecodeSpots
a.catFlexDecodeSecs = s.FlexDecodeSecs
if !s.Enabled {
a.cat.Stop()
return
+73 -1
View File
@@ -26,6 +26,8 @@ import {
ConnectAllClusters, DisconnectAllClusters, GetClusterStatus, SendClusterCommand,
ListClusterServers, ClusterSpotStatuses, SendClusterSpot,
GetCATSettings,
GetSolarData,
LoTWUserInfo,
OperatingDefaultForBand,
LogUDPLoggedADIF,
ListCountries,
@@ -371,6 +373,30 @@ export default function App() {
// hide the rig ON/OFF buttons on USB, where the interface is unpowered when the
// rig is off so power-ON can't work).
const [catBackend, setCatBackend] = useState('');
// Live space-weather (solar flux / sunspots / A / K) for the header strip.
// Loaded on mount, refreshed on the backend 'solar:update' event, plus a slow
// fallback poll. These same numbers are stamped onto each logged QSO.
const [solar, setSolar] = useState<any>(null);
useEffect(() => {
const load = () => { GetSolarData().then((d) => setSolar(d ?? null)).catch(() => {}); };
load();
const off = EventsOn('solar:update', load);
const id = window.setInterval(load, 60 * 60 * 1000); // hourly fallback; the event refreshes it live
return () => { off(); window.clearInterval(id); };
}, []);
// LoTW-user lookup for the entered callsign (from the cached ARRL activity list),
// debounced. Drives a colour-coded LoTW badge by last-upload recency.
const [lotwInfo, setLotwInfo] = useState<{ is_user: boolean; last_upload?: string; days_ago: number } | null>(null);
useEffect(() => {
const c = callsign.trim();
if (!c) { setLotwInfo(null); return; }
const run = () => { LoTWUserInfo(c).then((r) => setLotwInfo(r as any)).catch(() => setLotwInfo(null)); };
const t = window.setTimeout(run, 300);
// Re-run when the background auto-download finishes (so a call typed before
// the list loaded gets its badge without re-typing).
const off = EventsOn('lotwusers:updated', run);
return () => { window.clearTimeout(t); off(); };
}, [callsign]);
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 });
const [agStatus, setAgStatus] = useState<AGStatus>({ connected: false, port_a: 0, port_b: 0, antennas: [] });
@@ -2731,6 +2757,23 @@ export default function App() {
<Input value={grid} placeholder="JN05" className="font-mono" onChange={(e) => { setGrid(e.target.value); markEdited('grid'); }} />
</div>
);
// LoTW-user badge: shown only when the entered call is a LoTW user, coloured by
// last-upload recency (green < 1 week · amber 14 weeks · red > 30 days). The
// tooltip shows the exact last-upload date. Needs the list downloaded once
// (Settings → LoTW); until then no badge appears.
const lotwBlock = (lotwInfo && lotwInfo.is_user) ? (() => {
const d = lotwInfo.days_ago ?? -1;
const cls = d >= 0 && d < 7 ? 'border-success text-success bg-success/15'
: d < 30 ? 'border-warning text-warning bg-warning/15'
: 'border-danger text-danger bg-danger/15';
return (
<div className="self-end shrink-0" title={t('lotw.userTip', { date: lotwInfo.last_upload || '?', days: d })}>
<span className={cn('inline-flex items-center rounded-md border px-1.5 py-1.5 text-[10px] font-extrabold tracking-wide leading-none', cls)}>
LoTW
</span>
</div>
);
})() : null;
// A discreet spot-alert LED (bell) that fills the gap at the right of the Grid
// row instead of the intrusive floating cards. It lights + shows a count when
// alerts are pending; click it to see the last 3 (each clickable to tune).
@@ -3222,7 +3265,7 @@ export default function App() {
</Button>
</header>
) : (
<header className="grid grid-cols-[auto_auto_1fr_auto_auto] items-center gap-4 px-4 h-12 bg-card/95 backdrop-blur border-b border-border shrink-0 shadow-sm">
<header className="grid grid-cols-[auto_auto_1fr_auto_auto_auto] items-center gap-4 px-4 h-12 bg-card/95 backdrop-blur border-b border-border shrink-0 shadow-sm">
<div className="flex items-center gap-2 pr-2 border-r border-border/60">
<div className="size-2.5 rounded-full bg-gradient-to-br from-primary to-orange-400 shadow-[0_0_0_3px_rgba(234,88,12,0.18)]" />
<div className="flex items-baseline gap-1.5">
@@ -3445,6 +3488,34 @@ export default function App() {
)}
</div>
{/* Space-weather / propagation — compact, in the header. Live from N0NBH
(hamqsl.com), auto-refreshed hourly; the same SFI / A / K are stamped
onto each logged QSO. Always renders one element so the grid columns
stay aligned (empty span until the feed loads). */}
{solar && solar.ok ? (
<div className="flex items-center gap-2.5 font-mono px-2.5 h-8 rounded-md border border-border/60 bg-muted/40 whitespace-nowrap"
title={`${t('prop.title')}${solar.updated ? ' · ' + solar.updated : ''}`}>
{(() => {
const geo = String(solar.geomag_field || '').toUpperCase();
const geoCls = /STORM|SEVERE/.test(geo) ? 'text-danger'
: /ACTIVE|UNSETTLED/.test(geo) ? 'text-warning' : 'text-success';
const it = (label: string, val: any, cls = 'text-foreground') => (
<span className="inline-flex items-baseline gap-1">
<span className="text-muted-foreground uppercase tracking-wider text-[9px]">{label}</span>
<span className={cn('font-bold text-[12px]', cls)}>{(val ?? '') === '' ? '—' : val}</span>
</span>
);
return (<>
{it('SFI', solar.sfi)}
{it('SSN', solar.ssn)}
{it('A', solar.a_index)}
{it('K', solar.k_index)}
{geo ? <span className={cn('font-bold text-[12px]', geoCls)}>{geo}</span> : null}
</>);
})()}
</div>
) : <span />}
<div className="flex items-center gap-1.5 font-mono text-xs text-muted-foreground px-2.5 py-1 bg-muted rounded-md border border-border/60">
<Clock className="size-3" />
{utcNow}<span className="text-[10px]">UTC</span>
@@ -3666,6 +3737,7 @@ export default function App() {
</div>
{qthBlock}
{gridBlock}
{lotwBlock}
{alertLedBlock}
</div>
+4 -2
View File
@@ -365,8 +365,10 @@ export function AwardEditor({ open, onClose, onSaved }: Props) {
<Field2 label={t('awed.trailingString')}><Input className="h-8 font-mono text-xs" value={cur.trailing_str ?? ''} onChange={(e) => patch({ trailing_str: e.target.value })} /></Field2>
</div>
{/* Additional OR searches: a QSO earns a reference if the
primary rule OR any of these match. */}
{/* Fallback searches: tried in order, only while nothing
has matched yet — the first that hits wins (short-circuit),
so a value already resolved by the primary rule isn't
re-derived differently by a later one. */}
<div className="border-t pt-2.5 space-y-2">
<div className="flex items-center justify-between">
<p className="text-[11px] text-muted-foreground">{t('awed.additionalSearches')} <span className="font-semibold">(OR)</span> {t('awed.orAlsoMatch')}</p>
+45 -1
View File
@@ -37,6 +37,7 @@ import {
GetExternalServices, SaveExternalServices, TestQRZUpload, TestClublogUpload, TestHRDLogUpload, TestEQSLUpload,
GetPOTAToken, SavePOTAToken,
TestLoTWUpload, ListTQSLStationLocations,
DownloadLoTWUsers, GetLoTWUsersStatus,
ComputeStationInfo,
GetUIPref, SetUIPref,
GetFlexState, GetFlexBandAntennas, SaveFlexBandAntennas,
@@ -343,6 +344,9 @@ function TreeNodeView({
// Select and slamming the open dropdown shut on any ambient re-render.
const THEME_SWATCH: Record<Exclude<ThemeChoice, 'auto'>, { bg: string; card: string; accent: string }> = {
'light-warm': { bg: '#e8dfc9', card: '#faf6ea', accent: '#b8410c' },
'light-cool': { bg: '#f4f6f8', card: '#ffffff', accent: '#2563eb' },
'light-sage': { bg: '#eef1ec', card: '#f8faf6', accent: '#2f855a' },
'dim-slate': { bg: '#343b47', card: '#3d4552', accent: '#fb923c' },
'dark-warm': { bg: '#221d18', card: '#2e2820', accent: '#e07a2e' },
'dark-graphite': { bg: '#16181d', card: '#1f232b', accent: '#f97316' },
'high-contrast': { bg: '#000000', card: '#0d0d0d', accent: '#ff7a1a' },
@@ -811,7 +815,7 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
const [bandDraft, setBandDraft] = useState('');
const [modeDraft, setModeDraft] = useState('');
const [catCfg, setCatCfg] = useState<CATSettings>({
enabled: false, backend: 'omnirig', omnirig_rig: 1, flex_host: '', flex_port: 4992, flex_spots: false,
enabled: false, backend: 'omnirig', omnirig_rig: 1, flex_host: '', flex_port: 4992, flex_spots: false, flex_decode_spots: false, flex_decode_secs: 120,
icom_port: '', icom_baud: 115200, icom_addr: 0x98, icom_net_host: '', icom_net_user: '', icom_net_pass: '', icom_net_audio: false,
tci_host: '', tci_port: 40001, tci_spots: false, poll_ms: 250, delay_ms: 0,
digital_default: 'FT8',
@@ -996,6 +1000,16 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
const [clublogTesting, setClublogTesting] = useState(false);
const [lotwTest, setLotwTest] = useState<{ ok: boolean; msg: string } | null>(null);
const [lotwTesting, setLotwTesting] = useState(false);
// LoTW user-activity list (for the callsign badge): count + last refresh.
const [lotwUsers, setLotwUsers] = useState<{ count: number; updated?: string }>({ count: 0 });
const [lotwUsersBusy, setLotwUsersBusy] = useState(false);
useEffect(() => { GetLoTWUsersStatus().then((s) => setLotwUsers(s as any)).catch(() => {}); }, []);
const downloadLotwUsers = async () => {
setLotwUsersBusy(true);
try { await DownloadLoTWUsers(); const s = await GetLoTWUsersStatus(); setLotwUsers(s as any); }
catch (e: any) { setLotwTest({ ok: false, msg: String(e?.message ?? e) }); }
finally { setLotwUsersBusy(false); }
};
const [hrdlogTest, setHrdlogTest] = useState<{ ok: boolean; msg: string } | null>(null);
const [hrdlogTesting, setHrdlogTesting] = useState(false);
const [eqslTest, setEqslTest] = useState<{ ok: boolean; msg: string } | null>(null);
@@ -2041,6 +2055,19 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
<Checkbox checked={!!catCfg.flex_spots} onCheckedChange={(c) => setCatCfg((s) => ({ ...s, flex_spots: !!c }))} />
{t('cat.flexSpots')} <span className="text-xs text-muted-foreground">{t('cat.flexSpotsHint')}</span>
</label>
<label className="col-span-2 flex items-center gap-2 text-sm cursor-pointer">
<Checkbox checked={!!catCfg.flex_decode_spots} onCheckedChange={(c) => setCatCfg((s) => ({ ...s, flex_decode_spots: !!c }))} />
{t('cat.flexDecodeSpots')} <span className="text-xs text-muted-foreground">{t('cat.flexDecodeSpotsHint')}</span>
</label>
{catCfg.flex_decode_spots && (
<div className="col-span-2 flex items-center gap-2 pl-6">
<Label className="text-sm">{t('cat.flexDecodeSecs')}</Label>
<Input type="number" className="w-24" min={10} max={3600}
value={catCfg.flex_decode_secs || 120}
onChange={(e) => setCatCfg((s) => ({ ...s, flex_decode_secs: parseInt(e.target.value) || 120 }))} />
<span className="text-xs text-muted-foreground">{t('cat.flexDecodeSecsHint')}</span>
</div>
)}
</>
)}
{catCfg.backend === 'icom' && (
@@ -3551,6 +3578,23 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
)}
</div>
</div>
{/* LoTW user list — powers the colour-coded "LoTW" badge next to the
entered callsign (green < 1 week · amber 14 weeks · red > 30 days). */}
<div className="border-t border-border/60 pt-3 space-y-2">
<Label className="text-sm font-medium">{t('lotw.usersTitle')}</Label>
<p className="text-[11px] text-muted-foreground">{t('lotw.usersHint')}</p>
<div className="flex items-center gap-3">
<Button variant="outline" size="sm" onClick={downloadLotwUsers} disabled={lotwUsersBusy}>
<ArrowDown className="size-3.5" /> {lotwUsersBusy ? t('lotw.usersDownloading') : t('lotw.usersDownload')}
</Button>
<span className="text-xs text-muted-foreground">
{lotwUsers.count > 0
? t('lotw.usersLoaded', { n: lotwUsers.count.toLocaleString(), date: lotwUsers.updated ? new Date(lotwUsers.updated).toLocaleDateString() : '?' })
: t('lotw.usersNone')}
</span>
</div>
</div>
</div>
) : extSvcTab === 'pota' ? (
<div className="space-y-4 max-w-2xl">
+14 -6
View File
@@ -13,6 +13,8 @@ type Dict = Record<string, string>;
const en: Dict = {
// Menu bar
'prop.title': 'Propagation', 'prop.geomag': 'Geomag', 'prop.refresh': 'Refresh space weather',
'lotw.userTip': 'LoTW user — last upload {date} ({days} days ago)',
'menu.file': 'File', 'menu.edit': 'Edit', 'menu.view': 'View', 'menu.tools': 'Tools',
'file.import': 'Import ADIF…', 'file.export': 'Export ADIF…', 'file.exporting': 'Exporting…',
'file.exportCabrillo': 'Export Cabrillo…', 'file.deleteAll': 'Delete all QSOs…', 'file.exit': 'Exit',
@@ -45,7 +47,8 @@ const en: Dict = {
'lang.english': 'English', 'lang.french': 'Français',
'settings.language': 'Language', 'settings.languageHint': 'Interface language.',
'settings.theme': 'Theme', 'settings.themeHint': 'Interface colour theme.',
'theme.auto': 'Auto (system)', 'theme.light-warm': 'Warm light', 'theme.dark-warm': 'Warm dark',
'theme.auto': 'Auto (system)', 'theme.light-warm': 'Warm light', 'theme.light-cool': 'Cool light',
'theme.light-sage': 'Sage light', 'theme.dim-slate': 'Dim slate', 'theme.dark-warm': 'Warm dark',
'theme.dark-graphite': 'Graphite dark', 'theme.high-contrast': 'High contrast',
// Settings navigation (sidebar groups + section names)
'nav.user': 'User Configuration', 'nav.software': 'Software Configuration', 'nav.hardware': 'Hardware Configuration', 'nav.lists': 'Lists',
@@ -136,7 +139,7 @@ const en: Dict = {
'cat.icomNetHint': "Connects to the rig's built-in LAN server directly — no RS-BA1 or Remote Utility needed (close them first). Use the Network User1 ID/Password set in the rig's Network menu. A rig in standby is powered on automatically.",
'cat.icomNetAudio': 'Stream RX audio over the network (experimental)',
'cat.icomNetAudioHint': 'Play the rigs received audio through your Listening device (Settings → Audio) over the 50003 stream. Experimental — the audio framing is pending on-rig verification; leave off if control misbehaves.',
'cat.omnirigRig': 'OmniRig rig slot', 'cat.flexIp': 'FlexRadio IP', 'cat.port': 'Port', 'cat.flexSpots': 'Show cluster spots on the panadapter', 'cat.flexSpotsHint': "(spots from OpsLog's DX cluster appear on the radio, auto-expire after 30 min)",
'cat.omnirigRig': 'OmniRig rig slot', 'cat.flexIp': 'FlexRadio IP', 'cat.port': 'Port', 'cat.flexSpots': 'Show cluster spots on the panadapter', 'cat.flexSpotsHint': "(spots from OpsLog's DX cluster appear on the radio, auto-expire after 30 min)", 'cat.flexDecodeSpots': 'Show WSJT-X decodes on the panadapter', 'cat.flexDecodeSpotsHint': '(heard FT8/FT4 stations from your WSJT-X/JTDX UDP feed, one spot per call)', 'cat.flexDecodeSecs': 'Display for', 'cat.flexDecodeSecsHint': 'seconds before a station is removed',
'cat.icomPort': 'Icom CI-V port', 'cat.selectCom': 'Select COM port', 'cat.noPorts': 'No ports found', 'cat.baud': 'Baud rate', 'cat.icomModel': 'Rig model', 'cat.icomModelOther': 'Other (custom address)', 'cat.civAddr': 'CI-V address (hex)', 'cat.civHint': 'Pick your model to set the CI-V address automatically (or choose "Other" and type it). Set "CI-V USB Echo Back" OFF and CI-V baud to match on the rig.',
'cat.tciHost': 'TCI host', 'cat.tciHint': 'Enable the TCI server in ExpertSDR2/EESDR (Options → TCI). Default port 40001. Use 127.0.0.1 when OpsLog runs on the same PC.', 'cat.tciSpots': 'Show cluster spots on the panorama', 'cat.tciSpotsHint': "(spots from OpsLog's DX cluster appear on the SDR panadapter)",
'cat.pollMs': 'Poll interval (ms)', 'cat.delayMs': 'CAT delay (ms)', 'cat.digitalDefault': 'Default digital mode (when rig reports DIG)', 'cat.modeBeforeFreq': 'Set mode before frequency', 'cat.modeBeforeFreqHint': '(older rigs that drop the mode after a band change)',
@@ -146,6 +149,7 @@ const en: Dict = {
'cat.ubOk': 'Connected — the Ultrabeam responded with a status frame.',
// External services (repeated labels)
'es.autoUpload': 'Automatic upload on new QSO', 'es.uploadTiming': 'Upload timing', 'es.immediate': 'Immediate', 'es.delayed': 'Delayed (12 min, lets you fix mistakes)', 'es.onClose': 'On app close (batch)', 'es.testConn': 'Test connection', 'es.testing': 'Testing…', 'es.password': 'Password', 'es.apiKey': 'API key', 'es.forceCall': 'Force station callsign', 'es.accountEmail': 'Account email', 'es.logbookCall': 'Logbook callsign',
'lotw.usersTitle': 'LoTW user list', 'lotw.usersHint': "Downloads ARRL's public list of LoTW users + their last-upload date, to show a colour-coded LoTW badge next to a callsign (green < 1 week · amber 14 weeks · red > 30 days).", 'lotw.usersDownload': 'Download LoTW user list', 'lotw.usersDownloading': 'Downloading…', 'lotw.usersLoaded': '{n} users loaded · updated {date}', 'lotw.usersNone': 'Not downloaded yet — the badge stays hidden until you do.',
'hw.connecting': 'Connecting…', 'hw.testConn': 'Test connection', 'hw.sending': 'Sending…', 'hw.testRotator': 'Test (point to 0°)',
// Profiles panel
'prof.deleteConfirm': 'Delete profile "{name}"? All its settings will be lost.', 'prof.dupPrompt': 'Name for the new profile (copy of "{name}"):', 'prof.dupSuffix': '{name} Copy', 'prof.newPrompt': 'Name for the new profile:', 'prof.newDefault': 'New profile',
@@ -210,7 +214,7 @@ const en: Dict = {
'awrp.remove': 'Remove', 'awrp.searchLabel': 'Search {label}…', 'awrp.searching': 'Searching…', 'awrp.noMatch': 'No match.', 'awrp.noMatchDxcc': 'No match for this DXCC.',
'awrs.group': 'Group', 'awrs.sub': 'Sub', 'awrs.pickReference': '← pick a reference', 'awrs.add': 'Add', 'awrs.enterCallsignFirst': 'Enter a callsign first', 'awrs.noRefsAdded': 'No references added yet', 'awrs.references': 'References', 'awrs.autoMatchTitle': 'The {field} field is {code} — this award counts it automatically', 'awrs.fromField': 'from {field}', 'awrs.autoClickToAdd': 'auto — click to add', 'awrs.search': 'Search…', 'awrs.addUnlistedTitle': "Add this reference even though it isn't in the list yet (new / unlisted)", 'awrs.addPrefix': '+ Add', 'awrs.unlisted': '(unlisted)', 'awrs.searching': 'Searching…', 'awrs.typeToSearch': 'Type 2+ chars to search', 'awrs.enterCallsignOrSearch': 'Enter a callsign, or type to search.', 'awrs.noRefsForEntity': 'No references for this entity.', 'awrs.noResults': 'No results.', 'awrs.downloadLists': 'Download reference lists in the Awards panel → Import data.',
'awp.awards': 'Awards', 'awp.editAwards': 'Edit awards', 'awp.rescanTitle': 'Re-pull the logbook and recompute (picks up new LoTW/QRZ confirmations)', 'awp.rescan': 'Rescan', 'awp.selectAward': 'Select an award…', 'awp.of': 'of', 'awp.computing': 'Computing…', 'awp.noData': 'No data', 'awp.worked': 'worked', 'awp.confirmed': 'confirmed', 'awp.validated': 'validated', 'awp.ofConfirmed': 'of {total} · {pct}% confirmed', 'awp.byBand': 'By band (confirmed / worked)', 'awp.filterReferences': 'Filter references…', 'awp.filterAll': 'All', 'awp.filterWkd': 'Wkd', 'awp.filterNotWkd': 'Not wkd', 'awp.filterWkdNotCfmd': 'Wkd not cfmd', 'awp.refs': 'refs', 'awp.missingRefsTitle': "Contacts in this award's scope (right DXCC/band/mode) but with no reference — they're excluded until you add it", 'awp.missingRefs': 'Missing refs', 'awp.gridView': 'Grid view', 'awp.listView': 'List view', 'awp.statistics': 'Statistics', 'awp.statistic': 'Statistic', 'awp.total': 'Total', 'awp.grand': 'Grand', 'awp.ref': 'Ref', 'awp.description': 'Description', 'awp.cellTitle': '{ref} · {band} — click to view QSOs', 'awp.name': 'Name', 'awp.groupCol': 'Group', 'awp.status': 'Status', 'awp.bands': 'Bands', 'awp.missing': '— missing', 'awp.contactsMissingRef': 'contacts missing a reference', 'awp.recomputeTitle': "Recompute now — contacts you've fixed drop off the list", 'awp.refresh': 'Refresh', 'awp.missingScopeHelp': "In this award's scope (DXCC / band / mode / dates) but no reference was found — so they don't count yet. Sort by a column, tick the matching contacts, then assign the reference below.", 'awp.orClickRow': '(Or click a row to open the QSO.)', 'awp.selectedArrow': '{n} selected →', 'awp.chooseReference': 'Choose a reference to assign…', 'awp.assignToSelected': 'Assign to {n} selected', 'awp.scanning': 'Scanning…', 'awp.noGaps': 'No gaps found. (Missing-reference detection applies to awards scoped to a DXCC entity — e.g. DDFM, WAS, RAC, WAJA.)', 'awp.dateUtc': 'Date (UTC)', 'awp.callsign': 'Callsign', 'awp.band': 'Band', 'awp.mode': 'Mode', 'awp.country': 'Country', 'awp.qthNote': 'QTH / Note', 'awp.stations': 'stations', 'awp.contactsWithoutRef': 'contacts without a reference', 'awp.assignedMsg': 'Assigned {code}@{ref} to {n} contact(s).', 'awp.loading': 'Loading…', 'awp.noQsos': 'No QSOs.',
'awed.addCountry': 'Add country…', 'awed.exportedTo': 'Awards exported to:\n{path}', 'awed.importedMsg': 'Imported {awards} award(s) and {references} reference(s).', 'awed.awardManagement': 'Award management', 'awed.searchAwards': 'Search awards…', 'awed.newAward': 'New award', 'awed.clickToDismiss': 'Click to dismiss', 'awed.selectOrCreate': 'Select or create an award.', 'awed.tabInfo': 'Award info', 'awed.tabType': 'Award type', 'awed.tabConfirmation': 'Confirmation', 'awed.tabReferences': 'References', 'awed.awardName': 'Award name', 'awed.valid': 'Valid', 'awed.deleteAward': 'Delete award', 'awed.description': 'Description', 'awed.awardUrl': 'Award URL', 'awed.refDisplay': 'Column shows', 'awed.refDisplayRef': 'Reference', 'awed.refDisplayName': 'Description / name', 'awed.refDisplayBoth': 'Both (ref — name)', 'awed.referenceUrl': 'Reference URL', 'awed.validFrom': 'Valid from', 'awed.validTo': 'Valid to', 'awed.dxccFilter': 'DXCC filter', 'awed.validBands': 'Valid bands (empty = all)', 'awed.emission': 'Emission (empty = all)', 'awed.validModes': 'Valid modes (empty = all)', 'awed.awardType': 'Award type', 'awed.allowMultiple': 'Allow multiple references on a single QSO', 'awed.dynamicRefs': 'Dynamic references (not predefined — any value counts, like POTA)', 'awed.qsoParams': 'QSO parameters (used by QSOFIELDS / REFERENCE types)', 'awed.searchInField': 'Search in field', 'awed.matchBy': 'Match by', 'awed.exactMatch': 'Exact match (else search reference inside the field)', 'awed.patternRegex': 'Pattern (regex)', 'awed.patternPlaceholder': 'group 1 = reference (for match-by pattern / dynamic)', 'awed.leadingString': 'Leading string', 'awed.trailingString': 'Trailing string', 'awed.additionalSearches': 'Additional searches', 'awed.orAlsoMatch': '— also match the reference if any of these hit', 'awed.addOr': 'Add OR', 'awed.orSearchIn': 'OR — search in', 'awed.exact': 'exact', 'awed.removeOrSearch': 'Remove this OR search', 'awed.orPatternPlaceholder': 'regex — group 1 = reference (e.g. \\b(\\d{2})\\d{3}\\b for postal → dept)', 'awed.prefixPlaceholder': 'prefix (D)', 'awed.prefixTitle': 'Prepended to each found reference, e.g. 74 → D74', 'awed.confirmationLabel': 'Confirmation (worked → confirmed)', 'awed.validationLabel': 'Validation (confirmed → validated)', 'awed.grantCodes': 'Grant codes', 'awed.exportCreditGranted': 'Export award in ADIF credit_granted field', 'awed.resetDefaults': 'Reset to defaults', 'awed.exportTitle': 'Export all award definitions + reference lists to a JSON backup', 'awed.export': 'Export…', 'awed.importTitle': 'Import an award bundle (definitions + reference lists)', 'awed.import': 'Import…', 'awed.cancel': 'Cancel', 'awed.save': 'Save', 'awed.populatedMsg': 'Populated {n} built-in references.', 'awed.newRefCodePrompt': 'New reference code:', 'awed.importedRefsMsg': 'Imported {n} references.', 'awed.referenceCount': 'Reference count:', 'awed.applyPreset': 'Apply preset…', 'awed.pasteCsv': 'Paste / CSV', 'awed.populateBuiltinTitle': 'Replace with the shipped built-in list (DXCC entities, French departments, …)', 'awed.populateBuiltin': 'Populate built-in', 'awed.updateOnline': 'Update online', 'awed.add': 'Add', 'awed.onePerLine': 'One reference per line:', 'awed.replacesList': '(comma/semicolon/tab). Replaces the whole list.', 'awed.import2': 'Import', 'awed.search': 'Search…', 'awed.searching': 'Searching…', 'awed.tooManyItems': 'Too many items ({total}). Please refine search (type 2+ characters).', 'awed.noReferences': 'No references.', 'awed.selectReference': 'Select a reference, or Add / import a list.', 'awed.group': 'Group', 'awed.subgroup': 'Subgroup', 'awed.perRefRegex': 'optional per-reference regex', 'awed.score': 'Score', 'awed.bonus': 'Bonus', 'awed.grid': 'Grid', 'awed.saveReference': 'Save reference',
'awed.addCountry': 'Add country…', 'awed.exportedTo': 'Awards exported to:\n{path}', 'awed.importedMsg': 'Imported {awards} award(s) and {references} reference(s).', 'awed.awardManagement': 'Award management', 'awed.searchAwards': 'Search awards…', 'awed.newAward': 'New award', 'awed.clickToDismiss': 'Click to dismiss', 'awed.selectOrCreate': 'Select or create an award.', 'awed.tabInfo': 'Award info', 'awed.tabType': 'Award type', 'awed.tabConfirmation': 'Confirmation', 'awed.tabReferences': 'References', 'awed.awardName': 'Award name', 'awed.valid': 'Valid', 'awed.deleteAward': 'Delete award', 'awed.description': 'Description', 'awed.awardUrl': 'Award URL', 'awed.refDisplay': 'Column shows', 'awed.refDisplayRef': 'Reference', 'awed.refDisplayName': 'Description / name', 'awed.refDisplayBoth': 'Both (ref — name)', 'awed.referenceUrl': 'Reference URL', 'awed.validFrom': 'Valid from', 'awed.validTo': 'Valid to', 'awed.dxccFilter': 'DXCC filter', 'awed.validBands': 'Valid bands (empty = all)', 'awed.emission': 'Emission (empty = all)', 'awed.validModes': 'Valid modes (empty = all)', 'awed.awardType': 'Award type', 'awed.allowMultiple': 'Allow multiple references on a single QSO', 'awed.dynamicRefs': 'Dynamic references (not predefined — any value counts, like POTA)', 'awed.qsoParams': 'QSO parameters (used by QSOFIELDS / REFERENCE types)', 'awed.searchInField': 'Search in field', 'awed.matchBy': 'Match by', 'awed.exactMatch': 'Exact match (else search reference inside the field)', 'awed.patternRegex': 'Pattern (regex)', 'awed.patternPlaceholder': 'group 1 = reference (for match-by pattern / dynamic)', 'awed.leadingString': 'Leading string', 'awed.trailingString': 'Trailing string', 'awed.additionalSearches': 'Fallback searches', 'awed.orAlsoMatch': '— tried in order, only if nothing matched yet; first hit wins', 'awed.addOr': 'Add OR', 'awed.orSearchIn': 'OR — search in', 'awed.exact': 'exact', 'awed.removeOrSearch': 'Remove this OR search', 'awed.orPatternPlaceholder': 'regex — group 1 = reference (e.g. \\b(\\d{2})\\d{3}\\b for postal → dept)', 'awed.prefixPlaceholder': 'prefix (D)', 'awed.prefixTitle': 'Prepended to each found reference, e.g. 74 → D74', 'awed.confirmationLabel': 'Confirmation (worked → confirmed)', 'awed.validationLabel': 'Validation (confirmed → validated)', 'awed.grantCodes': 'Grant codes', 'awed.exportCreditGranted': 'Export award in ADIF credit_granted field', 'awed.resetDefaults': 'Reset to defaults', 'awed.exportTitle': 'Export all award definitions + reference lists to a JSON backup', 'awed.export': 'Export…', 'awed.importTitle': 'Import an award bundle (definitions + reference lists)', 'awed.import': 'Import…', 'awed.cancel': 'Cancel', 'awed.save': 'Save', 'awed.populatedMsg': 'Populated {n} built-in references.', 'awed.newRefCodePrompt': 'New reference code:', 'awed.importedRefsMsg': 'Imported {n} references.', 'awed.referenceCount': 'Reference count:', 'awed.applyPreset': 'Apply preset…', 'awed.pasteCsv': 'Paste / CSV', 'awed.populateBuiltinTitle': 'Replace with the shipped built-in list (DXCC entities, French departments, …)', 'awed.populateBuiltin': 'Populate built-in', 'awed.updateOnline': 'Update online', 'awed.add': 'Add', 'awed.onePerLine': 'One reference per line:', 'awed.replacesList': '(comma/semicolon/tab). Replaces the whole list.', 'awed.import2': 'Import', 'awed.search': 'Search…', 'awed.searching': 'Searching…', 'awed.tooManyItems': 'Too many items ({total}). Please refine search (type 2+ characters).', 'awed.noReferences': 'No references.', 'awed.selectReference': 'Select a reference, or Add / import a list.', 'awed.group': 'Group', 'awed.subgroup': 'Subgroup', 'awed.perRefRegex': 'optional per-reference regex', 'awed.score': 'Score', 'awed.bonus': 'Bonus', 'awed.grid': 'Grid', 'awed.saveReference': 'Save reference',
// QSO modals (context menu / bulk edit / QSL manager / QSO edit)
'qctx.selected': '{n} QSO(s) selected', 'qctx.fixCountry': 'Fix country & zones from cty.dat', 'qctx.updateQrz': 'Update from QRZ.com', 'qctx.updateClublog': 'Update from ClubLog (exceptions)', 'qctx.sendQslEmail': 'Send OpsLog QSL by e-mail', 'qctx.sendRecording': 'Send recording by e-mail', 'qctx.bulkEdit': 'Bulk edit field… ({n})', 'qctx.exportSelectedAdif': 'Export selected to ADIF ({n})', 'qctx.exportFilteredAdif': 'Export filtered view to ADIF (no limit)', 'qctx.exportSelectedCabrillo': 'Export selected to Cabrillo ({n})', 'qctx.exportFilteredCabrillo': 'Export filtered view to Cabrillo (no limit)', 'qctx.sendTo': 'Send to {name}', 'qctx.delete': 'Delete {n} QSO(s)…',
'bulk.fLotwSent': 'LoTW sent', 'bulk.fLotwRcvd': 'LoTW received', 'bulk.fEqslSent': 'eQSL sent', 'bulk.fEqslRcvd': 'eQSL received', 'bulk.fQslSent': 'Paper QSL sent', 'bulk.fQslRcvd': 'Paper QSL received', 'bulk.fQrzUpload': 'QRZ.com upload', 'bulk.fClublogUpload': 'Club Log upload', 'bulk.fHrdlogUpload': 'HRDLog upload', 'bulk.fQslVia': 'QSL via', 'bulk.fStationCall': 'Station callsign', 'bulk.fOperator': 'Operator', 'bulk.fMyGrid': 'My grid', 'bulk.fMyAntenna': 'My antenna', 'bulk.fMyRig': 'My rig', 'bulk.fMyStreet': 'My street', 'bulk.fMyCity': 'My city', 'bulk.fMyPostal': 'My postal code', 'bulk.fMyCountry': 'My country', 'bulk.fMyState': 'My state', 'bulk.fMyCounty': 'My county', 'bulk.fMyIota': 'My IOTA', 'bulk.fMySota': 'My SOTA ref', 'bulk.fMyPota': 'My POTA ref', 'bulk.fMyWwff': 'My WWFF ref', 'bulk.fMySig': 'My SIG', 'bulk.fMySigInfo': 'My SIG info', 'bulk.fContestId': 'Contest ID', 'bulk.fSrxString': 'Serial rcvd (exchange)', 'bulk.fStxString': 'Serial sent (exchange)', 'bulk.fArrlSect': 'ARRL section', 'bulk.fPrecedence': 'Precedence', 'bulk.fClass': 'Class', 'bulk.fPropMode': 'Propagation mode', 'bulk.fSatName': 'Satellite name', 'bulk.fSatMode': 'Satellite mode', 'bulk.fPotaRef': 'POTA ref', 'bulk.fSotaRef': 'SOTA ref', 'bulk.fWwffRef': 'WWFF ref', 'bulk.fIota': 'IOTA', 'bulk.fSig': 'SIG', 'bulk.fSigInfo': 'SIG info', 'bulk.fComment': 'Comment', 'bulk.fNotes': 'Notes', 'bulk.fRig': 'Rig (contacted)', 'bulk.fAnt': 'Antenna (contacted)', 'bulk.statusY': 'Y — Yes / uploaded', 'bulk.statusN': 'N — No', 'bulk.statusR': 'R — Requested', 'bulk.statusI': 'I — Ignore', 'bulk.statusBlank': '(blank — clear)', 'bulk.groupQsl': 'QSL / upload', 'bulk.groupMyStation': 'My station', 'bulk.groupContacted': 'Contacted station', 'bulk.groupContest': 'Contest', 'bulk.groupPropagation': 'Propagation', 'bulk.groupMisc': 'Misc', 'bulk.title': 'Bulk edit field', 'bulk.desc': 'Set one field on the {n} selected QSO(s). This overwrites the current value — there is no undo.', 'bulk.fieldLabel': 'Field', 'bulk.valueLabel': 'Value', 'bulk.clearPlaceholder': 'leave empty to clear the field', 'bulk.willSet': 'Will set', 'bulk.blank': '(blank)', 'bulk.onQsos': 'on {n} QSO(s).', 'bulk.cancel': 'Cancel', 'bulk.applyTo': 'Apply to {n}',
@@ -223,6 +227,8 @@ const en: Dict = {
};
const fr: Dict = {
'prop.title': 'Propagation', 'prop.geomag': 'Géomag', 'prop.refresh': 'Actualiser la météo spatiale',
'lotw.userTip': 'Utilisateur LoTW — dernier upload {date} (il y a {days} j)',
'menu.file': 'Fichier', 'menu.edit': 'Édition', 'menu.view': 'Affichage', 'menu.tools': 'Outils',
'file.import': 'Importer ADIF…', 'file.export': 'Exporter ADIF…', 'file.exporting': 'Export…',
'file.exportCabrillo': 'Exporter Cabrillo…', 'file.deleteAll': 'Supprimer tous les QSO…', 'file.exit': 'Quitter',
@@ -251,7 +257,8 @@ const fr: Dict = {
'lang.english': 'English', 'lang.french': 'Français',
'settings.language': 'Langue', 'settings.languageHint': "Langue de l'interface.",
'settings.theme': 'Thème', 'settings.themeHint': "Thème de couleur de l'interface.",
'theme.auto': 'Auto (système)', 'theme.light-warm': 'Clair chaud', 'theme.dark-warm': 'Sombre chaud',
'theme.auto': 'Auto (système)', 'theme.light-warm': 'Clair chaud', 'theme.light-cool': 'Clair froid',
'theme.light-sage': 'Clair sauge', 'theme.dim-slate': 'Ardoise tamisé', 'theme.dark-warm': 'Sombre chaud',
'theme.dark-graphite': 'Sombre graphite', 'theme.high-contrast': 'Contraste élevé',
'nav.user': 'Configuration utilisateur', 'nav.software': 'Configuration logicielle', 'nav.hardware': 'Configuration matérielle', 'nav.lists': 'Listes',
'sec.station': 'Informations station', 'sec.profiles': 'Profils', 'sec.operating': "Conditions d'opération",
@@ -331,7 +338,7 @@ const fr: Dict = {
'cat.icomNetHint': "Se connecte directement au serveur LAN intégré du poste — sans RS-BA1 ni Remote Utility (ferme-les d'abord). Utilise l'ID/mot de passe Network User1 configurés dans le menu Network du poste. Un poste en veille est allumé automatiquement.",
'cat.icomNetAudio': 'Diffuser laudio RX par le réseau (expérimental)',
'cat.icomNetAudioHint': 'Écoute laudio reçu du poste sur ton périphérique d’écoute (Réglages → Audio) via le flux 50003. Expérimental — le format audio reste à vérifier sur le poste ; laisse désactivé si le contrôle se comporte mal.',
'cat.omnirigRig': 'Slot OmniRig', 'cat.flexIp': 'IP FlexRadio', 'cat.port': 'Port', 'cat.flexSpots': 'Afficher les spots cluster sur le panadapter', 'cat.flexSpotsHint': "(les spots du cluster DX d'OpsLog apparaissent sur la radio, expirent après 30 min)",
'cat.omnirigRig': 'Slot OmniRig', 'cat.flexIp': 'IP FlexRadio', 'cat.port': 'Port', 'cat.flexSpots': 'Afficher les spots cluster sur le panadapter', 'cat.flexSpotsHint': "(les spots du cluster DX d'OpsLog apparaissent sur la radio, expirent après 30 min)", 'cat.flexDecodeSpots': 'Afficher les décodes WSJT-X sur le panadapter', 'cat.flexDecodeSpotsHint': '(stations FT8/FT4 entendues via ton flux UDP WSJT-X/JTDX, un spot par station)', 'cat.flexDecodeSecs': 'Affichage pendant', 'cat.flexDecodeSecsHint': 'secondes avant retrait d\'une station',
'cat.icomPort': 'Port CI-V Icom', 'cat.selectCom': 'Choisir un port COM', 'cat.noPorts': 'Aucun port trouvé', 'cat.baud': 'Débit (baud)', 'cat.icomModel': 'Modèle de poste', 'cat.icomModelOther': 'Autre (adresse perso)', 'cat.civAddr': 'Adresse CI-V (hex)', 'cat.civHint': 'Choisis ton modèle pour fixer ladresse CI-V automatiquement (ou « Autre » et saisis-la). Mets « CI-V USB Echo Back » sur OFF et fais correspondre le débit CI-V sur le poste.',
'cat.tciHost': 'Hôte TCI', 'cat.tciHint': 'Active le serveur TCI dans ExpertSDR2/EESDR (Options → TCI). Port par défaut 40001. Utilise 127.0.0.1 si OpsLog tourne sur le même PC.', 'cat.tciSpots': 'Afficher les spots cluster sur le panorama', 'cat.tciSpotsHint': "(les spots du cluster DX d'OpsLog apparaissent sur le panadapter SDR)",
'cat.pollMs': 'Intervalle de poll (ms)', 'cat.delayMs': 'Délai CAT (ms)', 'cat.digitalDefault': 'Mode numérique par défaut (quand le poste indique DIG)', 'cat.modeBeforeFreq': 'Régler le mode avant la fréquence', 'cat.modeBeforeFreqHint': '(anciens postes qui perdent le mode après un changement de bande)',
@@ -340,6 +347,7 @@ const fr: Dict = {
'cat.rotatorOk': "Paquet envoyé — l'antenne devrait tourner vers 0° (nord). Sinon, vérifie l'hôte/port PstRotator et que l'écouteur UDP de PstRotator est activé.",
'cat.ubOk': "Connecté — l'Ultrabeam a répondu avec une trame de statut.",
'es.autoUpload': 'Envoi automatique à chaque nouveau QSO', 'es.uploadTiming': "Moment de l'envoi", 'es.immediate': 'Immédiat', 'es.delayed': 'Différé (12 min, permet de corriger les erreurs)', 'es.onClose': "À la fermeture (par lot)", 'es.testConn': 'Tester la connexion', 'es.testing': 'Test…', 'es.password': 'Mot de passe', 'es.apiKey': 'Clé API', 'es.forceCall': "Forcer l'indicatif de station", 'es.accountEmail': 'E-mail du compte', 'es.logbookCall': 'Indicatif du carnet',
'lotw.usersTitle': 'Liste des utilisateurs LoTW', 'lotw.usersHint': "Télécharge la liste publique ARRL des utilisateurs LoTW + leur date de dernier upload, pour afficher un badge LoTW coloré à côté d'un indicatif (vert < 1 semaine · ambre 14 semaines · rouge > 30 j).", 'lotw.usersDownload': 'Télécharger la liste LoTW', 'lotw.usersDownloading': 'Téléchargement…', 'lotw.usersLoaded': '{n} utilisateurs chargés · maj {date}', 'lotw.usersNone': 'Pas encore téléchargée — le badge reste caché tant que ce nest pas fait.',
'hw.connecting': 'Connexion…', 'hw.testConn': 'Tester la connexion', 'hw.sending': 'Envoi…', 'hw.testRotator': 'Tester (pointer vers 0°)',
'prof.deleteConfirm': 'Supprimer le profil « {name} » ? Tous ses réglages seront perdus.', 'prof.dupPrompt': 'Nom du nouveau profil (copie de « {name} ») :', 'prof.dupSuffix': '{name} Copie', 'prof.newPrompt': 'Nom du nouveau profil :', 'prof.newDefault': 'Nouveau profil',
'prof.hint': "Bascule entre tes identités d'opération (maison / portable / SOTA / contest). Choisis un profil ici, puis édite ses champs dans les autres sections (Informations station, etc.) — les changements sont enregistrés sur le profil sélectionné.", 'prof.active': 'ACTIF', 'prof.duplicate': 'Dupliquer', 'prof.delete': 'Supprimer', 'prof.profileName': 'Nom du profil',
@@ -397,7 +405,7 @@ const fr: Dict = {
'awrp.remove': 'Retirer', 'awrp.searchLabel': 'Rechercher {label}…', 'awrp.searching': 'Recherche…', 'awrp.noMatch': 'Aucune correspondance.', 'awrp.noMatchDxcc': 'Aucune correspondance pour ce DXCC.',
'awrs.group': 'Groupe', 'awrs.sub': 'Sous', 'awrs.pickReference': '← choisis une référence', 'awrs.add': 'Ajouter', 'awrs.enterCallsignFirst': "Saisis d'abord un indicatif", 'awrs.noRefsAdded': 'Aucune référence ajoutée', 'awrs.references': 'Références', 'awrs.autoMatchTitle': 'Le champ {field} vaut {code} — ce diplôme le compte automatiquement', 'awrs.fromField': 'depuis {field}', 'awrs.autoClickToAdd': 'auto — clic pour ajouter', 'awrs.search': 'Rechercher…', 'awrs.addUnlistedTitle': "Ajouter cette référence même si elle n'est pas encore dans la liste (nouvelle / non listée)", 'awrs.addPrefix': '+ Ajouter', 'awrs.unlisted': '(non listée)', 'awrs.searching': 'Recherche…', 'awrs.typeToSearch': 'Tape 2+ caractères pour chercher', 'awrs.enterCallsignOrSearch': 'Saisis un indicatif, ou tape pour chercher.', 'awrs.noRefsForEntity': 'Aucune référence pour cette entité.', 'awrs.noResults': 'Aucun résultat.', 'awrs.downloadLists': 'Télécharge les listes de références dans le panneau Diplômes → Importer les données.',
'awp.awards': 'Diplômes', 'awp.editAwards': 'Éditer les diplômes', 'awp.rescanTitle': 'Recharger le journal et recalculer (récupère les nouvelles confirmations LoTW/QRZ)', 'awp.rescan': 'Rescan', 'awp.selectAward': 'Sélectionner un diplôme…', 'awp.of': 'sur', 'awp.computing': 'Calcul…', 'awp.noData': 'Aucune donnée', 'awp.worked': 'contacté', 'awp.confirmed': 'confirmé', 'awp.validated': 'validé', 'awp.ofConfirmed': 'sur {total} · {pct}% confirmés', 'awp.byBand': 'Par bande (confirmés / contactés)', 'awp.filterReferences': 'Filtrer les références…', 'awp.filterAll': 'Tous', 'awp.filterWkd': 'Contactés', 'awp.filterNotWkd': 'Non contactés', 'awp.filterWkdNotCfmd': 'Contactés non conf.', 'awp.refs': 'réf.', 'awp.missingRefsTitle': "Contacts dans le périmètre de ce diplôme (bon DXCC/bande/mode) mais sans référence — exclus tant que tu n'en ajoutes pas", 'awp.missingRefs': 'Réf. manquantes', 'awp.gridView': 'Vue grille', 'awp.listView': 'Vue liste', 'awp.statistics': 'Statistiques', 'awp.statistic': 'Statistique', 'awp.total': 'Total', 'awp.grand': 'Général', 'awp.ref': 'Réf', 'awp.description': 'Description', 'awp.cellTitle': '{ref} · {band} — clic pour voir les QSO', 'awp.name': 'Nom', 'awp.groupCol': 'Groupe', 'awp.status': 'Statut', 'awp.bands': 'Bandes', 'awp.missing': '— manquant', 'awp.contactsMissingRef': 'contacts sans référence', 'awp.recomputeTitle': 'Recalculer — les contacts corrigés disparaissent de la liste', 'awp.refresh': 'Rafraîchir', 'awp.missingScopeHelp': 'Dans le périmètre de ce diplôme (DXCC / bande / mode / dates) mais aucune référence trouvée — ils ne comptent donc pas encore. Trie par colonne, coche les contacts concernés, puis attribue la référence ci-dessous.', 'awp.orClickRow': '(Ou clique une ligne pour ouvrir le QSO.)', 'awp.selectedArrow': '{n} sélectionné(s) →', 'awp.chooseReference': 'Choisir une référence à attribuer…', 'awp.assignToSelected': 'Attribuer à {n} sélectionné(s)', 'awp.scanning': 'Analyse…', 'awp.noGaps': "Aucun manque trouvé. (La détection de référence manquante s'applique aux diplômes limités à une entité DXCC — ex. DDFM, WAS, RAC, WAJA.)", 'awp.dateUtc': 'Date (UTC)', 'awp.callsign': 'Indicatif', 'awp.band': 'Bande', 'awp.mode': 'Mode', 'awp.country': 'Pays', 'awp.qthNote': 'QTH / Note', 'awp.stations': 'stations', 'awp.contactsWithoutRef': 'contacts sans référence', 'awp.assignedMsg': '{code}@{ref} attribué à {n} contact(s).', 'awp.loading': 'Chargement…', 'awp.noQsos': 'Aucun QSO.',
'awed.addCountry': 'Ajouter un pays…', 'awed.exportedTo': 'Diplômes exportés vers :\n{path}', 'awed.importedMsg': '{awards} diplôme(s) et {references} référence(s) importés.', 'awed.awardManagement': 'Gestion des diplômes', 'awed.searchAwards': 'Rechercher un diplôme…', 'awed.newAward': 'Nouveau diplôme', 'awed.clickToDismiss': 'Cliquer pour fermer', 'awed.selectOrCreate': 'Sélectionne ou crée un diplôme.', 'awed.tabInfo': 'Infos diplôme', 'awed.tabType': 'Type de diplôme', 'awed.tabConfirmation': 'Confirmation', 'awed.tabReferences': 'Références', 'awed.awardName': 'Nom du diplôme', 'awed.valid': 'Valide', 'awed.deleteAward': 'Supprimer le diplôme', 'awed.description': 'Description', 'awed.awardUrl': 'URL du diplôme', 'awed.refDisplay': 'La colonne affiche', 'awed.refDisplayRef': 'Référence', 'awed.refDisplayName': 'Description / nom', 'awed.refDisplayBoth': 'Les deux (réf — nom)', 'awed.referenceUrl': 'URL de référence', 'awed.validFrom': 'Valide du', 'awed.validTo': 'Valide au', 'awed.dxccFilter': 'Filtre DXCC', 'awed.validBands': 'Bandes valides (vide = toutes)', 'awed.emission': 'Émission (vide = toutes)', 'awed.validModes': 'Modes valides (vide = tous)', 'awed.awardType': 'Type de diplôme', 'awed.allowMultiple': 'Autoriser plusieurs références sur un seul QSO', 'awed.dynamicRefs': 'Références dynamiques (non prédéfinies — toute valeur compte, comme POTA)', 'awed.qsoParams': 'Paramètres QSO (utilisés par les types QSOFIELDS / REFERENCE)', 'awed.searchInField': 'Chercher dans le champ', 'awed.matchBy': 'Correspondance par', 'awed.exactMatch': 'Correspondance exacte (sinon cherche la référence dans le champ)', 'awed.patternRegex': 'Motif (regex)', 'awed.patternPlaceholder': 'groupe 1 = référence (pour correspondance par motif / dynamique)', 'awed.leadingString': 'Chaîne de début', 'awed.trailingString': 'Chaîne de fin', 'awed.additionalSearches': 'Recherches supplémentaires', 'awed.orAlsoMatch': "— correspond aussi à la référence si l'une d'elles est trouvée", 'awed.addOr': 'Ajouter OU', 'awed.orSearchIn': 'OU — chercher dans', 'awed.exact': 'exact', 'awed.removeOrSearch': 'Supprimer cette recherche OU', 'awed.orPatternPlaceholder': 'regex — groupe 1 = référence (ex. \\b(\\d{2})\\d{3}\\b pour code postal → dépt)', 'awed.prefixPlaceholder': 'préfixe (D)', 'awed.prefixTitle': 'Ajouté devant chaque référence trouvée, ex. 74 → D74', 'awed.confirmationLabel': 'Confirmation (contacté → confirmé)', 'awed.validationLabel': 'Validation (confirmé → validé)', 'awed.grantCodes': "Codes d'attribution", 'awed.exportCreditGranted': 'Exporter le diplôme dans le champ ADIF credit_granted', 'awed.resetDefaults': 'Réinitialiser par défaut', 'awed.exportTitle': 'Exporter toutes les définitions de diplômes + listes de références vers une sauvegarde JSON', 'awed.export': 'Exporter…', 'awed.importTitle': 'Importer un lot de diplômes (définitions + listes de références)', 'awed.import': 'Importer…', 'awed.cancel': 'Annuler', 'awed.save': 'Enregistrer', 'awed.populatedMsg': '{n} références intégrées ajoutées.', 'awed.newRefCodePrompt': 'Nouveau code de référence :', 'awed.importedRefsMsg': '{n} références importées.', 'awed.referenceCount': 'Nombre de références :', 'awed.applyPreset': 'Appliquer un préréglage…', 'awed.pasteCsv': 'Coller / CSV', 'awed.populateBuiltinTitle': 'Remplacer par la liste intégrée fournie (entités DXCC, départements français, …)', 'awed.populateBuiltin': "Charger l'intégrée", 'awed.updateOnline': 'Mettre à jour en ligne', 'awed.add': 'Ajouter', 'awed.onePerLine': 'Une référence par ligne :', 'awed.replacesList': '(virgule/point-virgule/tab). Remplace toute la liste.', 'awed.import2': 'Importer', 'awed.search': 'Rechercher…', 'awed.searching': 'Recherche…', 'awed.tooManyItems': "Trop d'éléments ({total}). Affine la recherche (tape 2+ caractères).", 'awed.noReferences': 'Aucune référence.', 'awed.selectReference': 'Sélectionne une référence, ou Ajouter / importer une liste.', 'awed.group': 'Groupe', 'awed.subgroup': 'Sous-groupe', 'awed.perRefRegex': 'regex optionnelle par référence', 'awed.score': 'Score', 'awed.bonus': 'Bonus', 'awed.grid': 'Locator', 'awed.saveReference': 'Enregistrer la référence',
'awed.addCountry': 'Ajouter un pays…', 'awed.exportedTo': 'Diplômes exportés vers :\n{path}', 'awed.importedMsg': '{awards} diplôme(s) et {references} référence(s) importés.', 'awed.awardManagement': 'Gestion des diplômes', 'awed.searchAwards': 'Rechercher un diplôme…', 'awed.newAward': 'Nouveau diplôme', 'awed.clickToDismiss': 'Cliquer pour fermer', 'awed.selectOrCreate': 'Sélectionne ou crée un diplôme.', 'awed.tabInfo': 'Infos diplôme', 'awed.tabType': 'Type de diplôme', 'awed.tabConfirmation': 'Confirmation', 'awed.tabReferences': 'Références', 'awed.awardName': 'Nom du diplôme', 'awed.valid': 'Valide', 'awed.deleteAward': 'Supprimer le diplôme', 'awed.description': 'Description', 'awed.awardUrl': 'URL du diplôme', 'awed.refDisplay': 'La colonne affiche', 'awed.refDisplayRef': 'Référence', 'awed.refDisplayName': 'Description / nom', 'awed.refDisplayBoth': 'Les deux (réf — nom)', 'awed.referenceUrl': 'URL de référence', 'awed.validFrom': 'Valide du', 'awed.validTo': 'Valide au', 'awed.dxccFilter': 'Filtre DXCC', 'awed.validBands': 'Bandes valides (vide = toutes)', 'awed.emission': 'Émission (vide = toutes)', 'awed.validModes': 'Modes valides (vide = tous)', 'awed.awardType': 'Type de diplôme', 'awed.allowMultiple': 'Autoriser plusieurs références sur un seul QSO', 'awed.dynamicRefs': 'Références dynamiques (non prédéfinies — toute valeur compte, comme POTA)', 'awed.qsoParams': 'Paramètres QSO (utilisés par les types QSOFIELDS / REFERENCE)', 'awed.searchInField': 'Chercher dans le champ', 'awed.matchBy': 'Correspondance par', 'awed.exactMatch': 'Correspondance exacte (sinon cherche la référence dans le champ)', 'awed.patternRegex': 'Motif (regex)', 'awed.patternPlaceholder': 'groupe 1 = référence (pour correspondance par motif / dynamique)', 'awed.leadingString': 'Chaîne de début', 'awed.trailingString': 'Chaîne de fin', 'awed.additionalSearches': 'Recherches de repli', 'awed.orAlsoMatch': "— essayées dans l'ordre, seulement si rien n'a encore été trouvé ; la première qui marche gagne", 'awed.addOr': 'Ajouter OU', 'awed.orSearchIn': 'OU — chercher dans', 'awed.exact': 'exact', 'awed.removeOrSearch': 'Supprimer cette recherche OU', 'awed.orPatternPlaceholder': 'regex — groupe 1 = référence (ex. \\b(\\d{2})\\d{3}\\b pour code postal → dépt)', 'awed.prefixPlaceholder': 'préfixe (D)', 'awed.prefixTitle': 'Ajouté devant chaque référence trouvée, ex. 74 → D74', 'awed.confirmationLabel': 'Confirmation (contacté → confirmé)', 'awed.validationLabel': 'Validation (confirmé → validé)', 'awed.grantCodes': "Codes d'attribution", 'awed.exportCreditGranted': 'Exporter le diplôme dans le champ ADIF credit_granted', 'awed.resetDefaults': 'Réinitialiser par défaut', 'awed.exportTitle': 'Exporter toutes les définitions de diplômes + listes de références vers une sauvegarde JSON', 'awed.export': 'Exporter…', 'awed.importTitle': 'Importer un lot de diplômes (définitions + listes de références)', 'awed.import': 'Importer…', 'awed.cancel': 'Annuler', 'awed.save': 'Enregistrer', 'awed.populatedMsg': '{n} références intégrées ajoutées.', 'awed.newRefCodePrompt': 'Nouveau code de référence :', 'awed.importedRefsMsg': '{n} références importées.', 'awed.referenceCount': 'Nombre de références :', 'awed.applyPreset': 'Appliquer un préréglage…', 'awed.pasteCsv': 'Coller / CSV', 'awed.populateBuiltinTitle': 'Remplacer par la liste intégrée fournie (entités DXCC, départements français, …)', 'awed.populateBuiltin': "Charger l'intégrée", 'awed.updateOnline': 'Mettre à jour en ligne', 'awed.add': 'Ajouter', 'awed.onePerLine': 'Une référence par ligne :', 'awed.replacesList': '(virgule/point-virgule/tab). Remplace toute la liste.', 'awed.import2': 'Importer', 'awed.search': 'Rechercher…', 'awed.searching': 'Recherche…', 'awed.tooManyItems': "Trop d'éléments ({total}). Affine la recherche (tape 2+ caractères).", 'awed.noReferences': 'Aucune référence.', 'awed.selectReference': 'Sélectionne une référence, ou Ajouter / importer une liste.', 'awed.group': 'Groupe', 'awed.subgroup': 'Sous-groupe', 'awed.perRefRegex': 'regex optionnelle par référence', 'awed.score': 'Score', 'awed.bonus': 'Bonus', 'awed.grid': 'Locator', 'awed.saveReference': 'Enregistrer la référence',
'qctx.selected': '{n} QSO sélectionné(s)', 'qctx.fixCountry': 'Corriger pays et zones depuis cty.dat', 'qctx.updateQrz': 'Mettre à jour depuis QRZ.com', 'qctx.updateClublog': 'Mettre à jour depuis ClubLog (exceptions)', 'qctx.sendQslEmail': 'Envoyer la QSL OpsLog par e-mail', 'qctx.sendRecording': "Envoyer l'enregistrement par e-mail", 'qctx.bulkEdit': "Édition groupée d'un champ… ({n})", 'qctx.exportSelectedAdif': 'Exporter la sélection en ADIF ({n})', 'qctx.exportFilteredAdif': 'Exporter la vue filtrée en ADIF (sans limite)', 'qctx.exportSelectedCabrillo': 'Exporter la sélection en Cabrillo ({n})', 'qctx.exportFilteredCabrillo': 'Exporter la vue filtrée en Cabrillo (sans limite)', 'qctx.sendTo': 'Envoyer vers {name}', 'qctx.delete': 'Supprimer {n} QSO…',
'bulk.fLotwSent': 'LoTW envoyé', 'bulk.fLotwRcvd': 'LoTW reçu', 'bulk.fEqslSent': 'eQSL envoyé', 'bulk.fEqslRcvd': 'eQSL reçu', 'bulk.fQslSent': 'QSL papier envoyée', 'bulk.fQslRcvd': 'QSL papier reçue', 'bulk.fQrzUpload': 'Envoi QRZ.com', 'bulk.fClublogUpload': 'Envoi Club Log', 'bulk.fHrdlogUpload': 'Envoi HRDLog', 'bulk.fQslVia': 'QSL via', 'bulk.fStationCall': 'Indicatif de la station', 'bulk.fOperator': 'Opérateur', 'bulk.fMyGrid': 'Mon locator', 'bulk.fMyAntenna': 'Mon antenne', 'bulk.fMyRig': 'Mon équipement', 'bulk.fMyStreet': 'Ma rue', 'bulk.fMyCity': 'Ma ville', 'bulk.fMyPostal': 'Mon code postal', 'bulk.fMyCountry': 'Mon pays', 'bulk.fMyState': 'Mon état', 'bulk.fMyCounty': 'Mon comté', 'bulk.fMyIota': 'Mon IOTA', 'bulk.fMySota': 'Ma réf. SOTA', 'bulk.fMyPota': 'Ma réf. POTA', 'bulk.fMyWwff': 'Ma réf. WWFF', 'bulk.fMySig': 'Mon SIG', 'bulk.fMySigInfo': 'Mon info SIG', 'bulk.fContestId': 'ID concours', 'bulk.fSrxString': 'Série reçue (échange)', 'bulk.fStxString': 'Série envoyée (échange)', 'bulk.fArrlSect': 'Section ARRL', 'bulk.fPrecedence': 'Précédence', 'bulk.fClass': 'Classe', 'bulk.fPropMode': 'Mode de propagation', 'bulk.fSatName': 'Nom du satellite', 'bulk.fSatMode': 'Mode satellite', 'bulk.fPotaRef': 'Réf POTA', 'bulk.fSotaRef': 'Réf SOTA', 'bulk.fWwffRef': 'Réf WWFF', 'bulk.fIota': 'IOTA', 'bulk.fSig': 'SIG', 'bulk.fSigInfo': 'Info SIG', 'bulk.fComment': 'Commentaire', 'bulk.fNotes': 'Notes', 'bulk.fRig': 'Équipement (contacté)', 'bulk.fAnt': 'Antenne (contactée)', 'bulk.statusY': 'Y — Oui / envoyé', 'bulk.statusN': 'N — Non', 'bulk.statusR': 'R — Demandé', 'bulk.statusI': 'I — Ignorer', 'bulk.statusBlank': '(vide — effacer)', 'bulk.groupQsl': 'QSL / envoi', 'bulk.groupMyStation': 'Ma station', 'bulk.groupContacted': 'Station contactée', 'bulk.groupContest': 'Concours', 'bulk.groupPropagation': 'Propagation', 'bulk.groupMisc': 'Divers', 'bulk.title': "Édition groupée d'un champ", 'bulk.desc': 'Définir un champ sur les {n} QSO sélectionné(s). Cela écrase la valeur actuelle — aucune annulation possible.', 'bulk.fieldLabel': 'Champ', 'bulk.valueLabel': 'Valeur', 'bulk.clearPlaceholder': 'laisser vide pour effacer le champ', 'bulk.willSet': 'Définira', 'bulk.blank': '(vide)', 'bulk.onQsos': 'sur {n} QSO.', 'bulk.cancel': 'Annuler', 'bulk.applyTo': 'Appliquer à {n}',
'qslm.leave': '— laisser —', 'qslm.yes': 'Oui', 'qslm.no': 'Non', 'qslm.requested': 'Demandé', 'qslm.ignore': 'Ignorer', 'qslm.viaBureau': 'Bureau', 'qslm.viaDirect': 'Direct', 'qslm.viaElectronic': 'Électronique', 'qslm.svcPota': 'Journal chasseur POTA', 'qslm.svcPaper': 'QSL papier', 'qslm.sentRequested': 'Demandé', 'qslm.sentNo': 'Non', 'qslm.sentQueued': 'En file', 'qslm.sentYes': 'Oui (déjà envoyé)', 'qslm.sentInvalid': 'Invalide', 'qslm.sentBlank': '— vide —', 'qslm.qsoUpdated': '{n} QSO mis à jour.', 'qslm.service': 'Service', 'qslm.callsign': 'Indicatif', 'qslm.callsignScopeTitle': "L'envoi/téléchargement est limité à cet indicatif (indicatif de station forcé, sinon celui du profil actif)", 'qslm.syncHunterLog': 'Synchroniser le journal chasseur', 'qslm.onlyMyCallTitle': "Ne synchroniser que les chasses faites sous l'indicatif de votre profil actif — ignorer les QSO faits sous un autre indicatif (ex. XV9Q, NQ2H) absents de ce journal", 'qslm.onlyMyCall': "Uniquement l'indicatif de mon profil", 'qslm.addMissingTitle': "Insérer les contacts du journal chasseur dont l'indicatif n'est pas encore dans votre journal (indicatif/date/bande/mode/parc)", 'qslm.addMissing': 'Ajouter les QSO introuvables à mon journal', 'qslm.potaToken': 'Jeton dans Réglages → Services externes → POTA.', 'qslm.callsignPlaceholder': 'ex. DL1ABC', 'qslm.search': 'Rechercher', 'qslm.paperHint': 'Trouvez un indicatif, puis définissez QSL envoyée/reçue + via + date sur la sélection.', 'qslm.sentStatus': 'Statut envoyé', 'qslm.selectRequired': 'Sélectionner les requis', 'qslm.potaSummaryShort': '{updated} mis à jour · {added} ajoutés · {already} déjà · {unmatched} sans correspondance', 'qslm.potaOtherCall': ' · {n} autre indicatif', 'qslm.paperCount': '{total} QSO · {selected} sélectionné(s)', 'qslm.filter': 'Filtre', 'qslm.filterAll': 'Tous', 'qslm.filterNew': 'Nouveau (tout)', 'qslm.filterNewDxcc': 'Nouveau DXCC', 'qslm.filterNewBand': 'Nouvelle bande', 'qslm.filterNewSlot': 'Nouveau créneau', 'qslm.results': 'Résultats', 'qslm.log': 'Journal', 'qslm.confCount': '{shown} / {total} confirmation(s)', 'qslm.foundCount': '{found} trouvé(s) · {selected} sélectionné(s)', 'qslm.paperEmpty': 'Recherchez un indicatif pour lister ses QSO, puis définissez le statut QSL ci-dessous.', 'qslm.potaEmpty': 'Cliquez sur « Synchroniser le journal chasseur » pour récupérer votre journal pota.app et tamponner les références de parc.', 'qslm.potaSyncing': 'Synchronisation avec pota.app…', 'qslm.potaSummary': '{updated} QSO mis à jour · {added} ajoutés au journal · {already} déjà tamponnés · {unmatched} sans correspondance (sur {fetched} entrées du journal chasseur).', 'qslm.potaSkipped': ' {n} chasse(s) faites sous un autre indicatif ont été ignorées', 'qslm.potaKeptOnly': ' (conservé uniquement {call})', 'qslm.potaRescan': 'Relancez le scan du diplôme POTA pour compter les nouvelles références.', 'qslm.thActivator': 'Activateur', 'qslm.thDateUtc': 'Date UTC', 'qslm.thBand': 'Bande', 'qslm.thPark': 'Parc', 'qslm.thWhyUnmatched': 'Pourquoi sans correspondance', 'qslm.openToFix': 'Ouvrir ce QSO pour le corriger', 'qslm.starting': 'démarrage…', 'qslm.working': 'en cours…', 'qslm.noNewConf': 'Aucune nouvelle confirmation.', 'qslm.noConfMatch': 'Aucune confirmation ne correspond à ce filtre.', 'qslm.thCallsign': 'Indicatif', 'qslm.thMode': 'Mode', 'qslm.thCountry': 'Pays', 'qslm.thNew': 'Nouveau ?', 'qslm.newDxcc': 'NOUVEAU DXCC', 'qslm.newBand': 'NOUVELLE BANDE', 'qslm.newSlot': 'NOUVEAU CRÉNEAU', 'qslm.uploadEmpty': 'Choisissez un service + statut envoyé, puis « Sélectionner les requis ».', 'qslm.qslReceived': 'QSL reçue', 'qslm.qslRcvdDateTitle': 'Date de réception QSL', 'qslm.qslSent': 'QSL envoyée', 'qslm.qslSentDateTitle': "Date d'envoi QSL", 'qslm.via': 'Via', 'qslm.notes': 'Notes', 'qslm.notesPlaceholder': 'ex. payé 3€', 'qslm.comment': 'Commentaire', 'qslm.commentPlaceholder': 'commentaire', 'qslm.applyToSelected': 'Appliquer à {n} sélectionné(s)', 'qslm.downloadTitle': 'Récupérer les confirmations du service et mettre à jour le statut reçu', 'qslm.downloadConf': 'Télécharger les confirmations', 'qslm.downloadRangeTitle': "Jusqu'où télécharger", 'qslm.sinceLast': 'Depuis le dernier téléchargement', 'qslm.sinceDate': 'Depuis une date…', 'qslm.sinceAll': 'Tout', 'qslm.sinceDateTitleQrz': 'QRZ : filtre par date de QSO (pas de filtre par date de réception côté serveur)', 'qslm.sinceDateTitleLotw': 'LoTW : confirmations reçues depuis cette date', 'qslm.addNotFoundTitle': "Insérer les QSO confirmés qui ne sont pas encore dans votre journal", 'qslm.addNotFound': 'Ajouter les introuvables', 'qslm.uploadTo': 'Envoyer {n} vers {service}',
+2 -2
View File
@@ -5,11 +5,11 @@ import { writeUiPref } from './uiPref';
// CSS variables in style.css key off of. 'auto' follows the OS light/dark
// preference. The choice is persisted (localStorage + portable UI pref, so it
// travels with the data/ folder like the language).
export type ThemeChoice = 'auto' | 'light-warm' | 'dark-warm' | 'dark-graphite' | 'high-contrast';
export type ThemeChoice = 'auto' | 'light-warm' | 'light-cool' | 'light-sage' | 'dim-slate' | 'dark-warm' | 'dark-graphite' | 'high-contrast';
// Selectable, concrete themes (excludes 'auto') in display order.
export const CONCRETE_THEMES: Exclude<ThemeChoice, 'auto'>[] = [
'light-warm', 'dark-warm', 'dark-graphite', 'high-contrast',
'light-warm', 'light-cool', 'light-sage', 'dim-slate', 'dark-warm', 'dark-graphite', 'high-contrast',
];
export const LS_KEY = 'opslog.theme';
+201
View File
@@ -92,6 +92,207 @@
color-scheme: light;
}
/* ---- Theme 1b: Cool light (slate/blue) — crisp daylight, neutral cool --- */
[data-theme="light-cool"] {
--background: #f4f6f8; /* cool blue-white */
--foreground: #0f172a; /* slate-900 */
--card: #ffffff;
--card-foreground: #0f172a;
--popover: #ffffff;
--popover-foreground: #0f172a;
--primary: #2563eb; /* blue-600 */
--primary-foreground: #ffffff;
--secondary: #e2e8f0; /* slate-200 */
--secondary-foreground: #0f172a;
--muted: #e6ebf1; /* toolbars / table headers */
--muted-foreground: #475569; /* slate-600 — readable on muted */
--accent: #dbeafe; /* blue-100 */
--accent-foreground: #1e3a8a; /* blue-900 */
--destructive: #dc2626;
--destructive-foreground: #ffffff;
--destructive-muted: #fef2f2;
--destructive-muted-foreground: #b91c1c;
--border: #d3dae2; /* cool slate border */
--input: #d3dae2;
--ring: #3b82f6; /* blue-500 focus ring */
--success: #16a34a;
--success-foreground: #ffffff;
--success-muted: #dcfce7;
--success-muted-foreground: #166534;
--success-border: #86efac;
--warning: #d97706;
--warning-foreground: #ffffff;
--warning-muted: #fef3c7;
--warning-muted-foreground: #92400e;
--warning-border: #fcd34d;
--caution: #ca8a04;
--caution-foreground: #1c1917;
--caution-muted: #fef9c3;
--caution-muted-foreground: #854d0e;
--caution-border: #fde047;
--danger: #e11d48;
--danger-foreground: #ffffff;
--danger-muted: #ffe4e6;
--danger-muted-foreground: #9f1239;
--danger-border: #fda4af;
--info: #0284c7;
--info-foreground: #ffffff;
--info-muted: #e0f2fe;
--info-muted-foreground: #075985;
--info-border: #7dd3fc;
/* Band/mode matrix (BandSlotGrid) — emerald/indigo ramp, cool neutral base. */
--mx-call-conf: #15803d;
--mx-call-work: #6ee7b7;
--mx-dx-conf: #3730a3;
--mx-dx-work: #a5b4fc;
--mx-none: #e2e8f0;
--scrollbar-thumb: #b6c2d1;
--scrollbar-thumb-hover: #8fa1b5;
--card-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(15, 23, 42, 0.02);
color-scheme: light;
}
/* ---- Theme 1c: Sage light (Nordic) — soft green-grey, low-fatigue ------- */
[data-theme="light-sage"] {
--background: #eef1ec; /* pale sage */
--foreground: #1a2420; /* deep pine-ink */
--card: #f8faf6; /* lifted off-white with a green cast */
--card-foreground: #1a2420;
--popover: #f8faf6;
--popover-foreground: #1a2420;
--primary: #2f855a; /* deep sage green */
--primary-foreground: #f0fdf4;
--secondary: #dde5db;
--secondary-foreground: #1a2420;
--muted: #dde5db; /* toolbars / table headers */
--muted-foreground: #445048; /* muted pine — readable on muted */
--accent: #d7e8d5; /* soft green */
--accent-foreground: #1e4634; /* forest-900 */
--destructive: #b91c1c;
--destructive-foreground: #ffffff;
--destructive-muted: #fef2f2;
--destructive-muted-foreground: #b91c1c;
--border: #cdd8ce; /* soft sage border */
--input: #cdd8ce;
--ring: #38a169; /* green focus ring */
--success: #16a34a;
--success-foreground: #ffffff;
--success-muted: #dcfce7;
--success-muted-foreground: #166534;
--success-border: #86efac;
--warning: #d97706;
--warning-foreground: #ffffff;
--warning-muted: #fef3c7;
--warning-muted-foreground: #92400e;
--warning-border: #fcd34d;
--caution: #ca8a04;
--caution-foreground: #1c1917;
--caution-muted: #fef9c3;
--caution-muted-foreground: #854d0e;
--caution-border: #fde047;
--danger: #e11d48;
--danger-foreground: #ffffff;
--danger-muted: #ffe4e6;
--danger-muted-foreground: #9f1239;
--danger-border: #fda4af;
--info: #0284c7;
--info-foreground: #ffffff;
--info-muted: #e0f2fe;
--info-muted-foreground: #075985;
--info-border: #7dd3fc;
/* Band/mode matrix (BandSlotGrid) — emerald/indigo ramp, sage neutral base. */
--mx-call-conf: #15803d;
--mx-call-work: #6ee7b7;
--mx-dx-conf: #3730a3;
--mx-dx-work: #a5b4fc;
--mx-none: #dde5db;
--scrollbar-thumb: #b3c2b3;
--scrollbar-thumb-hover: #91a591;
--card-shadow: 0 1px 2px rgba(26, 36, 32, 0.06), 0 0 0 1px rgba(26, 36, 32, 0.02);
color-scheme: light;
}
/* ---- Theme 1d: Dim slate — mid-tone twilight, between light and dark ---- */
[data-theme="dim-slate"] {
--background: #343b47; /* medium slate — light text, not deep dark */
--foreground: #eceef2;
--card: #3d4552; /* lifted panel */
--card-foreground: #eceef2;
--popover: #3d4552;
--popover-foreground: #eceef2;
--primary: #fb923c; /* orange-400 — brand warmth, pops on slate */
--primary-foreground: #241206;
--secondary: #454e5c;
--secondary-foreground: #eceef2;
--muted: #414a58; /* toolbars / table headers */
--muted-foreground: #b4bcc9; /* readable on muted */
--accent: #495468; /* hover / selection tint */
--accent-foreground: #dce3ef;
--destructive: #ef4444;
--destructive-foreground: #1a0808;
--destructive-muted: #3f1f1f;
--destructive-muted-foreground: #fca5a5;
--border: #4e5867;
--input: #4e5867;
--ring: #fdba74; /* orange-300 focus ring */
--success: #34d399;
--success-foreground: #06231a;
--success-muted: #1c3d34;
--success-muted-foreground: #6ee7b7;
--success-border: #2a5f4c;
--warning: #fbbf24;
--warning-foreground: #241a06;
--warning-muted: #41371a;
--warning-muted-foreground: #fcd34d;
--warning-border: #5e4d22;
--caution: #facc15;
--caution-foreground: #242006;
--caution-muted: #403b1a;
--caution-muted-foreground: #fde047;
--caution-border: #5b5222;
--danger: #fb7185;
--danger-foreground: #260a11;
--danger-muted: #421f28;
--danger-muted-foreground: #fda4af;
--danger-border: #63303c;
--info: #38bdf8;
--info-foreground: #061f2b;
--info-muted: #16384a;
--info-muted-foreground: #7dd3fc;
--info-border: #1d5670;
/* Matrix: bright confirmed, medium worked, slate not-worked (sits on dim). */
--mx-call-conf: #22c55e;
--mx-call-work: #2f7d55;
--mx-dx-conf: #6366f1;
--mx-dx-work: #3f3f8a;
--mx-none: #4a5262;
--scrollbar-thumb: #565f70;
--scrollbar-thumb-hover: #6b7588;
--card-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(236, 238, 242, 0.05);
color-scheme: dark;
}
/* ---- Theme 2: Warm dark (espresso) — same soul, night mode ------------- */
[data-theme="dark-warm"] {
--background: #221d18;
+1 -1
View File
@@ -1,6 +1,6 @@
// 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).
export const APP_VERSION = '0.19.2';
export const APP_VERSION = '0.19.4';
// Author / credits, shown in Help -> About.
export const APP_AUTHOR = 'F4BPO';
+12
View File
@@ -11,12 +11,14 @@ import {awardref} from '../models';
import {cluster} from '../models';
import {extsvc} from '../models';
import {powergenius} from '../models';
import {solar} from '../models';
import {winkeyer} from '../models';
import {alerts} from '../models';
import {audio} from '../models';
import {contest} from '../models';
import {operating} from '../models';
import {udp} from '../models';
import {lotwusers} from '../models';
import {lookup} from '../models';
import {netctl} from '../models';
@@ -138,6 +140,8 @@ export function DownloadClublogCty():Promise<main.ClublogCtyInfo>;
export function DownloadConfirmations(arg1:string,arg2:boolean,arg3:string):Promise<void>;
export function DownloadLoTWUsers():Promise<number>;
export function DuplicateProfile(arg1:number,arg2:string):Promise<profile.Profile>;
export function ExportADIF(arg1:string,arg2:boolean):Promise<adif.ExportResult>;
@@ -318,6 +322,8 @@ export function GetListsSettings():Promise<main.ListsSettings>;
export function GetLiveStatusEnabled():Promise<boolean>;
export function GetLoTWUsersStatus():Promise<main.LoTWUsersStatus>;
export function GetLogFilePath():Promise<string>;
export function GetLogbookRevision():Promise<string>;
@@ -344,6 +350,8 @@ export function GetRotatorSettings():Promise<main.RotatorSettings>;
export function GetSecretStatus():Promise<main.SecretStatus>;
export function GetSolarData():Promise<solar.Data>;
export function GetStartupStatus():Promise<main.StartupStatus>;
export function GetStationSettings():Promise<main.StationSettings>;
@@ -486,6 +494,8 @@ export function ListTQSLStationLocations():Promise<Array<extsvc.StationLocation>
export function ListUDPIntegrations():Promise<Array<udp.Config>>;
export function LoTWUserInfo(arg1:string):Promise<lotwusers.Info>;
export function LogUDPLoggedADIF(arg1:string):Promise<number>;
export function LookupCallsign(arg1:string):Promise<lookup.Result>;
@@ -592,6 +602,8 @@ export function QuitApp():Promise<void>;
export function RefreshCtyDat():Promise<main.CtyDatInfo>;
export function RefreshSolar():Promise<void>;
export function ReloadUDPIntegrations():Promise<Array<string>>;
export function RemovePassphrase(arg1:string):Promise<void>;
+20
View File
@@ -238,6 +238,10 @@ export function DownloadConfirmations(arg1, arg2, arg3) {
return window['go']['main']['App']['DownloadConfirmations'](arg1, arg2, arg3);
}
export function DownloadLoTWUsers() {
return window['go']['main']['App']['DownloadLoTWUsers']();
}
export function DuplicateProfile(arg1, arg2) {
return window['go']['main']['App']['DuplicateProfile'](arg1, arg2);
}
@@ -598,6 +602,10 @@ export function GetLiveStatusEnabled() {
return window['go']['main']['App']['GetLiveStatusEnabled']();
}
export function GetLoTWUsersStatus() {
return window['go']['main']['App']['GetLoTWUsersStatus']();
}
export function GetLogFilePath() {
return window['go']['main']['App']['GetLogFilePath']();
}
@@ -650,6 +658,10 @@ export function GetSecretStatus() {
return window['go']['main']['App']['GetSecretStatus']();
}
export function GetSolarData() {
return window['go']['main']['App']['GetSolarData']();
}
export function GetStartupStatus() {
return window['go']['main']['App']['GetStartupStatus']();
}
@@ -934,6 +946,10 @@ export function ListUDPIntegrations() {
return window['go']['main']['App']['ListUDPIntegrations']();
}
export function LoTWUserInfo(arg1) {
return window['go']['main']['App']['LoTWUserInfo'](arg1);
}
export function LogUDPLoggedADIF(arg1) {
return window['go']['main']['App']['LogUDPLoggedADIF'](arg1);
}
@@ -1146,6 +1162,10 @@ export function RefreshCtyDat() {
return window['go']['main']['App']['RefreshCtyDat']();
}
export function RefreshSolar() {
return window['go']['main']['App']['RefreshSolar']();
}
export function ReloadUDPIntegrations() {
return window['go']['main']['App']['ReloadUDPIntegrations']();
}
+99
View File
@@ -1154,6 +1154,27 @@ export namespace lookup {
}
export namespace lotwusers {
export class Info {
is_user: boolean;
last_upload?: string;
days_ago: number;
static createFrom(source: any = {}) {
return new Info(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.is_user = source["is_user"];
this.last_upload = source["last_upload"];
this.days_ago = source["days_ago"];
}
}
}
export namespace main {
export class AntGeniusSettings {
@@ -1357,6 +1378,8 @@ export namespace main {
flex_host: string;
flex_port: number;
flex_spots: boolean;
flex_decode_spots: boolean;
flex_decode_secs: number;
icom_port: string;
icom_baud: number;
icom_addr: number;
@@ -1383,6 +1406,8 @@ export namespace main {
this.flex_host = source["flex_host"];
this.flex_port = source["flex_port"];
this.flex_spots = source["flex_spots"];
this.flex_decode_spots = source["flex_decode_spots"];
this.flex_decode_secs = source["flex_decode_secs"];
this.icom_port = source["icom_port"];
this.icom_baud = source["icom_baud"];
this.icom_addr = source["icom_addr"];
@@ -1738,6 +1763,20 @@ export namespace main {
return a;
}
}
export class LoTWUsersStatus {
count: number;
updated?: string;
static createFrom(source: any = {}) {
return new LoTWUsersStatus(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.count = source["count"];
this.updated = source["updated"];
}
}
export class LookupSettings {
qrz_user: string;
qrz_password: string;
@@ -3298,6 +3337,66 @@ export namespace qso {
}
export namespace solar {
export class Data {
sfi: string;
ssn: string;
a_index: string;
k_index: string;
xray: string;
geomag_field: string;
aurora: string;
muf: string;
updated: string;
source: string;
ok: boolean;
error?: string;
// Go type: time
fetched_at: any;
static createFrom(source: any = {}) {
return new Data(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.sfi = source["sfi"];
this.ssn = source["ssn"];
this.a_index = source["a_index"];
this.k_index = source["k_index"];
this.xray = source["xray"];
this.geomag_field = source["geomag_field"];
this.aurora = source["aurora"];
this.muf = source["muf"];
this.updated = source["updated"];
this.source = source["source"];
this.ok = source["ok"];
this.error = source["error"];
this.fetched_at = this.convertValues(source["fetched_at"], null);
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
}
if (a.slice && a.map) {
return (a as any[]).map(elem => this.convertValues(elem, classs));
} else if ("object" === typeof a) {
if (asMap) {
for (const key of Object.keys(a)) {
a[key] = new classs(a[key]);
}
return a;
}
return new classs(a);
}
return a;
}
}
}
export namespace udp {
export class Config {
+53 -46
View File
@@ -13,6 +13,7 @@
package award
import (
"errors"
"regexp"
"sort"
"strconv"
@@ -73,10 +74,13 @@ type Def struct {
Dynamic bool `json:"dynamic,omitempty"` // references not predefined (any value counts)
AddPrefixes []string `json:"add_prefixes,omitempty"` // possible reference additional prefixes
// OrRules are ADDITIONAL searches OR'd with the primary one above: a QSO
// earns a reference if the primary match OR any of these match. Lets a
// French department (DDFM) be found from "D74" in the note AND from a postal
// code "74140" in the address (pattern captures "74", Prefix "D" → "D74").
// OrRules are ordered FALLBACK searches for the primary one above: they are
// tried IN ORDER and only while nothing has matched yet — the first rule that
// yields a reference wins and the rest are skipped (short-circuit, like a
// chain of "else if"). Lets a Chinese province (WAPC) be found first from the
// province NAME in the address, and only if that fails, from a city regex
// (e.g. "\bJiangyin\b" → JS) — so a QSO already resolved by name isn't also
// re-tagged, possibly differently, by a later rule.
OrRules []OrRule `json:"or_rules,omitempty"`
// --- Scope ---
@@ -257,6 +261,21 @@ type RefMeta struct {
}
// NewRefList builds the engine's reference view from (code, meta) pairs.
// compileAwardRE compiles an award / reference regex. Award patterns are run
// over free-text log fields (QTH, NOTES) whose capitalization is arbitrary — a
// log may hold "Tokyo", "TOKYO" or "TOKIO" — so we match case-insensitively by
// default. An author who set their own flag group (e.g. "(?s)") is respected.
func compileAwardRE(p string) (*regexp.Regexp, error) {
p = strings.TrimSpace(p)
if p == "" {
return nil, errors.New("empty pattern")
}
if !strings.HasPrefix(p, "(?") {
p = "(?i)" + p
}
return regexp.Compile(p)
}
func NewRefList(metas []RefMeta) refList {
rl := refList{byCode: make(map[string]RefMeta, len(metas))}
for _, m := range metas {
@@ -265,7 +284,7 @@ func NewRefList(metas []RefMeta) refList {
continue
}
if p := strings.TrimSpace(m.Pattern); p != "" {
if re, err := regexp.Compile(p); err == nil {
if re, err := compileAwardRE(p); err == nil {
m.re = re
rl.withPattern = append(rl.withPattern, code)
}
@@ -297,7 +316,7 @@ func Compute(defs []Def, qsos []qso.QSO, refMetas map[string][]RefMeta, nameOf N
perr := make([]string, len(defs))
for i := range defs {
if p := strings.TrimSpace(defs[i].Pattern); p != "" {
re, err := regexp.Compile(p)
re, err := compileAwardRE(p)
if err != nil {
perr[i] = "bad pattern: " + err.Error()
} else {
@@ -432,24 +451,14 @@ func MatchQSO(d Def, metas []RefMeta, q *qso.QSO) []string {
}
var re *regexp.Regexp
if p := strings.TrimSpace(d.Pattern); p != "" {
if c, err := regexp.Compile(p); err == nil {
if c, err := compileAwardRE(p); err == nil {
re = c
} else {
return nil
}
}
rl := NewRefList(metas)
found := candidates(&d, re, q, rl, len(metas) > 0)
// Merge operator-assigned references (manual override). These let the
// operator tag a QSO for an award whose field/description matching can't
// auto-detect the reference — e.g. WAPC scans the ADDRESS field for a
// province NAME, so a contact whose address doesn't spell it out needs the
// province picked by hand. For a predefined award the override is still
// validated against its reference list.
if man := manualRefs(q, d.Code); len(man) > 0 {
found = mergeManual(found, man, rl, len(metas) > 0 && !d.Dynamic)
}
return found
return candidates(&d, re, q, rl, len(metas) > 0)
}
// ManualRefsKey is the ADIF extras key under which OpsLog stores per-QSO,
@@ -484,30 +493,6 @@ func manualRefs(q *qso.QSO, code string) []string {
return out
}
// mergeManual appends operator-assigned codes to the auto-found set, deduped.
// When the award is predefined, only references present and valid in its list
// are kept (so a typo can't invent a reference).
func mergeManual(found, manual []string, rl refList, predefined bool) []string {
seen := map[string]struct{}{}
for _, c := range found {
seen[normalizeRef(c)] = struct{}{}
}
for _, c := range manual {
c = normalizeRef(c)
if _, dup := seen[c]; dup {
continue
}
if predefined {
if m, ok := rl.byCode[c]; !ok || !m.Valid {
continue
}
}
seen[c] = struct{}{}
found = append(found, c)
}
return found
}
// Confirmed reports whether a QSO satisfies any of the given confirmation
// sources (lotw|qsl|eqsl). Exported for the statistics view.
func Confirmed(q *qso.QSO, sources []string) bool { return confirmed(q, sources) }
@@ -565,6 +550,14 @@ func searchOne(field, matchBy string, re *regexp.Regexp, exact bool, leading, tr
found = append(found, nc.code)
}
}
// A reference may also declare its own regex to broaden matching beyond
// its plain name (e.g. Tokyo's `\bTok[iy]o\b` also catches "TOKIO"). Test
// those too — the name match and the pattern are OR'd.
for _, code := range rl.withPattern {
if m := rl.byCode[code]; m.re != nil && m.re.MatchString(raw) {
found = append(found, code)
}
}
case predefined && !exact:
// "Search reference inside the field": look up each token of the field in
// the list — O(tokens), not O(all references) — plus test the few
@@ -596,19 +589,33 @@ func searchOne(field, matchBy string, re *regexp.Regexp, exact bool, leading, tr
func candidates(d *Def, re *regexp.Regexp, q *qso.QSO, rl refList, hasList bool) []string {
predefined := hasList && !d.Dynamic
// Primary search, then each OR rule — a QSO earns a reference if any matches.
// Primary search first; the OR rules are ordered FALLBACKS — try the next
// only while nothing has matched yet, and stop at the first that yields a
// reference (short-circuit). So a province already found by NAME isn't also
// re-derived, possibly differently, from a later city-regex rule.
found := searchOne(d.Field, d.MatchBy, re, d.ExactMatch, d.LeadingStr, d.TrailingStr, "", q, rl, predefined)
for i := range d.OrRules {
for i := 0; len(found) == 0 && i < len(d.OrRules); i++ {
r := &d.OrRules[i]
var rre *regexp.Regexp
if p := strings.TrimSpace(r.Pattern); p != "" {
c, err := regexp.Compile(p)
c, err := compileAwardRE(p)
if err != nil {
continue // skip a rule with a bad regex rather than failing the award
}
rre = c
}
found = append(found, searchOne(r.Field, r.MatchBy, rre, r.ExactMatch, r.LeadingStr, r.TrailingStr, r.Prefix, q, rl, predefined)...)
found = searchOne(r.Field, r.MatchBy, rre, r.ExactMatch, r.LeadingStr, r.TrailingStr, r.Prefix, q, rl, predefined)
}
// Merge operator-assigned references (manual override, ManualRefsKey). Lets
// the operator tag a QSO for an award whose field/description matching can't
// auto-detect the reference — e.g. WAPC scans ADDRESS for a province NAME, so
// a contact whose address doesn't spell it out needs the province picked by
// hand. Applied HERE (not just in MatchQSO) so Compute — which powers the
// awards panel and the per-QSO refs editor — honours overrides too. For a
// predefined award the ref is still validated against the list below.
for _, c := range manualRefs(q, d.Code) {
found = append(found, normalizeRef(c))
}
if !predefined {
+140
View File
@@ -128,6 +128,146 @@ func TestComputeMatchByDescription(t *testing.T) {
}
}
// OR rules are ordered fallbacks: the primary match wins and short-circuits the
// rules; when the primary finds nothing, the first OR rule that hits wins and
// later rules are skipped. DDFM-style: a French department from the NOTE first,
// else captured from a postal code in the address (Prefix "D" → "D74").
func TestComputeOrRuleFallback(t *testing.T) {
def := Def{Code: "DDFM", Type: TypeQSOFields, Field: "notes", Pattern: `\b(D\d{2})\b`,
DXCCFilter: []int{227}, Valid: true,
OrRules: []OrRule{
{Field: "address", MatchBy: "pattern", Pattern: `\b(\d{2})\d{3}\b`, Prefix: "D"},
},
}
refMetas := map[string][]RefMeta{"DDFM": {
{Code: "D74", Name: "Haute-Savoie", Valid: true},
{Code: "D75", Name: "Paris", Valid: true},
}}
worked := func(q qso.QSO) []string {
r := Compute([]Def{def}, []qso.QSO{q}, refMetas, nil)[0]
var out []string
for _, rf := range r.Refs {
if rf.Worked {
out = append(out, rf.Ref)
}
}
return out
}
// Primary (note "D74") matches → the postal OR rule is skipped, so the
// address's 75001 does NOT also add D75. Exactly the user's ask: first
// condition wins, no fall-through.
if got := worked(qso.QSO{Callsign: "F4ABC", DXCC: ip(227), Notes: "worked D74", Address: "75001 Paris"}); len(got) != 1 || got[0] != "D74" {
t.Errorf("primary wins: got %v, want [D74] (no postal fall-through to D75)", got)
}
// No note dept → fall through to the OR rule → postal 74140 → D74.
if got := worked(qso.QSO{Callsign: "F4ABC", DXCC: ip(227), Notes: "", Address: "74140 Annecy"}); len(got) != 1 || got[0] != "D74" {
t.Errorf("OR fallback: got %v, want [D74]", got)
}
}
// The user's WAPC cascade: (1) province NAME in QTH, else (2) province NAME in
// ADDRESS, else (3) match-by-pattern in QTH, which runs each reference's OWN
// regex (city lists). Confirms the ordered fallback + that a match-by-pattern
// rule with an empty rule-pattern triggers the per-reference regexes.
func TestComputeProvinceCascade(t *testing.T) {
def := Def{Code: "WAPC", Type: TypeQSOFields, Field: "qth", MatchBy: "description",
DXCCFilter: []int{318}, Valid: true,
OrRules: []OrRule{
{Field: "address", MatchBy: "description"},
{Field: "qth", MatchBy: "pattern"}, // empty pattern → per-reference regexes
},
}
refMetas := map[string][]RefMeta{"WAPC": {
{Code: "JS", Name: "Jiangsu", Pattern: `\bJiangyin\b`, Valid: true},
{Code: "ZJ", Name: "Zhejiang", Pattern: `\bHangzhou\b`, Valid: true},
}}
worked := func(q qso.QSO) []string {
r := Compute([]Def{def}, []qso.QSO{q}, refMetas, nil)[0]
var out []string
for _, rf := range r.Refs {
if rf.Worked {
out = append(out, rf.Ref)
}
}
return out
}
cases := []struct {
name, qth, addr string
want string
}{
{"name in qth", "Wuxi, Jiangsu", "", "JS"},
{"name in address", "Wuxi", "Jiangsu Province", "JS"},
{"city regex (Jiangyin) in qth", "Jiangyin", "", "JS"},
{"city regex (Hangzhou) in qth", "Hangzhou", "", "ZJ"},
}
for _, c := range cases {
got := worked(qso.QSO{Callsign: "BA1A", DXCC: ip(318), QTH: c.qth, Address: c.addr})
if len(got) != 1 || got[0] != c.want {
t.Errorf("%s: got %v, want [%s]", c.name, got, c.want)
}
}
}
// A manually-assigned override (ManualRefsKey) must count in Compute — not just
// MatchQSO — so a custom award like WAPC (matches ADDRESS by description, writes
// no QSO field) sticks after the operator picks the province by hand. The engine
// only auto-detects "Jiangsu" when the address spells it out; here it doesn't, so
// the ref exists solely as the override.
func TestComputeManualOverride(t *testing.T) {
def := Def{Code: "WAPC", Type: TypeQSOFields, Field: "address", MatchBy: "description",
DXCCFilter: []int{318}, Confirm: []string{"lotw", "qsl"}, Valid: true}
qsos := []qso.QSO{
// Address doesn't name the province → only the override tags it.
{Callsign: "BA1ABC", Band: "20m", DXCC: ip(318), Address: "Beijing Rd 5",
Extras: map[string]string{ManualRefsKey: "WAPC@JS"}},
}
refMetas := map[string][]RefMeta{"WAPC": {
{Code: "JS", Name: "Jiangsu", Valid: true},
{Code: "GD", Name: "Guangdong", Valid: true},
}}
r := Compute([]Def{def}, qsos, refMetas, nil)[0]
if r.Worked != 1 {
t.Fatalf("WAPC worked = %d, want 1 (Jiangsu via manual override); got %v", r.Worked, refCodes(r))
}
var worked []string
for _, rf := range r.Refs {
if rf.Worked {
worked = append(worked, rf.Ref)
}
}
if len(worked) != 1 || worked[0] != "JS" {
t.Errorf("worked refs = %v, want [JS]", worked)
}
// An override for a ref NOT in the predefined list is rejected (no typo refs).
qsos[0].Extras[ManualRefsKey] = "WAPC@ZZ"
if w := Compute([]Def{def}, qsos, refMetas, nil)[0].Worked; w != 0 {
t.Errorf("bogus override ZZ: worked = %d, want 0", w)
}
}
// A description-match award must also honour a REFERENCE's own regex (used to
// broaden matching past the plain name) AND match case-insensitively — a log
// QTH "ITABASHIKU, TOKIO" (uppercase, "Tokio" spelling) must count for Tokyo
// via its `\bTok[iy]o\b` pattern, which the plain name "Tokyo" can't catch.
func TestComputeDescriptionRefPattern(t *testing.T) {
def := Def{Code: "WAJA", Type: TypeQSOFields, Field: "qth", MatchBy: "description",
DXCCFilter: []int{339}, Confirm: []string{"lotw", "qsl"}, Valid: true}
qsos := []qso.QSO{
{Callsign: "JA1LZB", Band: "10m", DXCC: ip(339), QTH: "ITABASHIKU, TOKIO"}, // pattern + case
{Callsign: "JA3DEF", Band: "40m", DXCC: ip(339), QTH: "osaka pref"}, // lowercase name
}
refMetas := map[string][]RefMeta{"WAJA": {
{Code: "13", Name: "Tokyo", Pattern: `\bTok[iy]o\b`, Valid: true},
{Code: "27", Name: "Osaka", Valid: true},
{Code: "01", Name: "Hokkaido", Valid: true},
}}
r := Compute([]Def{def}, qsos, refMetas, nil)[0]
if r.Worked != 2 {
t.Errorf("WAJA worked = %d, want 2 (Tokyo via pattern + Osaka via lowercase name); got %v", r.Worked, refCodes(r))
}
}
// VUCC: a grid4 award counts distinct 4-char grid squares, and a QSO on a grid
// line (VUCC_GRIDS) contributes several. grid4 derives from VUCC_GRIDS else the
// 4-char prefix of GRIDSQUARE.
+6 -5
View File
@@ -205,11 +205,12 @@ func (m *Manager) SetPTT(on bool) error {
// the backend picks a default when it's empty. (Status-based colouring can be
// driven later by setting Color per spot.)
type SpotInfo struct {
FreqHz int64
Callsign string
Mode string
Color string
Comment string
FreqHz int64
Callsign string
Mode string
Color string
Comment string
LifetimeSec int // panadapter display seconds before auto-removal (0 = backend default)
}
// Spotter is an OPTIONAL backend capability: show cluster spots on the radio
+59 -12
View File
@@ -60,6 +60,7 @@ type Flex struct {
pendingSpot map[int]string // seq → callsign, awaiting the spot index in the R response
pendingSplit map[int]bool // seq → awaiting the new TX slice's index (split create)
spotCall map[int]string // spot index → callsign (to fill the call on a panadapter click)
spotByCall map[string]int // callsign → live spot index, so re-spotting a call replaces its old spot (WSJT decodes re-fire every cycle)
sentCmds map[int]string // seq → command text, so an R<seq> error names the command
// OnSpotClick is called (off the reader goroutine's hot path) when the user
@@ -157,7 +158,7 @@ func NewFlex(host string, port int, spotsEnabled bool) *Flex {
return &Flex{
host: strings.TrimSpace(host), port: port,
slices: map[int]*flexSlice{}, spotsEnabled: spotsEnabled,
spotIdx: map[int]bool{}, pendingSpot: map[int]string{}, spotCall: map[int]string{}, pendingSplit: map[int]bool{},
spotIdx: map[int]bool{}, pendingSpot: map[int]string{}, spotCall: map[int]string{}, spotByCall: map[string]int{}, pendingSplit: map[int]bool{},
meterMeta: map[int]meterInfo{}, meterVal: map[int]float64{}, meterSub: map[int]bool{},
sentCmds: map[int]string{}, txSetAt: map[string]time.Time{},
}
@@ -352,6 +353,7 @@ func (f *Flex) reader(conn net.Conn) {
if idx, e := strconv.Atoi(strings.TrimSpace(parts[2])); e == nil {
f.spotCall[idx] = call
f.spotIdx[idx] = true
f.spotByCall[strings.ToUpper(call)] = idx
}
}
// A successful "slice create" for split returns the new slice's index;
@@ -919,9 +921,11 @@ func (f *Flex) txSliceLocked() *flexSlice {
// operatingLocked resolves the operator's slices: the MAIN (active) slice for the
// mode/display, and — ONLY for a GENUINE split — the RX and TX slices. Split is
// the tx-flagged slice PLUS a distinct in-use slice on the SAME band (different
// freq) — detected from the pair itself, NOT from which slice is active (the TX
// slice often steals focus right after "slice create", which must NOT read as
// "no split"). A slice on another band is an independent receiver, ignored.
// freq) AND the SAME split class (both PHONE, or both CW) — detected from the
// pair itself, NOT from which slice is active (the TX slice often steals focus
// right after "slice create", which must NOT read as "no split"). A slice on
// another band is an independent receiver, ignored; so is a same-band slice in a
// different mode (SSB + FT8) or a data mode (FT8/FT4/RTTY never split).
// Caller holds f.mu.
func (f *Flex) operatingLocked() (main, rx, tx *flexSlice) {
_, main = f.mainSliceLocked()
@@ -933,21 +937,31 @@ func (f *Flex) operatingLocked() (main, rx, tx *flexSlice) {
if bt == "" {
return main, nil, nil
}
// RX = the active slice when it's a distinct same-band slice, else the first
// other in-use same-band slice.
if main != nil && main != txS && main.freqHz != txS.freqHz && BandFromHz(main.freqHz) == bt {
// Split only applies to PHONE/CW; a data-mode TX slice never splits.
ct := flexSplitClass(txS.mode)
if ct == "" {
return main, nil, nil
}
// A split partner is an in-use, same-band slice at a different freq in the
// SAME split class (so SSB + FT8 on one band is NOT a split).
sameSplit := func(s *flexSlice) bool {
return s != nil && s.inUse && s != txS && s.freqHz != txS.freqHz &&
BandFromHz(s.freqHz) == bt && flexSplitClass(s.mode) == ct
}
// RX = the active slice when it qualifies, else the first other qualifying
// same-band slice.
if sameSplit(main) {
rx = main
} else {
for _, idx := range f.sortedSliceIdxLocked() {
s := f.slices[idx]
if s.inUse && s != txS && s.freqHz != txS.freqHz && BandFromHz(s.freqHz) == bt {
if s := f.slices[idx]; sameSplit(s) {
rx = s
break
}
}
}
if rx == nil {
return main, nil, nil // tx slice alone (simplex) → not split
return main, nil, nil // tx slice alone (simplex) or no same-mode partner → not split
}
return main, rx, txS
}
@@ -1059,8 +1073,23 @@ func (f *Flex) SendSpot(s SpotInfo) error {
if color == "" {
color = "#FFFFA500" // opaque orange default
}
cmd := fmt.Sprintf("spot add rx_freq=%.6f callsign=%s color=%s source=OpsLog lifetime_seconds=1800 trigger_action=Tune timestamp=%d",
float64(s.FreqHz)/1e6, call, color, time.Now().Unix())
life := s.LifetimeSec
if life <= 0 {
life = 1800 // default 30 min (cluster spots)
}
// De-dupe by callsign: WSJT decodes re-fire every cycle, so a station already
// spotted gets its previous spot removed first — one live spot per call,
// refreshed, instead of a pile that all expire independently.
f.mu.Lock()
if old, ok := f.spotByCall[strings.ToUpper(s.Callsign)]; ok {
delete(f.spotByCall, strings.ToUpper(s.Callsign))
delete(f.spotCall, old)
delete(f.spotIdx, old)
f.send(fmt.Sprintf("spot remove %d", old))
}
f.mu.Unlock()
cmd := fmt.Sprintf("spot add rx_freq=%.6f callsign=%s color=%s source=OpsLog lifetime_seconds=%d trigger_action=Tune timestamp=%d",
float64(s.FreqHz)/1e6, call, color, life, time.Now().Unix())
if m := flexEncode(s.Mode); m != "" {
cmd += " mode=" + m
}
@@ -1106,6 +1135,7 @@ func (f *Flex) ClearSpots() error {
f.mu.Lock()
f.spotIdx = map[int]bool{}
f.spotCall = map[int]string{}
f.spotByCall = map[string]int{}
connected := f.conn != nil
f.mu.Unlock()
if !connected {
@@ -1921,6 +1951,23 @@ func parseFloatDefault(s string, def float64) float64 {
}
// flexModeToADIF maps a Flex slice mode to a generic ADIF mode.
// flexSplitClass groups a raw Flex slice mode into a split-capable class. A
// genuine split (one RX freq, one TX freq, SAME mode) only makes sense for PHONE
// and CW pileups. Data modes (FT8/FT4/RTTY all report as DIGU/DIGL/RTTY on a
// Flex) and digital voice never operate split, so they return "" (not
// split-capable). Two same-band slices whose classes differ (e.g. SSB + FT8) are
// independent operations, not a split.
func flexSplitClass(rawMode string) string {
switch flexModeToADIF(rawMode) {
case "SSB", "AM", "FM":
return "PHONE"
case "CW":
return "CW"
default: // DATA, RTTY, DIGITALVOICE, "" → never split
return ""
}
}
func flexModeToADIF(m string) string {
switch strings.ToUpper(strings.TrimSpace(m)) {
case "USB", "LSB":
+49
View File
@@ -0,0 +1,49 @@
package cat
import "testing"
// A genuine split is two same-band slices in the SAME split class (both PHONE or
// both CW). Two same-band slices in different modes (SSB + FT8), or in a data
// mode (FT8/FT4/RTTY = DIGU/DIGL), must NOT read as split.
func TestOperatingSplitMode(t *testing.T) {
mk := func(hz int64, mode string, active, tx bool) *flexSlice {
return &flexSlice{freqHz: hz, mode: mode, active: active, tx: tx, inUse: true}
}
cases := []struct {
name string
slices map[int]*flexSlice
wantSplit bool
}{
{"phone split (both USB)", map[int]*flexSlice{
0: mk(14_100_000, "USB", true, false),
1: mk(14_200_000, "USB", false, true),
}, true},
{"CW split (both CW)", map[int]*flexSlice{
0: mk(7_010_000, "CW", true, false),
1: mk(7_025_000, "CW", false, true),
}, true},
{"SSB + FT8 same band → not split", map[int]*flexSlice{
0: mk(14_100_000, "USB", true, false),
1: mk(14_074_000, "DIGU", false, true),
}, false},
{"both FT8 (DIGU) same band → not split", map[int]*flexSlice{
0: mk(14_074_000, "DIGU", true, false),
1: mk(14_080_000, "DIGU", false, true),
}, false},
{"different bands → not split", map[int]*flexSlice{
0: mk(14_100_000, "USB", true, false),
1: mk(7_100_000, "LSB", false, true),
}, false},
{"simplex (single slice) → not split", map[int]*flexSlice{
0: mk(14_100_000, "USB", true, true),
}, false},
}
for _, c := range cases {
f := &Flex{slices: c.slices}
_, rx, tx := f.operatingLocked()
gotSplit := rx != nil && tx != nil
if gotSplit != c.wantSplit {
t.Errorf("%s: split=%v, want %v", c.name, gotSplit, c.wantSplit)
}
}
}
+17
View File
@@ -202,6 +202,23 @@ func (db *DB) Resolve(call string, date time.Time) (Exception, bool) {
return Exception{}, false
}
// HasException reports whether the callsign has ANY full-call exception (at any
// date). Used to tell a genuinely date-sensitive call (G1T: Scotland only from
// 2024) — where cty.dat's date-blind exact-call override is wrong for older
// QSOs — from an ordinary call cty.dat handles fine.
func (db *DB) HasException(call string) bool {
if db == nil {
return false
}
c := strings.ToUpper(strings.TrimSpace(call))
for _, key := range candidates(c) {
if len(db.exceptions[key]) > 0 {
return true
}
}
return false
}
// candidates yields the call and a version with one trailing affix removed.
func candidates(c string) []string {
out := []string{c}
+50
View File
@@ -0,0 +1,50 @@
package clublog
import (
"testing"
"time"
)
func d(s string) time.Time {
t, _ := time.Parse("2006-01-02", s)
return t
}
// G1T is a contest call: Scotland ONLY from 2024-02-21; before that it's England
// by prefix. cty.dat's date-blind "=G1T → Scotland" override is wrong for a 2012
// QSO — the date-aware ClubLog cascade must give England then, Scotland now.
func TestG1TDatedException(t *testing.T) {
db := &DB{
exceptions: map[string][]Exception{
"G1T": {{Call: "G1T", Entity: "Scotland", ADIF: 279, Start: d("2024-02-21")}},
},
prefixes: map[string][]Exception{
"G": {{Entity: "England", ADIF: 223}},
},
}
// 2012 QSO: exception doesn't cover it, but the call HAS an exception →
// caller should use the prefix (England).
if _, ok := db.Resolve("G1T", d("2012-07-29")); ok {
t.Fatalf("2012: exception should NOT cover a pre-2024 date")
}
if !db.HasException("G1T") {
t.Fatalf("HasException(G1T) should be true")
}
pe, pok := db.ResolvePrefix("G1T", d("2012-07-29"))
if !pok || pe.Entity != "England" {
t.Fatalf("2012 prefix: got %q ok=%v, want England", pe.Entity, pok)
}
// 2025 QSO: the exception covers it → Scotland.
e, ok := db.Resolve("G1T", d("2025-01-01"))
if !ok || e.Entity != "Scotland" {
t.Fatalf("2025: got %q ok=%v, want Scotland", e.Entity, ok)
}
// An ordinary call with no exception → HasException false (caller leaves it
// to cty.dat).
if db.HasException("G4ABC") {
t.Fatalf("HasException(G4ABC) should be false")
}
}
+27
View File
@@ -50,6 +50,17 @@ func (m *Manager) Info() (date string, count int) {
return m.db.Date(), m.db.Count()
}
// NeedsRefresh reports whether the cached country file is missing or older than
// maxAge — so the caller re-downloads it to pick up newly-added date-ranged
// exceptions (e.g. an event call's fresh SARDINIA period).
func (m *Manager) NeedsRefresh(maxAge time.Duration) bool {
fi, err := os.Stat(m.Path())
if err != nil {
return true // missing
}
return time.Since(fi.ModTime()) > maxAge
}
// EnsureLoaded loads the cached file into memory if present. Does NOT download.
func (m *Manager) EnsureLoaded() error {
if m.Loaded() {
@@ -125,3 +136,19 @@ func (m *Manager) Resolve(call string, date time.Time) (Exception, bool) {
}
return db.Resolve(call, date)
}
// ResolvePrefix resolves a call by ClubLog's date-ranged PREFIX table.
func (m *Manager) ResolvePrefix(call string, date time.Time) (Exception, bool) {
m.mu.RLock()
db := m.db
m.mu.RUnlock()
return db.ResolvePrefix(call, date)
}
// HasException reports whether the call has any full-call exception (any date).
func (m *Manager) HasException(call string) bool {
m.mu.RLock()
db := m.db
m.mu.RUnlock()
return db.HasException(call)
}
+13 -5
View File
@@ -339,17 +339,25 @@ func normalizeCallsign(s string) string {
// which can change the DXCC entity (HD5MW/8 → HD8MW → Galápagos, not
// Ecuador). This is the same class of rule as KG4 and /MM.
if areaDigit != 0 {
main = replaceFirstDigit(main, areaDigit)
main = replaceAreaDigit(main, areaDigit)
}
return main
}
// replaceFirstDigit substitutes the first 0-9 digit of a call with d (used to
// apply a "/N" call-area change). Returns the call unchanged if it has no digit.
func replaceFirstDigit(call string, d byte) string {
// replaceAreaDigit substitutes the CALL-AREA digit of a call with d (used to
// apply a "/N" call-area change). The area digit is the first digit that comes
// AFTER a prefix letter — NOT a leading digit that is part of a digit-first
// prefix (7X, 3A, 4X, 9A, 2E…). So 7X2ARA/4 → 7X4ARA (still Algeria, area 4),
// NOT 4X2ARA (which is Israel — the old first-digit bug). Returns the call
// unchanged if it has no such digit.
func replaceAreaDigit(call string, d byte) string {
b := []byte(call)
seenLetter := false
for i := range b {
if b[i] >= '0' && b[i] <= '9' {
switch {
case b[i] >= 'A' && b[i] <= 'Z':
seenLetter = true
case b[i] >= '0' && b[i] <= '9' && seenLetter:
b[i] = d
return string(b)
}
+3
View File
@@ -219,6 +219,9 @@ func TestNormalize(t *testing.T) {
"F4BPO/M": "F4BPO", // plain mobile keeps the home entity
"F4BPO/5": "F5BPO", // "/5" re-homes to call area 5
"HD5MW/8": "HD8MW", // "/8" → Galápagos call area (HD8)
"7X2ARA/4": "7X4ARA", // "/4" changes the AREA digit (2→4), NOT the 7 of the 7X prefix (was wrongly 4X2ARA = Israel)
"3A2ABC/6": "3A6ABC", // digit-first prefix 3A: area digit is the 2, not the 3
"4X1AB/2": "4X2AB", // 4X (Israel) area 1→2, keep the leading 4
"DL/F4BPO": "DL",
"MM/KA9P": "MM", // leading MM = Scotland operating prefix
"MM/LY3X/P": "MM",
+70 -6
View File
@@ -61,9 +61,12 @@ const (
eqslBaseURL = "https://www.eQSL.cc"
)
// eqslAdiHrefRe pulls the generated .adi path out of the DownloadInBox reply,
// e.g. `<A HREF="/qslcard/downloadedfiles/xxxx.adi">`.
var eqslAdiHrefRe = regexp.MustCompile(`(?i)href="(/[^"]+\.adi)"`)
// eqslAdiHrefRe pulls the generated .adi link out of the DownloadInBox reply.
// eQSL serves old HTML 4.01 with UPPERCASE tags and often UNQUOTED attributes,
// e.g. `<A HREF=/downloadedFiles/xxxx.adi>` or `<a href="…/xxxx.adi">`, and the
// path may be root-relative or a bare filename. Match case-insensitively with
// optional quoting; resolve to an absolute URL afterwards.
var eqslAdiHrefRe = regexp.MustCompile(`(?i)href\s*=\s*["']?([^"'>\s]+\.adi)`)
// DownloadEQSLConfirmations fetches the account's Inbox (received eQSLs =
// confirmations) as ADIF text. since is "YYYY-MM-DD" (only QSLs received since
@@ -97,18 +100,79 @@ func DownloadEQSLConfirmations(ctx context.Context, client *http.Client, cfg Ser
}
m := eqslAdiHrefRe.FindStringSubmatch(page)
if m == nil {
// eQSL reports problems inline ("Error: …", or "no QSLs" wording).
return "", fmt.Errorf("eqsl: no download link in response: %s", eqslReason(page))
// eQSL reports problems inline ("Error: …", "You have no … confirmations").
return "", fmt.Errorf("eqsl: no download link in response: %s", eqslNoLinkReason(page))
}
// Resolve the link to an absolute URL. eQSL is a Windows/ColdFusion server, so
// the path may use BACKSLASHES and a leading `..` (e.g. `..\downloadedFiles\
// xxx.adi`); normalise those. It may also be absolute or a bare filename.
link := strings.TrimSpace(m[1])
link = strings.ReplaceAll(link, `\`, "/")
link = strings.TrimPrefix(link, "..") // "../downloadedFiles/…" → "/downloadedFiles/…"
var fileURL string
switch {
case strings.HasPrefix(strings.ToLower(link), "http"):
fileURL = link
case strings.HasPrefix(link, "/"):
fileURL = eqslBaseURL + link
default:
fileURL = eqslBaseURL + "/" + link
}
// Step 2: fetch the generated .adi file.
adif, err := eqslGet(ctx, client, eqslBaseURL+m[1])
adif, err := eqslGet(ctx, client, fileURL)
if err != nil {
return "", fmt.Errorf("eqsl: fetch adif: %w", err)
}
return adif, nil
}
// eqslNoLinkReason builds a helpful message when no .adi link was found: eQSL's
// own error/notice text if present, else a short tag-stripped snippet of the page
// so the real wording (e.g. "You have no Inbox items") is visible in the log.
func eqslNoLinkReason(page string) string {
low := strings.ToLower(page)
for _, marker := range []string{"you have no", "no inbox", "error", "invalid", "not found"} {
if i := strings.Index(low, marker); i >= 0 {
seg := page[i:]
if len(seg) > 160 {
seg = seg[:160]
}
return strings.Join(strings.Fields(stripTags(seg)), " ")
}
}
txt := strings.Join(strings.Fields(stripTags(page)), " ")
if len(txt) > 200 {
txt = txt[:200]
}
if txt == "" {
txt = "empty response"
}
return txt
}
// stripTags removes HTML tags for a readable one-line diagnostic.
func stripTags(s string) string {
var b strings.Builder
depth := 0
for _, r := range s {
switch r {
case '<':
depth++
case '>':
if depth > 0 {
depth--
}
default:
if depth == 0 {
b.WriteRune(r)
}
}
}
return b.String()
}
// eqslGet does a plain GET and returns the body as text (32 MB cap), erroring on
// a non-200 status.
func eqslGet(ctx context.Context, client *http.Client, u string) (string, error) {
+31 -3
View File
@@ -43,9 +43,15 @@ type Event struct {
DXCall string // ServiceWSJT (Status) or ServiceRemoteCall
DXGrid string // ServiceWSJT (Status)
Mode string // ServiceWSJT (Status)
Mode string // ServiceWSJT (Status/Decode)
FreqHz int64 // ServiceWSJT (Status)
LoggedADIF string // ServiceWSJT (LoggedADIF), ServiceADIF or ServiceN1MM
// A WSJT-X Decode (heard station) to render on the panadapter.
DecodeCall string // transmitting (DE) callsign
DecodeFreqHz int64 // RF frequency (dial + audio offset)
DecodeSNR int // reported SNR (dB)
DecodeCQ bool // the decode was a CQ
}
// Server is a single inbound UDP listener.
@@ -57,6 +63,8 @@ type Server struct {
done chan struct{}
stopped bool
mu sync.Mutex
lastDialHz int64 // WSJT: dial freq from the last Status, added to Decode offsets
}
func newServer(cfg Config, out chan<- Event) *Server {
@@ -175,9 +183,29 @@ func (s *Server) handle(pkt []byte, remote *net.UDPAddr) {
return
}
if !ok {
applog.Printf("udp: [%s] WSJT msg type ignored\n", s.cfg.Name)
return
}
// Status carries the current dial frequency; remember it so Decode audio
// offsets can be turned into RF frequencies for the panadapter.
if w.FreqHz > 0 && !w.IsDecode {
s.mu.Lock()
s.lastDialHz = w.FreqHz
s.mu.Unlock()
}
if w.IsDecode {
s.mu.Lock()
dial := s.lastDialHz
s.mu.Unlock()
if dial <= 0 {
return // no dial freq yet (Status not seen) → can't place the spot
}
ev.DecodeCall = w.DecodeCall
ev.DecodeFreqHz = dial + w.DeltaFreqHz
ev.DecodeSNR = w.SNR
ev.DecodeCQ = w.IsCQ
ev.Mode = w.Mode
break
}
applog.Printf("udp: [%s] WSJT decoded: prog=%q dx_call=%q grid=%q mode=%q freq=%d adif_len=%d\n",
s.cfg.Name, w.ProgramID, w.DXCall, w.DXGrid, w.Mode, w.FreqHz, len(w.LoggedADIF))
ev.DXCall = w.DXCall
@@ -241,7 +269,7 @@ func (s *Server) handle(pkt []byte, remote *net.UDPAddr) {
return
}
// Empty events are useless; skip.
if ev.DXCall == "" && ev.LoggedADIF == "" {
if ev.DXCall == "" && ev.LoggedADIF == "" && ev.DecodeCall == "" {
return
}
select {
+122 -5
View File
@@ -37,18 +37,27 @@ const (
)
// WSJTEvent is the parsed, typed result of decoding a single packet.
// One of (DXCall, LoggedADIF) is non-empty depending on the message.
// One of (DXCall, LoggedADIF, DecodeCall) is non-empty depending on the message.
type WSJTEvent struct {
DXCall string // current "DX Call" field in the WSJT app
DXGrid string // optional grid for that call
DXCall string // current "DX Call" field in the WSJT app (Status)
DXGrid string // optional grid for that call (Status)
Mode string // FT8 / FT4 / …
FreqHz int64 // current dial freq when available
FreqHz int64 // current dial freq when available (Status)
LoggedADIF string // full ADIF text when message is LoggedADIF
ProgramID string // "WSJT-X" / "JTDX" / "MSHV" — for diagnostics / dedup
// Decode (type 2): the transmitting station heard on the band. FreqHz is NOT
// set here (Decode carries only the audio offset); the caller adds the last
// known dial frequency (from Status) to DeltaFreqHz to get the RF frequency.
IsDecode bool
DecodeCall string // the sender (DE) callsign extracted from the message text
DeltaFreqHz int64 // audio offset within the passband (Hz)
SNR int // reported signal-to-noise (dB)
IsCQ bool // the decode was a CQ call
}
// ParseWSJT decodes one UDP packet. Returns ok=false for messages we
// don't care about (heartbeat, decode lines, clears, etc.).
// don't care about (heartbeat, clears, etc.).
func ParseWSJT(pkt []byte) (WSJTEvent, bool, error) {
if len(pkt) < 12 {
return WSJTEvent{}, false, fmt.Errorf("packet too short")
@@ -143,6 +152,56 @@ func ParseWSJT(pkt []byte) (WSJTEvent, bool, error) {
ev.DXGrid = strings.ToUpper(strings.TrimSpace(dxGrid))
return ev, true, nil
case wsjtMsgDecode:
// Decode payload (v2):
// bool is_new
// quint32 time (ms since midnight)
// qint32 snr
// double delta_time (seconds)
// quint32 delta_frequency (Hz, audio offset in the passband)
// QUtf8 mode
// QUtf8 message (the decoded text, e.g. "CQ K1ABC FN42")
// bool low_confidence
// bool off_air
var b uint8
if err := binary.Read(r, binary.BigEndian, &b); err != nil { // is_new
return WSJTEvent{}, false, err
}
var t32, df uint32
var snr int32
if err := binary.Read(r, binary.BigEndian, &t32); err != nil { // time
return WSJTEvent{}, false, err
}
if err := binary.Read(r, binary.BigEndian, &snr); err != nil {
return WSJTEvent{}, false, err
}
var dt float64
if err := binary.Read(r, binary.BigEndian, &dt); err != nil { // delta_time
return WSJTEvent{}, false, err
}
if err := binary.Read(r, binary.BigEndian, &df); err != nil { // delta_frequency
return WSJTEvent{}, false, err
}
mode, err := readQString(r)
if err != nil {
return WSJTEvent{}, false, err
}
msg, err := readQString(r)
if err != nil {
return WSJTEvent{}, false, err
}
call, isCQ := wsjtSender(msg)
if call == "" {
return WSJTEvent{}, false, nil // free-text / telemetry / unparseable → ignore
}
ev.IsDecode = true
ev.DecodeCall = call
ev.IsCQ = isCQ
ev.DeltaFreqHz = int64(df)
ev.SNR = int(snr)
ev.Mode = strings.ToUpper(strings.TrimSpace(mode))
return ev, true, nil
case wsjtMsgLoggedADIF:
// Payload: a single QString containing the ADIF record.
adif, err := readQString(r)
@@ -155,6 +214,64 @@ func ParseWSJT(pkt []byte) (WSJTEvent, bool, error) {
return WSJTEvent{}, false, nil
}
// wsjtSender extracts the transmitting (DE) callsign from a WSJT-X message and
// whether it was a CQ. Grammar:
//
// CQ [modifier] <de_call> [grid] → de_call, isCQ=true
// <to_call> <de_call> [report|…] → de_call, isCQ=false
//
// Returns "" for free-text / telemetry / hashed-call messages we can't resolve.
func wsjtSender(message string) (call string, isCQ bool) {
f := strings.Fields(strings.ToUpper(strings.TrimSpace(message)))
if len(f) == 0 {
return "", false
}
if f[0] == "CQ" {
// 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).
idx := 1
if len(f) > 2 && !looksLikeCall(f[1]) {
idx = 2
}
if idx < len(f) && looksLikeCall(f[idx]) {
return f[idx], true
}
return "", true
}
// Standard exchange: the DE (sender) call is the second token.
if len(f) >= 2 && looksLikeCall(f[1]) {
return f[1], false
}
return "", false
}
// looksLikeCall is a loose callsign test: 312 chars of AZ/09//, with at least
// one letter AND one digit. Rejects the fixed exchange tokens (RR73/RRR/73) that
// would otherwise pass.
func looksLikeCall(s string) bool {
switch s {
case "RR73", "RRR", "73":
return false
}
if len(s) < 3 || len(s) > 12 {
return false
}
hasL, hasD := false, false
for i := 0; i < len(s); i++ {
c := s[i]
switch {
case c >= 'A' && c <= 'Z':
hasL = true
case c >= '0' && c <= '9':
hasD = true
case c == '/':
default:
return false
}
}
return hasL && hasD
}
// readQString reads a Qt QString as written by QDataStream: an int32 byte
// length (or -1 for null) followed by the UTF-8 bytes.
func readQString(r *bytes.Reader) (string, error) {
@@ -0,0 +1,32 @@
package udp
import "testing"
func TestWSJTSender(t *testing.T) {
cases := []struct {
msg string
wantCall string
wantCQ bool
}{
{"CQ K1ABC FN42", "K1ABC", true},
{"CQ DX W2XYZ EM12", "W2XYZ", true}, // modifier "DX" skipped
{"CQ NA VE3ABC FN03", "VE3ABC", true}, // region modifier skipped
{"CQ 020 JA1XYZ PM95", "JA1XYZ", true},// zone modifier skipped
{"W2XYZ K1ABC -10", "K1ABC", false}, // exchange → sender is 2nd call
{"W2XYZ K1ABC R-10", "K1ABC", false},
{"W2XYZ K1ABC RR73", "K1ABC", false},
{"F4BPO K1ABC/P 73", "K1ABC/P", false},// portable call kept
{"CQ F/DL1ABC JO31", "F/DL1ABC", true},// compound prefix
// Non-callsign / free text → no sender.
{"TNX 73 GL", "", false},
{"K1ABC RR73", "", false}, // only one call + a token → 2nd token not a call
{"", "", false},
{"CQ CQ CQ", "", true}, // CQ but no resolvable call
}
for _, c := range cases {
call, cq := wsjtSender(c.msg)
if call != c.wantCall || cq != c.wantCQ {
t.Errorf("wsjtSender(%q) = (%q,%v), want (%q,%v)", c.msg, call, cq, c.wantCall, c.wantCQ)
}
}
}
+178
View File
@@ -0,0 +1,178 @@
// Package lotwusers tracks which callsigns are LoTW users and when they last
// uploaded, from ARRL's public "lotw-user-activity.csv" feed. OpsLog shows a
// colour-coded badge next to the entered callsign (recent upload = likely to
// confirm on LoTW). The list is cached on disk so it survives restarts.
package lotwusers
import (
"bufio"
"bytes"
"context"
"fmt"
"io"
"net/http"
"os"
"path/filepath"
"strings"
"sync"
"time"
)
// feedURL is ARRL's public LoTW last-upload activity list (CSV:
// "CALLSIGN,YYYY-MM-DD,HH:MM:SS", one line per registered LoTW callsign).
const feedURL = "https://lotw.arrl.org/lotw-user-activity.csv"
const cacheFile = "lotw-user-activity.csv"
// Info is a lookup result for one callsign.
type Info struct {
IsUser bool `json:"is_user"`
LastUpload string `json:"last_upload,omitempty"` // YYYY-MM-DD
DaysAgo int `json:"days_ago"` // days since last upload (-1 if unknown)
}
// Manager holds the parsed list + cache location.
type Manager struct {
mu sync.RWMutex
users map[string]time.Time // UPPER(callsign) → last-upload date (UTC)
updated time.Time // when the cache was last refreshed
dir string
client *http.Client
}
// NewManager loads any on-disk cache and returns a ready manager.
func NewManager(dataDir string) *Manager {
m := &Manager{
users: map[string]time.Time{},
dir: dataDir,
client: &http.Client{Timeout: 90 * time.Second},
}
m.loadCache()
return m
}
func (m *Manager) path() string { return filepath.Join(m.dir, cacheFile) }
func (m *Manager) loadCache() {
data, err := os.ReadFile(m.path())
if err != nil {
return
}
m.parse(data)
if fi, e := os.Stat(m.path()); e == nil {
m.mu.Lock()
m.updated = fi.ModTime()
m.mu.Unlock()
}
}
// Download fetches the latest list, caches it to disk and replaces the in-memory
// map. Returns the number of callsigns loaded.
func (m *Manager) Download(ctx context.Context) (int, error) {
req, err := http.NewRequestWithContext(ctx, http.MethodGet, feedURL, nil)
if err != nil {
return 0, err
}
req.Header.Set("User-Agent", "OpsLog")
resp, err := m.client.Do(req)
if err != nil {
return 0, fmt.Errorf("lotwusers: request failed: %w", err)
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return 0, fmt.Errorf("lotwusers: http %d", resp.StatusCode)
}
body, err := io.ReadAll(io.LimitReader(resp.Body, 64*1024*1024))
if err != nil {
return 0, fmt.Errorf("lotwusers: read: %w", err)
}
n := m.parse(body)
if n == 0 {
return 0, fmt.Errorf("lotwusers: feed parsed to 0 callsigns")
}
_ = os.WriteFile(m.path(), body, 0o644) // best-effort cache
m.mu.Lock()
m.updated = time.Now()
m.mu.Unlock()
return n, nil
}
// parse loads the CSV bytes into the map and returns the count.
func (m *Manager) parse(data []byte) int {
users := make(map[string]time.Time, 1<<20)
sc := bufio.NewScanner(bytes.NewReader(data))
sc.Buffer(make([]byte, 1024*1024), 1024*1024)
for sc.Scan() {
line := strings.TrimSpace(sc.Text())
if line == "" {
continue
}
parts := strings.Split(line, ",")
if len(parts) < 2 {
continue
}
call := strings.ToUpper(strings.TrimSpace(parts[0]))
if call == "" || strings.EqualFold(call, "callsign") {
continue // header row
}
t, err := time.Parse("2006-01-02", strings.TrimSpace(parts[1]))
if err != nil {
continue
}
users[call] = t
}
if len(users) == 0 {
return 0
}
m.mu.Lock()
m.users = users
m.mu.Unlock()
return len(users)
}
// Lookup reports whether callsign is a LoTW user and how long ago it uploaded.
// Tries the exact call, then (for portable calls like "EA8/DL1ABC" or "F5ABC/P")
// the longest slash-separated segment — the base call LoTW is keyed on.
func (m *Manager) Lookup(callsign string) Info {
c := strings.ToUpper(strings.TrimSpace(callsign))
if c == "" {
return Info{DaysAgo: -1}
}
m.mu.RLock()
defer m.mu.RUnlock()
if len(m.users) == 0 {
return Info{DaysAgo: -1}
}
t, ok := m.users[c]
if !ok && strings.Contains(c, "/") {
base := ""
for _, seg := range strings.Split(c, "/") {
if len(seg) > len(base) {
base = seg
}
}
t, ok = m.users[base]
}
if !ok {
return Info{DaysAgo: -1}
}
days := int(time.Since(t).Hours() / 24)
if days < 0 {
days = 0
}
return Info{IsUser: true, LastUpload: t.Format("2006-01-02"), DaysAgo: days}
}
// Count returns how many callsigns are loaded.
func (m *Manager) Count() int {
m.mu.RLock()
defer m.mu.RUnlock()
return len(m.users)
}
// Updated returns when the list was last refreshed (zero if never).
func (m *Manager) Updated() time.Time {
m.mu.RLock()
defer m.mu.RUnlock()
return m.updated
}
+49
View File
@@ -0,0 +1,49 @@
package qso
import (
"testing"
"time"
)
func tm(s string) time.Time {
t, _ := time.Parse("2006-01-02T15:04", s)
return t
}
func TestMatchIndexWindowAndMode(t *testing.T) {
idx := &MatchIndex{byMode: map[string][]matchRef{}}
// Local log: a CW QSO, an SSB (logged as USB) QSO, and an FT8 QSO.
idx.Add("4Z4DX", "15m", "CW", tm("2026-06-20T10:13"), 1)
idx.Add("V85NPV", "15m", "USB", tm("2025-04-18T17:01"), 2)
idx.Add("DK0SWL", "20m", "FT8", tm("2026-03-01T09:00"), 3)
win := 10 * time.Minute
cases := []struct {
name string
call, band, mode string
when string
wantID int64
wantOK bool
}{
{"exact", "4Z4DX", "15m", "CW", "2026-06-20T10:13", 1, true},
{"1-min drift", "4Z4DX", "15m", "CW", "2026-06-20T10:12", 1, true},
{"9-min drift ok", "4Z4DX", "15m", "CW", "2026-06-20T10:04", 1, true},
{"30-min drift misses", "4Z4DX", "15m", "CW", "2026-06-20T10:43", 0, false},
// Phone sidebands are interchangeable: an SSB confirmation matches a USB log.
{"SSB conf vs USB log", "V85NPV", "15m", "SSB", "2025-04-18T17:00", 2, true},
{"LSB conf vs USB log", "V85NPV", "15m", "LSB", "2025-04-18T17:00", 2, true},
// But a digital/phone mismatch does NOT match (exact for non-phone).
{"FT8 conf vs SSB log misses", "V85NPV", "15m", "FT8", "2025-04-18T17:00", 0, false},
// Digital is exact: FT8 matches FT8, but FT4 would not.
{"FT8 exact", "DK0SWL", "20m", "FT8", "2026-03-01T09:01", 3, true},
{"FT4 vs FT8 misses", "DK0SWL", "20m", "FT4", "2026-03-01T09:01", 0, false},
{"wrong band misses", "DK0SWL", "40m", "FT8", "2026-03-01T09:01", 0, false},
{"unknown call misses", "N0CALL", "15m", "CW", "2026-06-20T10:13", 0, false},
}
for _, c := range cases {
id, ok := idx.Match(c.call, c.band, c.mode, tm(c.when), win)
if ok != c.wantOK || (ok && id != c.wantID) {
t.Errorf("%s: got (id=%d ok=%v), want (id=%d ok=%v)", c.name, id, ok, c.wantID, c.wantOK)
}
}
}
+112
View File
@@ -490,6 +490,7 @@ type UploadRow struct {
// Manager may filter on (guards the dynamic column name in the query).
var uploadStatusCols = map[string]bool{
"lotw_sent": true,
"eqsl_sent": true,
"qrzcom_qso_upload_status": true,
"clublog_qso_upload_status": true,
"hrdlog_qso_upload_status": true,
@@ -1813,6 +1814,117 @@ func (r *Repo) DedupeKeyIDs(ctx context.Context) (map[string]int64, error) {
return out, rows.Err()
}
// matchRef is one local QSO's time + id, for time-window confirmation matching.
type matchRef struct {
when time.Time
id int64
}
// MatchIndex matches a downloaded confirmation to a local QSO within a TIME
// WINDOW (not an exact minute): QSL confirmations carry the OTHER station's
// logged time, which drifts a minute or two from ours. The MODE must match, with
// ONE equivalence: the phone modes SSB/USB/LSB are interchangeable (a station may
// confirm USB where we logged SSB). Every other mode is exact (FT8 only matches
// FT8, FT4 only FT4, CW only CW…). Built in one table scan.
type MatchIndex struct {
byMode map[string][]matchRef // call|band|canonMode → refs
}
// canonMode folds the phone sidebands into a single "SSB" bucket; every other
// mode is returned uppercased and unchanged (exact-match).
func canonMode(mode string) string {
m := strings.ToUpper(strings.TrimSpace(mode))
switch m {
case "SSB", "USB", "LSB":
return "SSB"
}
return m
}
func matchKeyMode(call, band, mode string) string {
return strings.ToUpper(call) + "|" + strings.ToLower(band) + "|" + canonMode(mode)
}
// parseQSODate reads the stored qso_date (ISO "2006-01-02T15:04[:05…]") to minute
// precision as UTC. Zero time on failure (never matched).
func parseQSODate(s string) time.Time {
if len(s) >= 16 {
if t, err := time.Parse("2006-01-02T15:04", s[:16]); err == nil {
return t
}
}
return time.Time{}
}
// BuildMatchIndex scans the log once and indexes every QSO by call+band(+mode)
// with its time, for windowed confirmation matching. When ownerCall is non-empty
// the index is SCOPED to QSOs whose station_callsign is that call (or blank —
// legacy QSOs that predate station-callsign stamping), so a confirmation download
// for one of the operator's calls (e.g. F4BPO) never touches QSOs logged under
// another (e.g. TM2Q).
func (r *Repo) BuildMatchIndex(ctx context.Context, ownerCall string) (*MatchIndex, error) {
idx := &MatchIndex{byMode: map[string][]matchRef{}}
query := `SELECT id, callsign, qso_date, band, mode FROM qso`
var args []any
if oc := strings.ToUpper(strings.TrimSpace(ownerCall)); oc != "" {
query += ` WHERE UPPER(TRIM(COALESCE(station_callsign,''))) IN ('', ?)`
args = append(args, oc)
}
rows, err := r.db.QueryContext(ctx, query, args...)
if err != nil {
return idx, err
}
defer rows.Close()
for rows.Next() {
var id int64
var call, when, band, mode string
if err := rows.Scan(&id, &call, &when, &band, &mode); err != nil {
return idx, err
}
idx.add(call, band, mode, parseQSODate(when), id)
}
return idx, rows.Err()
}
// add inserts a QSO into the index (also used to register a freshly-inserted
// "add not-found" QSO so later confirmations in the same batch can match it).
func (idx *MatchIndex) add(call, band, mode string, when time.Time, id int64) {
mk := matchKeyMode(call, band, mode)
idx.byMode[mk] = append(idx.byMode[mk], matchRef{when: when, id: id})
}
// Add registers a QSO in the index (exported wrapper for callers that inserted a
// not-found confirmation).
func (idx *MatchIndex) Add(call, band, mode string, when time.Time, id int64) {
idx.add(call, band, mode, when, id)
}
// Match returns the id of the local QSO closest in time to `when` (within
// `window`) for the given call/band/mode. The mode must match (phone sidebands
// folded together by canonMode). Ok is false when nothing is within the window.
func (idx *MatchIndex) Match(call, band, mode string, when time.Time, window time.Duration) (int64, bool) {
return closestRef(idx.byMode[matchKeyMode(call, band, mode)], when, window)
}
func closestRef(refs []matchRef, when time.Time, window time.Duration) (int64, bool) {
var best int64
bestD := window + time.Second
found := false
for _, rf := range refs {
if rf.when.IsZero() {
continue
}
d := when.Sub(rf.when)
if d < 0 {
d = -d
}
if d <= window && d < bestD {
bestD, best, found = d, rf.id, true
}
}
return best, found
}
// ConfirmedSets captures which DXCC / band / slot combinations are already
// confirmed (by any QSL system), so a freshly-downloaded confirmation can be
// flagged as a NEW DXCC / NEW BAND / NEW SLOT.
+178
View File
@@ -0,0 +1,178 @@
// Package solar fetches live space-weather / propagation numbers (solar flux,
// sunspot number, A/K indices, X-ray, geomagnetic field) from N0NBH's public
// hamqsl.com XML feed, caches them, and refreshes periodically. OpsLog shows the
// numbers in a header strip and stamps SFI / A_INDEX / K_INDEX onto each logged
// QSO (SSN has no standard ADIF field — the app stores it as an extra).
package solar
import (
"context"
"encoding/xml"
"fmt"
"io"
"net/http"
"strings"
"sync"
"time"
)
// feedURL is N0NBH's solar data as XML. Free, no key.
const feedURL = "https://www.hamqsl.com/solarxml.php"
// Data is the parsed snapshot exposed to the UI (strings — some fields read
// "No Report" or carry units, so we keep them verbatim and parse to numbers only
// when stamping a QSO).
type Data struct {
SFI string `json:"sfi"` // solar flux index
SSN string `json:"ssn"` // sunspot number
AIndex string `json:"a_index"` // geomagnetic A index
KIndex string `json:"k_index"` // geomagnetic K index
XRay string `json:"xray"` // X-ray flux class (e.g. C1.5)
GeomagField string `json:"geomag_field"` // QUIET / UNSETTLED / STORM…
Aurora string `json:"aurora"`
MUF string `json:"muf"`
Updated string `json:"updated"` // source timestamp text
Source string `json:"source"` // e.g. N0NBH
OK bool `json:"ok"` // last fetch succeeded
Error string `json:"error,omitempty"`
FetchedAt time.Time `json:"fetched_at"`
}
// xmlSolar mirrors the hamqsl solarxml.php document.
type xmlSolar struct {
XMLName xml.Name `xml:"solar"`
SolarData struct {
Source string `xml:"source"`
Updated string `xml:"updated"`
SolarFlux string `xml:"solarflux"`
AIndex string `xml:"aindex"`
KIndex string `xml:"kindex"`
XRay string `xml:"xray"`
Sunspots string `xml:"sunspots"`
Aurora string `xml:"aurora"`
GeomagField string `xml:"geomagfield"`
MUF string `xml:"muf"`
} `xml:"solardata"`
}
// Fetch performs one GET + parse of the feed.
func Fetch(ctx context.Context, client *http.Client) (Data, error) {
if client == nil {
client = &http.Client{Timeout: 20 * time.Second}
}
req, err := http.NewRequestWithContext(ctx, http.MethodGet, feedURL, nil)
if err != nil {
return Data{}, err
}
req.Header.Set("User-Agent", "OpsLog")
resp, err := client.Do(req)
if err != nil {
return Data{}, fmt.Errorf("solar: request failed: %w", err)
}
defer resp.Body.Close()
body, err := io.ReadAll(io.LimitReader(resp.Body, 1<<20))
if err != nil {
return Data{}, fmt.Errorf("solar: read: %w", err)
}
if resp.StatusCode != http.StatusOK {
return Data{}, fmt.Errorf("solar: http %d", resp.StatusCode)
}
return parseSolar(body)
}
// parseSolar turns the feed's XML bytes into a Data (split out so it can be
// unit-tested without a network call).
func parseSolar(body []byte) (Data, error) {
var x xmlSolar
if err := xml.Unmarshal(body, &x); err != nil {
return Data{}, fmt.Errorf("solar: parse: %w", err)
}
s := x.SolarData
return Data{
SFI: strings.TrimSpace(s.SolarFlux),
SSN: strings.TrimSpace(s.Sunspots),
AIndex: strings.TrimSpace(s.AIndex),
KIndex: strings.TrimSpace(s.KIndex),
XRay: strings.TrimSpace(s.XRay),
GeomagField: strings.TrimSpace(s.GeomagField),
Aurora: strings.TrimSpace(s.Aurora),
MUF: strings.TrimSpace(s.MUF),
Updated: strings.TrimSpace(s.Updated),
Source: strings.TrimSpace(s.Source),
OK: true,
FetchedAt: time.Now(),
}, nil
}
// Manager caches the latest Data and refreshes it on a timer.
type Manager struct {
mu sync.RWMutex
data Data
client *http.Client
onChange func()
stop chan struct{}
once sync.Once
}
// NewManager builds a manager. onChange (optional) fires after each refresh so
// the host can push a UI event.
func NewManager(onChange func()) *Manager {
return &Manager{
client: &http.Client{Timeout: 20 * time.Second},
onChange: onChange,
stop: make(chan struct{}),
}
}
// Start fetches now and every hour until Stop (the feed updates roughly hourly).
func (m *Manager) Start() {
go func() {
m.refresh()
t := time.NewTicker(1 * time.Hour)
defer t.Stop()
for {
select {
case <-m.stop:
return
case <-t.C:
m.refresh()
}
}
}()
}
// Stop ends the refresh loop.
func (m *Manager) Stop() {
if m == nil {
return
}
m.once.Do(func() { close(m.stop) })
}
// Get returns the latest snapshot.
func (m *Manager) Get() Data {
if m == nil {
return Data{}
}
m.mu.RLock()
defer m.mu.RUnlock()
return m.data
}
// Refresh forces an immediate fetch (used by a manual "refresh" binding).
func (m *Manager) Refresh() { m.refresh() }
func (m *Manager) refresh() {
d, err := Fetch(context.Background(), m.client)
m.mu.Lock()
if err != nil {
m.data.OK = false
m.data.Error = err.Error()
} else {
m.data = d
}
m.mu.Unlock()
if m.onChange != nil {
m.onChange()
}
}
+48
View File
@@ -0,0 +1,48 @@
package solar
import "testing"
// A trimmed sample of the real N0NBH hamqsl.com solarxml.php document.
const sampleXML = `<?xml version="1.0"?>
<solar>
<solardata>
<source url="http://www.hamqsl.com/solar.html">N0NBH</source>
<updated>08 Jul 2025 2100 GMT</updated>
<solarflux>170</solarflux>
<aindex>5</aindex>
<kindex>2</kindex>
<xray>C1.5</xray>
<sunspots>150</sunspots>
<geomagfield>QUIET</geomagfield>
<muf>18.5</muf>
</solardata>
</solar>`
func TestParseSolar(t *testing.T) {
d, err := parseSolar([]byte(sampleXML))
if err != nil {
t.Fatalf("parse: %v", err)
}
if !d.OK {
t.Fatalf("expected OK")
}
checks := map[string]string{
"SFI": d.SFI, "SSN": d.SSN, "A": d.AIndex, "K": d.KIndex,
"XRay": d.XRay, "Geomag": d.GeomagField, "Source": d.Source,
}
want := map[string]string{
"SFI": "170", "SSN": "150", "A": "5", "K": "2",
"XRay": "C1.5", "Geomag": "QUIET", "Source": "N0NBH",
}
for k, got := range checks {
if got != want[k] {
t.Errorf("%s = %q, want %q", k, got, want[k])
}
}
}
func TestParseSolarBadXML(t *testing.T) {
if _, err := parseSolar([]byte("not xml")); err == nil {
t.Fatalf("expected an error for non-XML input")
}
}
+1 -1
View File
@@ -21,7 +21,7 @@ import (
const (
// appVersion is stamped on every heartbeat (and could feed the About box).
appVersion = "0.19.2"
appVersion = "0.19.4"
// posthogHost is the PostHog ingestion endpoint. EU cloud by default; change
// to https://us.i.posthog.com for a US project.
+63 -15
View File
@@ -11,28 +11,76 @@ mode.
## How matching works
An award scans a **QSO field** for a reference, by one of:
An award scans a **QSO field** (state, QTH, address, notes, …) for a reference,
using one **Match by** mode:
- **code** — the field value is the reference (e.g. state = `NY`).
- **description** — the reference's name appears in the field (substring, case-
insensitive but **space-sensitive** — "Hongkong" won't match "Hong Kong").
- **pattern**a per-reference regex is tested against the field.
- **code** — the field value *is* the reference (e.g. state = `NY`).
- **description** — the reference's **name** appears in the field (substring,
space-sensitive — "Hongkong" won't match "Hong Kong").
- **pattern**the field is tested against a regex.
Plus **OR rules** (also match if any of these hit), a **leading/trailing** strip,
a **prefix** added to found references, and a **dynamic** mode (any value counts,
like POTA).
Plus a **leading/trailing** strip, a **prefix** prepended to found references, a
**dynamic** mode (any value counts, like POTA), and the **fallback searches**
described below.
> **Tip — Hong Kong / Macau style mismatches:** if the data says "Hong Kong" but
> the reference description is "Hongkong", either fix the description to match, or
> set that OR-search's *Match by* to **pattern** so the reference's own regex
> (e.g. `\bHong Kong\b`) is used. In *description* mode the per-reference pattern
> is ignored.
### The five rules to remember
1. **Every regex is case-insensitive.** Award and per-reference patterns match
regardless of case (log fields are typed however the operator felt) — so
`\bTok[iy]o\b` catches `TOKYO`, `Tokyo` and even `TOKIO`. Set your own flag
group (e.g. `(?s)`) to override.
2. **A reference's own `Pattern` is opt-in extra recognition.** On the
*References* tab each reference has a **Pattern (regex)** field. Fill it to
recognise a reference by more than its name — spelling variants, or the
**cities/terms** that imply it. Leave it empty and the reference is matched by
name only. Example — Jiangsu (China) carries the cities in its own regex:
`\b(Jiangyin|Wuxi|Suzhou|Nanjing|Changzhou)\b`.
3. **`description` also runs the per-reference regexes** (on the same field).
A description search looks for the reference *name* **OR** fires each
reference's own Pattern — so a description award over the QTH/address will
auto-match your city regexes with no extra rule. (A reference with an empty
Pattern stays name-only.)
4. **OR rules are ordered fallbacks (first hit wins).** The **Fallback searches**
section adds extra searches tried **in order, only while nothing has matched
yet** — the first that finds a reference wins and the rest are skipped
(short-circuit, like a chain of *else-if*). So a province already resolved by
name isn't also re-tagged, possibly differently, by a later city regex.
5. **Scope is checked first — a manual reference does not bypass it.** DXCC
filter, valid bands / modes / emission and the valid-from/to dates gate every
QSO before any reference is looked at. A 17 m QSO can't count for an award
whose valid bands are 80/40/20/15/10 m, even if you assign the reference by
hand. Widen the award's bands if it *should* count.
> **Tip — Hong Kong / Macau style mismatches:** if the log says "Hong Kong" but
> the reference name is "Hongkong", either fix the name, or give that reference a
> **Pattern** like `\bHong ?Kong\b`. Thanks to rule 3 the pattern now works even
> for a *description* award — no separate rule needed.
### Worked example — Worked All Provinces of China (WAPC)
A custom province award where the log rarely spells the province out (it names a
*city*). The clean setup:
- **Primary:** *Search in* **QTH**, *Match by* **description**.
- **Fallback search:** *Search in* **address**, *Match by* **description**.
- On the *References* tab, give each province a Pattern listing its cities.
Now a QSO is resolved by the province **name** if present, else by a **city**
regex — first in the QTH, then in the address. First hit wins.
## Live detection & manual refs
- References are detected **live** as you enter a callsign.
- You can **manually assign** a reference to a QSO (stored in an ADIF extra so it
survives export/import — see [[Import and Export ADIF]]).
- You can **manually assign** a reference to a QSO (the *Award Refs* tab of the
QSO editor). It's stored in an ADIF extra (`APP_OPSLOG_AWARDREFS`) so it
survives export/import — see [[Import and Export ADIF]] — and is honoured
everywhere (award panel, grid columns, totals). For a list-backed award the
assigned reference must still be a **valid, listed** reference, and the QSO
must be **in scope** (rule 5) for it to count.
## Reference lists & display