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
a4be3aef
Unverified
Commit
a4be3aef
authored
Nov 20, 2019
by
Don Gagne
Committed by
GitHub
Nov 20, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8060 from DonLakeFlyer/MoreTakeoffItem
Plan: More takeoff item fixes
parents
8f1b0d04
299fb347
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
8 deletions
+25
-8
MissionController.cc
src/MissionManager/MissionController.cc
+1
-1
TakeoffMissionItem.cc
src/MissionManager/TakeoffMissionItem.cc
+24
-7
No files found.
src/MissionManager/MissionController.cc
View file @
a4be3aef
...
...
@@ -395,7 +395,7 @@ VisualMissionItem* MissionController::insertSimpleMissionItem(QGeoCoordinate coo
VisualMissionItem
*
MissionController
::
insertTakeoffItem
(
QGeoCoordinate
/*coordinate*/
,
int
visualItemIndex
,
bool
makeCurrentItem
)
{
int
sequenceNumber
=
_nextSequenceNumber
();
TakeoffMissionItem
*
newItem
=
new
TakeoffMissionItem
(
_controllerVehicle
->
vtol
()
?
MAV_CMD_NAV_VTOL_TAKEOFF
:
MAV_CMD_NAV_TAKEOFF
,
_
manag
erVehicle
,
_flyView
,
_settingsItem
,
this
);
TakeoffMissionItem
*
newItem
=
new
TakeoffMissionItem
(
_controllerVehicle
->
vtol
()
?
MAV_CMD_NAV_VTOL_TAKEOFF
:
MAV_CMD_NAV_TAKEOFF
,
_
controll
erVehicle
,
_flyView
,
_settingsItem
,
this
);
newItem
->
setSequenceNumber
(
sequenceNumber
);
_initVisualItem
(
newItem
);
...
...
src/MissionManager/TakeoffMissionItem.cc
View file @
a4be3aef
...
...
@@ -50,19 +50,36 @@ void TakeoffMissionItem::_init(void)
{
_editorQml
=
QStringLiteral
(
"qrc:/qml/SimpleItemEditor.qml"
);
QGeoCoordinate
homePosition
=
_vehicle
->
homePosition
();
if
(
homePosition
.
isValid
())
{
_settingsItem
->
setCoordinate
(
homePosition
);
}
connect
(
_settingsItem
,
&
MissionSettingsItem
::
coordinateChanged
,
this
,
&
TakeoffMissionItem
::
launchCoordinateChanged
);
if
(
_flyView
)
{
_initLaunchTakeoffAtSameLocation
();
return
;
}
QGeoCoordinate
homePosition
=
_settingsItem
->
coordinate
();
if
(
!
homePosition
.
isValid
())
{
Vehicle
*
activeVehicle
=
qgcApp
()
->
toolbox
()
->
multiVehicleManager
()
->
activeVehicle
();
if
(
activeVehicle
)
{
homePosition
=
activeVehicle
->
homePosition
();
if
(
homePosition
.
isValid
())
{
_settingsItem
->
setCoordinate
(
homePosition
);
}
}
}
_initLaunchTakeoffAtSameLocation
();
if
(
_launchTakeoffAtSameLocation
&&
homePosition
.
isValid
())
{
if
(
homePosition
.
isValid
()
&&
coordinate
().
isValid
())
{
// Item already full specified, most likely from mission load from storage
_wizardMode
=
false
;
SimpleMissionItem
::
setCoordinate
(
homePosition
);
}
else
{
_wizardMode
=
true
;
if
(
_launchTakeoffAtSameLocation
&&
homePosition
.
isValid
())
{
_wizardMode
=
false
;
SimpleMissionItem
::
setCoordinate
(
homePosition
);
}
else
{
_wizardMode
=
true
;
}
}
setDirty
(
false
);
...
...
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