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
112580d8
Unverified
Commit
112580d8
authored
Dec 12, 2019
by
Don Gagne
Committed by
GitHub
Dec 12, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8114 from DonLakeFlyer/PreviousPosition
Plan: Support move item to previous item position
parents
fd3b7623
b9b28d03
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
MissionController.cc
src/MissionManager/MissionController.cc
+8
-1
MissionController.h
src/MissionManager/MissionController.h
+3
-0
MissionItemEditor.qml
src/PlanView/MissionItemEditor.qml
+14
-0
No files found.
src/MissionManager/MissionController.cc
View file @
112580d8
...
...
@@ -2243,6 +2243,7 @@ void MissionController::setCurrentPlanViewSeqNum(int sequenceNumber, bool force)
_isROIActive
=
false
;
_isROIBeginCurrentItem
=
false
;
_flyThroughCommandsAllowed
=
true
;
_previousCoordinate
=
QGeoCoordinate
();
for
(
int
viIndex
=
0
;
viIndex
<
_visualItems
->
count
();
viIndex
++
)
{
VisualMissionItem
*
pVI
=
qobject_cast
<
VisualMissionItem
*>
(
_visualItems
->
get
(
viIndex
));
...
...
@@ -2282,8 +2283,13 @@ void MissionController::setCurrentPlanViewSeqNum(int sequenceNumber, bool force)
}
}
// ROI state handling
if
(
simpleItem
)
{
// Remember previous coordinate
if
(
pVI
->
sequenceNumber
()
<
sequenceNumber
&&
simpleItem
->
specifiesCoordinate
()
&&
!
simpleItem
->
isStandaloneCoordinate
())
{
_previousCoordinate
=
simpleItem
->
coordinate
();
}
// ROI state handling
if
(
pVI
->
sequenceNumber
()
<=
sequenceNumber
)
{
if
(
_isROIActive
)
{
if
(
_isROICancelItem
(
simpleItem
))
{
...
...
@@ -2351,6 +2357,7 @@ void MissionController::setCurrentPlanViewSeqNum(int sequenceNumber, bool force)
emit
isROIActiveChanged
();
emit
isROIBeginCurrentItemChanged
();
emit
flyThroughCommandsAllowedChanged
();
emit
previousCoordinateChanged
();
}
}
...
...
src/MissionManager/MissionController.h
View file @
112580d8
...
...
@@ -72,6 +72,7 @@ public:
Q_PROPERTY
(
QmlObjectListModel
*
directionArrows
READ
directionArrows
CONSTANT
)
Q_PROPERTY
(
QStringList
complexMissionItemNames
READ
complexMissionItemNames
NOTIFY
complexMissionItemNamesChanged
)
Q_PROPERTY
(
QGeoCoordinate
plannedHomePosition
READ
plannedHomePosition
NOTIFY
plannedHomePositionChanged
)
Q_PROPERTY
(
QGeoCoordinate
previousCoordinate
MEMBER
_previousCoordinate
NOTIFY
previousCoordinateChanged
)
Q_PROPERTY
(
CoordinateVector
*
splitSegment
MEMBER
_splitSegment
NOTIFY
splitSegmentChanged
)
///< Segment which show show + split ui element
Q_PROPERTY
(
double
progressPct
READ
progressPct
NOTIFY
progressPctChanged
)
Q_PROPERTY
(
int
missionItemCount
READ
missionItemCount
NOTIFY
missionItemCountChanged
)
///< True mission item command count (only valid in Fly View)
...
...
@@ -266,6 +267,7 @@ signals:
void
isROIActiveChanged
(
void
);
void
isROIBeginCurrentItemChanged
(
void
);
void
flyThroughCommandsAllowedChanged
(
void
);
void
previousCoordinateChanged
(
void
);
private
slots
:
void
_newMissionItemsAvailableFromVehicle
(
bool
removeAllRequested
);
...
...
@@ -344,6 +346,7 @@ private:
QTimer
_updateTimer
;
QGCGeoBoundingCube
_travelBoundingCube
;
QGeoCoordinate
_takeoffCoordinate
;
QGeoCoordinate
_previousCoordinate
;
CoordinateVector
*
_splitSegment
;
bool
_isInsertTakeoffValid
=
true
;
bool
_isInsertLandValid
=
true
;
...
...
src/PlanView/MissionItemEditor.qml
View file @
112580d8
...
...
@@ -40,6 +40,7 @@ Rectangle {
property
real
_sectionSpacer
:
ScreenTools
.
defaultFontPixelWidth
/
2
// spacing between section headings
property
bool
_singleComplexItem
:
_missionController
.
complexMissionItemNames
.
length
===
1
property
bool
_readyForSave
:
missionItem
.
readyForSaveState
===
VisualMissionItem
.
ReadyForSave
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
readonly
property
real
_editFieldWidth
:
Math
.
min
(
width
-
_margin
*
2
,
ScreenTools
.
defaultFontPixelWidth
*
12
)
readonly
property
real
_margin
:
ScreenTools
.
defaultFontPixelWidth
/
2
...
...
@@ -137,6 +138,19 @@ Rectangle {
QGCMenu
{
id
:
hamburgerMenu
QGCMenuItem
{
text
:
qsTr
(
"
Move to vehicle position
"
)
visible
:
missionItem
.
specifiesCoordinate
enabled
:
_activeVehicle
onTriggered
:
missionItem
.
coordinate
=
_activeVehicle
.
coordinate
}
QGCMenuItem
{
text
:
qsTr
(
"
Move to previous item position
"
)
visible
:
_missionController
.
previousCoordinate
.
isValid
onTriggered
:
missionItem
.
coordinate
=
_missionController
.
previousCoordinate
}
QGCMenuItem
{
text
:
qsTr
(
"
Edit position...
"
)
visible
:
missionItem
.
specifiesCoordinate
...
...
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