1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
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
|