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)
This commit is contained in:
+4
-13
@@ -2197,20 +2197,11 @@ export default function App() {
|
|||||||
while (autoCallMacroRef.current === i && gen === autoCallGenRef.current && wkActiveRef.current) {
|
while (autoCallMacroRef.current === i && gen === autoCallGenRef.current && wkActiveRef.current) {
|
||||||
const m = wkMacros[i];
|
const m = wkMacros[i];
|
||||||
if (!m) break;
|
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);
|
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;
|
if (gen !== autoCallGenRef.current) break;
|
||||||
await sleep(Math.max(0, wkAutoCallSecsRef.current) * 1000); // the gap before the next call
|
await sleep(Math.max(0, wkAutoCallSecsRef.current) * 1000); // the gap before the next call
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user