23#include <QGeoCoordinate>
26#include "TrafficFactorAircraftType.h"
27#include "units/Angle.h"
28#include "units/Speed.h"
30using namespace Qt::Literals::StringLiterals;
32namespace Traffic::Ogn {
51 static void parseAprsisMessage(OgnMessage& ognMessage);
52 static QString formatLoginString(QStringView callSign,
53 const QGeoCoordinate &receiveLocation,
54 unsigned int receiveRadius,
56 QStringView appVersion);
57 static QString formatPositionReport(QStringView callSign,
58 const QGeoCoordinate &coordinate,
62 Traffic::AircraftType aircraftType);
65 static QString formatFilter(
const QGeoCoordinate &receiveLocation,
unsigned int receiveRadius);
66 static QString formatLatitude(
double latitude);
67 static QString formatLongitude(
double longitude);
68 static QString calculatePassword(QStringView callSign);
69 static double decodeLatitude(QStringView nmeaLatitude, QChar latitudeDirection, QChar latEnhancement);
70 static double decodeLongitude(QStringView nmeaLongitude, QChar longitudeDirection, QChar lonEnhancement);
71 static void parseTrafficReport(OgnMessage &ognMessage, QStringView header, QStringView body);
72 static void parseCommentMessage(OgnMessage& ognMessage);
73 static void parseStatusMessage(OgnMessage &ognMessage, QStringView header, QStringView body);
76enum class OgnMessageType
84Q_ENUM_NS(OgnMessageType);
87enum class OgnAddressType
94Q_ENUM_NS(OgnAddressType);
114 OgnMessageType type = OgnMessageType::UNKNOWN;
116 QStringView sourceId;
117 QStringView timestamp;
118 QGeoCoordinate coordinate;
119 OgnSymbol symbol = OgnSymbol::UNKNOWN;
123 QStringView aircraftID;
124 double verticalSpeed = {};
125 QStringView rotationRate;
126 QStringView signalStrength;
127 QStringView errorCount;
128 QStringView frequencyOffset;
130 QStringView flightlevel;
131 QStringView flightnumber;
133 Traffic::AircraftType aircraftType = Traffic::AircraftType::unknown;
134 OgnAddressType addressType = OgnAddressType::UNKNOWN;
136 bool stealthMode =
false;
137 bool noTrackingFlag =
false;
139 uint32_t wind_direction = {};
140 uint32_t wind_speed = {};
141 uint32_t wind_gust_speed = {};
142 uint32_t temperature = {};
143 uint32_t humidity = {};
144 double pressure = {};
149 type = OgnMessageType::UNKNOWN;
150 sourceId.truncate(0);
151 timestamp.truncate(0);
152 coordinate = QGeoCoordinate();
153 symbol = OgnSymbol::UNKNOWN;
156 aircraftID.truncate(0);
158 rotationRate.truncate(0);
159 signalStrength.truncate(0);
160 errorCount.truncate(0);
161 frequencyOffset.truncate(0);
163 flightlevel.truncate(0);
164 flightnumber.truncate(0);
166 aircraftType = Traffic::AircraftType::unknown;
167 addressType = OgnAddressType::UNKNOWN;
170 noTrackingFlag =
false;
Parser for OGN glidernet.org traffic receiver.