fix: release TX when the elements stop; WSJT-X colours, and worked beats the watch list

The motorised antenna gagged the transmitter for a second or two after it
had finished moving. Three delays were stacked: the antenna polled every
two seconds, the gag held for three after the command whatever the
antenna said, and the widget refreshed every three. The antenna is now
asked four times a second WHILE IT MOVES — an idle one has nothing to say
and stays at two seconds — the gag only bridges the command itself
(900 ms), and the widget follows at half a second while moving.

WSJT-X highlighting:

- A watch-list station already worked on this band and mode is no longer
  painted as one to call. The list is a statement of intent, not of what
  is left to do, and its pink outranked every other verdict including the
  log's, so a worked station stayed pink for the session with nothing to
  tell it from one still needed.
- The four colours are the operator's to choose (Settings → UDP). Only
  the background: the text colour is derived by luma, so a dark blue
  cannot come back as black-on-black in somebody else's window. Changing
  one clears the installed highlights, or the de-duplication would keep
  showing yesterday's colour until a callsign changed verdict.
This commit is contained in:
2026-09-06 18:43:08 +02:00
parent 07ee48e20c
commit d001616767
11 changed files with 306 additions and 31 deletions
@@ -3,6 +3,7 @@ import { Plus, Trash2, Edit2, RefreshCcw, ArrowDownToLine, ArrowUpFromLine } fro
import {
ListUDPIntegrations, SaveUDPIntegration, DeleteUDPIntegration, ReloadUDPIntegrations,
GetWsjtHighlight, SetWsjtHighlight, GetWsjtHighlightWorked, SetWsjtHighlightWorked, GetWsjtFollowMode, SetWsjtFollowMode,
GetWsjtHighlightColours, SetWsjtHighlightColours,
} from '../../wailsjs/go/main/App';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
@@ -161,9 +162,13 @@ type Props = { onError: (msg: string) => void };
export function UDPIntegrationsPanel({ onError }: Props) {
const [highlightOn, setHighlightOn] = useState(false);
const [hlWorked, setHlWorked] = useState(false);
// The palette, as chosen. Background per verdict; the text colour is the
// backends business (see colourFor).
const [colours, setColours] = useState({ watchlist: '#F472B6', new_dxcc: '#16823C', new_band: '#E27A18', worked: '#4B5563' });
const [followMode, setFollowMode] = useState(true);
useEffect(() => {
GetWsjtHighlight().then((v) => setHighlightOn(!!v)).catch(() => {});
GetWsjtHighlightColours().then((c: any) => { if (c) setColours(c); }).catch(() => {});
GetWsjtHighlightWorked().then((v) => setHlWorked(!!v)).catch(() => {});
GetWsjtHighlightWorked().then((v) => setHlWorked(!!v)).catch(() => {});
GetWsjtFollowMode().then((v) => setFollowMode(!!v)).catch(() => {});
@@ -249,6 +254,45 @@ export function UDPIntegrationsPanel({ onError }: Props) {
<span className="block text-[11px] text-muted-foreground">{t('udpp.highlightHint')}</span>
</span>
</label>
{/* The palette, nested under the switch for the same reason as the box
below it. One colour per verdict, and the background only: the text
colour is worked out from it, so a chosen colour cannot come back
unreadable in the decoder's window. */}
{highlightOn && (
<div className="pl-6 max-w-2xl space-y-1.5">
<div className="text-[11px] text-muted-foreground">{t('udpp.hlColours')}</div>
<div className="flex flex-wrap gap-3">
{([
['watchlist', t('udpp.hlWatchlist')],
['new_dxcc', t('udpp.hlNewDxcc')],
['new_band', t('udpp.hlNewBand')],
['worked', t('udpp.hlWorkedC')],
] as const).map(([k, label]) => (
<label key={k} className="inline-flex items-center gap-1.5 text-xs">
<input
type="color"
value={(colours as any)[k] || '#000000'}
onChange={(e) => {
const next = { ...colours, [k]: e.target.value.toUpperCase() };
setColours(next);
void SetWsjtHighlightColours(next as any);
}}
className="h-6 w-8 rounded border border-border bg-background p-0.5 cursor-pointer"
/>
{label}
</label>
))}
<button type="button" className="text-xs text-muted-foreground underline hover:text-foreground"
onClick={() => {
const def = { watchlist: '#F472B6', new_dxcc: '#16823C', new_band: '#E27A18', worked: '#4B5563' };
setColours(def as any);
void SetWsjtHighlightColours(def as any);
}}>
{t('udpp.hlReset')}
</button>
</div>
</div>
)}
{/* Nested under the switch above: the same feature, and meaningless
while that one is off. */}
{highlightOn && (