Start the transmit pane again on every new message
The macro buttons went wrong at the end of a transmission, both faults in
DigitalEngineSender:
- The engine reports the transmitter drop on its own thread.
WhenTransmitChanged took the state lock, decided the message had ended,
released the lock, and only then called Buffer.Ended(), which clears
what has gone to the engine. A macro pressed on the last character got
through StartAsync in that gap and had already flushed its own text into
Sent, so Ended() wiped the new text off the pane while the engine
transmitted it. Ended() is now called inside the same lock.
- The pane only started again when the engine reported a drop. Two macros
in a row keep the transmitter up, so that report never came and Sent
grew with every press. Everything in Sent is locked, because it is in
the engine and cannot be taken back, so the whole pane became
read-only. TypeAhead.Started() drops the last message's sent text and
keeps what was typed ahead, and StartAsync calls it whenever it keys a
new transmission.
The rest of this commit is the digital transmit work these fixes sit on:
the pane as one coloured box, the sender's three keying states, the
type-ahead feeder paced by the clock with the engine's count as a brake,
{RX} flushing what is left in one piece, and the entry window's function
keys reading the digital macros on a digital mode.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PdAYHcdRktqKry7nk414TU
This commit is contained in:
@@ -10,6 +10,12 @@ namespace Nonemm.Session;
|
||||
/// N1MM's rule, which this follows: an action macro runs before the message is
|
||||
/// sent, unless it stands after `{END}`, and then it runs when the message has
|
||||
/// finished. Text after `{END}` is dropped, because the message is over.
|
||||
///
|
||||
/// `{RX}` is the exception. It drops the transmitter, which cannot happen
|
||||
/// before the message it stands in has gone out, so it always runs with the
|
||||
/// actions that follow the message. N1MM does the same: it takes `{RX}` out of
|
||||
/// the text wherever it stands, sends the text, and stops the transmitter
|
||||
/// after it.
|
||||
public sealed record MessagePlan(
|
||||
IReadOnlyList<MessageAction> Before,
|
||||
string Text,
|
||||
@@ -45,7 +51,8 @@ public sealed record MessagePlan(
|
||||
}
|
||||
else if (Action(name) is { } action)
|
||||
{
|
||||
(ended ? after : before).Add(action);
|
||||
(ended || action.Command == MessageCommand.ReturnToReceive ? after : before)
|
||||
.Add(action);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user