aboutsummaryrefslogtreecommitdiff
path: root/src/waypoint.cc
diff options
context:
space:
mode:
authorccolin2021-01-02 01:16:06 +0100
committerccolin2021-01-02 01:16:06 +0100
commitbb0da810d945d98b25390c65ab3f34e695914fd6 (patch)
tree7ecbfe570db170b72b7e3096f78c3d60d0bf0acd /src/waypoint.cc
parent861d505606d612bc328534dba3257e9ef9a1c269 (diff)
move Drone and Waypoint declarations to their own files
Diffstat (limited to 'src/waypoint.cc')
-rw-r--r--src/waypoint.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/waypoint.cc b/src/waypoint.cc
new file mode 100644
index 0000000..7acf632
--- /dev/null
+++ b/src/waypoint.cc
@@ -0,0 +1,13 @@
+#include "waypoint.hh"
+
+
+Waypoint::Waypoint(unsigned frame, QVector3D pos)
+ :frame(frame),
+ pos(pos) {}
+
+
+Waypoint::Waypoint(const QJsonObject &json)
+ :Waypoint(json["frame"].toInt(),
+ QVector3D(json["position"]["lng_X"].toInt() / 100.0,
+ json["position"]["alt_Y"].toInt() / 100.0,
+ json["position"]["lat_Z"].toInt() / 100.0)) {}