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
12f888dc
Commit
12f888dc
authored
Apr 01, 2019
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
about to add fact system to wima
parent
00d7ea68
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
105 additions
and
52 deletions
+105
-52
WimaGlobalMeasurementPolygonEditor.qml
WimaGlobalMeasurementPolygonEditor.qml
+5
-0
qgroundcontrol.pro
qgroundcontrol.pro
+3
-0
qgroundcontrol.qrc
qgroundcontrol.qrc
+2
-1
WimaController.cc
src/MissionManager/WimaController.cc
+7
-1
WimaGlobalMeasurementPolygon.SettingsGroup.json
...onManager/WimaGlobalMeasurementPolygon.SettingsGroup.json
+0
-0
WimaGlobalMeasurementPolygon.cc
src/MissionManager/WimaGlobalMeasurementPolygon.cc
+1
-1
WimaGlobalMeasurementPolygon.h
src/MissionManager/WimaGlobalMeasurementPolygon.h
+17
-3
WimaPolygon.cc
src/MissionManager/WimaPolygon.cc
+5
-2
WimaPolygon.h
src/MissionManager/WimaPolygon.h
+0
-1
WimaServicePolygon.cc
src/MissionManager/WimaServicePolygon.cc
+1
-1
WimaVehicleCorridor.cc
src/MissionManager/WimaVehicleCorridor.cc
+1
-1
WimaVehicleMeasurementPolygon.cc
src/MissionManager/WimaVehicleMeasurementPolygon.cc
+1
-1
WimaItemEditor.qml
src/WimaView/WimaItemEditor.qml
+47
-21
WimaView.qml
src/WimaView/WimaView.qml
+15
-19
No files found.
WimaGlobalMeasurementPolygonEditor.qml
0 → 100644
View file @
12f888dc
import
QtQuick
2.0
Item
{
}
qgroundcontrol.pro
View file @
12f888dc
...
...
@@ -1307,3 +1307,6 @@ contains (CONFIG, QGC_DISABLE_INSTALLER_SETUP) {
}
else
{
include
(
QGCInstaller
.
pri
)
}
DISTFILES
+=
\
src
/
MissionManager
/
WimaGlobalMeasurementPolygon
.
SettingsGroup
.
json
qgroundcontrol.qrc
View file @
12f888dc
...
...
@@ -213,7 +213,8 @@
<file alias="QGroundControl/Controls/WimaMapVisual.qml">src/WimaView/WimaMapVisual.qml</file>
<file alias="QGroundControl/Controls/WimaGlobalMeasurementPolygonMapVisual.qml">src/WimaView/WimaGlobalMeasurementPolygonMapVisual.qml</file>
<file alias="QGroundControl/Controls/WimaServicePolygonMapVisual.qml">src/WimaView/WimaServicePolygonMapVisual.qml</file>
<file alias="WimaItemEditor.qml">src/WimaView/WimaItemEditor.qml</file>
<file alias="QGroundControl/Controls/WimaItemEditor.qml">src/WimaView/WimaItemEditor.qml</file>
<file alias="QGroundControl/Controls/WimaGlobalMeasurementPolygonEditor.qml">WimaGlobalMeasurementPolygonEditor.qml</file>
</qresource>
<qresource prefix="/json">
<file alias="APMMavlinkStreamRate.SettingsGroup.json">src/Settings/APMMavlinkStreamRate.SettingsGroup.json</file>
...
...
src/MissionManager/WimaController.cc
View file @
12f888dc
...
...
@@ -23,7 +23,7 @@ void WimaController::setMissionController(MissionController *missionC)
void
WimaController
::
setCurrentPolygonIndex
(
int
index
)
{
if
(
index
>
0
&&
index
<
_visualItems
->
count
()
&&
index
!=
_currentPolygonIndex
){
if
(
index
>
=
0
&&
index
<
_visualItems
->
count
()
&&
index
!=
_currentPolygonIndex
){
_currentPolygonIndex
=
index
;
emit
currentPolygonIndexChanged
(
index
);
...
...
@@ -47,6 +47,12 @@ void WimaController::removeArea(int index)
_visualItems
->
removeAt
(
index
);
emit
visualItemsChanged
();
if
(
_currentPolygonIndex
>=
_visualItems
->
count
()){
setCurrentPolygonIndex
(
_visualItems
->
count
()
-
1
);
}
else
{
recalcPolygonInteractivity
(
_currentPolygonIndex
);
}
}
else
{
qWarning
(
"Index out of bounds!"
);
}
...
...
src/MissionManager/WimaGlobalMeasurementPolygon.SettingsGroup.json
0 → 100644
View file @
12f888dc
src/MissionManager/WimaGlobalMeasurementPolygon.cc
View file @
12f888dc
...
...
@@ -5,7 +5,7 @@
WimaGlobalMeasurementPolygon
::
WimaGlobalMeasurementPolygon
(
QObject
*
parent
)
:
WimaPolygon
(
parent
)
{
this
->
setObjectName
(
"Operating Area"
);
}
WimaGlobalMeasurementPolygon
::
WimaGlobalMeasurementPolygon
(
QGCMapPolygon
*
other
,
QObject
*
parent
)
:
...
...
src/MissionManager/WimaGlobalMeasurementPolygon.h
View file @
12f888dc
...
...
@@ -44,6 +44,10 @@ public:
void
setNumberOfLayers
(
int
numberOfLayers
);
void
setLayerDistance
(
double
distance
);
static
const
char
*
settingsGroup
;
signals:
void
bottomLayerAltitudeChanged
(
void
);
void
numberOfLayersChanged
(
void
);
...
...
@@ -54,11 +58,21 @@ signals:
private:
double
_bottomLayerAltitude
;
int
_numberOfLayers
;
double
_layerDistance
;
QMap
<
QString
,
FactMetaData
*>
_metaDataMap
;
SettingsFact
_bottomLayerAltitude
;
SettingsFact
_numberOfLayers
;
SettingsFact
_layerDistance
;
QmlObjectListModel
*
_vehicleList
;
QGCMapPolyline
*
_entryPolyline
;
SettingsFact
};
src/MissionManager/WimaPolygon.cc
View file @
12f888dc
...
...
@@ -36,8 +36,11 @@ void WimaPolygon::setVehicle(Vehicle *vehicle)
void
WimaPolygon
::
setIsCurrentPolygon
(
bool
isCurrentPolygon
)
{
_isCurrentPolygon
=
isCurrentPolygon
;
emit
isCurrentPolygonChanged
();
if
(
_isCurrentPolygon
!=
isCurrentPolygon
){
_isCurrentPolygon
=
isCurrentPolygon
;
emit
isCurrentPolygonChanged
();
}
}
QList
<
QGCMapPolygon
*>*
WimaPolygon
::
splitPolygonArea
(
int
numberOfFractions
)
...
...
src/MissionManager/WimaPolygon.h
View file @
12f888dc
...
...
@@ -42,7 +42,6 @@ public:
//Property setters
void
setMaxAltitude
(
double
alt
);
void
setName
(
QString
name
);
void
setVehicle
(
Vehicle
*
vehicle
);
void
setIsCurrentPolygon
(
bool
isCurrentPolygon
);
...
...
src/MissionManager/WimaServicePolygon.cc
View file @
12f888dc
...
...
@@ -3,7 +3,7 @@
WimaServicePolygon
::
WimaServicePolygon
(
QObject
*
parent
)
:
WimaPolygon
(
parent
)
{
this
->
setObjectName
(
"Service Area"
);
}
WimaServicePolygon
::
WimaServicePolygon
(
QGCMapPolygon
*
other
,
QObject
*
parent
)
:
...
...
src/MissionManager/WimaVehicleCorridor.cc
View file @
12f888dc
...
...
@@ -3,7 +3,7 @@
WimaVehicleCorridor
::
WimaVehicleCorridor
(
QObject
*
parent
)
:
WimaPolygon
(
parent
)
{
this
->
setObjectName
(
"Corridor"
);
}
WimaVehicleCorridor
::
WimaVehicleCorridor
(
QGCMapPolygon
*
other
,
QObject
*
parent
)
:
...
...
src/MissionManager/WimaVehicleMeasurementPolygon.cc
View file @
12f888dc
...
...
@@ -4,7 +4,7 @@
WimaVehicleMeasurementPolygon
::
WimaVehicleMeasurementPolygon
(
QObject
*
parent
)
:
WimaPolygon
(
parent
)
{
this
->
setObjectName
(
"Vehicle Area"
);
}
WimaVehicleMeasurementPolygon
::
WimaVehicleMeasurementPolygon
(
QGCMapPolygon
*
other
,
QObject
*
parent
)
:
...
...
src/WimaView/WimaItemEditor.qml
View file @
12f888dc
...
...
@@ -15,14 +15,13 @@ import QGroundControl.Palette 1.0
/// Fly Area Item edit control
Rectangle
{
id
:
_root
height
:
editorLoader
.
visible
?
(
editorLoader
.
y
+
editorLoader
.
height
+
(
_margin
*
2
))
:
(
descriptionLabel
.
y
+
descriptionLabel
.
height
+
_margin
/
2
)
height
:
editorLoader
.
visible
?
(
editorLoader
.
y
+
editorLoader
.
height
+
(
_margin
*
2
))
:
(
commandPicker
.
y
+
commandPicker
.
height
+
_margin
/
2
)
color
:
_currentItem
?
qgcPal
.
missionItemEditor
:
qgcPal
.
windowShade
radius
:
_radius
property
var
map
///< Map control
property
var
flyArea
property
var
wimaController
property
var
masterController
property
var
polygon
///< MissionItem associated with this editor
property
bool
readOnly
///< true: read only view, false: full editing view
property
var
rootQgcView
property
int
_index
...
...
@@ -32,16 +31,15 @@ Rectangle {
property
var
_masterController
:
masterController
property
var
_missionController
:
_masterController
.
missionController
property
bool
_currentItem
:
polygon
.
interactive
property
var
_polygon
:
object
.
polygon
property
bool
_currentItem
:
object
.
isCurrentPolygon
property
color
_outerTextColor
:
_currentItem
?
qgcPal
.
primaryButtonText
:
qgcPal
.
text
property
bool
_noMissionItemsAdded
:
ListView
.
view
.
model
.
count
===
1
property
real
_sectionSpacer
:
ScreenTools
.
defaultFontPixelWidth
/
2
// spacing between section headings
readonly
property
real
_editFieldWidth
:
Math
.
min
(
width
-
_margin
*
2
,
ScreenTools
.
defaultFontPixelWidth
*
12
)
readonly
property
real
_margin
:
ScreenTools
.
defaultFontPixelWidth
/
2
readonly
property
real
_radius
:
ScreenTools
.
defaultFontPixelWidth
/
2
readonly
property
real
_hamburgerSize
:
descriptionLabel
.
height
*
0.75
readonly
property
bool
_waypointsOnlyMode
:
QGroundControl
.
corePlugin
.
options
.
missionWaypointsOnly
readonly
property
real
_hamburgerSize
:
commandPicker
.
height
*
0.75
QGCPalette
{
id
:
qgcPal
...
...
@@ -64,10 +62,10 @@ Rectangle {
QGCLabel
{
id
:
label
anchors.verticalCenter
:
descriptionLabel
.
verticalCenter
anchors.verticalCenter
:
commandPicker
.
verticalCenter
anchors.leftMargin
:
_margin
anchors.left
:
parent
.
left
text
:
index
text
:
_index
+
1
color
:
_outerTextColor
}
...
...
@@ -75,7 +73,7 @@ Rectangle {
id
:
hamburger
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
anchors.right
:
parent
.
right
anchors.verticalCenter
:
descriptionLabel
.
verticalCenter
anchors.verticalCenter
:
commandPicker
.
verticalCenter
width
:
_hamburgerSize
height
:
_hamburgerSize
sourceSize.height
:
_hamburgerSize
...
...
@@ -96,43 +94,66 @@ Rectangle {
id
:
hamburgerMenu
MenuItem
{
text
:
qsTr
(
"
Insert Fly Area
"
)
onTriggered
:
flyArea
.
appendFlyAreaPolygon
()
text
:
qsTr
(
"
Add Operating Area
"
)
onTriggered
:
wimaController
.
addGlobalMeasurementArea
()
}
MenuItem
{
text
:
qsTr
(
"
Add Service Area
"
)
onTriggered
:
wimaController
.
addServiceArea
()
}
MenuItem
{
text
:
qsTr
(
"
Delete
"
)
onTriggered
:
remove
()
}
MenuItem
{
text
:
qsTr
(
"
C
opy Fly Area
"
)
//onTriggered: //To Do
text
:
qsTr
(
"
C
hange Area Type ...
"
)
onTriggered
:
commandPicker
.
clicked
()
}
}
}
QGC
Label
{
id
:
descriptionLabel
QGC
Button
{
id
:
commandPicker
anchors.topMargin
:
_margin
/
2
anchors.leftMargin
:
ScreenTools
.
defaultFontPixelWidth
*
2
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
anchors.left
:
label
.
right
anchors.top
:
parent
.
top
text
:
"
Fly Area
"
verticalAlignment
:
Text
.
AlignVCenter
color
:
_outerTextColor
visible
:
_currentItem
text
:
object
.
objectName
;
Component
{
id
:
commandDialog
MissionCommandDialog
{
missionItem
:
object
}
}
onClicked
:
qgcView
.
showDialog
(
commandDialog
,
qsTr
(
"
Select Mission Command
"
),
qgcView
.
showDialogDefaultWidth
,
StandardButton
.
Cancel
)
}
QGCLabel
{
id
:
commandLabel
anchors.fill
:
commandPicker
visible
:
!
_currentItem
verticalAlignment
:
Text
.
AlignVCenter
text
:
object
.
objectName
;
color
:
_outerTextColor
}
Loader
{
id
:
editorLoader
anchors.leftMargin
:
_margin
anchors.topMargin
:
_margin
anchors.left
:
parent
.
left
anchors.top
:
descriptionLabel
.
bottom
source
:
"
FlyAreaEditor.qml
"
anchors.top
:
commandPicker
.
bottom
source
:
object
.
editorQml
visible
:
_currentItem
property
var
masterController
:
_masterController
...
...
@@ -140,3 +161,8 @@ Rectangle {
property
var
editorRoot
:
_root
}
}
// Rectangle
src/WimaView/WimaView.qml
View file @
12f888dc
...
...
@@ -155,7 +155,7 @@ QGCView {
}
}
}
}
_layerWimaPlan
}
Connections
{
target
:
QGroundControl
.
airspaceManager
...
...
@@ -257,7 +257,7 @@ QGCView {
}
Connections
{
target
:
_missionController
_layerWimaPlan
target
:
_missionController
onNewItemsFromVehicle
:
{
if
(
_visualItems
&&
_visualItems
.
count
!=
1
)
{
...
...
@@ -376,7 +376,7 @@ QGCView {
toIndex
=
1
}
_missionController
.
moveMissionItem
(
_moveDialogMissionItemIndex
,
toIndex
)
hideDialog
()
_layerWimaPlan
hideDialog
()
}
Column
{
...
...
@@ -413,7 +413,7 @@ QGCView {
planView
:
true
qgcView
:
_qgcView
// This is the center rectangle of the map which is not obscured by tools
// This is the center rectangle of the map which is not
_layerWimaPlan
obscured by tools
property
rect
centerViewport
:
Qt
.
rect
(
_leftToolWidth
,
_toolbarHeight
,
editorMap
.
width
-
_leftToolWidth
-
_rightPanelWidth
,
editorMap
.
height
-
_statusHeight
-
_toolbarHeight
)
property
real
_leftToolWidth
:
toolStrip
.
x
+
toolStrip
.
width
...
...
@@ -434,7 +434,7 @@ QGCView {
QGCMapPalette
{
id
:
mapPal
;
lightColors
:
editorMap
.
isSatelliteMap
}
onZoomLevelChanged
:
updateAirspace
(
false
)
onCenterChanged
:
updateAirspace
(
false
)
_layerWimaPlan
onCenterChanged
:
updateAirspace
(
false
)
MouseArea
{
//-- It's a whole lot faster to just fill parent and deal with top offset below
...
...
@@ -785,7 +785,7 @@ QGCView {
//-------------------------------------------------------
// Wima Item Editor
Item
{
id
:
flyAre
aItemEditor
id
:
wim
aItemEditor
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.top
:
rightControls
.
bottom
...
...
@@ -794,7 +794,7 @@ QGCView {
anchors.bottomMargin
:
ScreenTools
.
defaultFontPixelHeight
*
0.25
visible
:
_editingLayer
==
_layerWima
&&
!
planControlColapsed
QGCListView
{
id
:
flyAre
aItemEditorListView
id
:
wim
aItemEditorListView
anchors.fill
:
parent
spacing
:
ScreenTools
.
defaultFontPixelHeight
/
4
orientation
:
ListView
.
Vertical
...
...
@@ -808,20 +808,16 @@ QGCView {
delegate
:
WimaItemEditor
{
map
:
editorMap
masterController
:
_planMasterController
flyArea
:
_flyArea
wimaController
:
_wimaController
_index
:
index
polygon
:
object
width
:
parent
.
width
readOnly
:
false
rootQgcView
:
_qgcView
onClicked
:
_flyArea
.
selectCurrentPolygon
(
index
)
onClicked
:
_wimaController
.
currentPolygonIndex
=
index
onRemove
:
{
var
removeIndex
=
index
_flyArea
.
removeFlyAreaPolygon
(
removeIndex
)
if
(
removeIndex
>=
_flyArea
.
polygons
.
count
)
{
removeIndex
--
}
_flyArea
.
selectCurrentPolygon
(
removeIndex
)
_wimaController
.
removeArea
(
removeIndex
)
}
}
}
...
...
@@ -970,7 +966,7 @@ QGCView {
id
:
clearVehicleMissionDialog
QGCViewMessage
{
message
:
qsTr
(
"
Are you sure you want to remove all mission items and clear the mission from the vehicle?
"
)
function
accept
()
{
function
accept
()
{
_layerWimaPlan
masterController
.
removeAllFromVehicle
()
hideDialog
()
}
...
...
@@ -1065,7 +1061,7 @@ QGCView {
}
QGCButton
{
text
:
qsTr
(
"
Save Mission Waypoints As K
ML...
"
)
text
:
qsTr
(
"
Save Mission Waypoints As K
_layerWimaPlanML...
"
)
Layout.columnSpan
:
2
enabled
:
!
masterController
.
syncInProgress
&&
_visualItems
.
count
>
1
onClicked
:
{
...
...
@@ -1151,13 +1147,13 @@ QGCView {
QGCListView
{
anchors.fill
:
parent
model
:
_flyArea
.
polygon
s
model
:
wimaController
.
visualItem
s
delegate
:
Rectangle
{
height
:
15
color
:
"
lightsteelblue
"
radius
:
1
Text
{
text
:
object
.
i
nteractive
text
:
object
.
i
sCurrentPolygon
}
}
}
...
...
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