summaryrefslogtreecommitdiff
path: root/DecodedMessageReaction.hpp
diff options
context:
space:
mode:
authorhibby <d@vehibberd.com>2026-10-06 21:24:40 +0100
committerhibby <d@vehibberd.com>2026-10-06 21:24:40 +0100
commitc25cbdf6fb6d946175f4335fab77bfea601b56db (patch)
tree6f7a94b7b81f999e434f61b73d47e337dfd26bf2 /DecodedMessageReaction.hpp
parent71f5689252c9f13e70e1c24856904475b2307809 (diff)
parent0685fcada9f95fe90f70b387cd7d757da8209624 (diff)
Merge tag 'debian/3.2.0_rc1+dfsg-2' into debian/trixie-backportsdebian/trixie-backports
tagging wsjtx 3.2.0~rc1+dfsg-2
Diffstat (limited to 'DecodedMessageReaction.hpp')
-rw-r--r--DecodedMessageReaction.hpp210
1 files changed, 210 insertions, 0 deletions
diff --git a/DecodedMessageReaction.hpp b/DecodedMessageReaction.hpp
new file mode 100644
index 00000000..53d83a22
--- /dev/null
+++ b/DecodedMessageReaction.hpp
@@ -0,0 +1,210 @@
+#ifndef DECODEDMESSAGEREACTION_HPP
+#define DECODEDMESSAGEREACTION_HPP
+
+#include "QsoProgress.hpp"
+#include "Radio.hpp"
+#include "SpecialOperatingActivity.hpp"
+#include "AutoRespondPolicy.hpp"
+
+#include <functional>
+#include <QString>
+#include <QVector>
+
+class DecodedText;
+
+namespace DecodedMessageReaction
+{
+ enum class ReactionDisposition
+ {
+ NoReaction,
+ Reacted,
+ IgnoreDecode
+ };
+
+ enum class WaitDecodeSource
+ {
+ SlowDecoder,
+ Msk144FastDecoder
+ };
+
+ enum class AutoSequencePhase
+ {
+ StandardDecode,
+ LegacyShortMessage
+ };
+
+ enum class ContestHint
+ {
+ EuVhf,
+ FieldDay,
+ Rtty
+ };
+
+ enum class SelectionOrigin
+ {
+ None,
+ ManualLeftPane,
+ ManualRightPane,
+ Synthetic,
+ Udp
+ };
+
+ struct KeyboardModifiers
+ {
+ bool shift {false};
+ bool ctrl {false};
+ bool alt {false};
+ };
+
+ struct QsoReactionSnapshot
+ {
+ QString mode;
+ SpecialOperatingActivity specOp {SpecialOperatingActivity::NONE};
+ QString myCall;
+ QString baseCall;
+ QString dxCall;
+ QString hisCall;
+ QString hisGrid;
+ AutoRespondPolicy respondPolicy {AutoRespondPolicy::None};
+ double trPeriod {60.0};
+ Radio::Frequency nominalFrequency {0u};
+ int rxFrequency {0};
+ int txFrequency {0};
+
+ QsoProgress qsoProgress {QsoProgress::Calling};
+ int selectedTxMessage {0};
+ int currentMessageType {0};
+ bool sentReport {false};
+ bool shortMessages {false};
+ bool sendRr73 {false};
+ bool transmitting {false};
+ bool transmittingSignoff {false};
+
+ bool doubleClicked {false};
+ bool doubleClickAfterCqFrequency {false};
+ SelectionOrigin selectionOrigin {SelectionOrigin::None};
+ KeyboardModifiers modifiers;
+
+ bool fastMode {false};
+ bool transceiverOnline {false};
+ bool nominalQsyAllowed {false};
+ bool enableVhfFeatures {false};
+ bool holdTxFrequency {false};
+ bool rxFrequencyEnabled {true};
+ bool tx1Enabled {true};
+
+ bool autoEnabled {false};
+ bool autoButtonChecked {false};
+ bool autoReply {false};
+ bool callingCq {false};
+ bool sentFirst73 {false};
+ bool autoSequenceEnabled {false};
+ bool autoSequenceChecked {false};
+ bool quickCall {false};
+ bool repeatTx {false};
+
+ bool loggingEnabled {false};
+ bool contestHintShown {false};
+ bool ncccSprint {false};
+ int tx73Count {0};
+
+ bool waitFeaturesEnabled {false};
+ bool waitAndCall {false};
+ bool noWaitAndCall {false};
+ bool waitAndCallControlChecked {false};
+ bool fullDuplexEnabled {false};
+ bool txing {false};
+
+ };
+
+ struct QsoReactionEffect
+ {
+ enum class Kind
+ {
+ SetRxFrequency,
+ SetTxFrequency,
+ ApplyFastCqQsy,
+ RejectNominalQsy,
+ SetTxFirst,
+ // Keep setTxMsg(), raw index assignment, checked-state changes, and clicks distinct;
+ // each has different synchronous signal behavior in MainWindow.
+ SetTxMessage,
+ SetTxMessageIndex,
+ CheckTxMessage,
+ ClickTxMessage,
+ SetQsoProgress,
+ SetDxCall,
+ ClearDxGrid,
+ SetDxGrid,
+ SetReport,
+ SetReceivedExchange,
+ SetCallingCq,
+ SetMaxPoints,
+ SetRestart,
+ SetDoubleClicked,
+ SetDoubleClickAfterCqFrequency,
+ SetTuMessage,
+ SetNextCall,
+ SetNoLogging,
+ SetNoWaitAndCall,
+ SetBlockRightDisplay,
+ SetAutoEnabled,
+ RefreshQsoPaneIfChanged,
+ Lookup,
+ CaptureHisGrid,
+ ExtractReceivedReport,
+ GenerateStandardMessages,
+ RecordRr73Received,
+ RequestLogQso,
+ RequestLogQsoUnlessSuppressed,
+ CeaseAutoTx,
+ StopTx,
+ ClickStopTx,
+ LogStopped,
+ StartTxAgainTimer,
+ ResetWatchdog,
+ StopWaitCallTimer,
+ DisableWaitAndCallControl,
+ StartWaitReplyTimer,
+ StartWaitCallTimer,
+ ScheduleStopTx,
+ ScheduleNcccAutoReset,
+ ScheduleNoLoggingReset,
+ ScheduleAutoFlagOff,
+ QueueContestHint,
+ ProcessSyntheticMessageNow
+ };
+
+ Kind kind;
+ int intValue {0};
+ Radio::Frequency frequency {0u};
+ QString text;
+ bool boolValue {false};
+ bool userInitiated {false};
+ QsoProgress progress {QsoProgress::Calling};
+ ContestHint contestHint {ContestHint::EuVhf};
+ };
+
+ struct QsoReactionPlan
+ {
+ // Plans are deterministic for their inputs, but are one-shot ordered imperative scripts.
+ // Effects must never be reordered, replayed, or batched. ProcessSyntheticMessageNow takes
+ // a fresh live snapshot after every preceding effect has been applied.
+ ReactionDisposition disposition {ReactionDisposition::NoReaction};
+ QString reason;
+ QVector<QsoReactionEffect> effects;
+ };
+
+ bool shouldDeferAutoTxStopAfterRrr(QString const& mode, bool repeatTx, bool sendRr73);
+ void applyAutoTxStopAfterLogging(QString const& mode, bool repeatTx, bool sendRr73,
+ std::function<void()> stopAutoTx);
+
+ QsoReactionPlan planProcessMessage(DecodedText const& message, QsoReactionSnapshot const& snapshot);
+ QsoReactionPlan planAutoSequence(DecodedText const& message, QsoReactionSnapshot const& snapshot,
+ AutoSequencePhase phase, unsigned startTolerance,
+ unsigned stopTolerance);
+ QsoReactionPlan planWaitReplyCall(DecodedText const& message, QsoReactionSnapshot const& snapshot,
+ WaitDecodeSource source);
+}
+
+#endif // DECODEDMESSAGEREACTION_HPP