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
a672b841
Unverified
Commit
a672b841
authored
Sep 07, 2019
by
Don Gagne
Committed by
GitHub
Sep 07, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7788 from DonLakeFlyer/SplitLine
Plan: Allow split of current flight segment
parents
63680cba
2916ae4c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
107 additions
and
5 deletions
+107
-5
qgroundcontrol.qrc
qgroundcontrol.qrc
+1
-0
SplitIndicator.qml
src/FlightMap/MapItems/SplitIndicator.qml
+50
-0
MissionController.cc
src/MissionManager/MissionController.cc
+16
-0
MissionController.h
src/MissionManager/MissionController.h
+3
-0
PlanView.qml
src/PlanView/PlanView.qml
+36
-5
qmldir
src/QmlControls/QGroundControl/FlightMap/qmldir
+1
-0
No files found.
qgroundcontrol.qrc
View file @
a672b841
...
...
@@ -202,6 +202,7 @@
<file alias="QGroundControl/FlightMap/QGCPitchIndicator.qml">src/FlightMap/Widgets/QGCPitchIndicator.qml</file>
<file alias="QGroundControl/FlightMap/QGCVideoBackground.qml">src/FlightMap/QGCVideoBackground.qml</file>
<file alias="QGroundControl/FlightMap/qmldir">src/QmlControls/QGroundControl/FlightMap/qmldir</file>
<file alias="QGroundControl/FlightMap/SplitIndicator.qml">src/FlightMap/MapItems/SplitIndicator.qml</file>
<file alias="QGroundControl/FlightMap/VehicleMapItem.qml">src/FlightMap/MapItems/VehicleMapItem.qml</file>
<file alias="QGroundControl/ScreenTools/qmldir">src/QmlControls/QGroundControl/ScreenTools/qmldir</file>
<file alias="QGroundControl/ScreenTools/ScreenTools.qml">src/QmlControls/ScreenTools.qml</file>
...
...
src/FlightMap/MapItems/SplitIndicator.qml
0 → 100644
View file @
a672b841
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import
QtQuick
2.11
import
QtQuick
.
Controls
2.4
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Controls
1.0
Rectangle
{
id
:
_root
width
:
ScreenTools
.
defaultFontPixelHeight
*
1.5
height
:
width
radius
:
width
/
2
border.color
:
indicatorColor
color
:
"
transparent
"
property
color
indicatorColor
:
"
white
"
signal
clicked
Rectangle
{
anchors.margins
:
_root
.
height
/
6
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.horizontalCenter
:
parent
.
horizontalCenter
width
:
1
color
:
indicatorColor
}
Rectangle
{
anchors.margins
:
_root
.
height
/
6
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.verticalCenter
:
parent
.
verticalCenter
height
:
1
color
:
indicatorColor
}
QGCMouseArea
{
fillItem
:
parent
onClicked
:
_root
.
clicked
()
}
}
src/MissionManager/MissionController.cc
View file @
a672b841
...
...
@@ -69,6 +69,7 @@ MissionController::MissionController(PlanMasterController* masterController, QOb
,
_progressPct
(
0
)
,
_currentPlanViewIndex
(
-
1
)
,
_currentPlanViewItem
(
nullptr
)
,
_splitSegment
(
nullptr
)
{
_resetMissionFlightStatus
();
managerVehicleChanged
(
_managerVehicle
);
...
...
@@ -2106,6 +2107,7 @@ VisualMissionItem* MissionController::currentPlanViewItem(void) const
void
MissionController
::
setCurrentPlanViewIndex
(
int
sequenceNumber
,
bool
force
)
{
if
(
_visualItems
&&
(
force
||
sequenceNumber
!=
_currentPlanViewIndex
))
{
_splitSegment
=
nullptr
;
_currentPlanViewItem
=
nullptr
;
_currentPlanViewIndex
=
-
1
;
for
(
int
i
=
0
;
i
<
_visualItems
->
count
();
i
++
)
{
...
...
@@ -2114,12 +2116,26 @@ void MissionController::setCurrentPlanViewIndex(int sequenceNumber, bool force)
pVI
->
setIsCurrentItem
(
true
);
_currentPlanViewItem
=
pVI
;
_currentPlanViewIndex
=
sequenceNumber
;
if
(
pVI
->
specifiesCoordinate
()
&&
!
pVI
->
isStandaloneCoordinate
())
{
// Determine split segment used to display line split editing ui.
for
(
int
j
=
i
-
1
;
j
>
0
;
j
--
)
{
VisualMissionItem
*
pPrev
=
qobject_cast
<
VisualMissionItem
*>
(
_visualItems
->
get
(
j
));
if
(
pPrev
->
specifiesCoordinate
()
&&
!
pPrev
->
isStandaloneCoordinate
())
{
VisualItemPair
splitPair
(
pPrev
,
pVI
);
if
(
_linesTable
.
contains
(
splitPair
))
{
_splitSegment
=
_linesTable
[
splitPair
];
}
}
}
}
}
else
{
pVI
->
setIsCurrentItem
(
false
);
}
}
emit
currentPlanViewIndexChanged
();
emit
currentPlanViewItemChanged
();
emit
splitSegmentChanged
();
}
}
...
...
src/MissionManager/MissionController.h
View file @
a672b841
...
...
@@ -73,6 +73,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
(
CoordinateVector
*
splitSegment
MEMBER
_splitSegment
NOTIFY
splitSegmentChanged
)
///< Segment which show show + split ui element
Q_PROPERTY
(
double
progressPct
READ
progressPct
NOTIFY
progressPctChanged
)
...
...
@@ -207,6 +208,7 @@ public:
signals:
void
visualItemsChanged
(
void
);
void
waypointPathChanged
(
void
);
void
splitSegmentChanged
(
void
);
void
newItemsFromVehicle
(
void
);
void
missionDistanceChanged
(
double
missionDistance
);
void
missionTimeChanged
(
void
);
...
...
@@ -302,6 +304,7 @@ private:
QTimer
_updateTimer
;
QGCGeoBoundingCube
_travelBoundingCube
;
QGeoCoordinate
_takeoffCoordinate
;
CoordinateVector
*
_splitSegment
;
static
const
char
*
_settingsGroup
;
...
...
src/PlanView/PlanView.qml
View file @
a672b841
...
...
@@ -7,7 +7,6 @@
*
****************************************************************************/
import
QtQuick
2.3
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Dialogs
1.2
...
...
@@ -28,8 +27,6 @@ import QGroundControl.ShapeFileHelper 1.0
import
QGroundControl
.
Airspace
1.0
import
QGroundControl
.
Airmap
1.0
/// Mission Editor
Item
{
property
bool
planControlColapsed
:
false
...
...
@@ -258,6 +255,7 @@ Item {
Connections
{
target
:
_missionController
onNewItemsFromVehicle
:
{
if
(
_visualItems
&&
_visualItems
.
count
!==
1
)
{
mapFitFunctions
.
fitMapViewportToMissionItems
()
...
...
@@ -478,8 +476,41 @@ Item {
delegate
:
MapLineArrow
{
fromCoord
:
object
?
object
.
coordinate1
:
undefined
toCoord
:
object
?
object
.
coordinate2
:
undefined
arrowPosition
:
2
z
:
QGroundControl
.
zOrderWaypointLines
arrowPosition
:
3
z
:
QGroundControl
.
zOrderWaypointLines
+
1
}
}
// UI for splitting the current segment
MapQuickItem
{
id
:
splitSegmentItem
anchorPoint.x
:
sourceItem
.
width
/
2
anchorPoint.y
:
sourceItem
.
height
/
2
z
:
QGroundControl
.
zOrderWaypointLines
+
1
sourceItem
:
SplitIndicator
{
onClicked
:
insertSimpleMissionItem
(
splitSegmentItem
.
coordinate
,
_missionController
.
currentPlanViewIndex
)
}
function
_updateSplitCoord
()
{
if
(
_missionController
.
splitSegment
)
{
var
distance
=
_missionController
.
splitSegment
.
coordinate1
.
distanceTo
(
_missionController
.
splitSegment
.
coordinate2
)
var
azimuth
=
_missionController
.
splitSegment
.
coordinate1
.
azimuthTo
(
_missionController
.
splitSegment
.
coordinate2
)
splitSegmentItem
.
coordinate
=
_missionController
.
splitSegment
.
coordinate1
.
atDistanceAndAzimuth
(
distance
/
2
,
azimuth
)
}
else
{
coordinate
=
QtPositioning
.
coordinate
()
}
}
Connections
{
target
:
_missionController
onSplitSegmentChanged
:
splitSegmentItem
.
_updateSplitCoord
()
}
Connections
{
target
:
_missionController
.
splitSegment
onCoordinate1Changed
:
splitSegmentItem
.
_updateSplitCoord
()
onCoordinate2Changed
:
splitSegmentItem
.
_updateSplitCoord
()
}
}
...
...
src/QmlControls/QGroundControl/FlightMap/qmldir
View file @
a672b841
...
...
@@ -27,4 +27,5 @@ MissionItemView 1.0 MissionItemView.qml
MissionLineView 1.0 MissionLineView.qml
PlanMapItems 1.0 PlanMapItems.qml
PolygonEditor 1.0 PolygonEditor.qml
SplitIndicator 1.0 SplitIndicator.qml
VehicleMapItem 1.0 VehicleMapItem.qml
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