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
d03e945a
Commit
d03e945a
authored
Oct 05, 2019
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding wp to flight view
parent
95fdac9e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
94 additions
and
2 deletions
+94
-2
qgroundcontrol.qrc
qgroundcontrol.qrc
+1
-0
FlightDisplayViewMap.qml
src/FlightDisplay/FlightDisplayViewMap.qml
+10
-0
WimaPlanMapItems.qml
src/FlightMap/MapItems/WimaPlanMapItems.qml
+66
-0
WimaController.cc
src/Wima/WimaController.cc
+15
-1
WimaController.h
src/Wima/WimaController.h
+2
-1
No files found.
qgroundcontrol.qrc
View file @
d03e945a
...
...
@@ -227,6 +227,7 @@
<file alias="QGroundControl/Controls/CoordinateIndicator.qml">src/WimaView/CoordinateIndicator.qml</file>
<file alias="QGroundControl/Controls/WimaJoinedAreaMapVisual.qml">src/WimaView/WimaJoinedAreaMapVisual.qml</file>
<file alias="QGroundControl/Controls/WimaCorridorEditor.qml">src/WimaView/WimaCorridorEditor.qml</file>
<file>src/FlightMap/MapItems/WimaPlanMapItems.qml</file>
</qresource>
<qresource prefix="/json">
<file alias="APMMavlinkStreamRate.SettingsGroup.json">src/Settings/APMMavlinkStreamRate.SettingsGroup.json</file>
...
...
src/FlightDisplay/FlightDisplayViewMap.qml
View file @
d03e945a
...
...
@@ -209,6 +209,16 @@ FlightMap {
}
}
// Add mission items generated by wima planer to the map
PlanMapItems
{
map
:
flightMap
largeMapView
:
_mainIsMap
masterController
:
masterController
isActiveVehicle
:
_vehicle
.
active
property
var
_vehicle
:
object
}
// Add trajectory points to the map
MapItemView
{
model
:
_mainIsMap
?
_activeVehicle
?
_activeVehicle
.
trajectoryPoints
:
0
:
0
...
...
src/FlightMap/MapItems/WimaPlanMapItems.qml
0 → 100644
View file @
d03e945a
/****************************************************************************
*
* (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.3
import
QtLocation
5.3
import
QtPositioning
5.3
import
QGroundControl
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
FlightMap
1.0
// Adds visual items generated by wima planer to the map.
// Currently only used by Fly View even though it's called PlanMapItems!
Item
{
id
:
_root
property
var
map
///< Map control to show items on
property
bool
largeMapView
///< true: map takes up entire view, false: map is in small window
property
var
wimaController
value
property
var
_map
:
map
property
var
_missionLineViewComponent
// Add the mission item visuals to the map
Repeater
{
model
:
largeMapView
?
_missionController
.
visualItems
:
0
delegate
:
MissionItemMapVisual
{
map
:
_map
onClicked
:
{
if
(
isActiveVehicle
)
{
// Only active vehicle supports click to change current mission item
guidedActionsController
.
confirmAction
(
guidedActionsController
.
actionSetWaypoint
,
Math
.
max
(
object
.
sequenceNumber
,
1
))
}
}
}
}
Component
.
onCompleted
:
{
_missionLineViewComponent
=
missionLineViewComponent
.
createObject
(
map
)
if
(
_missionLineViewComponent
.
status
===
Component
.
Error
)
console
.
log
(
_missionLineViewComponent
.
errorString
())
map
.
addMapItem
(
_missionLineViewComponent
)
}
Component
.
onDestruction
:
{
_missionLineViewComponent
.
destroy
()
}
Component
{
id
:
missionLineViewComponent
MapPolyline
{
line.width
:
3
line.color
:
"
#be781c
"
// Hack, can't get palette to work in here
z
:
QGroundControl
.
zOrderWaypointLines
path
:
_missionController
.
waypointPath
}
}
}
src/Wima/WimaController.cc
View file @
d03e945a
...
...
@@ -43,6 +43,11 @@ WimaDataContainer *WimaController::dataContainer() const
return
_container
;
}
QmlObjectListModel
*
WimaController
::
missionItems
()
{
return
&
_missionItems
;
}
void
WimaController
::
setMasterController
(
PlanMasterController
*
masterC
)
{
_masterController
=
masterC
;
...
...
@@ -146,6 +151,7 @@ void WimaController::containerDataValidChanged(bool valid)
}
_localPlanDataValid
=
false
;
_visualItems
.
clear
();
_missionItems
.
clear
();
WimaPlanData
planData
=
_container
->
pull
();
// extract list with WimaAreas
...
...
@@ -198,14 +204,22 @@ void WimaController::containerDataValidChanged(bool valid)
break
;
}
QList
<
const
MissionItem
*>
tempMissionItems
=
planData
.
missionItems
();
for
(
auto
missionItem
:
tempMissionItems
)
_missionItems
.
append
(
const_cast
<
MissionItem
*>
(
missionItem
));
// losing const qualifier here
if
(
areaCounter
==
numAreas
)
_localPlanDataValid
=
true
;
}
else
{
_localPlanDataValid
=
false
;
_visualItems
.
clear
();
_visualItems
.
clear
();
_missionItems
.
clear
();
}
emit
visualItemsChanged
();
emit
missionItemsChanged
();
}
...
...
src/Wima/WimaController.h
View file @
d03e945a
...
...
@@ -53,7 +53,7 @@ public:
QString
fileExtension
(
void
)
const
{
return
wimaFileExtension
;
}
QGCMapPolygon
joinedArea
(
void
)
const
;
WimaDataContainer
*
dataContainer
(
void
)
const
;
QmlObjectListModel
*
missionItems
(
void
);
// Property setters
...
...
@@ -89,6 +89,7 @@ signals:
void
currentFileChanged
();
void
dataContainerChanged
();
void
readyForSaveSendChanged
(
bool
ready
);
void
missionItemsChanged
(
void
);
private
slots
:
void
containerDataValidChanged
(
bool
valid
);
...
...
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