Compare commits

...
20 Commits
Author SHA1 Message Date
rouggy 242a68080a chore: release v0.26.22 2026-08-28 17:33:35 +02:00
rouggy 8c7e1c1a3d fix(cluster): group duplicates by call AND band AND mode
The grouping keyed on the callsign alone, so every spot of a station outside the
first one's band and mode was dropped from the list. RI1FJL spotted on 17m CW,
20m, 30m, 12m and 15m FT8 showed as a single row: four slots gone from the one
view an operator uses to find them.

A duplicate is the dozen skimmers that all heard the same CQ — same station,
same band, same mode. The same station on another band is the opposite of a
duplicate; it is what the chaser is scanning for.
2026-08-28 16:25:06 +02:00
rouggy 47ddbed665 fix(tci): send the spot colour as an unsigned ARGB integer
Expert Electronics' own document gives the command whole:

    SPOT:RN6LHF,CW,7100000,16711680,ANY_TEXT;

16711680 is 0x00FF0000 — positive. This backend sent the same field as a SIGNED
32-bit value, from a third-party example: with the alpha byte set to FF for
opacity, 0xFFFFA500 becomes -22336, and a spot whose colour ExpertSDR cannot
read is dropped without a reply or an error.

Reported on ExpertSDR3 1.3, which speaks TCI 2.x — the protocol version was
never the problem, and my first reading of that report was wrong.

The first three spots are now logged verbatim: an ignored spot leaves no trace
whatsoever, so that line is the only evidence of what went out.
2026-08-28 16:23:32 +02:00
rouggy fd7ae77a61 fix(tci): subscribe to the radio's meters; fix the new-spot count; explain an SMTP refusal
TCI meters: the S-meter came only from RX_SMETER and the transmit meters from
TX_POWER / TX_SWR — commands ExpertSDR3 does not send. The protocol's answer is
a subscription (RX_SENSORS_ENABLE / TX_SENSORS_ENABLE, §4.4 of the TCI PDF),
after which the radio pushes RX_CHANNEL_SENSORS and TX_SENSORS. Nobody had
asked, so the console's meters sat empty in RX and in TX while everything else
worked.

Cluster: the held-spot counter looked for the row it froze on. A station spotted
again REPLACES its row, so that row vanishes in the ordinary course of things
and the count fell through to 'everything is new' — 4, 5, then 500. Counted by
timestamp now, which survives both the replacement and the ring buffer.

SMTP: '535 5.7.139 basic authentication is disabled' is a policy, not a typo.
The message now says so, and says what actually helps, without claiming a policy
when the server simply rejected the password.
2026-08-28 15:29:44 +02:00
rouggy 3e794f57e0 perf(cluster): widen the spot batching window with the rate of the feed
Every flush commits state the whole window re-renders on, and the window was a
flat 50 ms — twenty full renders a second under an RBN firehose. That is paid
everywhere else in the interface, and it is what a dropdown highlighting its
entries a beat behind the mouse actually is.

The window now follows the rate: 50 ms on a quiet cluster, where a spot should
appear the moment it arrives; 200 ms past five a second; 500 ms past twenty,
where half a second's delay on a line already scrolling past is invisible.
2026-08-28 15:06:08 +02:00
rouggy 30f74583ff style(cluster): one header row in the docked pane
The pane drew its own title bar above the grid's toolbar, so the cluster spent
two lines on headers where Recent QSOs beside it spent one — in a pane often
only a few spots tall. The grid's toolbar now takes what the caller wants on its
left, and the pane passes its title, live count and Filters button there.
Reported by VK4DX.
2026-08-28 13:15:41 +02:00
rouggy f7b9aa2181 fix(lotw): show TQSL's account of a refused upload, not just the error
UploadLoTW returns both a terse error ('no QSOs processed') and a Message
carrying TQSL's own lines — '17 QSO records were already uploaded', 'N QSO
records are out of date range'. The caller took the error whenever there was
one, which is precisely the half that explains nothing: the operator saw a red
line naming a condition with three unrelated causes and no way to tell which.
2026-08-28 13:10:09 +02:00
rouggy 766b0f95a4 feat(tci): key CW through the radio's own macro keyer
The sixth CW engine, and the one the TCI backend was left without. A SunSDR
keys from the WebSocket that already carries the CAT: no WinKeyer, no second
serial port, nothing to wire.

    CW_MACROS:0,<text>;     send
    CW_MACROS_SPEED:<wpm>;  speed
    CW_MACROS_STOP;         abort

Confirmed against the TCI command table in ars-ka0s/eesdr-tci — the source that
settled SPOT. CW_MACROS rather than TCI 2.0's CW_MSG: it exists from 1.6, and
OpsLog resolves its own variables, so the before/after callsign fields have
nothing to carry.

Commas and semicolons are stripped before sending. They are the protocol's own
separators: a comma would become another argument, a semicolon would end the
command with the message half keyed and the rest parsed as a command.

Only the MACRO speed is set, not the paddle keyer's — an operator who set their
paddle to 28 wpm did not ask for it to change because a macro went out at 25.
And there is no backspace: TCI can stop a message but cannot un-type one, so the
type-ahead correction the Flex engine offers is absent rather than faked.
2026-08-28 13:01:55 +02:00
rouggy 8bc4ed68d4 fix(window): place the window in absolute desktop coordinates
Wails saves and restores in two different coordinate systems. WindowGetPosition
returns GetWindowRect — absolute. WindowSetPosition is winc's ControlBase.SetPos,
which adds the CURRENT monitor's work-area origin:

    w32.SetWindowPos(hwnd, HWND_TOP, int(info.RcWork.Left)+x, ...)

On the primary monitor that origin is 0 and nothing shows. With a monitor to the
LEFT it compounds: a station with its left screen at x=-3840 saved -3844,
reopened there, had -3840 added, and stored -7684 — then -11524, one screen
further out at every launch, until the window was off the desktop entirely.

So the placement is done here, with SetWindowPos and no offset, falling back to
the toolkit when the handle cannot be found. Compact mode had the same pairing
and is fixed with it.
2026-08-28 12:48:03 +02:00
rouggy d534825e92 fix(tci): pick the sideband from the frequency just commanded
Clicking a spot sets the frequency, then the mode 150 ms later, and SetMode
chose USB or LSB from t.freqA — the frequency the radio had ECHOED. From 7 MHz
onto a 14 MHz spot that echo has often not landed, so the sideband was computed
for the band being left: LSB on 20 m. Clicking the same spot again, the echo
having arrived, gave USB. Reported from a SunSDR as 'the frequency is right, the
mode is wrong until I click twice'.

SetFrequency now records what was asked for and SetMode prefers it until the
radio's own echo confirms the move.

The server's 'protocol:' announcement is also kept instead of being filed under
unhandled: it names the ExpertSDR and its TCI version, and panorama spots need
TCI 1.5 — older servers accept the spot commands and silently drop them, which
is indistinguishable from a broken logger. Now it says so.
2026-08-28 12:42:05 +02:00
rouggy 08d6492df1 fix(bandmap): say WHOSE 'Worked' it is — the entity's, not the callsign's
The status comes from spotEntityStatus: it means the country has been worked on
this band and mode. The label said 'Worked (this band + mode already in log)',
which reads as 'I have had this station' — so a spot the cluster called NEW PFX
looked like a contradiction, when the two were answering different questions
about different subjects.

