From ffc62c792c9a5196cb4ce7a353287dfe20db6524 Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Fri, 9 Oct 2026 14:12:35 +0200 Subject: New upstream version 3.3.0~beta1+dfsg --- JttyReceiveResultController.hpp | 81 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 JttyReceiveResultController.hpp (limited to 'JttyReceiveResultController.hpp') diff --git a/JttyReceiveResultController.hpp b/JttyReceiveResultController.hpp new file mode 100644 index 00000000..8e05054e --- /dev/null +++ b/JttyReceiveResultController.hpp @@ -0,0 +1,81 @@ +#ifndef JTTY_RECEIVE_RESULT_CONTROLLER_HPP +#define JTTY_RECEIVE_RESULT_CONTROLLER_HPP + +#include "DecodeOperatingContext.hpp" +#include "JttyDecoder.hpp" +#include "JttyReceiveLine.hpp" +#include +#include +#include + +namespace Jtty { + +class ReceiveResultController +{ +public: + enum class Source { Live, Wav, Review }; + enum class Pane { All, Qso }; + + struct Reception { + Source source {Source::Live}; + quint64 contextId {}; + quint64 displayGroup {}; + QDateTime anchor, displayAnchor; + DecodeOperatingContext context; + float center {1500}, tolerance {50}; + }; + + struct Selection { + bool jttyActive {}; + quint64 contextId {}; + float center {1500}, tolerance {50}; + }; + + struct EchoOptions { bool enabled {}, lowerCase {}; }; + + struct Inputs { + std::function display; + std::function selection; + std::function echo; + std::function reporting; + }; + + struct Spot { + QString sender, grid; + Radio::Frequency frequency {}; + QString mode; + int snr {}; + QDateTime time; + }; + + // Effects and handle references are used only during synchronous invocation. + struct Effects { + std::function reviewHeading; + std::function render; + std::function echo; + std::function noteDecoded; + std::function log; + std::function spot; + }; + + void apply(QVector const&, Reception const&, Inputs const&, Effects const&); + void resetReplay(); + int snrForSelectedWord(QString const&, Pane) const; + +private: + struct Line { + QString text; + JttyReceiveLine allLine, qsoLine; + DecodeOperatingContext context; + bool admitted {}; + }; + struct SnrEntry { QString text; int snr; bool admitted; }; + QHash liveLines_, replayLines_; + std::deque snrHistory_; + bool reviewHeading_ {}; +}; + +} + +#endif -- cgit v1.2.3