|
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 | showCreateFromTemplateChanged () |
| void | syncInProgressChanged (void) |
| void | dirtyForSaveChanged (bool dirtyForSave) |
| void | dirtyForUploadChanged (bool dirtyForUpload) |
| void | offlineChanged (bool offlineEditing) |
| void | currentPlanFileChanged (void) |
| void | planCreatorsChanged (QmlObjectListModel *planCreators) |
| void | managerVehicleChanged (Vehicle *managerVehicle) |
| void | promptForPlanUsageOnVehicleChange (void) |
| void | userSelectedManualCreationChanged () |
Public Member Functions | |
| PlanMasterController (QObject *parent=nullptr) | |
| ~PlanMasterController () | |
| Either active vehicle or _controllerVehicle if no active vehicle. | |
| Q_INVOKABLE void | start (void) |
| Should be called immediately upon Component.onCompleted. | |
| Q_INVOKABLE void | startStaticActiveVehicle (Vehicle *vehicle, bool deleteWhenSendCompleted=false) |
| Q_INVOKABLE int | readyForSaveState (void) const |
| Q_INVOKABLE void | showPlanFromManagerVehicle (void) |
| Replaces any current plan with the plan from the manager vehicle even if offline. | |
| Q_INVOKABLE void | loadFromVehicle (void) |
| Q_INVOKABLE void | sendToVehicle (void) |
| Q_INVOKABLE void | loadFromFile (const QString &filename) |
| Q_INVOKABLE bool | saveToCurrent () |
| Q_INVOKABLE bool | saveToFile (const QString &filename) |
| Q_INVOKABLE void | saveToKml (const QString &filename) |
| Q_INVOKABLE void | removeAll (void) |
| Removes all from controller only, sync required to remove from vehicle. | |
| Q_INVOKABLE 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 | showCreateFromTemplate (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 |
| QStringList | loadNameFilters (void) const |
| QStringList | saveNameFilters (void) const |
| bool | isEmpty (void) const |
| bool | userSelectedManualCreation (void) const |
| QmlObjectListModel * | planCreators (void) const |
| void | setFlyView (bool flyView) |
| void | setUserSelectedManualCreation (bool userSelectedManualCreation) |
| 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 20 of file PlanMasterController.h.
| PlanMasterController::PlanMasterController | ( | QObject * | parent = nullptr | ) |
Definition at line 23 of file PlanMasterController.cc.
| PlanMasterController::~PlanMasterController | ( | ) |
Either active vehicle or _controllerVehicle if no active vehicle.
Offline controller vehicle true: controller is not connected to an active vehicle true: Elemement is non-empty true: No plan items and not in manual-creation mode; UI should show "create new plan" template selection 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 Base name of currentPlanFile, no path or extension File filter list loading plan files File filter list saving plan files true: User is not using a template to create the plan
Definition at line 70 of file PlanMasterController.cc.
| bool PlanMasterController::containsItems | ( | void | ) | const |
Definition at line 539 of file PlanMasterController.cc.
References GeoFenceController::containsItems(), MissionController::containsItems(), and RallyPointController::containsItems().
Referenced by showCreateFromTemplate().
|
signal |
|
inline |
Definition at line 116 of file PlanMasterController.h.
Referenced by LandingComplexItem::_init(), RallyPointController::addPoint(), SpeedSection::appendSectionItems(), CameraSection::cameraModeSupported(), SpeedSection::scanForSection(), SpeedSection::setAvailable(), MissionController::setCurrentPlanViewSeqNum(), and SpeedSection::SpeedSection().
|
inline |
Definition at line 103 of file PlanMasterController.h.
|
signal |
Referenced by loadFromFile(), and saveToFile().
| QString PlanMasterController::currentPlanFileName | ( | void | ) | const |
Definition at line 564 of file PlanMasterController.cc.
|
inline |
Definition at line 99 of file PlanMasterController.h.
|
signal |
|
inline |
Definition at line 100 of file PlanMasterController.h.
|
signal |
| QString PlanMasterController::fileExtension | ( | void | ) | const |
Definition at line 559 of file PlanMasterController.cc.
References AppSettings::planFileExtension.
Referenced by saveNameFilters(), and saveToFile().
|
inline |
Definition at line 92 of file PlanMasterController.h.
| bool PlanMasterController::isEmpty | ( | void | ) | const |
Definition at line 649 of file PlanMasterController.cc.
References GeoFenceController::isEmpty(), MissionController::isEmpty(), and RallyPointController::isEmpty().
| QString PlanMasterController::kmlFileExtension | ( | void | ) | const |
Definition at line 577 of file PlanMasterController.cc.
References AppSettings::kmlFileExtension.
Referenced by saveToKml().
| void PlanMasterController::loadFromFile | ( | const QString & | filename | ) |
Definition at line 343 of file PlanMasterController.cc.
References currentPlanFileChanged(), errorString, MissionController::loadTextFile(), AppSettings::planFileExtension, QGC::showAppMessage(), and AppSettings::waypointsFileExtension.
Referenced by sendPlanToVehicle().
| void PlanMasterController::loadFromVehicle | ( | void | ) |
Definition at line 203 of file PlanMasterController.cc.
References MissionController::loadFromVehicle(), offline(), VehicleLinkManager::primaryLink(), QGC::showAppMessage(), syncInProgress(), and Vehicle::vehicleLinkManager().
| QStringList PlanMasterController::loadNameFilters | ( | void | ) | const |
Definition at line 582 of file PlanMasterController.cc.
References AppSettings::planFileExtension, and AppSettings::waypointsFileExtension.
|
inline |
Definition at line 117 of file PlanMasterController.h.
Referenced by LandingComplexItem::_createDoLandStartItem(), LandingComplexItem::_scanForItem(), MissionController::multipleLandPatternsAllowed(), GeoFenceController::start(), and RallyPointController::start().
|
signal |
|
inline |
Definition at line 91 of file PlanMasterController.h.
Referenced by SimpleMissionItem::amslEntryAlt(), FixedWingLandingComplexItem::patternName(), and VTOLLandingComplexItem::patternName().
|
inline |
Definition at line 95 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 109 of file PlanMasterController.h.
|
signal |
|
signal |
|
inline |
Definition at line 93 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 71 of file PlanMasterController.h.
References MissionController::readyForSaveState().
| void PlanMasterController::removeAll | ( | void | ) |
Removes all from controller only, sync required to remove from vehicle.
Definition at line 506 of file PlanMasterController.cc.
References GeoFenceController::removeAll(), MissionController::removeAll(), RallyPointController::removeAll(), and setUserSelectedManualCreation().
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 521 of file PlanMasterController.cc.
References offline(), GeoFenceController::removeAllFromVehicle(), MissionController::removeAllFromVehicle(), RallyPointController::removeAllFromVehicle(), setUserSelectedManualCreation(), GeoFenceController::supported(), and RallyPointController::supported().
| QStringList PlanMasterController::saveNameFilters | ( | void | ) | const |
Definition at line 592 of file PlanMasterController.cc.
References fileExtension().
| bool PlanMasterController::saveToCurrent | ( | ) |
Definition at line 439 of file PlanMasterController.cc.
References saveToFile().
| bool PlanMasterController::saveToFile | ( | const QString & | filename | ) |
Definition at line 449 of file PlanMasterController.cc.
References currentPlanFileChanged(), fileExtension(), saveToJson(), and QGC::showAppMessage().
Referenced by saveToCurrent().
| QJsonDocument PlanMasterController::saveToJson | ( | ) |
Definition at line 416 of file PlanMasterController.cc.
References QGCCorePlugin::instance(), kJsonGeoFenceObjectKey, kJsonMissionObjectKey, kJsonRallyPointsObjectKey, kPlanFileType, kPlanFileVersion, QGCCorePlugin::postSaveToJson(), QGCCorePlugin::postSaveToMissionJson(), QGCCorePlugin::preSaveToJson(), QGCCorePlugin::preSaveToMissionJson(), GeoFenceController::save(), MissionController::save(), RallyPointController::save(), and JsonParsing::saveQGCJsonFileHeader().
Referenced by saveToFile().
| void PlanMasterController::saveToKml | ( | const QString & | filename | ) |
Definition at line 482 of file PlanMasterController.cc.
References MissionController::addMissionToKML(), kmlFileExtension(), and QGC::showAppMessage().
|
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 600 of file PlanMasterController.cc.
References loadFromFile(), sendToVehicle(), and startStaticActiveVehicle().
Referenced by Vehicle::sendPlan().
| void PlanMasterController::sendToVehicle | ( | void | ) |
Definition at line 319 of file PlanMasterController.cc.
References offline(), VehicleLinkManager::primaryLink(), MissionController::sendToVehicle(), QGC::showAppMessage(), syncInProgress(), and Vehicle::vehicleLinkManager().
Referenced by sendPlanToVehicle().
|
inline |
Definition at line 111 of file PlanMasterController.h.
| void PlanMasterController::setUserSelectedManualCreation | ( | bool | userSelectedManualCreation | ) |
Definition at line 770 of file PlanMasterController.cc.
References showCreateFromTemplate(), showCreateFromTemplateChanged(), userSelectedManualCreation(), and userSelectedManualCreationChanged().
Referenced by removeAll(), and removeAllFromVehicle().
|
inline |
Definition at line 97 of file PlanMasterController.h.
References containsItems().
Referenced by setUserSelectedManualCreation().
|
signal |
Referenced by setUserSelectedManualCreation().
| void PlanMasterController::showPlanFromManagerVehicle | ( | void | ) |
Replaces any current plan with the plan from the manager vehicle even if offline.
Definition at line 757 of file PlanMasterController.cc.
References offline(), and removeAll().
| void PlanMasterController::start | ( | void | ) |
Should be called immediately upon Component.onCompleted.
Definition at line 75 of file PlanMasterController.cc.
References MultiVehicleManager::activeVehicle(), MultiVehicleManager::activeVehicleChanged(), GeoFenceController::start(), MissionController::start(), and RallyPointController::start().
| 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 87 of file PlanMasterController.cc.
References GeoFenceController::start(), MissionController::start(), and RallyPointController::start().
Referenced by sendPlanToVehicle().
| bool PlanMasterController::syncInProgress | ( | void | ) | const |
Definition at line 642 of file PlanMasterController.cc.
References GeoFenceController::syncInProgress(), MissionController::syncInProgress(), and RallyPointController::syncInProgress().
Referenced by loadFromVehicle(), and sendToVehicle().
|
signal |
|
inline |
Definition at line 108 of file PlanMasterController.h.
Referenced by setUserSelectedManualCreation().
|
signal |
Referenced by setUserSelectedManualCreation().
|
staticconstexpr |
Definition at line 122 of file PlanMasterController.h.
Referenced by saveToJson().
|
staticconstexpr |
Definition at line 121 of file PlanMasterController.h.
Referenced by saveToJson().
|
staticconstexpr |
Definition at line 123 of file PlanMasterController.h.
Referenced by saveToJson().
|
staticconstexpr |
Definition at line 120 of file PlanMasterController.h.
Referenced by saveToJson().
|
staticconstexpr |
Definition at line 119 of file PlanMasterController.h.
Referenced by saveToJson().