7#include <QtCore/QString>
8#include <QtQmlIntegration/QtQmlIntegration>
19 QML_VALUE_TYPE(gpsCorrectionStream)
54 std::optional<GPSCorrectionStream>
selectedStream(qint64 now)
const;
65 qint64 lastRoutableMs = 0;
69 bool _fresh(
const Category& category, qint64 now)
const;
70 bool _eligible(
int index, qint64 now)
const;
71 void _select(qint64 now);
74 std::array<Category, GPS_CORRECTION_SOURCE_COUNT> _categories{};
78 qint64 _candidateSinceMs = 0;
79 bool _shutdown =
false;
constexpr int GPS_CORRECTION_SOURCE_COUNT
static constexpr std::chrono::milliseconds SWITCH_HOLD_DOWN
bool hasSources() const
Whether any source is begun.
bool submit(GPSCorrectionSettings::CorrectionSource source, const QString &instance, qint64 receivedAtMs, qint64 now)
void beginSource(GPSCorrectionSettings::CorrectionSource source, qint64 now)
Starts source. A category has one source at a time, which ends itself before a replacement begins.
std::optional< GPSCorrectionStream > selectedStream(qint64 now) const
The selected fresh stream, if any.
void endSource(GPSCorrectionSettings::CorrectionSource source, qint64 now)
Stops routing source.
static constexpr std::chrono::milliseconds FRESHNESS_TIMEOUT
Age at which a frame is no longer routed and its stream stops being eligible for selection.
void configure(GPSCorrectionSettings::CorrectionSource source, qint64 now)
Routes only source, or selects automatically for HighestPriority. A valid, changed source reselects a...
CorrectionSource
Persisted values of correctionSource. The storage type keeps any saved value a valid enum value.
The stream vehicles receive: its source category and the instance within it.
bool operator==(const GPSCorrectionStream &) const =default