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
34e49eab
Commit
34e49eab
authored
Nov 14, 2019
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
2e2eacac
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
71 deletions
+2
-71
MissionSettingsItem.cc
src/MissionManager/MissionSettingsItem.cc
+2
-43
MissionSettingsItem.h
src/MissionManager/MissionSettingsItem.h
+0
-6
MissionSettingsEditor.qml
src/PlanView/MissionSettingsEditor.qml
+0
-22
No files found.
src/MissionManager/MissionSettingsItem.cc
View file @
34e49eab
...
...
@@ -45,7 +45,6 @@ MissionSettingsItem::MissionSettingsItem(Vehicle* vehicle, bool flyView, QObject
_speedSection
.
setAvailable
(
true
);
connect
(
this
,
&
MissionSettingsItem
::
specifyMissionFlightSpeedChanged
,
this
,
&
MissionSettingsItem
::
_setDirtyAndUpdateLastSequenceNumber
);
connect
(
this
,
&
MissionSettingsItem
::
missionEndRTLChanged
,
this
,
&
MissionSettingsItem
::
_setDirtyAndUpdateLastSequenceNumber
);
connect
(
&
_cameraSection
,
&
CameraSection
::
itemCountChanged
,
this
,
&
MissionSettingsItem
::
_setDirtyAndUpdateLastSequenceNumber
);
connect
(
&
_speedSection
,
&
CameraSection
::
itemCountChanged
,
this
,
&
MissionSettingsItem
::
_setDirtyAndUpdateLastSequenceNumber
);
...
...
@@ -155,26 +154,9 @@ void MissionSettingsItem::appendMissionItems(QList<MissionItem*>& items, QObject
_speedSection
.
appendSectionItems
(
items
,
missionItemParent
,
seqNum
);
}
bool
MissionSettingsItem
::
addMissionEndAction
(
QList
<
MissionItem
*>&
items
,
int
seqNum
,
QObject
*
missionItemParent
)
bool
MissionSettingsItem
::
addMissionEndAction
(
QList
<
MissionItem
*>&
/*items*/
,
int
/*seqNum*/
,
QObject
*
/*missionItemParent*/
)
{
MissionItem
*
item
=
nullptr
;
// IMPORTANT NOTE: If anything changes here you must also change MissionSettingsItem::scanForMissionSettings
if
(
_missionEndRTL
)
{
qCDebug
(
MissionSettingsComplexItemLog
)
<<
"Appending end action RTL seqNum"
<<
seqNum
;
item
=
new
MissionItem
(
seqNum
,
MAV_CMD_NAV_RETURN_TO_LAUNCH
,
MAV_FRAME_MISSION
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
// param 1-7 not used
true
,
// autoContinue
false
,
// isCurrentItem
missionItemParent
);
items
.
append
(
item
);
return
true
;
}
else
{
return
false
;
}
return
false
;
}
bool
MissionSettingsItem
::
scanForMissionSettings
(
QmlObjectListModel
*
visualItems
,
int
scanIndex
)
...
...
@@ -188,21 +170,6 @@ bool MissionSettingsItem::scanForMissionSettings(QmlObjectListModel* visualItems
foundCameraSection
=
_cameraSection
.
scanForSection
(
visualItems
,
scanIndex
);
foundSpeedSection
=
_speedSection
.
scanForSection
(
visualItems
,
scanIndex
);
// Look at the end of the mission for end actions
int
lastIndex
=
visualItems
->
count
()
-
1
;
SimpleMissionItem
*
item
=
visualItems
->
value
<
SimpleMissionItem
*>
(
lastIndex
);
if
(
item
)
{
MissionItem
&
missionItem
=
item
->
missionItem
();
if
(
missionItem
.
command
()
==
MAV_CMD_NAV_RETURN_TO_LAUNCH
&&
missionItem
.
param1
()
==
0
&&
missionItem
.
param2
()
==
0
&&
missionItem
.
param3
()
==
0
&&
missionItem
.
param4
()
==
0
&&
missionItem
.
param5
()
==
0
&&
missionItem
.
param6
()
==
0
&&
missionItem
.
param7
()
==
0
)
{
qCDebug
(
MissionSettingsComplexItemLog
)
<<
"Scan: Found end action RTL"
;
_missionEndRTL
=
true
;
visualItems
->
removeAt
(
lastIndex
)
->
deleteLater
();
}
}
return
foundSpeedSection
||
foundCameraSection
;
}
...
...
@@ -307,14 +274,6 @@ double MissionSettingsItem::specifiedFlightSpeed(void)
}
}
void
MissionSettingsItem
::
setMissionEndRTL
(
bool
missionEndRTL
)
{
if
(
missionEndRTL
!=
_missionEndRTL
)
{
_missionEndRTL
=
missionEndRTL
;
emit
missionEndRTLChanged
(
missionEndRTL
);
}
}
void
MissionSettingsItem
::
_setHomeAltFromTerrain
(
double
terrainAltitude
)
{
if
(
!
_plannedHomePositionFromVehicle
&&
!
qIsNaN
(
terrainAltitude
))
{
...
...
src/MissionManager/MissionSettingsItem.h
View file @
34e49eab
...
...
@@ -27,17 +27,13 @@ public:
MissionSettingsItem
(
Vehicle
*
vehicle
,
bool
flyView
,
QObject
*
parent
);
Q_PROPERTY
(
Fact
*
plannedHomePositionAltitude
READ
plannedHomePositionAltitude
CONSTANT
)
Q_PROPERTY
(
bool
missionEndRTL
READ
missionEndRTL
WRITE
setMissionEndRTL
NOTIFY
missionEndRTLChanged
)
Q_PROPERTY
(
QObject
*
cameraSection
READ
cameraSection
CONSTANT
)
Q_PROPERTY
(
QObject
*
speedSection
READ
speedSection
CONSTANT
)
Fact
*
plannedHomePositionAltitude
(
void
)
{
return
&
_plannedHomePositionAltitudeFact
;
}
bool
missionEndRTL
(
void
)
const
{
return
_missionEndRTL
;
}
CameraSection
*
cameraSection
(
void
)
{
return
&
_cameraSection
;
}
SpeedSection
*
speedSection
(
void
)
{
return
&
_speedSection
;
}
void
setMissionEndRTL
(
bool
missionEndRTL
);
/// Scans the loaded items for settings items
bool
scanForMissionSettings
(
QmlObjectListModel
*
visualItems
,
int
scanIndex
);
...
...
@@ -96,7 +92,6 @@ public:
signals:
void
specifyMissionFlightSpeedChanged
(
bool
specifyMissionFlightSpeed
);
void
missionEndRTLChanged
(
bool
missionEndRTL
);
private
slots
:
void
_setDirtyAndUpdateLastSequenceNumber
(
void
);
...
...
@@ -112,7 +107,6 @@ private:
int
_sequenceNumber
=
0
;
bool
_plannedHomePositionFromVehicle
=
false
;
bool
_plannedHomePositionMovedByUser
=
false
;
bool
_missionEndRTL
=
false
;
CameraSection
_cameraSection
;
SpeedSection
_speedSection
;
...
...
src/PlanView/MissionSettingsEditor.qml
View file @
34e49eab
...
...
@@ -107,28 +107,6 @@ Rectangle {
visible
:
_showCameraSection
&&
cameraSection
.
checked
}
SectionHeader
{
id
:
missionEndHeader
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
text
:
qsTr
(
"
Mission End
"
)
checked
:
true
}
Column
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
spacing
:
_margin
visible
:
missionEndHeader
.
checked
QGCCheckBox
{
text
:
qsTr
(
"
Return To Launch
"
)
checked
:
missionItem
.
missionEndRTL
onClicked
:
missionItem
.
missionEndRTL
=
checked
}
}
SectionHeader
{
id
:
vehicleInfoSectionHeader
anchors.left
:
parent
.
left
...
...
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