7#include <QtCore/QObject>
8#include <QtCore/QPointer>
9#include <QtCore/QString>
26 std::optional<BaseModeDefinition::Mode>
mode;
28 std::optional<std::pair<GPSEllipsoidPosition, double>>
position;
40 bool allowPersistentChanges, QString*
error);
79 bool hasWorker()
const {
return !_worker.isNull(); }
82 QPointer<GPSReceiverWorker>
worker()
const {
return _worker; }
95 _connection.
type == GPSType::automatic ? _detectedType.value_or(GPSType::automatic) : _connection.
type);
109 const QString&
identity()
const {
return _identity; }
129 void _onReady(
const QString&
identity);
130 void _onDetected(
GPSType type);
131 void _forwardCorrection(
const QByteArray& data, qint64 receivedAtMs);
133 const quint64 _sessionId;
136 QPointer<GPSReceiverWorker> _worker;
138 std::unique_ptr<GPSCorrectionSourceHandle> _correction;
141 std::optional<GPSType> _detectedType;
142 bool _retired =
false;
std::function< GPSReceiverWorker *(GPSReceiverWorker::TransportFactory, GPSType, const GPSReceiverConfig &, QObject *)> GPSReceiverWorkerFactory
Creates a receiver session's worker; tests inject scripted workers.
int gpsReceiverManufacturerForType(GPSType type)
The persisted manufacturer of type, or GPS_AUTOMATIC_MANUFACTURER when it has none.
GPSBaseStationState gpsBaseStationStateFor(GPSType type, const GPSReceiverConfig &config)
The state a session starts from; a fixed base knows its position before the receiver reports.
GPSReceiverConfig gpsReceiverConfigFor(const GPSBaseStationConfig &base, GPSType type, uint32_t baudRate, bool allowPersistentChanges, QString *error)
std::shared_ptr< const void > GPSPositionSourceRegistration
A begun correction source and the stream it delivers; destroying it ends the source.
void registerPosition(PositionManager *positionManager, GPSSourceHealth *producer)
Publishes producer as the receiver position source. Registration observers may retire this session.
~GPSReceiverSession() override
void registerCorrections(GPSCorrectionManager *manager, const QString &sourceInstance)
Forwards the receiver's RTCM as the local correction source when the connection asks for it.
void receiverReady(const QString &identity)
GPSObservation observation(const GPSPositionReport &report, quint64 receivedAtUs) const
A base with a known antenna position reports that position instead of its navigation solution.
int baseMode() const
BaseModeDefinition::Mode of a configured base, or -1 for a passive receiver.
void ended(GPSConnectionError error, const QString &detail)
The worker failed or exited; the owner ends the session.
void surveyInStatusUpdated(const GPSSurveyReport &report)
Survey progress of a configured base.
bool compactObservations() const
A configured base sends compact (MSM4) observations.
QPointer< GPSReceiverWorker > worker() const
The worker, which outlives the session once retired until its thread exits.
const QString & serialDevice() const
RTKSettings::ReceiverRole role() const
bool start(const GPSReceiverWorkerFactory &factory, GPSReceiverWorker::TransportFactory transportFactory)
Creates the worker, with a real worker for an empty factory, and starts it. False when none is create...
void positionUpdated(const GPSPositionReport &report)
const QString & identity() const
std::optional< GPSType > detectedType() const
const QString & endpoint() const
void receiverDetected(GPSType type)
The family an Automatic session detected, or the protocol a passive receiver's output carries.
int manufacturer() const
The detected family's once an Automatic session detected it; a passive receiver's stays passive.
void inputProblem(GPSInputProblem problem)
Why a passive receiver delivers no position; None once positions arrive.
void satelliteInfoUpdated(const GPSSatelliteReport &report)
bool forwardsCorrections() const
std::function< std::unique_ptr< GPSTransport >(GPSCancelToken)> TransportFactory
Consumed on the worker thread, so transport construction, I/O and destruction share that thread.
Session health is independent of transport readiness and RTK survey-in validity.
ReceiverRole
Persisted values of receiverRole. The storage type keeps any saved value a valid enum value.
GPSInputProblem
Why a receiver that stays connected while silent reports no position.
Configuration used only by the RTK base-station role.
bool compactObservations
MSM4 instead of MSM7 observations: about a third less correction bandwidth, without Doppler.
A receiver session's base-station mode and the antenna position it reports.
void applySurvey(const GPSSurveyReport &report)
A surveying base adopts a valid, located result and otherwise has no position.
std::optional< std::pair< GPSEllipsoidPosition, double > > position
Antenna position and its accuracy in meters once known; the receiver then reports only a time fix.
std::optional< double > surveyAccuracyLimitMeters
Assumed accuracy of a survey-in result that reports none.
std::optional< BaseModeDefinition::Mode > mode
Base mode of a configured base; empty for a passive receiver.
Receiver-independent data. Unknown metadata remains absent, never a manufactured zero.
GPSBaseStationConfig base
QString endpoint
Serial device or network address shown to the user.
RTKSettings::ReceiverRole role
QString serialDevice
Serial device whose removal ends the session; empty for network receivers.
bool forwardsCorrections
The receiver's RTCM output is a correction source.