Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
360bfab5
Commit
360bfab5
authored
Dec 08, 2018
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
74a0e0de
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
17 deletions
+23
-17
PlanMasterController.cc
src/MissionManager/PlanMasterController.cc
+20
-16
PlanMasterController.h
src/MissionManager/PlanMasterController.h
+3
-1
No files found.
src/MissionManager/PlanMasterController.cc
View file @
360bfab5
...
...
@@ -33,22 +33,23 @@ const char* PlanMasterController::kJsonGeoFenceObjectKey = "geoFence";
const
char
*
PlanMasterController
::
kJsonRallyPointsObjectKey
=
"rallyPoints"
;
PlanMasterController
::
PlanMasterController
(
QObject
*
parent
)
:
QObject
(
parent
)
,
_multiVehicleMgr
(
qgcApp
()
->
toolbox
()
->
multiVehicleManager
())
,
_controllerVehicle
(
new
Vehicle
(
:
QObject
(
parent
)
,
_multiVehicleMgr
(
qgcApp
()
->
toolbox
()
->
multiVehicleManager
())
,
_controllerVehicle
(
new
Vehicle
(
static_cast
<
MAV_AUTOPILOT
>
(
qgcApp
()
->
toolbox
()
->
settingsManager
()
->
appSettings
()
->
offlineEditingFirmwareType
()
->
rawValue
().
toInt
()),
static_cast
<
MAV_TYPE
>
(
qgcApp
()
->
toolbox
()
->
settingsManager
()
->
appSettings
()
->
offlineEditingVehicleType
()
->
rawValue
().
toInt
()),
qgcApp
()
->
toolbox
()
->
firmwarePluginManager
()))
,
_managerVehicle
(
_controllerVehicle
)
,
_flyView
(
true
)
,
_offline
(
true
)
,
_missionController
(
this
)
,
_geoFenceController
(
this
)
,
_rallyPointController
(
this
)
,
_loadGeoFence
(
false
)
,
_loadRallyPoints
(
false
)
,
_sendGeoFence
(
false
)
,
_sendRallyPoints
(
false
)
,
_managerVehicle
(
_controllerVehicle
)
,
_flyView
(
true
)
,
_offline
(
true
)
,
_missionController
(
this
)
,
_geoFenceController
(
this
)
,
_rallyPointController
(
this
)
,
_loadGeoFence
(
false
)
,
_loadRallyPoints
(
false
)
,
_sendGeoFence
(
false
)
,
_sendRallyPoints
(
false
)
,
_deleteWhenSendCompleted
(
false
)
{
connect
(
&
_missionController
,
&
MissionController
::
dirtyChanged
,
this
,
&
PlanMasterController
::
dirtyChanged
);
connect
(
&
_geoFenceController
,
&
GeoFenceController
::
dirtyChanged
,
this
,
&
PlanMasterController
::
dirtyChanged
);
...
...
@@ -86,9 +87,10 @@ void PlanMasterController::start(bool flyView)
#endif
}
void
PlanMasterController
::
startStaticActiveVehicle
(
Vehicle
*
vehicle
)
void
PlanMasterController
::
startStaticActiveVehicle
(
Vehicle
*
vehicle
,
bool
deleteWhenSendCompleted
)
{
_flyView
=
true
;
_deleteWhenSendCompleted
=
deleteWhenSendCompleted
;
_missionController
.
start
(
_flyView
);
_geoFenceController
.
start
(
_flyView
);
_rallyPointController
.
start
(
_flyView
);
...
...
@@ -264,6 +266,9 @@ void PlanMasterController::_sendGeoFenceComplete(void)
void
PlanMasterController
::
_sendRallyPointsComplete
(
void
)
{
qCDebug
(
PlanMasterControllerLog
)
<<
"PlanMasterController::sendToVehicle Rally Point send complete"
;
if
(
_deleteWhenSendCompleted
)
{
this
->
deleteLater
();
}
}
void
PlanMasterController
::
sendToVehicle
(
void
)
...
...
@@ -535,10 +540,9 @@ void PlanMasterController::sendPlanToVehicle(Vehicle* vehicle, const QString& fi
{
// Use a transient PlanMasterController to accomplish this
PlanMasterController
*
controller
=
new
PlanMasterController
();
controller
->
startStaticActiveVehicle
(
vehicle
);
controller
->
startStaticActiveVehicle
(
vehicle
,
true
/* deleteWhenSendCompleted */
);
controller
->
loadFromFile
(
filename
);
controller
->
sendToVehicle
();
delete
controller
;
}
void
PlanMasterController
::
_showPlanFromManagerVehicle
(
void
)
...
...
src/MissionManager/PlanMasterController.h
View file @
360bfab5
...
...
@@ -49,7 +49,8 @@ public:
Q_INVOKABLE
void
start
(
bool
flyView
);
/// Starts the controller using a single static active vehicle. Will not track global active vehicle changes.
Q_INVOKABLE
void
startStaticActiveVehicle
(
Vehicle
*
vehicle
);
/// @param deleteWhenSendCmplete The PlanMasterController object should be deleted after the first send is completed.
Q_INVOKABLE
void
startStaticActiveVehicle
(
Vehicle
*
vehicle
,
bool
deleteWhenSendCompleted
=
false
);
/// Determines if the plan has all data needed to be saved or sent to the vehicle. Currently the only case where this
/// would return false is when it is still waiting on terrain data to determine correct altitudes.
...
...
@@ -127,5 +128,6 @@ private:
bool
_sendGeoFence
;
bool
_sendRallyPoints
;
QString
_currentPlanFile
;
bool
_deleteWhenSendCompleted
;
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment