up
This commit is contained in:
+34
-4
@@ -20,6 +20,7 @@ import {
|
||||
ListClusterServers, ClusterSpotStatuses,
|
||||
GetCATSettings,
|
||||
OperatingDefaultForBand,
|
||||
LogUDPLoggedADIF,
|
||||
} from '../wailsjs/go/main/App';
|
||||
import { EventsOn } from '../wailsjs/runtime/runtime';
|
||||
import type { adif as adifModels, lookup as lookupModels, cat as catModels } from '../wailsjs/go/models';
|
||||
@@ -246,7 +247,7 @@ export default function App() {
|
||||
|
||||
// CAT — receives live rig state via Wails events.
|
||||
const [catState, setCatState] = useState<CATState>({ enabled: false, connected: false } as any);
|
||||
// Mode HamLog shows when the rig reports generic DIG_U/DIG_L. OmniRig
|
||||
// Mode OpsLog shows when the rig reports generic DIG_U/DIG_L. OmniRig
|
||||
// can't tell us if it's FT8 vs FT4 vs RTTY, so the user picks the default
|
||||
// in Preferences > Hardware > CAT interface.
|
||||
const digitalDefaultRef = useRef<string>('FT8');
|
||||
@@ -637,6 +638,35 @@ export default function App() {
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
// ── UDP integration events ───────────────────────────────────────────
|
||||
// Live updates from external apps (WSJT-X / JTDX / MSHV / DXHunter…).
|
||||
// We push the broadcast DX call into the entry field and auto-log any
|
||||
// ADIF record that arrives.
|
||||
useEffect(() => {
|
||||
const unsubDX = EventsOn('udp:dx_call', (p: any) => {
|
||||
const call = String(p?.call ?? '').trim();
|
||||
if (!call) return;
|
||||
// Don't clobber what the user is currently typing — only update
|
||||
// when the entry field is empty or matches a previous broadcast.
|
||||
onCallsignInput(call);
|
||||
});
|
||||
const unsubRC = EventsOn('udp:remote_call', (call: string) => {
|
||||
if (call) onCallsignInput(String(call).trim());
|
||||
});
|
||||
const unsubLog = EventsOn('udp:logged_qso', async (p: any) => {
|
||||
const text = String(p?.adif ?? '').trim();
|
||||
if (!text) return;
|
||||
try {
|
||||
await LogUDPLoggedADIF(text);
|
||||
await refresh();
|
||||
} catch (e: any) {
|
||||
setError('UDP auto-log: ' + String(e?.message ?? e));
|
||||
}
|
||||
});
|
||||
return () => { unsubDX?.(); unsubRC?.(); unsubLog?.(); };
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
// Resolve slot status for any spot we haven't seen yet — debounced so we
|
||||
// don't hammer the backend at firehose rate. The mode passed to the
|
||||
// backend is derived from the comment (CW / FT8 / FT4 / SSB...) and the
|
||||
@@ -941,7 +971,7 @@ export default function App() {
|
||||
{ type: 'item', label: ctyRefreshing ? 'Refreshing cty.dat…' : 'Refresh cty.dat', action: 'tools.refreshCty', disabled: ctyRefreshing },
|
||||
]},
|
||||
{ name: 'help', label: 'Help', items: [
|
||||
{ type: 'item', label: 'About HamLog', action: 'help.about', disabled: true },
|
||||
{ type: 'item', label: 'About OpsLog', action: 'help.about', disabled: true },
|
||||
]},
|
||||
], [total, selectedId, ctyRefreshing, exporting]);
|
||||
|
||||
@@ -1006,7 +1036,7 @@ export default function App() {
|
||||
<header className="flex items-center gap-3 px-3 h-8 bg-card border-b border-border shrink-0">
|
||||
<div className="flex items-center gap-1.5">
|
||||
<div className="size-2 rounded-full bg-gradient-to-br from-primary to-orange-400" />
|
||||
<span className="font-bold text-xs tracking-tight">HamLog</span>
|
||||
<span className="font-bold text-xs tracking-tight">OpsLog</span>
|
||||
</div>
|
||||
<div className="flex items-baseline gap-1.5 font-mono ml-2">
|
||||
<span className="text-sm font-semibold text-primary">{freqMhz ? fmtFreqDots(freqMhz) : '—.———.———'}</span>
|
||||
@@ -1027,7 +1057,7 @@ export default function App() {
|
||||
<header className="grid grid-cols-[auto_auto_1fr_auto_auto] items-center gap-4 px-4 h-12 bg-card/95 backdrop-blur border-b border-border shrink-0 shadow-sm">
|
||||
<div className="flex items-center gap-2 pr-2 border-r border-border/60">
|
||||
<div className="size-2.5 rounded-full bg-gradient-to-br from-primary to-orange-400 shadow-[0_0_0_3px_rgba(234,88,12,0.18)]" />
|
||||
<span className="font-bold text-[15px] tracking-tight">HamLog</span>
|
||||
<span className="font-bold text-[15px] tracking-tight">OpsLog</span>
|
||||
<span className="text-[11px] text-muted-foreground">v0.1</span>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user