55 lines
1.3 KiB
C++
55 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include <QDateTime>
|
|
#include <QString>
|
|
|
|
#include <optional>
|
|
|
|
struct DopValues {
|
|
std::optional<double> gdop;
|
|
std::optional<double> pdop;
|
|
std::optional<double> hdop;
|
|
std::optional<double> vdop;
|
|
std::optional<double> tdop;
|
|
|
|
[[nodiscard]] bool hasAnyValue() const
|
|
{
|
|
return gdop.has_value() || pdop.has_value() || hdop.has_value()
|
|
|| vdop.has_value() || tdop.has_value();
|
|
}
|
|
};
|
|
|
|
struct TelemetryPoint {
|
|
double latitude = 0.0;
|
|
double longitude = 0.0;
|
|
QString latitudeText;
|
|
QString longitudeText;
|
|
std::optional<double> hheight;
|
|
std::optional<int> satellites;
|
|
DopValues dop;
|
|
QDateTime receivedAt = QDateTime::currentDateTimeUtc();
|
|
QString rawLine;
|
|
};
|
|
|
|
struct ParsedTelemetry {
|
|
std::optional<double> latitude;
|
|
std::optional<double> longitude;
|
|
QString latitudeText;
|
|
QString longitudeText;
|
|
std::optional<double> hheight;
|
|
std::optional<int> satellites;
|
|
DopValues dop;
|
|
QString rawLine;
|
|
|
|
[[nodiscard]] bool hasLocation() const
|
|
{
|
|
return latitude.has_value() && longitude.has_value();
|
|
}
|
|
|
|
[[nodiscard]] bool hasAnyValue() const
|
|
{
|
|
return latitude.has_value() || longitude.has_value() || hheight.has_value()
|
|
|| satellites.has_value() || dop.hasAnyValue();
|
|
}
|
|
};
|