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 /Ft8MtdDecodeCoordinator.cpp | |
| 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 'Ft8MtdDecodeCoordinator.cpp')
| -rw-r--r-- | Ft8MtdDecodeCoordinator.cpp | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/Ft8MtdDecodeCoordinator.cpp b/Ft8MtdDecodeCoordinator.cpp new file mode 100644 index 00000000..f314f65a --- /dev/null +++ b/Ft8MtdDecodeCoordinator.cpp @@ -0,0 +1,74 @@ +#include "Ft8MtdDecodeCoordinator.hpp" + +Ft8MtdDecodeCoordinator::Decision Ft8MtdDecodeCoordinator::request ( + Stage stage, qint64 period, int earlyStageCount, bool decoderBusy) +{ + return scheduler_.request (stage, period, earlyStageCount, decoderBusy, + hasPending ()); +} + +bool Ft8MtdDecodeCoordinator::published (Stage stage, qint64 period) +{ + return scheduler_.published (stage, period); +} + +void Ft8MtdDecodeCoordinator::completed (Stage stage, qint64 period) +{ + scheduler_.completed (stage, period); +} + +void Ft8MtdDecodeCoordinator::publicationFailed (Stage stage, qint64 period) +{ + scheduler_.publicationFailed (stage, period); +} + +Ft8MtdDecodeCoordinator::Action Ft8MtdDecodeCoordinator::deferFinal ( + std::unique_ptr<PendingMtdDecode> pending) +{ + Q_ASSERT (pending); + Q_ASSERT (8 == pending->payload.params.nmode); + Q_ASSERT (pending->payload.params.lmultift8); + auto const action = pending_ ? Action::ReplaceFinal : Action::DeferFinal; + pending_ = std::move (pending); + return action; +} + +Ft8MtdDecodeCoordinator::DrainOutcome Ft8MtdDecodeCoordinator::drainPending ( + PendingValidator const& validator, PendingPublisher const& publisher) +{ + if (!pending_) return {}; + + auto pending = std::move (pending_); + DrainOutcome outcome; + outcome.period = pending->period; + if (!validator (*pending)) + { + scheduler_.cancel (); + outcome.result = DrainResult::Obsolete; + return outcome; + } + + switch (publisher (*pending)) + { + case PendingPublishResult::Published: + outcome.result = DrainResult::Published; + outcome.recovered = scheduler_.published (Stage::Final, pending->period); + return outcome; + case PendingPublishResult::Unavailable: + pending_ = std::move (pending); + outcome.result = DrainResult::Retained; + return outcome; + case PendingPublishResult::Failed: + scheduler_.publicationFailed (Stage::Final, pending->period); + outcome.result = DrainResult::Failed; + return outcome; + } + + return outcome; +} + +void Ft8MtdDecodeCoordinator::cancel () +{ + scheduler_.cancel (); + pending_.reset (); +} |
