|
QGroundControl
Ground Control Station for MAVLink Drones
|
Master controller for mission, fence, rally. More...
#include <PlanMasterController.h>
Inheritance diagram for PlanMasterController:
Collaboration diagram for PlanMasterController:Signals | |
| void | containsItemsChanged () |
| void | syncInProgressChanged (void) |
| void | dirtyForSaveChanged (bool dirtyForSave) |
| void | dirtyForUploadChanged (bool dirtyForUpload) |
| void | offlineChanged (bool offlineEditing) |
| void | currentPlanFileChanged (void) |
| void | currentPlanFileNameChanged (void) |
| void | originalPlanFileNameChanged (void) |
| void | planFileRenamedChanged (void) |
| void | planCreatorsChanged (QmlObjectListModel *planCreators) |
| void | managerVehicleChanged (Vehicle *managerVehicle) |
| void | promptForPlanUsageOnVehicleChange (void) |
| void | manualCreationChanged () |
Public Member Functions | |
| PlanMasterController (QObject *parent=nullptr) | |
| ~PlanMasterController () | |
| bool flyView MEMBER | _flyView (Vehicle *controllerVehicle READ controllerVehicle CONSTANT) 1(Vehicle *managerVehicle READ managerVehicle NOTIFY managerVehicleChanged) 1(MissionController *missionController READ missionController CONSTANT) 1(GeoFenceController *geoFenceController READ geoFenceController CONSTANT) 1(RallyPointController *rallyPointController READ rallyPointController CONSTANT) 1(bool offline READ offline NOTIFY offlineChanged) 1(bool containsItems READ containsItems NOTIFY containsItemsChanged) 1(bool syncInProgress READ syncInProgress NOTIFY syncInProgressChanged) 1(bool dirtyForSave READ dirtyForSave NOTIFY dirtyForSaveChanged) 1(bool dirtyForUpload READ dirtyForUpload NOTIFY dirtyForUploadChanged) 1(QString fileExtension READ fileExtension CONSTANT) 1(QString kmlFileExtension READ kmlFileExtension CONSTANT) 1(QString currentPlanFile READ currentPlanFile NOTIFY currentPlanFileChanged) 1(QString currentPlanFileName READ currentPlanFileName WRITE setCurrentPlanFileName NOTIFY currentPlanFileNameChanged) 1(QString originalPlanFileName READ originalPlanFileName NOTIFY originalPlanFileNameChanged) 1(bool planFileRenamed READ planFileRenamed NOTIFY planFileRenamedChanged) 1(QStringList loadNameFilters READ loadNameFilters CONSTANT) 1(QStringList saveNameFilters READ saveNameFilters CONSTANT) 1(QmlObjectListModel *planCreators MEMBER _planCreators NOTIFY planCreatorsChanged) 1(bool manualCreation READ manualCreation WRITE setManualCreation NOTIFY manualCreationChanged) 1 void start(void) |
| < Either active vehicle or _controllerVehicle if no active vehicle | |
| void | startStaticActiveVehicle (Vehicle *vehicle, bool deleteWhenSendCompleted=false) |
| int | readyForSaveState (void) const |
| void | showPlanFromManagerVehicle (void) |
| Replaces any current plan with the plan from the manager vehicle even if offline. | |
| void | loadFromVehicle (void) |
| void | sendToVehicle (void) |
| void | loadFromFile (const QString &filename) |
| void | loadFromArchive (const QString &archivePath) |
| bool | saveToCurrent () |
| bool | saveToFile (const QString &filename) |
| void | saveToKml (const QString &filename) |
| bool | saveWithCurrentName () |
| Save using the (possibly renamed) currentPlanFileName. | |
| bool | resolvedPlanFileExists () const |
| true if a file at the renamed path already exists on disk | |
| void | removeAll (void) |
| Removes all from controller only, synce required to remove from vehicle. | |
| void | removeAllFromVehicle (void) |
| Removes all from vehicle and controller. | |
| MissionController * | missionController (void) |
| GeoFenceController * | geoFenceController (void) |
| RallyPointController * | rallyPointController (void) |
| bool | offline (void) const |
| bool | containsItems (void) const |
| bool | syncInProgress (void) const |
| bool | dirtyForSave (void) const |
| bool | dirtyForUpload (void) const |
| QString | fileExtension (void) const |
| QString | kmlFileExtension (void) const |
| QString | currentPlanFile (void) const |
| QString | currentPlanFileName (void) const |
| void | setCurrentPlanFileName (const QString &name) |
| QString | originalPlanFileName (void) const |
| bool | planFileRenamed (void) const |
| QStringList | loadNameFilters (void) const |
| QStringList | saveNameFilters (void) const |
| bool | isEmpty (void) const |
| bool | manualCreation (void) const |
| void | setFlyView (bool flyView) |
| void | setManualCreation (bool manualCreation) |
| QJsonDocument | saveToJson () |
| Vehicle * | controllerVehicle (void) |
| Vehicle * | managerVehicle (void) |
Static Public Member Functions | |
| static void | sendPlanToVehicle (Vehicle *vehicle, const QString &filename) |
Static Public Attributes | |
| static constexpr int | kPlanFileVersion = 1 |
| static constexpr const char * | kPlanFileType = "Plan" |
| static constexpr const char * | kJsonMissionObjectKey = "mission" |
| static constexpr const char * | kJsonGeoFenceObjectKey = "geoFence" |
| static constexpr const char * | kJsonRallyPointsObjectKey = "rallyPoints" |
Master controller for mission, fence, rally.
Definition at line 23 of file PlanMasterController.h.
| PlanMasterController::PlanMasterController | ( | QObject * | parent = nullptr | ) |
Definition at line 31 of file PlanMasterController.cc.
| PlanMasterController::~PlanMasterController | ( | ) |
Definition at line 76 of file PlanMasterController.cc.
| bool flyView MEMBER PlanMasterController::_flyView | ( | Vehicle *controllerVehicle READ controllerVehicle | CONSTANT | ) |
< Either active vehicle or _controllerVehicle if no active vehicle
< true: controller is not connected to an active vehicle < true: Elemement is non-empty < true: Information is currently being saved/sent, false: no active save/send in progress < true: Unsaved changes to disk are present, false: no changes since last save to disk < true: Unsent changes are present, false: no changes since last upload/download sync < File extension for missions < Fully qualified path, empty if not yet saved < Editable base name, no path or extension < On-disk name when last loaded/saved < true if currentPlanFileName differs from originalPlanFileName < File filter list loading plan files < File filter list saving plan files < true: User is not using a template to create the plan Should be called immediately upon Component.onCompleted.
| CONSTANT | Offline controller vehicle |
| bool PlanMasterController::containsItems | ( | void | ) | const |
Definition at line 574 of file PlanMasterController.cc.
References GeoFenceController::containsItems(), MissionController::containsItems(), and RallyPointController::containsItems().
|
signal |
|
inline |
Definition at line 129 of file PlanMasterController.h.
Referenced by LandingComplexItem::_init(), SpeedSection::appendSectionItems(), CameraSection::cameraModeSupported(), SpeedSection::scanForSection(), SpeedSection::setAvailable(), MissionController::setCurrentPlanViewSeqNum(), and SpeedSection::SpeedSection().
|
inline |
Definition at line 114 of file PlanMasterController.h.
|
signal |
Referenced by loadFromFile(), and saveToFile().
|
inline |
Definition at line 115 of file PlanMasterController.h.
|
signal |
Referenced by loadFromFile(), saveToFile(), and setCurrentPlanFileName().
|
inline |
Definition at line 110 of file PlanMasterController.h.
|
signal |
|
inline |
Definition at line 111 of file PlanMasterController.h.
|
signal |
| QString PlanMasterController::fileExtension | ( | void | ) | const |
Definition at line 579 of file PlanMasterController.cc.
References AppSettings::planFileExtension.
Referenced by saveNameFilters(), saveToFile(), and setCurrentPlanFileName().
|
inline |
Definition at line 104 of file PlanMasterController.h.
| bool PlanMasterController::isEmpty | ( | void | ) | const |
Definition at line 716 of file PlanMasterController.cc.
References GeoFenceController::isEmpty(), MissionController::isEmpty(), and RallyPointController::isEmpty().
| QString PlanMasterController::kmlFileExtension | ( | void | ) | const |
Definition at line 656 of file PlanMasterController.cc.
References AppSettings::kmlFileExtension.
Referenced by saveToKml().
| void PlanMasterController::loadFromArchive | ( | const QString & | archivePath | ) |
Load a plan from an archive file (.zip, .tar.gz, etc.) Extracts the archive and loads the first .plan file found.
| archivePath | Path to the archive file |
Definition at line 815 of file PlanMasterController.cc.
References QGCCompressionJob::extractArchive(), QGCCompressionJob::finished(), QGCCompression::isArchiveFile(), and qgcApp.
| void PlanMasterController::loadFromFile | ( | const QString & | filename | ) |
Definition at line 329 of file PlanMasterController.cc.
References currentPlanFileChanged(), currentPlanFileNameChanged(), errorString, JsonParsing::isJsonFile(), kJsonGeoFenceObjectKey, kJsonMissionObjectKey, kJsonRallyPointsObjectKey, kPlanFileType, kPlanFileVersion, GeoFenceController::load(), MissionController::load(), RallyPointController::load(), MissionController::loadTextFile(), originalPlanFileNameChanged(), AppSettings::planFileExtension, planFileRenamed(), planFileRenamedChanged(), qgcApp, JsonHelper::validateExternalQGCJsonFile(), JsonHelper::validateKeys(), and AppSettings::waypointsFileExtension.
Referenced by sendPlanToVehicle().
| void PlanMasterController::loadFromVehicle | ( | void | ) |
Definition at line 203 of file PlanMasterController.cc.
References MissionController::loadFromVehicle(), offline(), VehicleLinkManager::primaryLink(), qgcApp, syncInProgress(), and Vehicle::vehicleLinkManager().
| QStringList PlanMasterController::loadNameFilters | ( | void | ) | const |
Definition at line 661 of file PlanMasterController.cc.
References AppSettings::planFileExtension, and AppSettings::waypointsFileExtension.
|
inline |
Definition at line 130 of file PlanMasterController.h.
Referenced by LandingComplexItem::_createDoLandStartItem(), LandingComplexItem::_scanForItem(), MissionController::multipleLandPatternsAllowed(), GeoFenceController::start(), and RallyPointController::start().
|
signal |
|
inline |
Definition at line 122 of file PlanMasterController.h.
Referenced by setManualCreation().
|
signal |
Referenced by setManualCreation().
|
inline |
Definition at line 103 of file PlanMasterController.h.
Referenced by SimpleMissionItem::amslEntryAlt(), FixedWingLandingComplexItem::patternName(), and VTOLLandingComplexItem::patternName().
|
inline |
Definition at line 107 of file PlanMasterController.h.
Referenced by loadFromVehicle(), GeoFenceController::loadFromVehicle(), MissionController::loadFromVehicle(), RallyPointController::loadFromVehicle(), removeAllFromVehicle(), GeoFenceController::removeAllFromVehicle(), MissionController::removeAllFromVehicle(), RallyPointController::removeAllFromVehicle(), sendToVehicle(), GeoFenceController::sendToVehicle(), MissionController::sendToVehicle(), RallyPointController::sendToVehicle(), showPlanFromManagerVehicle(), GeoFenceController::showPlanFromManagerVehicle(), MissionController::showPlanFromManagerVehicle(), and RallyPointController::showPlanFromManagerVehicle().
|
signal |
|
inline |
Definition at line 117 of file PlanMasterController.h.
|
signal |
Referenced by loadFromFile(), and saveToFile().
|
signal |
| bool PlanMasterController::planFileRenamed | ( | void | ) | const |
Definition at line 612 of file PlanMasterController.cc.
Referenced by loadFromFile(), saveToFile(), and setCurrentPlanFileName().
|
signal |
Referenced by loadFromFile(), saveToFile(), and setCurrentPlanFileName().
|
signal |
|
inline |
Definition at line 105 of file PlanMasterController.h.
|
inline |
Determines if the plan has all information needed to be saved or sent to the vehicle. IMPORTANT NOTE: The return value is a VisualMissionItem::ReadForSaveState value. It is an int here to work around a nightmare of circular header dependency problems.
Definition at line 75 of file PlanMasterController.h.
References MissionController::readyForSaveState().
| void PlanMasterController::removeAll | ( | void | ) |
Removes all from controller only, synce required to remove from vehicle.
Definition at line 538 of file PlanMasterController.cc.
References GeoFenceController::removeAll(), MissionController::removeAll(), RallyPointController::removeAll(), GeoFenceController::setDirty(), MissionController::setDirty(), RallyPointController::setDirty(), and setManualCreation().
Referenced by BlankPlanCreator::createPlan(), CorridorScanPlanCreator::createPlan(), StructureScanPlanCreator::createPlan(), SurveyPlanCreator::createPlan(), and showPlanFromManagerVehicle().
| void PlanMasterController::removeAllFromVehicle | ( | void | ) |
Removes all from vehicle and controller.
Definition at line 556 of file PlanMasterController.cc.
References offline(), GeoFenceController::removeAllFromVehicle(), MissionController::removeAllFromVehicle(), RallyPointController::removeAllFromVehicle(), setManualCreation(), GeoFenceController::supported(), and RallyPointController::supported().
| bool PlanMasterController::resolvedPlanFileExists | ( | ) | const |
true if a file at the renamed path already exists on disk
Definition at line 617 of file PlanMasterController.cc.
| QStringList PlanMasterController::saveNameFilters | ( | void | ) | const |
Definition at line 671 of file PlanMasterController.cc.
References fileExtension().
| bool PlanMasterController::saveToCurrent | ( | ) |
Definition at line 458 of file PlanMasterController.cc.
References saveToFile().
| bool PlanMasterController::saveToFile | ( | const QString & | filename | ) |
Definition at line 468 of file PlanMasterController.cc.
References currentPlanFileChanged(), currentPlanFileNameChanged(), fileExtension(), originalPlanFileNameChanged(), planFileRenamed(), planFileRenamedChanged(), qgcApp, and saveToJson().
Referenced by saveToCurrent(), and saveWithCurrentName().
| QJsonDocument PlanMasterController::saveToJson | ( | ) |
Definition at line 435 of file PlanMasterController.cc.
References kJsonGeoFenceObjectKey, kJsonMissionObjectKey, kJsonRallyPointsObjectKey, kPlanFileType, kPlanFileVersion, GeoFenceController::save(), MissionController::save(), RallyPointController::save(), and JsonHelper::saveQGCJsonFileHeader().
Referenced by saveToFile().
| void PlanMasterController::saveToKml | ( | const QString & | filename | ) |
Definition at line 514 of file PlanMasterController.cc.
References MissionController::addMissionToKML(), kmlFileExtension(), and qgcApp.
| bool PlanMasterController::saveWithCurrentName | ( | ) |
Save using the (possibly renamed) currentPlanFileName.
Definition at line 604 of file PlanMasterController.cc.
References saveToFile().
|
static |
Sends a plan to the specified file
| [in] | vehicle | Vehicle we are sending a plan to |
| [in] | filename | Plan file to load |
Definition at line 679 of file PlanMasterController.cc.
References loadFromFile(), sendToVehicle(), and startStaticActiveVehicle().
Referenced by Vehicle::sendPlan().
| void PlanMasterController::sendToVehicle | ( | void | ) |
Definition at line 305 of file PlanMasterController.cc.
References offline(), VehicleLinkManager::primaryLink(), qgcApp, MissionController::sendToVehicle(), syncInProgress(), and Vehicle::vehicleLinkManager().
Referenced by sendPlanToVehicle().
| void PlanMasterController::setCurrentPlanFileName | ( | const QString & | name | ) |
Definition at line 584 of file PlanMasterController.cc.
References currentPlanFileNameChanged(), fileExtension(), planFileRenamed(), and planFileRenamedChanged().
|
inline |
Definition at line 124 of file PlanMasterController.h.
| void PlanMasterController::setManualCreation | ( | bool | manualCreation | ) |
Definition at line 807 of file PlanMasterController.cc.
References manualCreation(), and manualCreationChanged().
Referenced by removeAll(), and removeAllFromVehicle().
| void PlanMasterController::showPlanFromManagerVehicle | ( | void | ) |
Replaces any current plan with the plan from the manager vehicle even if offline.
Definition at line 794 of file PlanMasterController.cc.
References offline(), and removeAll().
| void PlanMasterController::startStaticActiveVehicle | ( | Vehicle * | vehicle, |
| bool | deleteWhenSendCompleted = false |
||
| ) |
Starts the controller using a single static active vehicle. Will not track global active vehicle changes.
| deleteWhenSendCmplete | The PlanMasterController object should be deleted after the first send is completed. |
Definition at line 93 of file PlanMasterController.cc.
References GeoFenceController::start(), MissionController::start(), and RallyPointController::start().
Referenced by sendPlanToVehicle().
| bool PlanMasterController::syncInProgress | ( | void | ) | const |
Definition at line 709 of file PlanMasterController.cc.
References GeoFenceController::syncInProgress(), MissionController::syncInProgress(), and RallyPointController::syncInProgress().
Referenced by loadFromVehicle(), and sendToVehicle().
|
signal |
|
staticconstexpr |
Definition at line 135 of file PlanMasterController.h.
Referenced by loadFromFile(), and saveToJson().
|
staticconstexpr |
Definition at line 134 of file PlanMasterController.h.
Referenced by loadFromFile(), and saveToJson().
|
staticconstexpr |
Definition at line 136 of file PlanMasterController.h.
Referenced by loadFromFile(), and saveToJson().
|
staticconstexpr |
Definition at line 133 of file PlanMasterController.h.
Referenced by loadFromFile(), and saveToJson().
|
staticconstexpr |
Definition at line 132 of file PlanMasterController.h.
Referenced by loadFromFile(), and saveToJson().