QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
TakeoffMissionItem.h
Go to the documentation of this file.
1#pragma once
2
3#include "SimpleMissionItem.h"
4
7
11{
12 Q_OBJECT
13
14public:
15 // Note: forLoad = true indicates that TakeoffMissionItem::load will be called onthe item
17 TakeoffMissionItem(MAV_CMD takeoffCmd, PlanMasterController* masterController, bool flyView, MissionSettingsItem* settingsItem, bool forLoad);
19
20 Q_PROPERTY(QGeoCoordinate launchCoordinate READ launchCoordinate WRITE _setLaunchCoordinate NOTIFY launchCoordinateChanged)
21 Q_PROPERTY(bool launchTakeoffAtSameLocation READ launchTakeoffAtSameLocation WRITE _setLaunchTakeoffAtSameLocation NOTIFY launchTakeoffAtSameLocationChanged)
22
23 QGeoCoordinate launchCoordinate(void) const;
24 bool launchTakeoffAtSameLocation(void) const { return _launchTakeoffAtSameLocation; }
25
26 static bool isTakeoffCommand(MAV_CMD command);
27
29
30 // Overrides from VisualMissionItem
31 void setCoordinate(const QGeoCoordinate& coordinate) override;
32 bool isTakeoffItem(void) const final { return true; }
33 double specifiedFlightSpeed(void) final { return std::numeric_limits<double>::quiet_NaN(); }
34 double specifiedGimbalYaw(void) final { return std::numeric_limits<double>::quiet_NaN(); }
35 double specifiedGimbalPitch(void) final { return std::numeric_limits<double>::quiet_NaN(); }
36 QString mapVisualQML(void) const override { return QStringLiteral("TakeoffItemMapVisual.qml"); }
37
38 // Overrides from SimpleMissionItem
39 bool load(QTextStream &loadStream) final;
40 bool load(const QJsonObject& json, int sequenceNumber, QString& errorString) final;
41
42 //void setDirty(bool dirty) final;
43
44signals:
45 void launchCoordinateChanged(const QGeoCoordinate& launchCoordinate);
47
48private:
49 void _init(bool forLoad);
50 void _initLaunchTakeoffAtSameLocation(void);
51 void _setLaunchCoordinate(const QGeoCoordinate& launchCoordinate);
52 void _setLaunchTakeoffAtSameLocation(bool launchTakeoffAtSameLocation);
53
54
55 MissionSettingsItem* _settingsItem;
56 bool _launchTakeoffAtSameLocation = true;
57};
QString errorString
Master controller for mission, fence, rally.
A SimpleMissionItem is used to represent a single MissionItem to the ui.
int sequenceNumber(void) const final
QGeoCoordinate coordinate(void) const final
int command(void) const
MissionItem & missionItem(void)
static bool isTakeoffCommand(MAV_CMD command)
QGeoCoordinate launchCoordinate READ launchCoordinate WRITE _setLaunchCoordinate NOTIFY launchCoordinateChanged(bool launchTakeoffAtSameLocation READ launchTakeoffAtSameLocation WRITE _setLaunchTakeoffAtSameLocation NOTIFY launchTakeoffAtSameLocationChanged) QGeoCoordinate launchCoordinate(void) const
double specifiedGimbalYaw(void) final
double specifiedGimbalPitch(void) final
void launchCoordinateChanged(const QGeoCoordinate &launchCoordinate)
bool launchTakeoffAtSameLocation(void) const
bool isTakeoffItem(void) const final
void setCoordinate(const QGeoCoordinate &coordinate) override
bool load(QTextStream &loadStream) final
double specifiedFlightSpeed(void) final
QString mapVisualQML(void) const override
void launchTakeoffAtSameLocationChanged(bool launchTakeoffAtSameLocation)
bool flyView(void) const
PlanMasterController * masterController(void)