Initial commit: add Location Plotter
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
#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();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user