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
|
#ifndef DECODEOUTPUTPLAN_HPP
#define DECODEOUTPUTPLAN_HPP
#include "Decoder/decodedtext.h"
#include "AutoRespondPolicy.hpp"
#include "SpecialOperatingActivity.hpp"
#include <QByteArray>
#include <QString>
#include <QStringList>
#include <QVector>
#include <functional>
namespace DecodeOutputPlan
{
enum class ActionKind
{
ShowQsyMessage,
AccumulateFoxActivity,
IncrementDecodeCount,
WriteAll,
UploadWsprSpot,
UpdateArrlActivity,
FlushFoxActivity
};
struct Action
{
ActionKind kind;
QString text;
};
struct PreparationContext
{
QString mode;
SpecialOperatingActivity specOp {SpecialOperatingActivity::NONE};
QString myCall;
bool qsyEnabled {false};
bool activeStationsAvailable {false};
bool activeStationsWantedOnly {false};
bool displayPoints {false};
bool noOwnCall {false};
bool diskData {false};
bool noA7Decodes {false};
bool multithreadFt8 {false};
int ft8DecoderStart {0};
quint64 nominalFrequency {0};
bool reduceFalseDecodes {false};
QString earlyDecodes;
};
enum class LineDisposition
{
Decode,
Finish,
Ignore
};
struct PreparedLine
{
LineDisposition disposition {LineDisposition::Decode};
QByteArray rawLine;
QByteArray normalizedLine;
QString decodedOriginal;
QString decodedForLogic;
DecodedText logicMessage {QString {}};
bool averaged {false};
int averageCount {0};
bool haveFrequencySpread {false};
float frequencySpread {0.0f};
// Finish-disposition fields parsed from <DecodeFinished>.
bool batchHasDecodes {false};
int q65SingleDecodes {0};
int q65AveragedDecodes {0};
QString reason;
QVector<Action> actions;
};
struct KeywordFilterContext
{
QString mode;
SpecialOperatingActivity specOp {SpecialOperatingActivity::NONE};
bool alreadyFiltered {false};
bool filterBySecondWord {false};
bool alwaysPass {false};
QStringList passKeywords;
bool blacklistEnabled {false};
QStringList blacklistKeywords;
bool whitelistEnabled {false};
QStringList whitelistKeywords;
bool waitAndPounceOnly {false};
bool bypass {false};
bool pounce {false};
AutoRespondPolicy respondPolicy {AutoRespondPolicy::None};
};
struct KeywordFilterDecision
{
bool filtered {false};
bool continueProcessing {true};
bool alwaysPassed {false};
bool resetPounceScores {false};
QString selectedWord;
QString reason;
};
struct VisibilityFilterContext
{
bool alreadyFiltered {false};
bool alwaysPassed {false};
bool bypass {false};
bool hideTerritory1 {false};
bool hideTerritory2 {false};
bool hideTerritory3 {false};
bool hideTerritory4 {false};
QString territory1;
QString territory2;
QString territory3;
QString territory4;
bool hideWorkedBefore {false};
bool hideEurope {false};
bool hideAsia {false};
bool hideNorthAmerica {false};
bool hideSouthAmerica {false};
bool hideAfrica {false};
bool hideOceania {false};
bool hideAntarctica {false};
bool hideIgnored {false};
QString ignoreList;
bool hideWorkedToday {false};
bool includeYesterday {false};
QString txLog;
QString today;
QString yesterday;
// Lazy resolvers so expensive logbook lookups run only when a matching
// hide filter is enabled and the message was not always-passed.
std::function<QString (QString const& deCall)> countryName;
std::function<QString (QString const& deCall)> continent;
std::function<bool (QString const& deCall, QString const& deGrid)> workedBeforeOnBand;
};
struct VisibilityFilterDecision
{
bool filtered {false};
QString reason;
};
struct ExperimentalFilterContext
{
QString mode;
bool multithreadFt8 {false};
bool reduceFalseDecodes {false};
// Contents of the shipped ALLCALL7.TXT callsign database.
QString allCallsigns;
bool alreadyFiltered {false};
};
struct ExperimentalFilterDecision
{
bool filtered {false};
QString reason;
};
struct RoutingContext
{
QString mode;
SpecialOperatingActivity specOp {SpecialOperatingActivity::NONE};
QString myCall;
QString baseCall;
QString hisCall;
int rxFrequency {0};
int wideGraphRxFrequency {0};
int q65Tolerance {10};
bool enableVhfFeatures {false};
bool includeAveragingVisible {false};
bool includeAveraging {false};
bool blockRightDisplay {false};
};
struct RoutingDecision
{
bool forUs {false};
bool displayRight {false};
bool competingFoxReport {false};
};
PreparedLine prepareLine(QByteArray const& rawLine, PreparationContext const& context);
ExperimentalFilterDecision decideExperimentalFilter(DecodedText const& message,
ExperimentalFilterContext const& context);
KeywordFilterDecision decideKeywordFilter(DecodedText const& message,
KeywordFilterContext const& context);
VisibilityFilterDecision decideVisibilityFilter(DecodedText const& message,
VisibilityFilterContext const& context);
bool shouldDisplayLeft(bool averaged, QString const& mode, SpecialOperatingActivity specOp,
bool filtered, bool filtersForWaitAndPounceOnly);
RoutingDecision decideRouting(DecodedText const& originalMessage, DecodedText const& displayMessage,
bool averaged, RoutingContext const& context);
bool shouldPostPsk(QString const& mode, SpecialOperatingActivity specOp, bool superFox,
bool standardMessage, bool bandPostingAllowed);
QVector<Action> finishBatchActions(QString const& mode, SpecialOperatingActivity specOp,
bool activeStationsAvailable, QString const& accumulatedDecodes);
}
#endif // DECODEOUTPUTPLAN_HPP
|