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
ef046629
Commit
ef046629
authored
Sep 07, 2019
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
63680cba
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
1 deletion
+14
-1
SimpleMissionItem.cc
src/MissionManager/SimpleMissionItem.cc
+4
-0
SimpleMissionItem.h
src/MissionManager/SimpleMissionItem.h
+6
-0
MissionItemEditor.qml
src/PlanView/MissionItemEditor.qml
+2
-1
MissionCommandDialog.qml
src/QmlControls/MissionCommandDialog.qml
+2
-0
No files found.
src/MissionManager/SimpleMissionItem.cc
View file @
ef046629
...
...
@@ -743,6 +743,10 @@ void SimpleMissionItem::_setDefaultsForCommand(void)
// No need to carry across previous lat/lon
_missionItem
.
_param5Fact
.
setRawValue
(
0
);
_missionItem
.
_param6Fact
.
setRawValue
(
0
);
}
else
if
((
specifiesCoordinate
()
||
isStandaloneCoordinate
())
&&
_missionItem
.
_param5Fact
.
rawValue
().
toDouble
()
==
0
&&
_missionItem
.
_param6Fact
.
rawValue
().
toDouble
()
==
0
)
{
// We switched from a command without a coordinate to a command with a coordinate. Use the hint.
_missionItem
.
_param5Fact
.
setRawValue
(
_mapCenterHint
.
latitude
());
_missionItem
.
_param6Fact
.
setRawValue
(
_mapCenterHint
.
longitude
());
}
// Set global defaults first, then if there are param defaults they will get reset
...
...
src/MissionManager/SimpleMissionItem.h
View file @
ef046629
...
...
@@ -49,6 +49,11 @@ public:
Q_PROPERTY
(
QmlObjectListModel
*
textFieldFacts
READ
textFieldFacts
CONSTANT
)
Q_PROPERTY
(
QmlObjectListModel
*
nanFacts
READ
nanFacts
CONSTANT
)
/// This should be called before changing the command. It is needed if the command changes
/// from an item which does not include a coordinate to an item which requires a coordinate.
/// It uses this value to set that new coordinate.
Q_INVOKABLE
void
setMapCenterHintForCommandChange
(
QGeoCoordinate
mapCenter
)
{
_mapCenterHint
=
mapCenter
;
};
/// Scans the loaded items for additional section settings
/// @param visualItems List of all visual items
/// @param scanIndex Index to start scanning from
...
...
@@ -162,6 +167,7 @@ private:
bool
_rawEdit
;
bool
_dirty
;
bool
_ignoreDirtyChangeSignals
;
QGeoCoordinate
_mapCenterHint
;
SpeedSection
*
_speedSection
;
CameraSection
*
_cameraSection
;
...
...
src/PlanView/MissionItemEditor.qml
View file @
ef046629
...
...
@@ -204,7 +204,8 @@ Rectangle {
id
:
commandDialog
MissionCommandDialog
{
missionItem
:
_root
.
missionItem
missionItem
:
_root
.
missionItem
map
:
_root
.
map
}
}
...
...
src/QmlControls/MissionCommandDialog.qml
View file @
ef046629
...
...
@@ -20,6 +20,7 @@ QGCViewDialog {
id
:
root
property
var
missionItem
property
var
map
property
var
_vehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
...
...
@@ -96,6 +97,7 @@ QGCViewDialog {
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
missionItem
.
setMapCenterHintForCommandChange
(
map
.
center
)
missionItem
.
command
=
mavCmdInfo
.
command
root
.
reject
()
}
...
...
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