3#include <QtCore/QFileInfo>
4#include <QtCore/QObject>
5#include <QtCore/QLoggingCategory>
6#include <QtQmlIntegration/QtQmlIntegration>
18#ifdef QGC_UNITTEST_BUILD
19class PlanMasterControllerTest;
27 Q_MOC_INCLUDE(
"QmlObjectListModel.h")
28 Q_MOC_INCLUDE(
"Vehicle.h")
30#ifdef QGC_UNITTEST_BUILD
31 friend class PlanMasterControllerTest;
38 PlanMasterController(MAV_AUTOPILOT firmwareType, MAV_TYPE vehicleType, QObject* parent =
nullptr);
43 Q_PROPERTY(
bool flyView MEMBER _flyView)
66 Q_INVOKABLE
void start(
void);
95 Q_INVOKABLE
bool saveToFile(
const QString& filename);
96 Q_INVOKABLE
void saveToKml(
const QString& filename);
107 bool offline (
void)
const {
return _offline; }
154 void _activeVehicleChanged (
Vehicle* activeVehicle);
155 void _loadMissionComplete (
void);
156 void _loadGeoFenceComplete (
void);
157 void _loadRallyPointsComplete (
void);
158 void _sendMissionComplete (
void);
159 void _sendGeoFenceComplete (
void);
160 void _sendRallyPointsComplete (
void);
161 void _updateOverallDirty (
void);
162 void _updatePlanCreatorsList (
void);
163 void _handleExtractionFinished (
bool success);
166 void _commonInit (
void);
167 void _showPlanFromManagerVehicle(
void);
171 QString _resolvedPlanFilePath()
const;
172 void _clearFileNames();
174#ifdef QGC_UNITTEST_BUILD
181 Vehicle* _controllerVehicle =
nullptr;
182 Vehicle* _managerVehicle =
nullptr;
183 bool _flyView =
true;
184 bool _offline =
true;
188 bool _loadGeoFence =
false;
189 bool _loadRallyPoints =
false;
190 bool _sendGeoFence =
false;
191 bool _sendRallyPoints =
false;
192 QString _currentPlanFile;
196 QString _currentPlanFileName;
197 QString _originalPlanFileName;
198 bool _deleteWhenSendCompleted =
false;
199 bool _dirtyForSave =
false;
200 bool _dirtyForUpload =
false;
201 bool _suppressOverallDirtyUpdate =
false;
203 bool _manualCreation =
false;
205 QString _extractionOutputDir;
Q_DECLARE_LOGGING_CATEGORY(AndroidSerialLog)
int readyForSaveState(void) const
Master controller for mission, fence, rally.
void removeAll(void)
Removes all from controller only, synce required to remove from vehicle.
void planFileRenamedChanged(void)
bool saveWithCurrentName()
Save using the (possibly renamed) currentPlanFileName.
void setCurrentPlanFileName(const QString &name)
void originalPlanFileNameChanged(void)
void containsItemsChanged()
Vehicle * controllerVehicle(void)
QStringList saveNameFilters(void) const
void currentPlanFileNameChanged(void)
void setManualCreation(bool manualCreation)
void promptForPlanUsageOnVehicleChange(void)
void saveToKml(const QString &filename)
void showPlanFromManagerVehicle(void)
Replaces any current plan with the plan from the manager vehicle even if offline.
static constexpr int kPlanFileVersion
QStringList loadNameFilters(void) const
void planCreatorsChanged(QmlObjectListModel *planCreators)
QString originalPlanFileName(void) const
void loadFromVehicle(void)
void managerVehicleChanged(Vehicle *managerVehicle)
QString kmlFileExtension(void) const
void syncInProgressChanged(void)
void loadFromFile(const QString &filename)
RallyPointController * rallyPointController(void)
void startStaticActiveVehicle(Vehicle *vehicle, bool deleteWhenSendCompleted=false)
bool dirtyForUpload(void) const
void manualCreationChanged()
QString currentPlanFile(void) const
static constexpr const char * kJsonGeoFenceObjectKey
void loadFromArchive(const QString &archivePath)
GeoFenceController * geoFenceController(void)
void dirtyForSaveChanged(bool dirtyForSave)
QString currentPlanFileName(void) const
bool manualCreation(void) const
bool syncInProgress(void) const
void currentPlanFileChanged(void)
bool dirtyForSave(void) const
QString fileExtension(void) const
void setFlyView(bool flyView)
bool saveToFile(const QString &filename)
bool planFileRenamed(void) const
bool resolvedPlanFileExists() const
true if a file at the renamed path already exists on disk
void dirtyForUploadChanged(bool dirtyForUpload)
static constexpr const char * kPlanFileType
static constexpr const char * kJsonMissionObjectKey
void removeAllFromVehicle(void)
Removes all from vehicle and controller.
static void sendPlanToVehicle(Vehicle *vehicle, const QString &filename)
QJsonDocument saveToJson()
int readyForSaveState(void) const
MissionController * missionController(void)
void offlineChanged(bool offlineEditing)
static constexpr const char * kJsonRallyPointsObjectKey
bool containsItems(void) const
Vehicle * managerVehicle(void)