diff options
| author | hibby <d@vehibberd.com> | 2026-10-06 21:24:40 +0100 |
|---|---|---|
| committer | hibby <d@vehibberd.com> | 2026-10-06 21:24:40 +0100 |
| commit | c25cbdf6fb6d946175f4335fab77bfea601b56db (patch) | |
| tree | 6f7a94b7b81f999e434f61b73d47e337dfd26bf2 /LiveAudioTestController.hpp | |
| parent | 71f5689252c9f13e70e1c24856904475b2307809 (diff) | |
| parent | 0685fcada9f95fe90f70b387cd7d757da8209624 (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 'LiveAudioTestController.hpp')
| -rw-r--r-- | LiveAudioTestController.hpp | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/LiveAudioTestController.hpp b/LiveAudioTestController.hpp new file mode 100644 index 00000000..b3fc9bdd --- /dev/null +++ b/LiveAudioTestController.hpp @@ -0,0 +1,103 @@ +// -*- Mode: C++ -*- +#ifndef LIVE_AUDIO_TEST_CONTROLLER_HPP__ +#define LIVE_AUDIO_TEST_CONTROLLER_HPP__ + +#include <QObject> +#include <QSet> +#include <QString> +#include <QStringList> +#include <QTimer> +#include <vector> + +class FixtureAudioInput; +class MainWindow; +class QTextEdit; + +class LiveAudioTestController final + : public QObject +{ + Q_OBJECT + +public: + enum class Mode + { + Ft8, + Jtty + }; + + LiveAudioTestController (MainWindow * window, FixtureAudioInput * fixture, + QString expectedPath, Mode mode = Mode::Ft8, + QObject * parent = nullptr); + + void begin (); + bool succeeded () const {return m_succeeded;} + +private: + enum class DecoderStage + { + None, + EarlyStandard, + Multithreaded + }; + + static QSet<QString> readExpectedMessages (QString const& path, QString * error); + static QStringList readExpectedJttyMessages (QString const& path, QString * error); + static QString messageFromDecoderLine (QByteArray const& line); + void prepareWhenReady (); + void prepareFt8WhenReady (); + void prepareJttyWhenReady (); + void maybeFinish (); + void maybeFinishFt8 (); + void maybeFinishJtty (); + void pollJttyDisplay (); + void fail (QString const& reason); + void checkForUnexpectedModal (); + void exerciseSubmittedFt8Rollover (); + + MainWindow * m_window; + FixtureAudioInput * m_fixture; + QString m_expectedPath; + Mode m_mode; + QSet<QString> m_expected; + QStringList m_expectedJtty; + QString m_expectedJttyPrefix; + QSet<QString> m_observed; + QSet<QString> m_displayed; + QSet<QString> m_earlyObserved; + QSet<QString> m_multithreadedObserved; + QSet<QString> m_earlyRaw; + QSet<QString> m_multithreadedRaw; + QString m_initializationError; + QTimer m_timeout; + QTimer m_prepareTimer; + QTimer m_modalTimer; + QTimer m_jttyPollTimer; + QTextEdit * m_jttyAllDecodes {nullptr}; + QTextEdit * m_jttyQsoFrequency {nullptr}; + qint64 m_emittedFrames {0}; + int m_completedCycles {0}; + quint64 m_submittedGeneration {0}; + quint64 m_submittedCycle {0}; + quint64 m_rolloverEpoch {0}; + quint64 m_preRolloverEpoch {0}; + int m_rolloverAcceptedEnd {0}; + int m_rolloverAcceptedBlocks {0}; + int m_rolloverRejectedBlocks {0}; + int m_submittedCompletions {0}; + std::vector<short> m_rolloverSamples; + bool m_rolloverVerified {false}; + DecoderStage m_decoderStage {DecoderStage::None}; + bool m_sawEarlyStandardDecode {false}; + bool m_sawConfiguredMultithreadedDecode {false}; + bool m_completedMultithreadedDecode {false}; + bool m_fixtureFinished {false}; + bool m_armed {false}; + bool m_jttyAllSawPrefix {false}; + bool m_jttyQsoSawPrefix {false}; + QSet<QString> m_jttyAllFinals; + QSet<QString> m_jttyQsoFinals; + bool m_finished {false}; + bool m_succeeded {false}; +}; + +#endif |