The callsign-level fact has its own marker and its own words ('Callsign already
worked'), so the two are now told apart by reading them.
2026-08-28 12:22:23 +02:00
rouggy a156b6ad10 fix(bandmap): the two tooltip labels the previous commit left out
Without them t() was handed undefined for a new prefix or grid, so the tooltip
would have shown an empty segment — the opposite of naming the fact.
2026-08-28 12:17:59 +02:00
rouggy 3bb92f79b2 fix(bandmap): name the new prefix and new grid in the tooltip
The strip deliberately shows three markers of five — the pill is 22 px and a
fourth segment makes it a colour code nobody reads. But the tooltip has room and
was filtering them out too, so the same spot read NEW PFX in the cluster and
'Worked (this band + mode already in log)' on the map. Both were true: the
entity is worked on that slot and the WPX prefix never has been. Neither view
said so.
2026-08-28 12:17:09 +02:00
rouggy 65cae0d822 perf(lotw): stop asking for the QSL details by default
A tester compared LogHX's two download options on the same account: two minutes
for the confirmations, twenty for the confirmations with QSO details. OpsLog was
always sending qso_qsldetail=yes — LogHX's slow option — which is the whole of
the wait people were reporting.

Marking a confirmation needs call, date, band and mode; the detail adds the QSL
date and the station's grid, state and county. Now a choice, off by default, and
forced on when the download is also ADDING the QSOs it cannot find — the one
case where those fields have no other source.
2026-08-28 08:54:42 +02:00
rouggy b24f880d62 chore: release v0.26.21 2026-08-28 08:48:14 +02:00
rouggy ef71ddb648 docs(changelog): open 0.26.21 with the entries written after the release
Miles and the LoTW download progress landed after v0.26.20 was tagged, so they
belonged to the next block: an entry appended to a shipped one never reaches the
operators who installed it, and misstates what that version contained. The .20
block is byte-identical to the tag again.
2026-08-28 08:47:00 +02:00
rouggy 0143a84cee fix(lotw): stop the heartbeat when the report starts arriving
Deferred, it stopped at the end of the function — so 'still waiting for LoTW to
build the report' kept printing between the megabyte lines, saying the opposite
of what was happening.
2026-08-28 08:43:06 +02:00
rouggy 82721110ed fix(lotw): count out the wait before the first byte
The progress lines only start once bytes arrive, and on a large account nothing
arrives for minutes — LoTW builds the entire report before sending any of it.
That silence WAS the complaint: the window still just said 'working'.

A heartbeat every fifteen seconds until the headers land, then the HTTP status,
then the megabytes — the first at 256 KB rather than 1 MB, so the very first
sign that it is moving comes early.
2026-08-28 08:38:34 +02:00
rouggy aec363b152 fix(lotw): show the download moving, retry a busy server, fail a dead one
Three reports of the same shape: a 503 for anything wider than a few days
before, and since the timeout was raised, a window that sits at 'working'
forever. Both are the same missing thing — nothing said what the transfer was
doing.

The body is now read in chunks and every megabyte is reported. A 503/502/504 is
retried twice, 20 s then 40 s, each attempt announced: LoTW answers 'busy' to a
wide report often enough that other loggers simply ask again. And the deadline
is no longer on the whole exchange, which either cut off a healthy slow download
or hid a dead one for twenty minutes — it is ten minutes to START answering
(LoTW builds the whole report first) and two minutes of silence once it has,
which is the difference between slow and dead.
2026-08-28 08:29:26 +02:00
rouggy 9a21c936b1 feat(units): show distances in miles
Everything is computed in kilometres and converted once at display time, in
lib/units — storing miles anywhere would give the same number two sources of
truth and a rounding error that grows with every hop.

The grids capture the unit inside their column definitions, header and formatter
both, so a change is published to them the way the date format already is;
without that a toggle would only appear after a language change or a restart.
The preference is portable, like the other display ones.
2026-08-28 08:25:02 +02:00
28 changed files with 959 additions and 77 deletions
+86 -7
View File
@@ -402,6 +402,7 @@ const (
keyExtLoTWTQSLPath = "extsvc.lotw.tqsl_path"
keyExtLoTWStationLoc = "extsvc.lotw.station_location"
keyExtLoTWQSLDetail = "extsvc.lotw.qsl_detail" // ask LoTW for the QSL dates and station details (an order of magnitude slower)
keyExtLoTWAllCalls = "extsvc.lotw.download_all_calls" // download confirmations for EVERY call on the account, not just this profile's
keyExtLoTWForceCall = "extsvc.lotw.force_station_callsign" // override STATION_CALLSIGN at sign time (e.g. F4BPO/P on the F4BPO cert)
keyExtLoTWKeyPassword = "extsvc.lotw.key_password"
@@ -2123,6 +2124,21 @@ func (a *App) saveWindowState() {
// position — which options can't express — remains, and it is set here while the
// window is still hidden, so there is no visible jump. Nothing to do for a
// maximised or first-run window.
// moveWindowTo places the window at an ABSOLUTE desktop coordinate — the same
// coordinate system WindowGetPosition reports and window.json stores.
//
// Wails' WindowSetPosition is relative to the current monitor's work area (see
// windowpos_windows.go), so on a monitor left of the primary one it added that
// monitor's negative origin to an already-absolute value and the window walked
// one screen further off the desktop at every launch. Fall back to it only when
// we cannot place the window ourselves — on the primary monitor the two agree.
func (a *App) moveWindowTo(x, y int) {
if setWindowPosAbsolute(x, y) {
return
}
wruntime.WindowSetPosition(a.ctx, x, y)
}
func (a *App) restoreWindowPosition() {
if a.ctx == nil {
return
@@ -2150,7 +2166,7 @@ func (a *App) restoreWindowPosition() {
return
}
wruntime.WindowUnmaximise(a.ctx)
wruntime.WindowSetPosition(a.ctx, ws.X, ws.Y)
a.moveWindowTo(ws.X, ws.Y)
wruntime.WindowMaximise(a.ctx)
gx, gy := wruntime.WindowGetPosition(a.ctx)
applog.Printf("window: re-maximised at the saved corner — now at %d,%d", gx, gy)
@@ -2178,10 +2194,13 @@ func (a *App) restoreWindowPosition() {
}
applog.Printf("window: saved position %d,%d is off every monitor (%s) — moved to %d,%d",
ws.X, ws.Y, describeMonitors(monitorRects()), nx, ny)
wruntime.WindowSetPosition(a.ctx, nx, ny)
a.moveWindowTo(nx, ny)
return
}
wruntime.WindowSetPosition(a.ctx, ws.X, ws.Y)
a.moveWindowTo(ws.X, ws.Y)
if gx, gy := wruntime.WindowGetPosition(a.ctx); gx != ws.X || gy != ws.Y {
applog.Printf("window: asked for %d,%d and the window reports %d,%d", ws.X, ws.Y, gx, gy)
}
}
// onSomeMonitor reports whether a window at these coordinates would land on the
@@ -7233,7 +7252,9 @@ func (a *App) SetCompactMode(on bool) {
wruntime.WindowSetMinSize(a.ctx, normalMinW, normalMinH)
if a.preCompactValid {
wruntime.WindowSetSize(a.ctx, a.preCompactW, a.preCompactH)
wruntime.WindowSetPosition(a.ctx, a.preCompactX, a.preCompactY)
// Absolute, like the capture — see moveWindowTo. Leaving compact mode on a
// monitor left of the primary one moved the window a screen further out.
a.moveWindowTo(a.preCompactX, a.preCompactY)
if a.preCompactMax {
wruntime.WindowMaximise(a.ctx)
}
@@ -11305,11 +11326,19 @@ func (a *App) runManualUpload(svc extsvc.Service, ids []int64, cfg extsvc.Extern
}
res, err := extsvc.UploadLoTW(ctx, cfg.LoTW, "", strings.Join(recs, "\n"))
if err != nil || !res.OK {
msg := res.Message
if err != nil {
// The DETAIL wins over the error string. UploadLoTW returns both: a
// terse error ("no QSOs processed") and a Message carrying TQSL's own
// account of what happened to the contacts ("…already uploaded", "…out
// of date range"). Taking the error whenever there was one threw the
// answer away and showed the operator the half that explains nothing.
msg := strings.TrimSpace(res.Message)
if msg == "" && err != nil {
msg = err.Error()
} else if err != nil && !strings.Contains(msg, err.Error()) {
msg = msg + " (" + err.Error() + ")"
}
emit("LoTW upload failed: " + msg)
emit(" The station location OpsLog signs with must match the callsign on these contacts, and their dates must fall inside the certificate's validity — TQSL refuses the whole batch otherwise.")
// The qslmgr:log console is only visible in the QSL Manager — a failure
// triggered from the Recent QSOs right-click was completely silent, which
// read as "send to LoTW does nothing". Surface it as a toast too.
@@ -12097,6 +12126,16 @@ func manualRefFor(existing, code string) string {
return ""
}
// GetLoTWQSLDetail reports whether the download asks LoTW for the QSL detail.
func (a *App) GetLoTWQSLDetail() bool {
return a.settingOr(keyExtLoTWQSLDetail, "") == "1"
}
// SetLoTWQSLDetail stores that choice.
func (a *App) SetLoTWQSLDetail(on bool) {
a.setSetting(keyExtLoTWQSLDetail, map[bool]string{true: "1", false: "0"}[on])
}
// GetLoTWDownloadAllCalls reports whether the LoTW download ignores the
// profile's own call and pulls every callsign on the account.
func (a *App) GetLoTWDownloadAllCalls() bool {
@@ -12212,7 +12251,17 @@ func (a *App) runDownloadConfirmations(ctx context.Context, svc extsvc.Service,
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)
// The report arrives over minutes, and a window that says nothing while it
// does is indistinguishable from one that has hung — which is what it was
// being reported as. Every half-megabyte, say how much has landed.
// Adding the QSOs LoTW knows and we do not is the one job that needs the
// slow report: without the detail those records would come in with no
// grid, state or county, and nothing else would ever fill them.
detail := addNotFound || a.settingOr(keyExtLoTWQSLDetail, "") == "1"
if detail {
emit("Asking for the QSL details too — LoTW takes considerably longer to build that report.")
}
adifText, err := extsvc.DownloadLoTWConfirmations(ctx, nil, cfg.LoTW, sinceDate, ownCall, detail, emit)
if err != nil {
emit("Download failed: " + err.Error())
done(matched, total)
@@ -14578,6 +14627,36 @@ func (a *App) FlexBackspaceCW(n int) error {
return a.cat.FlexDo(func(fc cat.FlexController) error { return fc.BackspaceCW(n) })
}
// TCISendCW keys a CW message through the SunSDR's own macro keyer, so a TCI
// station needs no WinKeyer and no second serial port. Text is already
// variable-resolved by the UI.
func (a *App) TCISendCW(text string) error {
if a.cat == nil {
return fmt.Errorf("cat not initialized")
}
err := a.cat.TCICWDo(func(tc cat.TCICWController) error { return tc.SendCW(text) })
if err != nil {
applog.Printf("tci cw: TCISendCW(%q) failed: %v", text, err)
}
return err
}
// TCIStopCW aborts whatever the keyer is sending.
func (a *App) TCIStopCW() error {
if a.cat == nil {
return fmt.Errorf("cat not initialized")
}
return a.cat.TCICWDo(func(tc cat.TCICWController) error { return tc.StopCW() })
}
// TCISetKeySpeed sets the macro keyer speed in WPM.
func (a *App) TCISetKeySpeed(wpm int) error {
if a.cat == nil {
return fmt.Errorf("cat not initialized")
}
return a.cat.TCICWDo(func(tc cat.TCICWController) error { return tc.SetCWSpeed(wpm) })
}
// IcomStopCW aborts the CW message currently being sent.
func (a *App) IcomStopCW() error {
if a.cat == nil {
+46
View File
@@ -1,4 +1,50 @@
[
{
"version": "0.26.22",
"date": "",
"en": [
"LoTW download: the QSL details (QSL date, grid, state, county) are now optional and off by default — LoTW takes about ten times longer to build that report, twenty minutes against two on the same account, and marking a confirmation needs none of it. Still asked for automatically when adding the QSOs not found in the log.",
"Band map: the tooltip now also names a new prefix or a new grid square. They stay off the 22-pixel colour strip, but leaving them out of the text made the two panels look as though they disagreed — the cluster said NEW PFX about a spot the map called Worked, and both were right. The maps “Worked” also says whose: it is the ENTITY that was worked on that band and mode, not the callsign, which is what made the two readings look contradictory.",
"TCI (SunSDR): clicking a cluster spot no longer needs a second click to get the mode right — the sideband was chosen from the frequency the radio had last reported instead of the one just asked for. The log also names the ExpertSDR version now, and says so when it is older than the 1.5 that panorama spots need.",
"Two screens: OpsLog no longer walks off the desktop. On a monitor placed left of the primary one, the saved position was being added to that monitors own origin at every launch, so the window moved one screen further out each time until it was invisible.",
"CW over TCI: a SunSDR can now be keyed through its own macro keyer — pick TCI as the keyer engine (Settings → CW Keyer) and macros, auto-call and the speed control all work over the link already open, with no WinKeyer and no second serial port. NOT TESTED on the air yet.",
"LoTW upload: a refusal now shows TQSLs own explanation — which contacts were already uploaded, which fell outside the certificates dates — instead of the bare “no QSOs processed”, and names the two settings that cause it.",
"Main tab: the docked cluster now has ONE header row — its title, live count and Filters button sit with Clear filters and Columns, as Recent QSOs beside it already did. The pane is titled DX Cluster.",
"A busy cluster no longer makes the rest of the interface sluggish: incoming spots are grouped into fewer, larger updates as the feed gets faster (up to half a second), instead of redrawing the window twenty times a second. A quiet cluster still shows each spot as it lands.",
"SunSDR console: the meters work. The S-meter, transmit power and SWR are pushed by the radio only to a client that subscribes, and OpsLog never did — it was reading commands ExpertSDR3 does not send.",
"Cluster: the “N new spots” counter no longer jumps to the whole buffer. It was looking for the row it had frozen on, and a station spotted again replaces its row — so the count fell through to “everything is new”.",
"E-mail: a refused SMTP login now says what to do about it — Microsoft 365 and outlook.com have switched off password-based SMTP, and an app password does not bring it back.",
"TCI panorama spots: the colour was sent as a negative number and ExpertSDR dropped every spot in silence. It now goes out as the unsigned ARGB integer the protocol document uses, and the first few spots are written to the log verbatim.",
"Cluster: “Group duplicates” was hiding the same station on OTHER bands and modes — a DXpedition spotted on five bands showed as one line and four slots disappeared. A duplicate is now what it should always have been: the same station on the same band and mode."
],
"fr": [
"Téléchargement LoTW : les détails QSL (date du QSL, locator, état, comté) deviennent optionnels et désactivés par défaut — LoTW met environ dix fois plus longtemps à construire ce rapport, vingt minutes contre deux sur le même compte, et marquer une confirmation n'en a pas besoin. Toujours demandés automatiquement quand on ajoute les QSO absents du log.",
"Carte des bandes : l'infobulle indique aussi un nouveau préfixe ou un nouveau locator. Ils restent hors de la bande de couleur de 22 pixels, mais les omettre du texte donnait l'impression que les deux panneaux se contredisaient — le cluster annonçait NOUVEAU PFX pour un spot que la carte disait contacté, et les deux avaient raison. Le « Contacté » de la carte dit aussi de qui il parle : c'est l'ENTITÉ qui a été contactée sur cette bande et ce mode, pas l'indicatif — d'où l'impression de contradiction.",
"TCI (SunSDR) : cliquer un spot du cluster ne demande plus un second clic pour obtenir le bon mode — la bande latérale était choisie d'après la fréquence encore annoncée par la radio au lieu de celle qu'on venait de demander. Le journal indique aussi la version d'ExpertSDR, et signale si elle est antérieure à la 1.5 qu'exigent les spots sur le panorama.",
"Deux écrans : OpsLog ne s'échappe plus du bureau. Sur un écran placé à gauche de l'écran principal, la position enregistrée était ajoutée à l'origine de cet écran à chaque lancement, si bien que la fenêtre s'éloignait d'un écran à chaque fois jusqu'à devenir invisible.",
"CW en TCI : un SunSDR peut désormais être manipulé par son propre keyer à macros — choisissez TCI comme moteur (Réglages → Manipulateur CW) et les macros, l'appel automatique et le réglage de vitesse passent par la liaison déjà ouverte, sans WinKeyer ni second port série. PAS ENCORE TESTÉ sur l'air.",
"Envoi LoTW : un refus affiche désormais l'explication de TQSL — quels contacts étaient déjà envoyés, lesquels tombaient hors des dates du certificat — au lieu du seul « no QSOs processed », et nomme les deux réglages qui en sont la cause.",
"Onglet Main : le cluster ancré n'a plus qu'UNE ligne d'en-tête — son titre, le compteur live et le bouton Filtres rejoignent Effacer les filtres et Colonnes, comme le faisait déjà la liste des QSO récents à côté. Le panneau s'intitule DX Cluster.",
"Un cluster chargé ne ralentit plus le reste de l'interface : les spots entrants sont regroupés en mises à jour moins nombreuses à mesure que le flux s'accélère (jusqu'à une demi-seconde), au lieu de redessiner la fenêtre vingt fois par seconde. Sur un cluster calme, chaque spot s'affiche toujours dès son arrivée.",
"Console SunSDR : les mesures fonctionnent. Le S-mètre, la puissance et le ROS ne sont envoyés qu'à un client qui s'abonne, ce qu'OpsLog ne faisait pas — il lisait des commandes qu'ExpertSDR3 n'envoie pas.",
"Cluster : le compteur « N nouveaux spots » ne saute plus à la taille du tampon. Il cherchait la ligne sur laquelle il s'était figé, or une station re-spottée remplace sa ligne — le compte basculait donc sur « tout est nouveau ».",
"E-mail : un refus d'authentification SMTP explique désormais quoi faire — Microsoft 365 et outlook.com ont désactivé le SMTP par mot de passe, et un mot de passe d'application ne le rétablit pas.",
"Spots sur le panorama TCI : la couleur partait en nombre négatif et ExpertSDR écartait chaque spot en silence. Elle est désormais envoyée en entier ARGB non signé, comme dans la documentation du protocole, et les premiers spots sont écrits tels quels dans le journal.",
"Cluster : « Grouper les doublons » masquait la même station sur les AUTRES bandes et modes — une expédition spottée sur cinq bandes n'affichait qu'une ligne et quatre créneaux disparaissaient. Un doublon est désormais ce qu'il aurait toujours dû être : la même station sur la même bande et le même mode."
]
},
{
"version": "0.26.21",
"date": "",
"en": [
"Distances can be shown in miles (Settings → General): the cluster and Recent QSOs columns, the map path box, the rotator buttons and the band-opening list all follow, and the column headers name the unit.",
"LoTW download: the report is now counted in megabytes as it arrives, LoTWs \"busy\" answer (HTTP 503) is retried twice instead of failing, and a transfer that stops moving for two minutes says so rather than showing \"working\" indefinitely."
],
"fr": [
"Les distances peuvent s'afficher en miles (Réglages → Général) : les colonnes du cluster et des QSO récents, l'encart du tracé sur la carte, les boutons du rotor et la liste des ouvertures suivent, et l'unité est indiquée dans les en-têtes de colonne.",
"Téléchargement LoTW : le rapport est compté en mégaoctets au fur et à mesure, la réponse « occupé » de LoTW (HTTP 503) est retentée deux fois au lieu d'échouer, et un transfert qui n'avance plus pendant deux minutes le dit au lieu d'afficher « en cours » indéfiniment."
]
},
{
"version": "0.26.20",
"date": "",
+54 -17
View File
@@ -41,6 +41,7 @@ import {
IcomSendCW, YaesuSendCW, YaesuStopCW, SetYaesuKeySpeed, IcomStopCW, IcomSetKeySpeed, IcomSetBreakIn, GetIcomState,
KenwoodSendCW, KenwoodStopCW, SetKenwoodKeySpeed,
FlexSendCW, FlexStopCW, FlexSetKeySpeed, FlexBackspaceCW,
TCISendCW, TCIStopCW, TCISetKeySpeed,
GetDVKMessages, GetDVKStatus, DVKPlay, DVKStop,
StartCWDecoder, StopCWDecoder, SetCWDecoderPitch,
ChatAvailable, GetChatHistory, SendChatMessage, GetOnlineOperators,
@@ -57,6 +58,7 @@ import {
import { Combobox } from '@/components/ui/combobox';
import { applyAwardRefs, parseAwardRefs as parseManualRefs, spotRefList , withIOTARef, withRDARef } from '@/lib/awardRefs';
import { ListRadios, SetActiveRadio } from '../wailsjs/go/main/App';
import { formatDistance } from '@/lib/units';
import { EventsOn, BrowserOpenURL, WindowMinimise, WindowToggleMaximise, WindowIsMaximised, Quit } from '../wailsjs/runtime/runtime';
import type { adif as adifModels, lookup as lookupModels, cat as catModels } from '../wailsjs/go/models';
import type { QSOForm, WorkedBeforeView, StationSettingsForm, ListsSettingsForm, ModePresetForm } from '@/types';
@@ -1489,7 +1491,7 @@ export default function App() {
// CI-V 0x17 (no extra hardware — sends over the CAT connection). Macros,
// auto-call and <LOGQSO> are shared; only the transport differs.
const [wkEngine, setWkEngine] = useState<string>('winkeyer');
const cwSource: 'winkeyer' | 'icom' | 'flex' | 'yaesu' | 'kenwood' = wkEngine === 'icom' ? 'icom' : wkEngine === 'flex' ? 'flex' : wkEngine === 'yaesu' ? 'yaesu' : wkEngine === 'kenwood' ? 'kenwood' : 'winkeyer';
const cwSource: 'winkeyer' | 'icom' | 'flex' | 'yaesu' | 'kenwood' | 'tci' = wkEngine === 'icom' ? 'icom' : wkEngine === 'flex' ? 'flex' : wkEngine === 'yaesu' ? 'yaesu' : wkEngine === 'kenwood' ? 'kenwood' : wkEngine === 'tci' ? 'tci' : 'winkeyer';
// Setting the CW speed has to reach the keyer that is ACTUALLY sending, and
// both the CW panel and the Yaesu console can ask for it. With DTR/RTS line
// keying the PC does the timing, so the rig's internal keyer speed changes
@@ -1503,6 +1505,7 @@ export default function App() {
else if (src === 'flex') FlexSetKeySpeed(w).catch(() => {});
else if (src === 'yaesu') SetYaesuKeySpeed(w).catch(() => {});
else if (src === 'kenwood') SetKenwoodKeySpeed(w).catch(() => {});
else if (src === 'tci') TCISetKeySpeed(w).catch(() => {});
else WinkeyerSetSpeed(w).catch(() => {});
// The rig's own keyer follows too whenever a Yaesu is on CAT, even when it is
// not the sending engine: its front panel and OpsLog then agree.
@@ -1547,6 +1550,7 @@ export default function App() {
: cwSource === 'flex' ? (catState.backend === 'flex' && catState.connected)
: cwSource === 'yaesu' ? (catState.backend === 'yaesu' && catState.connected)
: cwSource === 'kenwood' ? (catState.backend === 'kenwood' && catState.connected)
: cwSource === 'tci' ? (catState.backend === 'tci' && catState.connected)
: wkStatus.connected;
wkActiveRef.current = wkEnabled && connected;
}, [wkEnabled, wkStatus.connected, cwSource, catState.backend, catState.connected]);
@@ -2064,6 +2068,9 @@ export default function App() {
useEffect(() => { spotStatusRef.current = spotStatus; }, [spotStatus]);
// Mirror of spots so the log-triggered refresh reads the current list without
// a stale closure.
// Arrival times of the last second's spots, for the adaptive batching window
// in the cluster:spot listener.
const spotRateRef = useRef<number[]>([]);
const spotsRef = useRef(spots);
useEffect(() => { spotsRef.current = spots; }, [spots]);
// The decoded stations, for the same reason: the status refresh and the cache
@@ -3591,11 +3598,24 @@ export default function App() {
const unsubSpot = EventsOn('cluster:spot', (sp: ClusterSpot) => {
// Stage the spot; a short timer resolves its status then commits it.
pendingSpotsRef.current.push(sp);
// 50 ms is enough to coalesce an RBN burst into one status lookup (the
// worked-index is in memory, so resolving is near-instant) while staying
// imperceptible.
// The window WIDENS with the rate of the feed.
//
// Every flush commits state that the whole window re-renders on, so a
// fixed 50 ms means twenty full renders a second under an RBN firehose —
// and that is felt everywhere else: a dropdown highlighting its entries a
// beat late as the mouse moves down them, which is what was reported.
//
// A quiet cluster keeps the 50 ms: a handful of spots an hour should
// appear the moment they arrive. A busy one is coalesced instead, and half
// a second's delay on a line in a list that is already scrolling past is
// not something anyone can see.
const now = Date.now();
spotRateRef.current = spotRateRef.current.filter((t) => now - t < 1000);
spotRateRef.current.push(now);
const perSec = spotRateRef.current.length;
const window_ms = perSec > 20 ? 500 : perSec > 5 ? 200 : 50;
if (pendingSpotTimer.current === undefined) {
pendingSpotTimer.current = window.setTimeout(flushPendingSpots, 50);
pendingSpotTimer.current = window.setTimeout(flushPendingSpots, window_ms);
}
// Self-spot: someone spotted OUR callsign — show it in the shared header
// toast (same place as the other notifications), not a separate banner.
@@ -3967,7 +3987,7 @@ export default function App() {
// segment AFTER the <LOGQSO> (which logs and clears the form) still expands its
// variables correctly.
const parts = rawText.split(/<LOGQSO>/i).map((pt) => resolveCW(pt));
const isRig = cwSourceRef.current === 'icom' || cwSourceRef.current === 'flex' || cwSourceRef.current === 'yaesu' || cwSourceRef.current === 'kenwood';
const isRig = cwSourceRef.current === 'icom' || cwSourceRef.current === 'flex' || cwSourceRef.current === 'yaesu' || cwSourceRef.current === 'kenwood' || cwSourceRef.current === 'tci';
for (let p = 0; p < parts.length; p++) {
if (aborted()) return; // ESC / Stop before this segment → stop sending, don't log
const resolved = parts[p];
@@ -3979,7 +3999,7 @@ export default function App() {
// current WPM, so it scales automatically.
const keyed = resolved + ' ';
setWkSent(resolved);
const sendFn = cwSourceRef.current === 'flex' ? FlexSendCW : cwSourceRef.current === 'icom' ? IcomSendCW : cwSourceRef.current === 'yaesu' ? YaesuSendCW : cwSourceRef.current === 'kenwood' ? KenwoodSendCW : null;
const sendFn = cwSourceRef.current === 'flex' ? FlexSendCW : cwSourceRef.current === 'icom' ? IcomSendCW : cwSourceRef.current === 'yaesu' ? YaesuSendCW : cwSourceRef.current === 'kenwood' ? KenwoodSendCW : cwSourceRef.current === 'tci' ? TCISendCW : null;
if (sendFn) await sendFn(keyed).catch((e) => setError(String(e?.message ?? e)));
else await WinkeyerSend(keyed).catch((e) => setError(String(e?.message ?? e)));
// WAIT for THIS segment's CW to finish before moving on — so a <LOGQSO>
@@ -4022,6 +4042,7 @@ export default function App() {
else if (cwSourceRef.current === 'flex') FlexStopCW().catch(() => {});
else if (cwSourceRef.current === 'yaesu') YaesuStopCW().catch(() => {});
else if (cwSourceRef.current === 'kenwood') KenwoodStopCW().catch(() => {});
else if (cwSourceRef.current === 'tci') TCIStopCW().catch(() => {});
else WinkeyerStop().catch(() => {});
}
// runAutoCall sends macro i, waits for the keyer to finish, waits the chosen
@@ -4070,6 +4091,10 @@ export default function App() {
// send-on-type: key the typed chars verbatim (no variable substitution).
function wkSendRaw(chars: string) {
if (cwSourceRef.current === 'flex') { FlexSendCW(chars).catch(() => {}); return; }
// TCI keys the character as a macro of its own. There is no un-typing it
// afterwards — the radio can stop the message but not shorten it — so the
// backspace below leaves the TCI engine alone rather than pretending.
if (cwSourceRef.current === 'tci') { TCISendCW(chars).catch(() => {}); return; }
WinkeyerSend(chars).catch(() => {});
}
function wkBackspace() {
@@ -5901,11 +5926,17 @@ export default function App() {
});
let rendered = list as (ClusterSpot & { repeats?: number })[];
if (clusterGroup) {
// A DUPLICATE is the same station on the same band AND mode — the dozen
// skimmers that all heard one CQ. The same station on another band is the
// opposite of a duplicate: it is the line a DX chaser is scanning for, and
// grouping on the callsign alone deleted it. RI1FJL spotted on five bands
// showed as one row, so four slots simply vanished from the list.
const seen = new Map<string, ClusterSpot & { repeats: number }>();
for (const s of list) {
const e = seen.get(s.dx_call);
const key = `${(s.dx_call ?? '').toUpperCase()}|${(s.band ?? '').toLowerCase()}|${inferSpotMode(s.comment ?? '', s.freq_hz)}`;
const e = seen.get(key);
if (e) { e.repeats++; }
else seen.set(s.dx_call, { ...s, repeats: 1 });
else seen.set(key, { ...s, repeats: 1 });
}
rendered = Array.from(seen.values());
}
@@ -6227,13 +6258,19 @@ export default function App() {
case 'cluster':
return (
<div className="h-full w-full min-h-0 flex flex-col bg-card border border-border rounded-lg overflow-hidden">
<div className="flex items-center justify-between px-2 py-1 border-b border-border/60 shrink-0">
<span className="text-[11px] font-semibold uppercase tracking-wider text-muted-foreground">Cluster</span>
{clusterFiltersToggleBtn}
</div>
<div className="flex-1 min-h-0 flex">
<div className="flex-1 min-w-0 flex flex-col min-h-0">
<ClusterGrid key={`clg-${activeProfileId ?? 'x'}`} rows={clusterRenderedRows as any} spotStatus={spotStatus} onSpotClick={handleSpotClick} onSpotSelect={handleSpotSelect} />
{/* Title, count and Filters ride INSIDE the grid's toolbar: two
header rows cost a pane that is often only a few spots tall
one of the few lines it has. */}
<ClusterGrid key={`clg-${activeProfileId ?? 'x'}`} rows={clusterRenderedRows as any} spotStatus={spotStatus} onSpotClick={handleSpotClick} onSpotSelect={handleSpotSelect}
headerLeft={(
<>
<span className="text-[11px] font-semibold uppercase tracking-wider text-muted-foreground shrink-0">DX Cluster</span>
<Badge variant="secondary" className="text-[10px] shrink-0">{spots.length} live</Badge>
{clusterFiltersToggleBtn}
</>
)} />
</div>
{clusterShowFilters && renderClusterFilters()}
</div>
@@ -6419,7 +6456,7 @@ export default function App() {
disabled={disabled}
onClick={() => p && goto(p.bearingShort, 'SP')}
title={p
? `Rotate short-path · ${Math.round(p.distanceShort).toLocaleString()} km`
? `Rotate short-path · ${formatDistance(p.distanceShort)}`
: (station.my_grid ? 'No remote grid' : 'Set your station grid in Preferences')}
className={cn(
'inline-flex items-center gap-1 px-2 py-0.5 transition-colors',
@@ -6435,7 +6472,7 @@ export default function App() {
type="button"
disabled={disabled}
onClick={() => p && goto(p.bearingLong, 'LP')}
title={p ? `Rotate long-path · ${Math.round(p.distanceLong).toLocaleString()} km` : ''}
title={p ? `Rotate long-path · ${formatDistance(p.distanceLong)}` : ''}
className={cn(
'px-1.5 py-0.5 border-l border-info-border text-[10px] transition-colors',
disabled
@@ -8570,7 +8607,7 @@ export default function App() {
"1.5k" and then appended the unit, giving "1.5kkm" and even
written correctly, "1.5k km" makes a reader do arithmetic to
recover a number that was four characters long to begin with. */}
<span className="font-mono opacity-80">{o.median_km} km</span>
<span className="font-mono opacity-80">{formatDistance(o.median_km)}</span>
{/* Out of season is the one an operator must not learn last, so it
earns a mark on the badge rather than a line in the tooltip. */}
{!o.in_season && <span className="opacity-90">!</span>}
+8 -1
View File
@@ -76,6 +76,13 @@ const BMP_MARKER_LABEL: Record<string, string> = {
new_pota: 'bmp.legendNewPota',
new_county: 'bmp.legendNewCounty',
worked_call: 'bmp.legendWorkedCall',
// Not on the strip — the pill is 22 px and a fourth segment turns it into a
// colour code nobody reads — but the TOOLTIP has room, and leaving them out of
// it made the two panels contradict each other: the cluster said NEW PFX about
// a spot the map called "Worked". Both were true (the entity is worked on this
// slot, the WPX prefix never has been) and neither view said so.
new_pfx: 'clg2.newPfx',
new_grid: 'clg2.newGrid',
};
interface Props {
@@ -737,7 +744,7 @@ export function BandMap({ band, spots, spotStatus: spotStatusRaw, currentFreqHz,
'hover:translate-x-0.5 hover:shadow',
style.pill,
)}
title={`${p.spot.dx_call}${entry?.country ? ' · ' + entry.country : ''} · ${p.spot.freq_khz.toFixed(1)} kHz · ${statusLabel(st, t)}${markersFor(entry).map((m) => ' · ' + t(BMP_MARKER_LABEL[m.key])).join('')}${p.spot.comment ? ' · ' + p.spot.comment : ''}${p.spot.spotter ? ' · de ' + p.spot.spotter : ''}`}
title={`${p.spot.dx_call}${entry?.country ? ' · ' + entry.country : ''} · ${p.spot.freq_khz.toFixed(1)} kHz · ${statusLabel(st, t)}${activeMarkers(entry).map((m) => ' · ' + t(BMP_MARKER_LABEL[m.key])).join('')}${p.spot.comment ? ' · ' + p.spot.comment : ''}${p.spot.spotter ? ' · de ' + p.spot.spotter : ''}`}
>
{/* Left accent strip. With no extra marker it repeats the status
colour, exactly as before; otherwise it splits into one
+2 -1
View File
@@ -10,6 +10,7 @@
// new is being decoded on FT8/FT4/JS8 near here — not that the band is dead.
import { useEffect, useMemo, useState } from 'react';
import { Radar, Loader2, X } from 'lucide-react';
import { formatDistance } from '@/lib/units';
import { useI18n } from '@/lib/i18n';
import { markerColour } from '@/lib/spotMarkers';
import { cn } from '@/lib/utils';
@@ -186,7 +187,7 @@ export function ChaseNewPanel({ onPick, onClose }: Props) {
title={[
s.country,
s.grid,
s.dist_km ? `${s.dist_km} km` : '',
s.dist_km ? formatDistance(s.dist_km) : '',
s.freq_hz ? `${(s.freq_hz / 1000).toFixed(1)} kHz` : '',
].filter(Boolean).join(' · ')}
>
+39 -13
View File
@@ -15,6 +15,7 @@ import { cleanSpotter, inferSpotMode, spotStatusKey } from '@/lib/spot';
import { markerColour } from '@/lib/spotMarkers';
import { applySpotDisplay, readSpotDisplayOptions } from '@/lib/spotDisplay';
import { loadLocal, loadRemote, saveState, seedLocal, whenGridPrefsReady } from '@/lib/gridPrefs';
import { distanceUnit, distanceValue, subscribeDistanceUnit } from '@/lib/units';
import { useI18n } from '@/lib/i18n';
type TFn = (key: string, vars?: Record<string, string | number>) => string;
@@ -83,6 +84,11 @@ type Props = {
// stray click while looking took the operator off the station they were
// working. Looking and going are now two different gestures.
onSpotSelect?: (s: ClusterSpot) => void;
// Anything the caller wants on the LEFT of the toolbar — the pane's title, its
// live count, its Filters button. Docked in a pane, the title used to sit on a
// row of its own above this one, so the cluster ate two lines of a short pane
// where Recent QSOs beside it ate one. Reported by VK4DX.
headerLeft?: React.ReactNode;
};
const COL_STATE_KEY = 'hamlog.clusterColState.v1';
@@ -443,8 +449,13 @@ const makeColCatalog = (t: TFn): ColEntry[] => [
},
{
group: 'Geo', label: t('clg2.c.distance_km'), colId: 'distance_km',
headerName: t('clg2.h.distance_km'), field: 'distance_km' as any, width: 80, type: 'rightAligned', cellClass: 'font-mono',
valueFormatter: (p) => p.value ? String(p.value) : '',
// The header carries the unit, so the cells stay bare numbers and the
// column still sorts on the km the backend sent — converting the VALUE
// would sort miles as if they were kilometres either way, but it would
// also round twice.
headerName: t('clg2.h.distance_km') + ' (' + distanceUnit() + ')',
field: 'distance_km' as any, width: 90, type: 'rightAligned', cellClass: 'font-mono',
valueFormatter: (p) => p.value ? String(distanceValue(p.value)) : '',
comparator: (a, b) => (a ?? 0) - (b ?? 0),
},
{
@@ -517,13 +528,15 @@ const GROUP_ORDER = ['Spot', 'Geo'];
const CLG_GRP_KEYS: Record<string, string> = { Spot: 'clg2.grpSpot', Geo: 'clg2.grpGeo' };
const groupLabel = (t: TFn, g: string): string => t(CLG_GRP_KEYS[g] ?? g);
export function ClusterGrid({ rows, spotStatus, onSpotClick, onSpotSelect }: Props) {
export function ClusterGrid({ rows, spotStatus, onSpotClick, onSpotSelect, headerLeft }: Props) {
const { t } = useI18n();
const gridRef = useRef<any>(null);
const [pickerOpen, setPickerOpen] = useState(false);
// Localized column catalog — rebuilt when the language changes.
const COL_CATALOG = useMemo(() => makeColCatalog(t), [t]);
const [distUnit, setDistUnit] = useState(distanceUnit);
useEffect(() => subscribeDistanceUnit(() => setDistUnit(distanceUnit())), []);
const COL_CATALOG = useMemo(() => makeColCatalog(t), [t, distUnit]);
// A rebuild makes AG Grid re-apply every colDef hide/width DEFAULT and fire the
// matching column events. Without this guard those events were persisted, so a
@@ -614,16 +627,27 @@ export function ClusterGrid({ rows, spotStatus, onSpotClick, onSpotSelect }: Pro
const [held, setHeld] = useState<ClusterSpot[] | null>(null);
const shown = held ?? rows;
// How many arrived since the freeze. Counted by finding the frozen top row in
// the live list rather than by comparing lengths: the list is a ring buffer,
// so once it is full the length stops growing and a length comparison would
// report nothing new for the rest of the evening.
const spotID = (r: ClusterSpot) => `${(r as any).received_at}-${r.dx_call}-${(r as any).source_id}`;
// How many arrived since the freeze — counted by TIME, not by finding the
// frozen top row again.
//
// Looking for that row was wrong in the ordinary case: a station spotted again
// REPLACES its row (that is the de-dupe), so the row we froze on disappears
// from the live list the moment somebody re-spots it — and the count fell
// through to "everything is new", jumping from 4 to the buffer cap. Reported
// as "it shows 4, 5 new spots and then 500 all at once".
//
// A timestamp survives both the replacement and the ring buffer, which was the
// reason the length was not used either.
const spotTime = (r: ClusterSpot) => Date.parse(String((r as any).received_at ?? '')) || 0;
const waiting = useMemo(() => {
if (!held || held.length === 0) return 0;
const top = spotID(held[0]);
const i = rows.findIndex((r) => spotID(r) === top);
return i < 0 ? rows.length : i; // fell out of the buffer: everything is new
const since = spotTime(held[0]);
if (!since) return 0; // no usable timestamp — say nothing rather than a number
let n = 0;
for (const r of rows) {
if (spotTime(r) > since) n++;
}
return n;
}, [held, rows]);
const onBodyScroll = (e: { top: number }) => {
@@ -681,7 +705,9 @@ export function ClusterGrid({ rows, spotStatus, onSpotClick, onSpotSelect }: Pro
return (
<>
<div className="flex items-center justify-end gap-2 px-2.5 py-1 border-b border-border/60 bg-muted/20">
<div className="flex items-center gap-2 px-2.5 py-1 border-b border-border/60 bg-muted/20">
{headerLeft}
<div className="flex-1" />
<Button variant="ghost" size="sm" className="h-7 text-[11px]" onClick={() => gridRef.current?.api?.setFilterModel(null)}
title={t('clg2.clearFiltersTitle')}>
<FilterX className="size-3.5" /> {t('clg2.clearFilters')}
+3 -2
View File
@@ -4,6 +4,7 @@ import 'leaflet/dist/leaflet.css';
import { nightPolygon } from '../lib/greyline';
import { gridToLatLon, gridSquareBounds, greatCirclePoints, pathBetween, destinationPoint } from '@/lib/maidenhead';
import { writeUiPref } from '@/lib/uiPref';
import { formatDistance } from '@/lib/units';
// Persisted free-pan view of the world map (when auto-zoom is off).
function loadMapView(): { lat: number; lon: number; zoom: number } | null {
@@ -446,8 +447,8 @@ export function WorldMap({ fromGrid, toGrid, fromLabel, toLabel, beamAzimuths, b
</button>
{path && (
<div className="absolute bottom-1 left-1 z-[500] rounded-md bg-card/90 backdrop-blur px-2 py-1 text-[11px] font-mono shadow border border-border pointer-events-none">
<div><span className="text-muted-foreground">Dist</span> {Math.round(path.distanceShort).toLocaleString()} km
<span className="text-muted-foreground"> · LP</span> {Math.round(path.distanceLong).toLocaleString()} km</div>
<div><span className="text-muted-foreground">Dist</span> {formatDistance(path.distanceShort)}
<span className="text-muted-foreground"> · LP</span> {formatDistance(path.distanceLong)}</div>
<div><span className="text-muted-foreground">Az SP</span> {Math.round(path.bearingShort)}°
<span className="text-muted-foreground"> · LP</span> {Math.round(path.bearingLong)}°</div>
</div>
+15 -2
View File
@@ -8,7 +8,7 @@ import {
Select, SelectTrigger, SelectValue, SelectContent, SelectItem,
} from '@/components/ui/select';
import { cn } from '@/lib/utils';
import { GetLoTWDownloadAllCalls, SetLoTWDownloadAllCalls, OpenExternalURL, FindQSOsForUpload, UploadQSOsManual, DownloadConfirmations, CancelConfirmations, ImportHamlogConfirmations, ExportHamlogUnmatched, OpenADIFFile, SaveADIFFile, SyncPOTAHunterLog, ListQSO, BulkUpdateQSL, UploadCallsign, GetSlotStats } from '../../wailsjs/go/main/App';
import { GetLoTWQSLDetail, SetLoTWQSLDetail, GetLoTWDownloadAllCalls, SetLoTWDownloadAllCalls, OpenExternalURL, FindQSOsForUpload, UploadQSOsManual, DownloadConfirmations, CancelConfirmations, ImportHamlogConfirmations, ExportHamlogUnmatched, OpenADIFFile, SaveADIFFile, SyncPOTAHunterLog, ListQSO, BulkUpdateQSL, UploadCallsign, GetSlotStats } from '../../wailsjs/go/main/App';
import { Input } from '@/components/ui/input';
import { RecentQSOsGrid } from '@/components/RecentQSOsGrid';
import { EventsOn } from '../../wailsjs/runtime/runtime';
@@ -257,7 +257,13 @@ export function QSLManagerPanel({ onEditQSO, actions, paperRequest }: {
const [addNotFound, setAddNotFound] = useState(false);
// LoTW only: pull the whole account rather than this profile's callsign.
const [lotwAllCalls, setLotwAllCalls] = useState(false);
useEffect(() => { GetLoTWDownloadAllCalls().then((v: boolean) => setLotwAllCalls(!!v)).catch(() => {}); }, []);
// LoTW only: ask for the QSL dates and station details. Ten times slower to
// build, so it is a choice rather than the default it used to be.
const [lotwDetail, setLotwDetail] = useState(false);
useEffect(() => {
GetLoTWDownloadAllCalls().then((v: boolean) => setLotwAllCalls(!!v)).catch(() => {});
GetLoTWQSLDetail().then((v: boolean) => setLotwDetail(!!v)).catch(() => {});
}, []);
// Download date window: 'last' = incremental since last pull, 'date' = from a
// chosen date, 'all' = everything.
const [sinceMode, setSinceMode] = useState<'last' | 'date' | 'all'>('last');
@@ -751,6 +757,13 @@ export function QSLManagerPanel({ onEditQSO, actions, paperRequest }: {
<Checkbox checked={addNotFound} onCheckedChange={(c) => setAddNotFound(!!c)} />
{t('qslm.addNotFound')}
</label>
{service === 'lotw' && (
<label className="flex items-center gap-1.5 text-[11px] text-muted-foreground cursor-pointer" title={t('qslm.lotwDetailTitle')}>
<Checkbox checked={lotwDetail || addNotFound} disabled={addNotFound}
onCheckedChange={(c) => { setLotwDetail(!!c); SetLoTWQSLDetail(!!c); }} />
{t('qslm.lotwDetail')}
</label>
)}
{service === 'lotw' && (
<label className="flex items-center gap-1.5 text-[11px] text-muted-foreground cursor-pointer" title={t('qslm.lotwAllCallsTitle')}>
<Checkbox checked={lotwAllCalls} onCheckedChange={(c) => { setLotwAllCalls(!!c); SetLoTWDownloadAllCalls(!!c); }} />
+7 -3
View File
@@ -9,6 +9,7 @@ import { formatDateTimeUTC, formatDateOnly, getDateFormat, subscribeDateFormat }
import { AgGridReact } from 'ag-grid-react';
import { Columns3, FilterX, ListChecks } from 'lucide-react';
import type { QSOForm } from '@/types';
import { distanceUnit, distanceValue, subscribeDistanceUnit } from '@/lib/units';
import { QSOContextMenu, type QSOMenuState } from './QSOContextMenu';
import {
Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter, DialogDescription,
@@ -177,8 +178,9 @@ export const makeColCatalog = (t: TFn, myGrid?: string): ColEntry[] => [
{ group: 'Contacted', label: t('rqg.c.lon'), colId: 'lon', headerName: t('rqg.c.lon'), field: 'lon' as any, width: 90, type: 'rightAligned', cellClass: 'font-mono' },
// Derived, not stored: computed from the two locations at display time, like
// the cluster grid's own distance column.
{ group: 'Contacted', label: t('rqg.c.distance_km'), colId: 'distance_km', headerName: t('rqg.h.distance_km'), width: 90, type: 'rightAligned', cellClass: 'font-mono',
valueGetter: (p) => qsoDistanceKm(p.data, myGrid),
{ group: 'Contacted', label: t('rqg.c.distance_km'), colId: 'distance_km',
headerName: t('rqg.h.distance_km') + ' (' + distanceUnit() + ')', width: 95, type: 'rightAligned', cellClass: 'font-mono',
valueGetter: (p) => { const km = qsoDistanceKm(p.data, myGrid); return km ? distanceValue(km) : km; },
comparator: (a, b) => (a ?? 0) - (b ?? 0), defaultVisible: true },
{ group: 'Contacted', label: t('rqg.c.email'), colId: 'email', headerName: t('rqg.c.email'), field: 'email' as any, width: 180 },
{ group: 'Contacted', label: t('rqg.c.web'), colId: 'web', headerName: t('rqg.c.web'), field: 'web' as any, width: 180 },
@@ -335,7 +337,9 @@ export function RecentQSOsGrid({ rows, myGrid, selectAllSignal, selectRowSignal,
// inside the column definitions, so nothing else would notice.
const [dateFmt, setDateFmt] = useState(getDateFormat);
useEffect(() => subscribeDateFormat(() => setDateFmt(getDateFormat())), []);
const COL_CATALOG = useMemo(() => makeColCatalog(t, myGrid), [t, myGrid, dateFmt]);
const [distUnit, setDistUnit] = useState(distanceUnit);
useEffect(() => subscribeDistanceUnit(() => setDistUnit(distanceUnit())), []);
const COL_CATALOG = useMemo(() => makeColCatalog(t, myGrid), [t, myGrid, dateFmt, distUnit]);
// Right-click: if the clicked row isn't already part of the selection,
// select just it; then open the bulk-action menu on the whole selection.
+26 -1
View File
@@ -80,6 +80,7 @@ import {
} from '@/components/ui/select';
import { cn } from '@/lib/utils';
import { writeUiPref } from '@/lib/uiPref';
import { setUseMiles } from '@/lib/units';
import { getDateFormat, setDateFormat, type DateFormat } from '@/lib/dateFormat';
import { useI18n, FlagGB, FlagFR, type Lang } from '@/lib/i18n';
import { useTheme, CONCRETE_THEMES, type ThemeChoice } from '@/lib/theme';
@@ -1747,6 +1748,7 @@ function SettingsModalImpl({ onClose, onSaved, initialSection, onMainPaneChanged
const [startEqEnd, setStartEqEnd] = useState(() => localStorage.getItem('opslog.startEqualsEnd') === '1');
const [lookupOnBlur, setLookupOnBlur] = useState(() => localStorage.getItem('opslog.lookupOnBlur') === '1');
const [groupDigital, setGroupDigital] = useState(() => localStorage.getItem('opslog.groupDigitalSlots') === '1');
const [milesUnit, setMilesUnit] = useState(() => localStorage.getItem('opslog.distanceMiles') === '1');
const [clusterWorkedSameSlot, setClusterWorkedSameSlot] = useState(() => localStorage.getItem('opslog.clusterWorkedSameSlot') === '1');
// Declared HERE and not in ClusterPanel: that renderer is called as a plain
// function by the PANELS map, so it must stay hooks-free.
@@ -4865,7 +4867,7 @@ function SettingsModalImpl({ onClose, onSaved, initialSection, onMainPaneChanged
<SelectItem value="yaesu">{t('wk.engYaesu')}</SelectItem>
<SelectItem value="kenwood">{t('wk.engKenwood')}</SelectItem>
<SelectItem value="flex">{t('wk.engFlex')}</SelectItem>
<SelectItem value="tci" disabled>{t('wk.engTci')}</SelectItem>
<SelectItem value="tci">{t('wk.engTci')}</SelectItem>
</SelectContent>
</Select>
</div>
@@ -4926,6 +4928,22 @@ function SettingsModalImpl({ onClose, onSaved, initialSection, onMainPaneChanged
</div>
</div>
</>
) : wk.engine === 'tci' ? (
<>
{(!catCfg.enabled || catCfg.backend !== 'tci') && (
<p className="text-xs font-medium text-warning -mt-1 flex items-start gap-1.5">
<span aria-hidden></span>
<span>{t('wk.catWarnTci', { backend: catCfg.enabled ? (catCfg.backend || 'none') : 'disabled' })}</span>
</p>
)}
<p className="text-xs text-muted-foreground -mt-1">{t('wk.tciHint')}</p>
<div className="grid grid-cols-4 gap-3">
<div className="space-y-1">
<Label>{t('wk.speed')}</Label>
<Input type="number" min={5} max={60} value={wk.wpm} onChange={(e) => setWkField({ wpm: num(e.target.value, 25) })} className="font-mono" />
</div>
</div>
</>
) : wk.engine === 'flex' ? (
<>
{(!catCfg.enabled || catCfg.backend !== 'flex') && (
@@ -7221,6 +7239,13 @@ function SettingsModalImpl({ onClose, onSaved, initialSection, onMainPaneChanged
<Checkbox checked={groupDigital} onCheckedChange={(c) => { const v = !!c; setGroupDigital(v); writeUiPref('opslog.groupDigitalSlots', v ? '1' : '0'); }} />
{t('gen.groupDigital')} <span className="text-xs text-muted-foreground">{t('gen.groupDigitalHint')}</span>
</label>
<label className="flex items-center gap-2 text-sm cursor-pointer">
{/* Distances are computed in km everywhere and converted at display
time see lib/units. Changing this repaints the columns that
already carry a distance; nothing stored moves. */}
<Checkbox checked={milesUnit} onCheckedChange={(c) => { const v = !!c; setMilesUnit(v); setUseMiles(v); }} />
{t('gen.miles')} <span className="text-xs text-muted-foreground">{t('gen.milesHint')}</span>
</label>
<label className="flex items-center gap-2 text-sm cursor-pointer">
<Checkbox checked={checkUpdates} onCheckedChange={(c) => { const v = !!c; setCheckUpdates(v); writeUiPref('opslog.checkUpdates', v ? '1' : '0'); }} />
{t('gen.checkUpdates')} <span className="text-xs text-muted-foreground">{t('gen.checkUpdatesHint')}</span>
+4 -4
View File
@@ -26,7 +26,7 @@ interface Props {
wpm: number;
macros: WKMacro[];
sent: string; // text echoed back by the keyer as it transmits
source: 'winkeyer' | 'icom' | 'flex' | 'yaesu' | 'kenwood'; // CW output engine (chosen in Settings → CW Keyer)
source: 'winkeyer' | 'icom' | 'flex' | 'yaesu' | 'kenwood' | 'tci'; // CW output engine (chosen in Settings → CW Keyer)
breakIn?: number; // Icom CW break-in: 0=OFF, 1=SEMI, 2=FULL
onSetBreakIn?: (mode: number) => void;
onSelectPort: (p: string) => void;
@@ -109,16 +109,16 @@ export function WinkeyerPanel({
<Radio className="size-4 text-primary shrink-0" />
{/* CW output engine (chosen in Settings → CW Keyer). */}
<span className="text-xs font-semibold uppercase tracking-wider text-muted-foreground shrink-0">
{source === 'icom' ? 'Icom CW' : source === 'flex' ? 'Flex CWX' : source === 'yaesu' ? 'Yaesu CW' : source === 'kenwood' ? 'Kenwood CW' : 'WinKeyer'}
{source === 'icom' ? 'Icom CW' : source === 'flex' ? 'Flex CWX' : source === 'yaesu' ? 'Yaesu CW' : source === 'kenwood' ? 'Kenwood CW' : source === 'tci' ? 'TCI CW' : 'WinKeyer'}
</span>
<span className={cn('size-2 rounded-full', connected ? (status.busy ? 'bg-warning animate-pulse' : 'bg-success') : 'bg-muted-foreground/40')}
title={connected ? (status.busy ? t('wkp.sending') : t('wkp.connectedV', { version: status.version })) : t('wkp.disconnected')} />
<div className="flex-1" />
{source === 'icom' || source === 'flex' || source === 'yaesu' || source === 'kenwood' ? (
{source === 'icom' || source === 'flex' || source === 'yaesu' || source === 'kenwood' || source === 'tci' ? (
<span className="text-[11px] font-medium text-muted-foreground">
{source === 'flex'
? (connected ? t('wkp.cwxReady') : t('wkp.cwxOffline'))
: source === 'yaesu' || source === 'kenwood'
: source === 'yaesu' || source === 'kenwood' || source === 'tci'
? (connected ? t('wkp.rigReady') : t('wkp.rigOffline'))
: (connected ? t('wkp.civReady') : t('wkp.civOffline'))}
</span>
+14 -4
View File
@@ -128,7 +128,12 @@ const en: Dict = {
'mx.tipDxConf': 'Entity confirmed (other callsign)', 'mx.tipDxWork': 'Entity worked (other callsign)',
'mx.tipNone': 'Never worked', 'mx.tipClick': 'click to list the QSOs',
'icmp.scopeNoStream': 'This radio does not send its scope over CI-V — its own screen still works.',
'wk.catWarnTci': 'The CW keyer is set to the radio, but the CAT backend is "{backend}". Pick TCI in Settings → CAT, or another keying engine.',
'wk.tciHint': "Keying goes through the radio's own macro keyer, over the link already open — no WinKeyer and no second serial port. The radio can stop a message but cannot un-type one, so there is no type-ahead correction here.",
'gen.miles': 'Distances in miles', 'gen.milesHint': '(instead of kilometres)',
'qslm.qrzTitle': 'Open this callsign on QRZ.com',
'qslm.lotwDetail': 'QSL details',
'qslm.lotwDetailTitle': 'Ask LoTW for the QSL date and the station details (grid, state, county) as well as the confirmation. LoTW takes about ten times longer to build that report — two minutes against twenty on the same account — and marking a confirmation needs none of it. Forced on when adding the QSOs not found, which have no other source for those fields.',
'qslm.lotwAllCalls': 'All my callsigns',
'qslm.lotwAllCallsTitle': "Download the confirmations of every callsign on the LoTW account, not just this profile's. A QSO made as F4BPO/P or TM2Q is confirmed at LoTW but never reaches an F4BPO profile without this.",
'awp.filterSlotsNotCfmd': 'Slots to confirm', 'awp.slotGap': 'slots to confirm',
@@ -408,10 +413,10 @@ const en: Dict = {
'chp.noPriorQso': 'No prior QSO with this callsign.', 'chp.first': 'First', 'chp.last': 'Last', 'chp.dateUtc': 'Date UTC', 'chp.band': 'Band', 'chp.mode': 'Mode',
'chp.lotwRcvd': 'LoTW rcvd', 'chp.bureauRcvd': 'Bureau rcvd', 'chp.olderQsos': '+ {n} older QSOs',
'bmp.statusNew': 'NEW DXCC (entity never worked)', 'bmp.statusNewBandMode': 'NEW BAND+MODE (neither worked with this entity)', 'bmp.statusNewBand': 'NEW BAND (entity not worked on this band)', 'bmp.statusNewSlot': 'NEW SLOT (mode not worked on this band)', 'bmp.statusNewCall': 'NEW CALL (this callsign never worked on this band and mode)', 'bmp.statusNewMode': 'NEW MODE (mode never worked for this entity)',
'bmp.statusWorked': 'Worked (this band + mode already in log)', 'bmp.statusUnresolved': 'Entity not resolved', 'bmp.bandMap': 'Band map', 'bmp.notConfigured': 'Not configured for {band}.',
'bmp.statusWorked': 'Entity worked on this band and mode', 'bmp.statusUnresolved': 'Entity not resolved', 'bmp.bandMap': 'Band map', 'bmp.notConfigured': 'Not configured for {band}.',
'bmp.zoomOut': 'Zoom out', 'bmp.zoomIn': 'Zoom in', 'bmp.scrollToRig': 'Scroll to current rig frequency', 'bmp.moveLeft': 'Move band map to the left', 'bmp.moveRight': 'Move band map to the right', 'bmp.hide': 'Hide band map',
'bmp.bandsLabel': 'Bands:', 'bmp.fit': 'FIT', 'bmp.ftx': 'FTx', 'bmp.hideFt': 'Hide FTx', 'bmp.hideFtTitle': 'Hide all digital (FT8/FT4/JS8/…) spots on every band map', 'bmp.fitBand': 'Fit to band', 'bmp.widthTip': 'Drag to resize — double-click to reset', 'bmp.fitTitle': 'Size each band map to show the whole band edge-to-edge',
'bmp.legendNewDxcc': 'New DXCC', 'bmp.legendNewBand': 'New band', 'bmp.legendNewSlot': 'New slot (mode)', 'bmp.openUnusual': 'unusual for the season', 'bmp.legendWorked': 'Worked', 'bmp.legendNewPota': 'New POTA', 'bmp.legendNewCounty': 'New county', 'bmp.legendWorkedCall': 'Callsign already worked', 'bmp.legendCW': 'CW', 'bmp.legendData': 'Data', 'bmp.legendPhone': 'Phone', 'bmp.footerHint': 'scroll · ctrl+wheel = zoom · ◎ = jump to rig', 'bmp.spotsHidden': '{n} FT8/FT4 spots hidden — top {max} kept (CW/SSB all shown)',
'bmp.legendNewDxcc': 'New DXCC', 'bmp.legendNewBand': 'New band', 'bmp.legendNewSlot': 'New slot (mode)', 'bmp.openUnusual': 'unusual for the season', 'bmp.legendWorked': 'Entity worked', 'bmp.legendNewPota': 'New POTA', 'bmp.legendNewCounty': 'New county', 'bmp.legendWorkedCall': 'Callsign already worked', 'bmp.legendCW': 'CW', 'bmp.legendData': 'Data', 'bmp.legendPhone': 'Phone', 'bmp.footerHint': 'scroll · ctrl+wheel = zoom · ◎ = jump to rig', 'bmp.spotsHidden': '{n} FT8/FT4 spots hidden — top {max} kept (CW/SSB all shown)',
'frm.welcome': 'Welcome to OpsLog', 'frm.intro': 'Set up your station to start logging. These fields stamp every QSO and can be changed later in Preferences → Station Information (and per profile).',
'frm.callsign': 'Callsign', 'frm.locator': 'Locator', 'frm.operator': 'Operator', 'frm.operatorPh': 'same as callsign', 'frm.owner': 'Owner', 'frm.ownerPh': 'station owner callsign', 'frm.name': 'Name', 'frm.namePh': 'your first name',
'frm.awardRefs': 'Award reference lists', 'frm.awardRefsHint': 'IOTA · POTA · WWFF · SOTA — names & totals for those awards (optional, can take a minute).', 'frm.downloading': 'Downloading…', 'frm.reDownload': 'Re-download', 'frm.download': 'Download', 'frm.required': 'Callsign and locator are required.', 'frm.saving': 'Saving…', 'frm.startLogging': 'Start logging',
@@ -623,7 +628,12 @@ const fr: Dict = {
'mx.tipDxConf': 'Entité confirmée (autre indicatif)', 'mx.tipDxWork': 'Entité contactée (autre indicatif)',
'mx.tipNone': 'Jamais contacté', 'mx.tipClick': 'cliquer pour lister les QSO',
'icmp.scopeNoStream': "Cette radio n'envoie pas son scope en CI-V — son propre écran fonctionne toujours.",
'wk.catWarnTci': "Le manipulateur CW est réglé sur la radio, mais le backend CAT est « {backend} ». Choisissez TCI dans Réglages → CAT, ou un autre moteur de manipulation.",
'wk.tciHint': "La manipulation passe par le keyer à macros de la radio, sur la liaison déjà ouverte — ni WinKeyer ni second port série. La radio sait interrompre un message mais pas en effacer la fin, donc pas de correction en frappe anticipée ici.",
'gen.miles': 'Distances en miles', 'gen.milesHint': '(au lieu des kilomètres)',
'qslm.qrzTitle': 'Ouvrir cet indicatif sur QRZ.com',
'qslm.lotwDetail': 'Détails QSL',
'qslm.lotwDetailTitle': "Demander à LoTW la date du QSL et les détails de la station (locator, état, comté) en plus de la confirmation. LoTW met environ dix fois plus longtemps à construire ce rapport — deux minutes contre vingt sur le même compte — et marquer une confirmation n'en a pas besoin. Forcé quand on ajoute les QSO absents, qui n'ont pas d'autre source pour ces champs.",
'qslm.lotwAllCalls': 'Tous mes indicatifs',
'qslm.lotwAllCallsTitle': "Télécharger les confirmations de tous les indicatifs du compte LoTW, pas seulement celui du profil. Un QSO fait en F4BPO/P ou TM2Q est confirmé chez LoTW mais n'atteint jamais un profil F4BPO sans cette option.",
'awp.filterSlotsNotCfmd': 'Slots à confirmer', 'awp.slotGap': 'slots à confirmer',
@@ -890,10 +900,10 @@ const fr: Dict = {
'chp.noPriorQso': 'Aucun QSO antérieur avec cet indicatif.', 'chp.first': 'Premier', 'chp.last': 'Dernier', 'chp.dateUtc': 'Date UTC', 'chp.band': 'Bande', 'chp.mode': 'Mode',
'chp.lotwRcvd': 'LoTW reçue', 'chp.bureauRcvd': 'Bureau reçue', 'chp.olderQsos': '+ {n} QSO plus anciens',
'bmp.statusNew': 'NOUVEAU DXCC (entité jamais contactée)', 'bmp.statusNewBandMode': 'NOUVEAU BANDE+MODE (ni lun ni lautre fait avec cette entité)', 'bmp.statusNewBand': 'NOUVELLE BANDE (entité non contactée sur cette bande)', 'bmp.statusNewSlot': 'NOUVEAU MODE (mode non contacté sur cette bande)', 'bmp.statusNewCall': "CALL NEUF (indicatif jamais contacté sur cette bande et ce mode)", 'bmp.statusNewMode': 'NOUVEAU MODE (mode jamais contacté pour cette entité)',
'bmp.statusWorked': 'Contacté (cette bande + mode déjà au log)', 'bmp.statusUnresolved': 'Entité non résolue', 'bmp.bandMap': 'Carte de bande', 'bmp.notConfigured': 'Non configurée pour {band}.',
'bmp.statusWorked': 'Entité contactée sur cette bande et ce mode', 'bmp.statusUnresolved': 'Entité non résolue', 'bmp.bandMap': 'Carte de bande', 'bmp.notConfigured': 'Non configurée pour {band}.',
'bmp.zoomOut': 'Dézoomer', 'bmp.zoomIn': 'Zoomer', 'bmp.scrollToRig': 'Aller à la fréquence actuelle du poste', 'bmp.moveLeft': 'Déplacer la carte de bande à gauche', 'bmp.moveRight': 'Déplacer la carte de bande à droite', 'bmp.hide': 'Masquer la carte de bande',
'bmp.bandsLabel': 'Bandes :', 'bmp.fit': 'FIT', 'bmp.ftx': 'FTx', 'bmp.hideFt': 'Masquer FTx', 'bmp.hideFtTitle': 'Masquer tous les spots numériques (FT8/FT4/JS8/…) sur toutes les cartes', 'bmp.fitBand': 'Ajuster à la bande', 'bmp.widthTip': 'Glisser pour redimensionner — double-clic pour réinitialiser', 'bmp.fitTitle': 'Dimensionner chaque carte pour afficher toute la bande',
'bmp.legendNewDxcc': 'Nouveau DXCC', 'bmp.legendNewBand': 'Nouvelle bande', 'bmp.legendNewSlot': 'Nouveau mode', 'bmp.openUnusual': 'inhabituel pour la saison', 'bmp.legendWorked': 'Contacté', 'bmp.legendNewPota': 'Nouveau POTA', 'bmp.legendNewCounty': 'Nouveau comté', 'bmp.legendWorkedCall': 'Indicatif déjà contacté', 'bmp.legendCW': 'CW', 'bmp.legendData': 'Numérique', 'bmp.legendPhone': 'Phonie', 'bmp.footerHint': 'défiler · ctrl+molette = zoom · ◎ = aller au poste', 'bmp.spotsHidden': '{n} spots FT8/FT4 masqués — {max} meilleurs conservés (CW/SSB tous affichés)',
'bmp.legendNewDxcc': 'Nouveau DXCC', 'bmp.legendNewBand': 'Nouvelle bande', 'bmp.legendNewSlot': 'Nouveau mode', 'bmp.openUnusual': 'inhabituel pour la saison', 'bmp.legendWorked': 'Entité contactée', 'bmp.legendNewPota': 'Nouveau POTA', 'bmp.legendNewCounty': 'Nouveau comté', 'bmp.legendWorkedCall': 'Indicatif déjà contacté', 'bmp.legendCW': 'CW', 'bmp.legendData': 'Numérique', 'bmp.legendPhone': 'Phonie', 'bmp.footerHint': 'défiler · ctrl+molette = zoom · ◎ = aller au poste', 'bmp.spotsHidden': '{n} spots FT8/FT4 masqués — {max} meilleurs conservés (CW/SSB tous affichés)',
'frm.welcome': 'Bienvenue dans OpsLog', 'frm.intro': 'Configure ta station pour commencer à logger. Ces champs sont inscrits sur chaque QSO et peuvent être modifiés plus tard dans Préférences → Informations station (et par profil).',
'frm.callsign': 'Indicatif', 'frm.locator': 'Locator', 'frm.operator': 'Opérateur', 'frm.operatorPh': "identique à l'indicatif", 'frm.owner': 'Propriétaire', 'frm.ownerPh': 'indicatif du propriétaire de la station', 'frm.name': 'Nom', 'frm.namePh': 'ton prénom',
'frm.awardRefs': 'Listes de références des diplômes', 'frm.awardRefsHint': 'IOTA · POTA · WWFF · SOTA — noms et totaux pour ces diplômes (optionnel, peut prendre une minute).', 'frm.downloading': 'Téléchargement…', 'frm.reDownload': 'Retélécharger', 'frm.download': 'Télécharger', 'frm.required': "L'indicatif et le locator sont obligatoires.", 'frm.saving': 'Enregistrement…', 'frm.startLogging': 'Commencer à logger',
+1
View File
@@ -40,6 +40,7 @@ const PORTABLE_KEYS = [
'opslog.clusterFilterSource', 'opslog.clusterGroup', 'opslog.clusterBands',
'opslog.clusterLockBand', 'opslog.clusterLockMode', 'opslog.clusterStatusFilter',
'opslog.clusterModeFilter', 'opslog.clusterSearch', 'opslog.clusterHideWorked',
'opslog.distanceMiles', // distances shown in statute miles rather than km
'opslog.activeTab', // last selected tab
'opslog.mainSplit', // Main tab: width share of the left pane (percent) — legacy, read once to seed mainShares
'opslog.mainShares', // Main tab: column shares per column count, as {2:[..],3:[..],4:[..]}
+49
View File
@@ -0,0 +1,49 @@
// Distance units.
//
// Everything is COMPUTED in kilometres — the great-circle maths, the backend's
// distance_km on a spot, the map's path lengths — and converted once, here, at
// display time. Storing miles anywhere would mean two sources of truth for the
// same number and a rounding error that grows with every hop.
//
// The preference is portable (see lib/uiPref): an operator who works in miles
// works in miles on every machine they copy their folder to.
import { writeUiPref } from '@/lib/uiPref';
export const KEY_MILES = 'opslog.distanceMiles';
const KM_PER_MILE = 1.609344; // statute miles, the ones a US licence is used in
export function useMiles(): boolean {
try { return localStorage.getItem(KEY_MILES) === '1'; } catch { return false; }
}
export function setUseMiles(on: boolean): void {
writeUiPref(KEY_MILES, on ? '1' : '0');
listeners.forEach((l) => l());
}
// subscribeDistanceUnit notifies on a change. The grids capture the unit inside
// their column definitions (header text and formatter both), so without this a
// toggle would only show up on the next language change or restart.
const listeners = new Set<() => void>();
export function subscribeDistanceUnit(fn: () => void): () => void {
listeners.add(fn);
return () => { listeners.delete(fn); };
}
// distanceValue converts a distance in km to the operator's unit, rounded to a
// whole unit — the precision the inputs actually justify (a 4-character grid is
// a square tens of kilometres wide).
export function distanceValue(km: number): number {
if (!isFinite(km)) return 0;
return Math.round(useMiles() ? km / KM_PER_MILE : km);
}
// distanceUnit is the short label: "km" or "mi".
export function distanceUnit(): string {
return useMiles() ? 'mi' : 'km';
}
// formatDistance is value + unit, thousands-separated: "12 345 km".
export function formatDistance(km: number): string {
return `${distanceValue(km).toLocaleString()} ${distanceUnit()}`;
}
+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.26.20';
export const APP_VERSION = '0.26.22';
// Author / credits, shown in Help -> About.
export const APP_AUTHOR = 'F4BPO';
+10
View File
@@ -505,6 +505,8 @@ export function GetLiveStations():Promise<Array<main.LiveStation>>;
export function GetLoTWDownloadAllCalls():Promise<boolean>;
export function GetLoTWQSLDetail():Promise<boolean>;
export function GetLoTWUsersStatus():Promise<main.LoTWUsersStatus>;
export function GetLogFilePath():Promise<string>;
@@ -1161,6 +1163,8 @@ export function SetLinkedAmps(arg1:Array<string>):Promise<void>;
export function SetLoTWDownloadAllCalls(arg1:boolean):Promise<void>;
export function SetLoTWQSLDetail(arg1:boolean):Promise<void>;
export function SetMotorFollow(arg1:boolean,arg2:number,arg3:string):Promise<void>;
export function SetOpsLogQSLReceived(arg1:number,arg2:boolean):Promise<void>;
@@ -1275,6 +1279,12 @@ export function SyncFolderNow():Promise<number>;
export function SyncPOTAHunterLog(arg1:boolean,arg2:boolean):Promise<main.POTASyncResult>;
export function TCISendCW(arg1:string):Promise<void>;
export function TCISetKeySpeed(arg1:number):Promise<void>;
export function TCIStopCW():Promise<void>;
export function TailLogFile(arg1:number):Promise<string>;
export function TestCloudlogUpload():Promise<string>;
+20
View File
@@ -950,6 +950,10 @@ export function GetLoTWDownloadAllCalls() {
return window['go']['main']['App']['GetLoTWDownloadAllCalls']();
}
export function GetLoTWQSLDetail() {
return window['go']['main']['App']['GetLoTWQSLDetail']();
}
export function GetLoTWUsersStatus() {
return window['go']['main']['App']['GetLoTWUsersStatus']();
}
@@ -2262,6 +2266,10 @@ export function SetLoTWDownloadAllCalls(arg1) {
return window['go']['main']['App']['SetLoTWDownloadAllCalls'](arg1);
}
export function SetLoTWQSLDetail(arg1) {
return window['go']['main']['App']['SetLoTWQSLDetail'](arg1);
}
export function SetMotorFollow(arg1, arg2, arg3) {
return window['go']['main']['App']['SetMotorFollow'](arg1, arg2, arg3);
}
@@ -2490,6 +2498,18 @@ export function SyncPOTAHunterLog(arg1, arg2) {
return window['go']['main']['App']['SyncPOTAHunterLog'](arg1, arg2);
}
export function TCISendCW(arg1) {
return window['go']['main']['App']['TCISendCW'](arg1);
}
export function TCISetKeySpeed(arg1) {
return window['go']['main']['App']['TCISetKeySpeed'](arg1);
}
export function TCIStopCW() {
return window['go']['main']['App']['TCIStopCW']();
}
export function TailLogFile(arg1) {
return window['go']['main']['App']['TailLogFile'](arg1);
}
+87 -6
View File
@@ -27,6 +27,14 @@ type TCI struct {
digitalDefault string // surfaced when the rig reports a digital mode (FT8/…)
spotsEnabled bool // mirror cluster spots onto the TCI panorama
// wantFreq is the frequency last COMMANDED and not yet echoed back, used to
// pick the sideband before the radio has confirmed the move.
wantFreq int64
// What the server said it is, from its "protocol:" announcement.
serverName string
serverVersion string
// How many spots have been logged verbatim (the first few only).
spotsSent int
// OnSpotClick is called when the user clicks one of our spots on the TCI
// panorama (callsign + freq), so the host can fill the entry form. Set before
@@ -149,6 +157,16 @@ func (t *TCI) Connect() error {
t.mu.Unlock()
debugLog.Printf("TCI: connected to %s", url)
go t.reader(conn)
// Ask for the meters. Nothing measures anything until this goes out: the
// S-meter, the transmit power and the SWR are all pushed by the radio, and
// only to a client that has subscribed. 200 ms is the rate the protocol's own
// examples use — fast enough for a needle, slow enough not to flood a socket
// that also carries audio.
if t.spotsEnabled {
debugLog.Printf("TCI: panorama spots are ON — spots will be sent to the radio")
}
_ = t.send("rx_sensors_enable:true,200;")
_ = t.send("tx_sensors_enable:true,200;")
if t.spotsEnabled {
// Forget what we thought was on the panorama at the same moment the radio
// is told to drop it. Kept, the memory would suppress the next spot for
@@ -228,11 +246,19 @@ func (t *TCI) SendSpot(s SpotInfo) error {
// other two matching what already works here.
_ = t.send(fmt.Sprintf("spot_delete:%s;", call))
}
// TCI's SPOT command wants the colour as a signed 32-bit DECIMAL integer in
// 0xAARRGGBB order — NOT a "0x…" hex string (e.g. "spot:UN7GK,cw,14025000,
// -16776961,test;"). ExpertSDR silently drops a spot whose colour field it
// can't parse as a number, which is why spots never showed on the panorama
// while tuning (a separate command) still worked.
// The colour is a DECIMAL ARGB integer, and an UNSIGNED one.
//
// Expert Electronics' own protocol document gives the whole command:
//
// SPOT:RN6LHF,CW,7100000,16711680,ANY_TEXT;
//
// 16711680 is 0x00FF0000 — positive, alpha zero. This backend was sending
// the same number as a SIGNED 32-bit value, taken from a third-party
// example: with the alpha byte set to FF for opacity, 0xFFFFA500 becomes
// -22336, and a spot whose colour field ExpertSDR cannot read is dropped in
// silence. Reported on ExpertSDR3 1.3 (which speaks TCI 2.x, so the version
// was never the problem): everything else worked and the panorama stayed
// empty.
hex := strings.TrimPrefix(strings.TrimPrefix(strings.TrimSpace(s.Color), "#"), "0x")
if hex == "" {
hex = "FFFFA500" // opaque orange default
@@ -253,7 +279,15 @@ func (t *TCI) SendSpot(s SpotInfo) error {
}
// Commas/semicolons would break TCI's comma-separated argument parsing.
text := strings.NewReplacer(",", " ", ";", " ").Replace(s.Comment)
return t.send(fmt.Sprintf("spot:%s,%s,%d,%d,%s;", call, mode, s.FreqHz, int32(argb), text))
cmd := fmt.Sprintf("spot:%s,%s,%d,%d,%s;", call, mode, s.FreqHz, argb, text)
// The first few, verbatim. A spot that the radio ignores leaves no trace at
// all — no reply, no error — so the only evidence that OpsLog sent one, and
// in what shape, is this line.
if n := t.spotsSent; n < 3 {
t.spotsSent = n + 1
debugLog.Printf("TCI: sending spot #%d: %s", n+1, strings.TrimSuffix(cmd, ";"))
}
return t.send(cmd)
}
// Disconnect closes the WebSocket; the reader goroutine then exits.
@@ -334,6 +368,11 @@ func (t *TCI) ReadState() (RigState, error) {
// SetFrequency tunes VFO A (the main/RX VFO).
func (t *TCI) SetFrequency(hz int64) error {
// Remember what we ASKED for. SetMode reads it to choose the sideband, and
// the radio's own echo can be a moment behind — see SetMode.
t.mu.Lock()
t.wantFreq = hz
t.mu.Unlock()
return t.send(fmt.Sprintf("vfo:0,0,%d;", hz))
}
@@ -342,6 +381,17 @@ func (t *TCI) SetFrequency(hz int64) error {
func (t *TCI) SetMode(mode string) error {
t.mu.Lock()
freq := t.freqA
// Prefer the frequency we just COMMANDED over the one the radio has echoed.
//
// Clicking a spot sets the frequency and then the mode, and the sideband is
// chosen from the frequency (below 10 MHz → LSB). Read from the echo, that
// is the frequency we were on BEFORE the click whenever the echo has not
// landed yet: a 14 MHz spot clicked from 7 MHz got LSB, and clicking the same
// spot again — now that the echo has arrived — got USB. Reported from a
// SunSDR as "the frequency is right, the mode is wrong until I click twice".
if t.wantFreq > 0 {
freq = t.wantFreq
}
t.mu.Unlock()
m := adifToTCIMode(mode, freq)
if m == "" {
@@ -493,6 +543,18 @@ func (t *TCI) handle(msg string) {
switch lower {
case "device":
t.device = strings.TrimSpace(args)
// The server's own announcement: "protocol:ExpertSDR3,1.9;" — its name and
// the TCI version it speaks. Worth keeping rather than filing under
// "unhandled": panorama spots need a version that HAS the spot command, and
// without this an operator on an older ExpertSDR sees nothing on the
// waterfall and nothing anywhere saying why.
case "protocol":
t.serverName, t.serverVersion = get(0), get(1)
debugLog.Printf("TCI: server is %s, TCI %s", t.serverName, t.serverVersion)
if t.spotsEnabled && tciSpotsUnsupported(t.serverVersion) {
debugLog.Printf("TCI: this server speaks TCI %s — panorama spots need 1.5 or later, so they will not appear",
t.serverVersion)
}
// The radio ANNOUNCES its audio format at connect —
// "audio_stream_sample_type:float32" and "audio_stream_channels:2" — which
// is better evidence than anything derived from a frame, and it arrives
@@ -516,6 +578,10 @@ func (t *TCI) handle(msg string) {
switch get(1) {
case "0":
t.freqA = hz
// The radio has caught up: from here the echo IS the truth.
if t.wantFreq != 0 && absInt64(hz-t.wantFreq) < 100 {
t.wantFreq = 0
}
case "1":
t.freqB = hz
}
@@ -651,3 +717,18 @@ func adifToTCIMode(mode string, freqHz int64) string {
return "digu"
}
}
// tciSpotsUnsupported reports whether a TCI version predates the spot commands.
//
// SPOT / SPOT_DELETE / SPOT_CLEAR arrived in TCI 1.5. An older ExpertSDR accepts
// the connection, answers frequency and mode perfectly, and silently ignores
// every spot — which is indistinguishable from a bug in the logger unless
// somebody says so. Anything unparseable is treated as supported: refusing to
// draw on a doubt would be the worse mistake.
func tciSpotsUnsupported(version string) bool {
var maj, min int
if n, err := fmt.Sscanf(strings.TrimSpace(version), "%d.%d", &maj, &min); n < 2 || err != nil {
return false
}
return maj < 1 || (maj == 1 && min < 5)
}
+72
View File
@@ -0,0 +1,72 @@
package cat
import (
"fmt"
"strings"
)
// CW keying over TCI — a sixth CW engine, so a SunSDR needs no WinKeyer and no
// second serial port: the radio's own macro keyer is driven over the WebSocket
// that already carries the CAT.
//
// The commands, from the TCI command table (confirmed against ars-ka0s/eesdr-tci,
// the same source that settled SPOT):
//
// CW_MACROS:<trx>,<text>; send text through the radio's keyer
// CW_MACROS_SPEED:<wpm>; the speed those macros are keyed at
// CW_MACROS_STOP; abort what is being keyed
// CW_MACROS_EMPTY; the radio saying the buffer has run dry
//
// CW_MSG (TCI 2.0) does the same with separate before/after callsign fields.
// CW_MACROS is used instead because it exists from 1.6 and OpsLog resolves the
// variables itself — the text handed here is already what should go on the air.
//
// Notably absent: there is no backspace. The FlexRadio CWX keyer can un-type
// what has not been sent yet; TCI can only stop. So the type-ahead correction
// the Flex engine offers is not offered here rather than faked.
// tciCWTextLimit caps one macro. A runaway paste down a WebSocket that also
// carries audio is worth refusing, and no real CW message is this long.
const tciCWTextLimit = 512
// SendCW keys a message through the radio's macro keyer.
func (t *TCI) SendCW(text string) error {
msg := sanitiseTCICW(text)
if msg == "" {
return nil
}
return t.send(fmt.Sprintf("cw_macros:0,%s;", msg))
}
// StopCW aborts the message being keyed.
func (t *TCI) StopCW() error { return t.send("cw_macros_stop;") }
// SetCWSpeed sets the macro keyer speed in words per minute.
//
// Only the MACRO speed: the paddle keyer has its own (CW_KEYER_SPEED) and an
// operator who has set their paddle to 28 wpm did not ask the logger to change
// it because a macro went out at 25.
func (t *TCI) SetCWSpeed(wpm int) error {
if wpm < 5 {
wpm = 5
}
if wpm > 60 {
wpm = 60
}
return t.send(fmt.Sprintf("cw_macros_speed:%d;", wpm))
}
// sanitiseTCICW makes a message safe to put in a TCI command.
//
// Commas and semicolons are the protocol's own separators — a comma inside the
// text would be read as another argument and a semicolon would end the command
// early, keying half a message and leaving the rest to be parsed as a command of
// its own. Neither belongs in Morse anyway.
func sanitiseTCICW(text string) string {
s := strings.ToUpper(strings.TrimSpace(text))
s = strings.NewReplacer(",", " ", ";", " ", "\r", " ", "\n", " ").Replace(s)
if len(s) > tciCWTextLimit {
s = s[:tciCWTextLimit]
}
return strings.TrimSpace(s)
}
+23
View File
@@ -96,3 +96,26 @@ func (m *Manager) TCIPanelDo(fn func(TCIPanelController) error) error {
return fn(tc)
})
}
// TCICWController is the radio's CW keyer, as the CW engine uses it.
//
// Three methods, and no backspace: TCI can stop a message but cannot un-type one
// (see tci_cw.go). Kept as its own interface rather than folded into the console
// one so a CW engine does not have to depend on forty panel setters to key a
// message.
type TCICWController interface {
SendCW(text string) error
StopCW() error
SetCWSpeed(wpm int) error
}
// TCICWDo dispatches one keyer command onto the CAT goroutine.
func (m *Manager) TCICWDo(fn func(TCICWController) error) error {
return m.exec(func(b Backend) error {
tc, ok := b.(TCICWController)
if !ok {
return fmt.Errorf("the active CAT backend is not a TCI radio")
}
return fn(tc)
})
}
+36
View File
@@ -233,6 +233,42 @@ func (t *TCI) handlePanel(name string, get func(int) string, args string) bool {
if n, ok := num(get(1)); ok && forRX0() {
p.SMeter = n
}
// The meters of ExpertSDR3. The S-meter used to be read only from RX_SMETER
// and the transmit ones from TX_POWER / TX_SWR — commands this radio simply
// never sends, which is why the console's meters sat empty on a SunSDR in
// both RX and TX while everything else worked.
//
// The protocol's own answer (TCI Protocol.pdf, §4.4) is a SUBSCRIPTION:
//
// RX_SENSORS:<rx>,<dBm>; (deprecated in 2.0)
// RX_CHANNEL_SENSORS:<rx>,<channel>,<dBm>; (its replacement)
// TX_SENSORS:<trx>,<mic dBm>,<power W>,<peak W>,<SWR>;
//
// none of which arrives until the client asks with RX_SENSORS_ENABLE and
// TX_SENSORS_ENABLE — see Connect.
case "rx_sensors":
if v, err := strconv.ParseFloat(strings.TrimSpace(get(1)), 64); err == nil && forRX0() {
p.SMeter = int(v)
}
case "rx_channel_sensors":
// Main channel (A) of receiver 0: the one the console is showing.
if v, err := strconv.ParseFloat(strings.TrimSpace(get(2)), 64); err == nil &&
get(0) == "0" && get(1) == "0" {
p.SMeter = int(v)
}
case "tx_sensors":
if get(0) != "0" {
break
}
// arg3 is RMS power, arg4 the peak. The peak is what a power meter's
// needle does on speech; the RMS is what the operator is asked to keep
// under the amplifier's limit — so RMS is the number, as elsewhere.
if v, err := strconv.ParseFloat(strings.TrimSpace(get(2)), 64); err == nil {
p.TXPowerW = v
}
if v, err := strconv.ParseFloat(strings.TrimSpace(get(4)), 64); err == nil {
p.TXSWR = v
}
case "tune":
if forRX0() {
p.Tuning = yes(get(1))
+41
View File
@@ -0,0 +1,41 @@
package cat
import "testing"
func TestTCISpotsUnsupported(t *testing.T) {
// SPOT arrived in TCI 1.5. The SunSDR2 PRO report that prompted this was an
// ExpertSDR announcing 1.3 — spots accepted and silently dropped.
for _, c := range []struct {
version string
old bool
}{
{"1.3", true},
{"1.4", true},
{"1.5", false},
{"1.9", false},
{"2.0", false},
{"", false}, // unparseable → assume it works
{"weird", false}, // refusing to draw on a doubt is the worse mistake
} {
if got := tciSpotsUnsupported(c.version); got != c.old {
t.Errorf("tciSpotsUnsupported(%q) = %v, want %v", c.version, got, c.old)
}
}
}
func TestSanitiseTCICW(t *testing.T) {
// The separators must never survive: a comma would become another argument
// and a semicolon would end the command with the message half sent.
for _, c := range []struct{ in, want string }{
{"cq cq de f4bpo", "CQ CQ DE F4BPO"},
{" tu 599 ", "TU 599"},
{"73, gl", "73 GL"},
{"test;cw_macros_stop", "TEST CW_MACROS_STOP"},
{"line\r\nbreak", "LINE BREAK"},
{" ", ""},
} {
if got := sanitiseTCICW(c.in); got != c.want {
t.Errorf("sanitiseTCICW(%q) = %q, want %q", c.in, got, c.want)
}
}
}
+33 -2
View File
@@ -5,6 +5,7 @@ package email
import (
"fmt"
"os"
"strings"
"time"
"github.com/wneessen/go-mail"
@@ -86,12 +87,42 @@ func SendFiles(cfg Config, to, subject, body string, attachPaths []string) error
return fmt.Errorf("smtp client: %w", err)
}
if err := client.DialAndSend(m); err != nil {
return fmt.Errorf("send via %s:%d (%s, %s): %w",
cfg.Host, cfg.Port, cfg.Encryption, describeSize(attachPaths), err)
return fmt.Errorf("send via %s:%d (%s, %s): %w%s",
cfg.Host, cfg.Port, cfg.Encryption, describeSize(attachPaths), err, explainSMTP(err))
}
return nil
}
// explainSMTP turns a server's refusal into the thing to go and do.
//
// A rejection is quoted verbatim above it — the server's own words are the
// evidence — but several of them name a policy rather than a mistake, and no
// amount of re-checking the password will fix those. Microsoft's is the one
// operators keep hitting: basic authentication for SMTP is switched off across
// Microsoft 365 and outlook.com, and an app password does not bring it back.
func explainSMTP(err error) string {
msg := strings.ToLower(err.Error())
switch {
case strings.Contains(msg, "basic authentication is disabled"),
strings.Contains(msg, "5.7.139"):
return "\n\nMicrosoft has switched off password-based SMTP for this account. " +
"An app password does not restore it — the server refuses the password itself, not the one you typed. " +
"On a Microsoft 365 tenant an administrator can re-enable it for this mailbox " +
"(Set-CASMailbox -SmtpClientAuthenticationDisabled $false, plus the tenant-wide setting); " +
"otherwise use another provider for alerts (a Gmail account with an app password works, so does any ordinary IMAP/SMTP host)."
case strings.Contains(msg, "application-specific password"),
strings.Contains(msg, "5.7.9"):
return "\n\nThis account needs an APP PASSWORD rather than the one you sign in with " +
"(Google, Yahoo and others require it once two-factor authentication is on)."
case strings.Contains(msg, "5.7.8"), strings.Contains(msg, "authentication failed"),
strings.Contains(msg, "535"):
return "\n\nThe server rejected the username or the password."
case strings.Contains(msg, "must issue a starttls"):
return "\n\nThe server requires encryption: set STARTTLS (usually port 587) or SSL (465)."
}
return ""
}
// describeSize reports what was attached, in bytes.
//
// "An existing connection was forcibly closed" during DATA is the same message
+29
View File
@@ -0,0 +1,29 @@
package email
import (
"errors"
"strings"
"testing"
)
func TestExplainSMTP(t *testing.T) {
// The real refusal, from an operator's Outlook account.
outlook := errors.New("SMTP AUTH failed: 535 5.7.139 Authentication unsuccessful, basic authentication is disabled.")
if got := explainSMTP(outlook); !strings.Contains(got, "Microsoft has switched off") {
t.Errorf("the Microsoft policy refusal is not explained: %q", got)
}
// A plain wrong password must NOT claim a policy: the advice would send the
// operator to an administrator over a typo.
wrong := errors.New("535 5.7.8 authentication failed")
got := explainSMTP(wrong)
if strings.Contains(got, "Microsoft") {
t.Errorf("a wrong password was explained as a Microsoft policy: %q", got)
}
if !strings.Contains(got, "rejected the username") {
t.Errorf("a wrong password is not explained: %q", got)
}
// Anything else is left to speak for itself.
if got := explainSMTP(errors.New("dial tcp: i/o timeout")); got != "" {
t.Errorf("an unrelated error got an explanation: %q", got)
}
}
+151 -11
View File
@@ -12,6 +12,7 @@ import (
"os/exec"
"path/filepath"
"strings"
"sync"
"syscall"
"time"
)
@@ -20,6 +21,67 @@ import (
// document of the user's QSOs (optionally only confirmed ones).
const lotwReportURL = "https://lotw.arrl.org/lotwuser/lotwreport.adi"
const (
// How long LoTW may take to START answering. It builds the whole report
// before sending anything, so this is the slow part of a big account.
lotwHeaderTimeout = 10 * time.Minute
// How long the transfer may stall once it HAS started. A download that has
// not moved in this long is not slow, it is dead — and saying so beats a
// progress window that sits at "working" until someone gives up.
lotwIdleTimeout = 2 * time.Minute
lotwMaxBytes = 256 * 1024 * 1024
)
// readWithProgress reads the body in chunks, reporting the running total and
// failing fast on a stall.
//
// Reported as it arrives rather than at the end: an 18 MB report over a slow
// link is minutes of silence otherwise, which is indistinguishable from a hang —
// and that is exactly what operators were reporting.
func say(note func(string), msg string) {
if note != nil {
note(msg)
}
LogSink("%s", msg)
}
func readWithProgress(ctx context.Context, r io.Reader, note func(string)) ([]byte, error) {
var (
out []byte
total int64
last = time.Now()
buf = make([]byte, 64*1024)
next = int64(256 * 1024) // first report early — proof it is moving
)
for {
if err := ctx.Err(); err != nil {
return nil, err
}
n, err := r.Read(buf)
if n > 0 {
out = append(out, buf[:n]...)
total += int64(n)
last = time.Now()
if total >= next {
say(note, fmt.Sprintf(" … %.1f MB received", float64(total)/(1024*1024)))
next = total + 512*1024
}
if total >= lotwMaxBytes {
return out, nil
}
}
if err == io.EOF {
return out, nil
}
if err != nil {
return nil, err
}
if time.Since(last) > lotwIdleTimeout {
return nil, fmt.Errorf("the transfer stalled after %d KB — LoTW stopped sending", total/1024)
}
}
}
// DownloadLoTWConfirmations fetches confirmed QSOs from LoTW as ADIF text.
// Uses the LoTW *website* login (Username/Password), not the TQSL cert. When
// since is non-empty (YYYY-MM-DD) only confirmations received since then are
@@ -27,7 +89,7 @@ const lotwReportURL = "https://lotw.arrl.org/lotwuser/lotwreport.adi"
// non-empty, only confirmations for that station callsign are returned (an
// LoTW account holds every call you operate — F4BPO, F4BPO/P, TM2Q — so this
// scopes the pull to the active profile's call).
func DownloadLoTWConfirmations(ctx context.Context, client *http.Client, cfg ServiceConfig, since, ownCall string) (string, error) {
func DownloadLoTWConfirmations(ctx context.Context, client *http.Client, cfg ServiceConfig, since, ownCall string, detail bool, note func(string)) (string, error) {
user := strings.TrimSpace(cfg.Username)
if user == "" || cfg.Password == "" {
return "", fmt.Errorf("lotw: website login (username/password) not set")
@@ -37,7 +99,18 @@ func DownloadLoTWConfirmations(ctx context.Context, client *http.Client, cfg Ser
q.Set("password", cfg.Password)
q.Set("qso_query", "1")
q.Set("qso_qsl", "yes") // only QSLed (confirmed) records
q.Set("qso_qsldetail", "yes") // include QSL_RCVD / QSLRDATE detail
// qso_qsldetail is what LoTW charges for: it adds the QSL date and the
// station's own DXCC / grid / state / county to every record, and takes an
// order of magnitude longer to build — a report that arrives in two minutes
// without it takes twenty with it, measured on the same account.
//
// What we actually need to mark a confirmation is call, date, band and mode.
// The rest is worth its price only when the download is also ADDING the QSOs
// it cannot find, which is the one case where the extra fields are the only
// source for them.
if detail {
q.Set("qso_qsldetail", "yes")
}
if c := strings.TrimSpace(ownCall); c != "" {
q.Set("qso_owncall", c) // restrict to this station callsign
}
@@ -57,20 +130,87 @@ func DownloadLoTWConfirmations(ctx context.Context, client *http.Client, cfg Ser
if err != nil {
return "", fmt.Errorf("lotw: build request: %w", err)
}
// Named, because LoTW's front end throttles unidentified clients harder than
// it throttles known ones, and an operator reporting a 503 deserves a request
// that says who is asking.
req.Header.Set("User-Agent", "OpsLog")
if client == nil {
// A full account is tens of megabytes and LoTW builds it slowly — several
// minutes for a log of 30 000 QSOs, all of it before the first byte. The
// old two-minute limit turned that into "context deadline exceeded while
// reading body", which reads as a network fault rather than as "ask for
// less at a time".
client = &http.Client{Timeout: 20 * time.Minute}
// NO overall deadline. A full account is tens of megabytes and LoTW spends
// minutes building it before the first byte; a total timeout turns a slow
// but healthy download into "context deadline exceeded", and a longer one
// turns a dead connection into a window that says "working" for twenty
// minutes. What matters is not how long it takes but whether it is still
// moving — see the idle watchdog below.
client = &http.Client{
Transport: &http.Transport{
Proxy: http.ProxyFromEnvironment,
ResponseHeaderTimeout: lotwHeaderTimeout,
TLSHandshakeTimeout: 30 * time.Second,
},
}
}
// LoTW answers 503 when it is busy, which for a report covering more than a
// few days is often — other loggers get the same answer and simply ask
// again. Three tries, spaced, and each one said out loud: an operator whose
// download takes four minutes because the ARRL is loaded should be able to
// see that rather than guess it.
// LoTW sends nothing at all until the whole report is built — minutes for a
// large account. That silence was the entire complaint: a window saying
// "working" with no way to tell a busy server from a dead one. Count it out
// loud until the first byte.
beat := make(chan struct{})
go func() {
start := time.Now()
tick := time.NewTicker(15 * time.Second)
defer tick.Stop()
for {
select {
case <-beat:
return
case <-ctx.Done():
return
case <-tick.C:
say(note, fmt.Sprintf(" … still waiting for LoTW to build the report (%.0f s)", time.Since(start).Seconds()))
}
}
}()
// Stopped where the WAIT ends, not where the function does: deferred, the
// heartbeat went on counting between the megabyte lines and read as if the
// report were still being built while it was already arriving.
stopBeat := sync.OnceFunc(func() { close(beat) })
defer stopBeat()
var resp *http.Response
for attempt := 1; ; attempt++ {
resp, err = client.Do(req) //nolint:bodyclose // closed below or in the retry
if err == nil && resp.StatusCode != http.StatusServiceUnavailable &&
resp.StatusCode != http.StatusBadGateway && resp.StatusCode != http.StatusGatewayTimeout {
break
}
if attempt >= 3 {
break
}
wait := time.Duration(attempt*20) * time.Second
if resp != nil {
say(note, fmt.Sprintf("LoTW is busy (HTTP %d) — asking again in %s…", resp.StatusCode, wait))
resp.Body.Close()
} else {
say(note, fmt.Sprintf("LoTW did not answer (%v) — asking again in %s…", err, wait))
}
select {
case <-ctx.Done():
return "", ctx.Err()
case <-time.After(wait):
}
req = req.Clone(ctx)
}
resp, err := client.Do(req)
if err != nil {
return "", fmt.Errorf("lotw: request failed: %w", err)
}
defer resp.Body.Close()
body, err := io.ReadAll(io.LimitReader(resp.Body, 256*1024*1024))
stopBeat()
say(note, fmt.Sprintf("LoTW answered (HTTP %d) — receiving…", resp.StatusCode))
body, err := readWithProgress(ctx, resp.Body, note)
if err != nil {
return "", fmt.Errorf("lotw: read response: %w", err)
}
@@ -378,7 +518,7 @@ func TestLoTW(cfg ServiceConfig, stationDataPath string) (string, error) {
}
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
if _, err := DownloadLoTWConfirmations(ctx, nil, cfg, "2099-01-01", ""); err != nil {
if _, err := DownloadLoTWConfirmations(ctx, nil, cfg, "2099-01-01", "", false, nil); err != nil {
return "", fmt.Errorf("%s — but the DOWNLOAD login failed: %w", up, err)
}
return up + ". Download login accepted.", nil
+1 -1
View File
@@ -21,7 +21,7 @@ import (
const (
// appVersion is stamped on every heartbeat (and could feed the About box).
appVersion = "0.26.20"
appVersion = "0.26.22"
// posthogHost is the PostHog ingestion endpoint. EU cloud by default; change
// to https://us.i.posthog.com for a US project.
+7
View File
@@ -0,0 +1,7 @@
//go:build !windows
package main
// Placing a window at an absolute desktop coordinate is Windows-specific; every
// caller falls back to the toolkit's own call when this says no.
func setWindowPosAbsolute(x, y int) bool { return false }
+93
View File
@@ -0,0 +1,93 @@
//go:build windows
package main
import (
"syscall"
"unsafe"
"hamlog/internal/applog"
)
// Moving the window to an ABSOLUTE virtual-desktop position.
//
// Wails' own WindowSetPosition cannot do it. Its Windows implementation reads:
//
// func (cba *ControlBase) SetPos(x, y int) {
// info := getMonitorInfo(cba.hwnd)
// w32.SetWindowPos(cba.hwnd, HWND_TOP, int(info.RcWork.Left)+x, int(info.RcWork.Top)+y, ...)
// }
//
// — the coordinates are relative to the CURRENT monitor's work area, while
// WindowGetPosition returns GetWindowRect, which is absolute. Saving one and
// restoring the other is only harmless on the primary monitor, where the work
// area starts at 0.
//
// On a second monitor to the LEFT it compounds at every launch. Reported from a
// two-screen station with the left monitor at x = -3840: OpsLog saved -3844,
// reopened on that monitor, added the monitor's own origin, and stored -7684 —
// then -11524, each launch one screen further into nowhere.
//
// So we place the window ourselves. Same call the toolkit makes, without the
// offset.
const (
swpNoSize = 0x0001
swpNoZOrder = 0x0004
swpNoActivate = 0x0010
)
var (
procSetWindowPos = user32Dll.NewProc("SetWindowPos")
procEnumWindows = user32Dll.NewProc("EnumWindows")
procGetWindowThreadProcessID = user32Dll.NewProc("GetWindowThreadProcessId")
procGetWindowTextLengthW = user32Dll.NewProc("GetWindowTextLengthW")
procGetWindow = user32Dll.NewProc("GetWindow")
kernel32Dll = syscall.NewLazyDLL("kernel32.dll")
procGetCurrentProcessIDWinPos = kernel32Dll.NewProc("GetCurrentProcessId")
)
// mainWindowHandle finds this process's own top-level window.
//
// Wails does not expose the handle, so it is looked up: the first top-level
// window belonging to this process id that has no owner and a title. The window
// is created hidden (StartHidden), and EnumWindows lists hidden windows too,
// which is what makes this usable before the window is shown.
func mainWindowHandle() uintptr {
self, _, _ := procGetCurrentProcessIDWinPos.Call()
var found uintptr
cb := syscall.NewCallback(func(hwnd uintptr, _ uintptr) uintptr {
var pid uint32
procGetWindowThreadProcessID.Call(hwnd, uintptr(unsafe.Pointer(&pid)))
if uintptr(pid) != self {
return 1 // keep going
}
// GW_OWNER = 4: skip tool windows and dialogs owned by the main one.
if owner, _, _ := procGetWindow.Call(hwnd, 4); owner != 0 {
return 1
}
if n, _, _ := procGetWindowTextLengthW.Call(hwnd); n == 0 {
return 1
}
found = hwnd
return 0 // stop
})
procEnumWindows.Call(cb, 0)
return found
}
// setWindowPosAbsolute moves the window to a virtual-desktop coordinate.
// Reports whether it could; the caller falls back to the toolkit's own call.
func setWindowPosAbsolute(x, y int) bool {
hwnd := mainWindowHandle()
if hwnd == 0 {
applog.Printf("window: could not find our own window handle — falling back to the toolkit's placement")
return false
}
r, _, err := procSetWindowPos.Call(hwnd, 0, uintptr(int32(x)), uintptr(int32(y)), 0, 0,
swpNoSize|swpNoZOrder|swpNoActivate)
if r == 0 {
applog.Printf("window: SetWindowPos(%d,%d) failed: %v", x, y, err)
return false
}
return true
}