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
fc2781c3
Commit
fc2781c3
authored
Nov 17, 2019
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
87363227
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
15 deletions
+25
-15
MissionController.cc
src/MissionManager/MissionController.cc
+3
-7
MissionSettingsItem.cc
src/MissionManager/MissionSettingsItem.cc
+14
-8
MissionSettingsItem.h
src/MissionManager/MissionSettingsItem.h
+1
-0
TakeoffMissionItem.cc
src/MissionManager/TakeoffMissionItem.cc
+7
-0
No files found.
src/MissionManager/MissionController.cc
View file @
fc2781c3
...
@@ -395,9 +395,8 @@ VisualMissionItem* MissionController::insertSimpleMissionItem(QGeoCoordinate coo
...
@@ -395,9 +395,8 @@ VisualMissionItem* MissionController::insertSimpleMissionItem(QGeoCoordinate coo
VisualMissionItem
*
MissionController
::
insertTakeoffItem
(
QGeoCoordinate
/*coordinate*/
,
int
visualItemIndex
,
bool
makeCurrentItem
)
VisualMissionItem
*
MissionController
::
insertTakeoffItem
(
QGeoCoordinate
/*coordinate*/
,
int
visualItemIndex
,
bool
makeCurrentItem
)
{
{
int
sequenceNumber
=
_nextSequenceNumber
();
int
sequenceNumber
=
_nextSequenceNumber
();
TakeoffMissionItem
*
newItem
=
new
TakeoffMissionItem
(
_controllerVehicle
->
vtol
()
?
MAV_CMD_NAV_VTOL_TAKEOFF
:
MAV_CMD_NAV_TAKEOFF
,
_
controll
erVehicle
,
_flyView
,
_settingsItem
,
this
);
TakeoffMissionItem
*
newItem
=
new
TakeoffMissionItem
(
_controllerVehicle
->
vtol
()
?
MAV_CMD_NAV_VTOL_TAKEOFF
:
MAV_CMD_NAV_TAKEOFF
,
_
manag
erVehicle
,
_flyView
,
_settingsItem
,
this
);
newItem
->
setSequenceNumber
(
sequenceNumber
);
newItem
->
setSequenceNumber
(
sequenceNumber
);
newItem
->
setWizardMode
(
true
);
_initVisualItem
(
newItem
);
_initVisualItem
(
newItem
);
if
(
newItem
->
specifiesAltitude
())
{
if
(
newItem
->
specifiesAltitude
())
{
...
@@ -1705,8 +1704,6 @@ void MissionController::_initAllVisualItems(void)
...
@@ -1705,8 +1704,6 @@ void MissionController::_initAllVisualItems(void)
}
}
}
}
_settingsItem
->
setHomePositionFromVehicle
(
_managerVehicle
);
connect
(
_settingsItem
,
&
MissionSettingsItem
::
coordinateChanged
,
this
,
&
MissionController
::
_recalcAll
);
connect
(
_settingsItem
,
&
MissionSettingsItem
::
coordinateChanged
,
this
,
&
MissionController
::
_recalcAll
);
connect
(
_settingsItem
,
&
MissionSettingsItem
::
coordinateChanged
,
this
,
&
MissionController
::
plannedHomePositionChanged
);
connect
(
_settingsItem
,
&
MissionSettingsItem
::
coordinateChanged
,
this
,
&
MissionController
::
plannedHomePositionChanged
);
...
@@ -1831,7 +1828,7 @@ bool MissionController::_findPreviousAltitude(int newIndex, double* prevAltitude
...
@@ -1831,7 +1828,7 @@ bool MissionController::_findPreviousAltitude(int newIndex, double* prevAltitude
{
{
bool
found
=
false
;
bool
found
=
false
;
double
foundAltitude
=
0
;
double
foundAltitude
=
0
;
int
foundAltitudeMode
;
int
foundAltitudeMode
=
QGroundControlQmlGlobal
::
AltitudeModeNone
;
if
(
newIndex
>
_visualItems
->
count
())
{
if
(
newIndex
>
_visualItems
->
count
())
{
return
false
;
return
false
;
...
@@ -1879,9 +1876,8 @@ MissionSettingsItem* MissionController::_addMissionSettings(QmlObjectListModel*
...
@@ -1879,9 +1876,8 @@ MissionSettingsItem* MissionController::_addMissionSettings(QmlObjectListModel*
{
{
qCDebug
(
MissionControllerLog
)
<<
"_addMissionSettings"
;
qCDebug
(
MissionControllerLog
)
<<
"_addMissionSettings"
;
MissionSettingsItem
*
settingsItem
=
new
MissionSettingsItem
(
_
controll
erVehicle
,
_flyView
,
visualItems
);
MissionSettingsItem
*
settingsItem
=
new
MissionSettingsItem
(
_
manag
erVehicle
,
_flyView
,
visualItems
);
visualItems
->
insert
(
0
,
settingsItem
);
visualItems
->
insert
(
0
,
settingsItem
);
settingsItem
->
setHomePositionFromVehicle
(
_managerVehicle
);
if
(
visualItems
==
_visualItems
)
{
if
(
visualItems
==
_visualItems
)
{
_settingsItem
=
settingsItem
;
_settingsItem
=
settingsItem
;
...
...
src/MissionManager/MissionSettingsItem.cc
View file @
fc2781c3
...
@@ -47,17 +47,16 @@ MissionSettingsItem::MissionSettingsItem(Vehicle* vehicle, bool flyView, QObject
...
@@ -47,17 +47,16 @@ MissionSettingsItem::MissionSettingsItem(Vehicle* vehicle, bool flyView, QObject
connect
(
this
,
&
MissionSettingsItem
::
specifyMissionFlightSpeedChanged
,
this
,
&
MissionSettingsItem
::
_setDirtyAndUpdateLastSequenceNumber
);
connect
(
this
,
&
MissionSettingsItem
::
specifyMissionFlightSpeedChanged
,
this
,
&
MissionSettingsItem
::
_setDirtyAndUpdateLastSequenceNumber
);
connect
(
&
_cameraSection
,
&
CameraSection
::
itemCountChanged
,
this
,
&
MissionSettingsItem
::
_setDirtyAndUpdateLastSequenceNumber
);
connect
(
&
_cameraSection
,
&
CameraSection
::
itemCountChanged
,
this
,
&
MissionSettingsItem
::
_setDirtyAndUpdateLastSequenceNumber
);
connect
(
&
_speedSection
,
&
CameraSection
::
itemCountChanged
,
this
,
&
MissionSettingsItem
::
_setDirtyAndUpdateLastSequenceNumber
);
connect
(
&
_speedSection
,
&
CameraSection
::
itemCountChanged
,
this
,
&
MissionSettingsItem
::
_setDirtyAndUpdateLastSequenceNumber
);
connect
(
this
,
&
MissionSettingsItem
::
terrainAltitudeChanged
,
this
,
&
MissionSettingsItem
::
_setHomeAltFromTerrain
);
connect
(
this
,
&
MissionSettingsItem
::
terrainAltitudeChanged
,
this
,
&
MissionSettingsItem
::
_setHomeAltFromTerrain
);
connect
(
&
_plannedHomePositionAltitudeFact
,
&
Fact
::
rawValueChanged
,
this
,
&
MissionSettingsItem
::
_updateAltitudeInCoordinate
);
connect
(
&
_cameraSection
,
&
CameraSection
::
dirtyChanged
,
this
,
&
MissionSettingsItem
::
_sectionDirtyChanged
);
connect
(
&
_cameraSection
,
&
CameraSection
::
dirtyChanged
,
this
,
&
MissionSettingsItem
::
_sectionDirtyChanged
);
connect
(
&
_speedSection
,
&
SpeedSection
::
dirtyChanged
,
this
,
&
MissionSettingsItem
::
_sectionDirtyChanged
);
connect
(
&
_speedSection
,
&
SpeedSection
::
dirtyChanged
,
this
,
&
MissionSettingsItem
::
_sectionDirtyChanged
);
connect
(
&
_cameraSection
,
&
CameraSection
::
specifiedGimbalYawChanged
,
this
,
&
MissionSettingsItem
::
specifiedGimbalYawChanged
);
connect
(
&
_cameraSection
,
&
CameraSection
::
specifiedGimbalYawChanged
,
this
,
&
MissionSettingsItem
::
specifiedGimbalYawChanged
);
connect
(
&
_cameraSection
,
&
CameraSection
::
specifiedGimbalPitchChanged
,
this
,
&
MissionSettingsItem
::
specifiedGimbalPitchChanged
);
connect
(
&
_cameraSection
,
&
CameraSection
::
specifiedGimbalPitchChanged
,
this
,
&
MissionSettingsItem
::
specifiedGimbalPitchChanged
);
connect
(
&
_speedSection
,
&
SpeedSection
::
specifiedFlightSpeedChanged
,
this
,
&
MissionSettingsItem
::
specifiedFlightSpeedChanged
);
connect
(
&
_speedSection
,
&
SpeedSection
::
specifiedFlightSpeedChanged
,
this
,
&
MissionSettingsItem
::
specifiedFlightSpeedChanged
);
connect
(
_vehicle
,
&
Vehicle
::
homePositionChanged
,
this
,
&
MissionSettingsItem
::
_updateHomePosition
);
connect
(
&
_plannedHomePositionAltitudeFact
,
&
Fact
::
rawValueChanged
,
this
,
&
MissionSettingsItem
::
_updateAltitudeInCoordinate
);
_updateHomePosition
(
_vehicle
->
homePosition
());
}
}
int
MissionSettingsItem
::
lastSequenceNumber
(
void
)
const
int
MissionSettingsItem
::
lastSequenceNumber
(
void
)
const
...
@@ -285,3 +284,10 @@ QString MissionSettingsItem::abbreviation(void) const
...
@@ -285,3 +284,10 @@ QString MissionSettingsItem::abbreviation(void) const
{
{
return
_flyView
?
tr
(
"H"
)
:
tr
(
"Launch"
);
return
_flyView
?
tr
(
"H"
)
:
tr
(
"Launch"
);
}
}
void
MissionSettingsItem
::
_updateHomePosition
(
const
QGeoCoordinate
&
homePosition
)
{
if
(
_flyView
)
{
setCoordinate
(
homePosition
);
}
}
src/MissionManager/MissionSettingsItem.h
View file @
fc2781c3
...
@@ -100,6 +100,7 @@ private slots:
...
@@ -100,6 +100,7 @@ private slots:
void
_updateAltitudeInCoordinate
(
QVariant
value
);
void
_updateAltitudeInCoordinate
(
QVariant
value
);
void
_setHomeAltFromTerrain
(
double
terrainAltitude
);
void
_setHomeAltFromTerrain
(
double
terrainAltitude
);
void
_setCoordinateWorker
(
const
QGeoCoordinate
&
coordinate
);
void
_setCoordinateWorker
(
const
QGeoCoordinate
&
coordinate
);
void
_updateHomePosition
(
const
QGeoCoordinate
&
homePosition
);
private:
private:
QGeoCoordinate
_plannedHomePositionCoordinate
;
// Does not include altitude
QGeoCoordinate
_plannedHomePositionCoordinate
;
// Does not include altitude
...
...
src/MissionManager/TakeoffMissionItem.cc
View file @
fc2781c3
...
@@ -58,6 +58,13 @@ void TakeoffMissionItem::_init(void)
...
@@ -58,6 +58,13 @@ void TakeoffMissionItem::_init(void)
_initLaunchTakeoffAtSameLocation
();
_initLaunchTakeoffAtSameLocation
();
if
(
_launchTakeoffAtSameLocation
&&
homePosition
.
isValid
())
{
_wizardMode
=
false
;
SimpleMissionItem
::
setCoordinate
(
homePosition
);
}
else
{
_wizardMode
=
true
;
}
setDirty
(
false
);
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