summaryrefslogtreecommitdiff
path: root/SuperFoxTxPlanner.h
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 /SuperFoxTxPlanner.h
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 'SuperFoxTxPlanner.h')
-rw-r--r--SuperFoxTxPlanner.h86
1 files changed, 86 insertions, 0 deletions
diff --git a/SuperFoxTxPlanner.h b/SuperFoxTxPlanner.h
new file mode 100644
index 00000000..509d4b18
--- /dev/null
+++ b/SuperFoxTxPlanner.h
@@ -0,0 +1,86 @@
+#ifndef SUPERFOXTXPLANNER_H
+#define SUPERFOXTXPLANNER_H
+
+#include <QQueue>
+#include <QSet>
+#include <QString>
+#include <QVector>
+
+class SuperFoxTxPlanner
+{
+public:
+ enum class RecordKind
+ {
+ RR73,
+ Report
+ };
+
+ struct QsoState
+ {
+ QString call;
+ QString grid;
+ QString sent;
+ QString rcvd;
+ int ncall {0};
+ int nRR73 {0};
+ int tFoxRrpt {-1};
+ int tFoxTxRR73 {-1};
+ };
+
+ struct QueuedHound
+ {
+ QString call;
+ QString grid;
+ QString report;
+ };
+
+ struct Record
+ {
+ RecordKind kind {RecordKind::Report};
+ QString call;
+ QString grid;
+ QString report;
+ bool fromQueue {false};
+
+ Record() = default;
+ Record(RecordKind kind, QString const& call, QString const& grid,
+ QString const& report, bool fromQueue);
+ };
+
+ struct Capacity
+ {
+ int maxRecords {9};
+ int maxRR73 {5};
+ int maxReports {4};
+
+ Capacity() = default;
+ Capacity(int maxRecords, int maxRR73, int maxReports);
+ };
+
+ struct Plan
+ {
+ Capacity capacity;
+ QVector<Record> records;
+
+ int rr73Count() const;
+ int reportCount() const;
+ int queuedReportCount() const;
+ };
+
+ static Capacity capacity(bool sendFreeText);
+ static Plan plan(QVector<QsoState> const& qsos,
+ QQueue<QString> const& inProgress,
+ QVector<QueuedHound> const& queuedHounds,
+ int maxStrikes,
+ bool sendFreeText);
+ static QueuedHound parseQueuedHound(QString const& line);
+
+private:
+ static void addRR73Candidates(QVector<QsoState> const& qsos,
+ QSet<QString>& selectedCalls,
+ Plan& plan,
+ bool (*predicate)(QsoState const&));
+ static bool canAdd(Plan const& plan, RecordKind kind);
+};
+
+#endif