From be66ac1e19439ef8830a45d7c96cdada59860b6f Mon Sep 17 00:00:00 2001 From: rouggy Date: Tue, 21 Jul 2026 10:26:28 +0200 Subject: [PATCH] fix: auto-call gap respected again (wkSend already waits for the send; runAutoCall no longer double-counts it, so a 4s gap is 4s not ~13s) --- frontend/src/App.tsx | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 40e4506..5f1dd2d 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -2197,20 +2197,11 @@ export default function App() { while (autoCallMacroRef.current === i && gen === autoCallGenRef.current && wkActiveRef.current) { const m = wkMacros[i]; if (!m) break; + // wkSend now WAITS for the CW to finish sending on its own (per-segment, all + // engines), so we must NOT re-wait the estimated duration here — doing both + // double-counted the send time and made the gap between calls far longer than + // configured (a 4 s gap became ~13 s). Just wait the configured gap. await wkSend(m.text); - // Wait for the message to finish before the gap+resend. The Icom keyer has - // no busy echo, so just wait the estimated send time. For the WinKeyer, cap - // the wait at the ESTIMATED send time (not the busy flag alone): over a - // remote/serial-over-IP link the "busy" status lags badly and stays stuck - // true for tens of seconds, which made the next CQ fire ~120s late. - if (cwSourceRef.current === 'icom' || cwSourceRef.current === 'flex') { - await sleep(Math.round(estimateCwMs(resolveCW(m.text), wkWpm)) + 300); - } else { - const capMs = Math.round(estimateCwMs(resolveCW(m.text), wkWpm) * 1.4) + 2500; - for (let k = 0; k < 20 && !wkBusyRef.current && gen === autoCallGenRef.current; k++) await sleep(50); // ≤1s to start - const deadline = Date.now() + capMs; - while (wkBusyRef.current && gen === autoCallGenRef.current && Date.now() < deadline) await sleep(50); - } if (gen !== autoCallGenRef.current) break; await sleep(Math.max(0, wkAutoCallSecsRef.current) * 1000); // the gap before the next call }