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
e7ee7d09
Commit
e7ee7d09
authored
Mar 20, 2019
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
before editing QGCMapPolygonVisuals.qml
parent
1b6d3ca9
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
107 additions
and
39 deletions
+107
-39
qgroundcontrol.qrc
qgroundcontrol.qrc
+1
-1
WimaController.cc
src/MissionManager/WimaController.cc
+5
-5
WimaController.h
src/MissionManager/WimaController.h
+5
-8
WimaFlyArea.cc
src/MissionManager/WimaFlyArea.cc
+17
-7
WimaFlyArea.h
src/MissionManager/WimaFlyArea.h
+10
-10
QGCApplication.cc
src/QGCApplication.cc
+5
-1
WimaView.qml
src/WimaView/WimaView.qml
+64
-7
No files found.
qgroundcontrol.qrc
View file @
e7ee7d09
...
...
@@ -210,7 +210,7 @@
<file alias="VirtualJoystick.qml">src/FlightDisplay/VirtualJoystick.qml</file>
<file alias="QGroundControl/Controls/WimaToolBar.qml">src/WimaView/WimaToolBar.qml</file>
<file alias="WimaView.qml">src/WimaView/WimaView.qml</file>
<file alias="QGroundControl/
Controls
/FlyAreaMapVisual.qml">src/WimaView/FlyAreaMapVisual.qml</file>
<file alias="QGroundControl/
FlightMap
/FlyAreaMapVisual.qml">src/WimaView/FlyAreaMapVisual.qml</file>
</qresource>
<qresource prefix="/json">
<file alias="APMMavlinkStreamRate.SettingsGroup.json">src/Settings/APMMavlinkStreamRate.SettingsGroup.json</file>
...
...
src/MissionManager/WimaController.cc
View file @
e7ee7d09
...
...
@@ -3,13 +3,13 @@
WimaController
::
WimaController
(
QObject
*
parent
)
:
QObject
(
parent
)
{
this
->
_flyArea
=
WimaFlyArea
(
parent
);
this
->
_flyArea
=
new
WimaFlyArea
(
parent
);
}
void
WimaController
::
initWimaFlyArea
()
void
WimaController
::
start
()
{
this
->
_flyArea
.
setReady
();
return
;
_flyArea
->
_init
();
}
src/MissionManager/WimaController.h
View file @
e7ee7d09
...
...
@@ -15,17 +15,14 @@ public:
Q_PROPERTY
(
WimaFlyArea
*
flyArea
READ
flyArea
CONSTANT
)
//Q_PROPERTY(QmlObjectListModel* visualItems READ visualItems NOTIFY visualItemsChanged)
/// Add a fly area to the list
/// @param itemName: Name of complex item to create (from complexMissionItemNames)
/// @param mapCenterCoordinate: coordinate for current center of map
/// @param i: index to insert at
/// @return Sequence number for new item
Q_INVOKABLE
void
initWimaFlyArea
();
//Property Accessors
WimaFlyArea
*
flyArea
(
void
)
{
return
&
_flyArea
;
}
WimaFlyArea
*
flyArea
(
void
)
{
return
_flyArea
;
}
//QmlObjectListModel* visualItems (void) { return _visualItems; }
Q_INVOKABLE
void
start
(
void
);
signals:
...
...
@@ -33,7 +30,7 @@ public slots:
private:
//QmlObjectListModel* _visualItems;
WimaFlyArea
_flyArea
;
WimaFlyArea
*
_flyArea
;
};
#endif // WIMACONTROLLER_H
src/MissionManager/WimaFlyArea.cc
View file @
e7ee7d09
#include "WimaFlyArea.h"
WimaFlyArea
::
WimaFlyArea
(
QObject
*
parent
)
:
QObject
(
parent
)
,
_polygons
(
nullptr
)
{
this
->
_isReady
=
false
;
}
WimaFlyArea
::
WimaFlyArea
(
const
WimaFlyArea
&
other
,
QObject
*
parent
)
:
QObject
(
parent
)
...
...
@@ -12,14 +13,23 @@ WimaFlyArea::WimaFlyArea(const WimaFlyArea &other, QObject *parent): QObject(par
const
WimaFlyArea
&
WimaFlyArea
::
operator
=
(
const
WimaFlyArea
&
other
)
{
this
->
_flyAreaPolygon
=
other
.
_flyAreaPolygon
;
this
->
_isReady
=
other
.
_isReady
;
this
->
_polygons
=
other
.
_polygons
;
return
*
this
;
}
void
WimaFlyArea
::
setReady
()
void
WimaFlyArea
::
_init
()
{
_polygons
=
new
QmlObjectListModel
(
this
);
}
void
WimaFlyArea
::
append_WimaFlyArea
()
{
this
->
_isReady
=
true
;
emit
readyStateChanged
();
QGCMapPolygon
*
newPolygon
=
new
QGCMapPolygon
();
_polygons
->
append
(
newPolygon
);
emit
polygonsChanged
();
}
src/MissionManager/WimaFlyArea.h
View file @
e7ee7d09
...
...
@@ -3,6 +3,7 @@
#include <QObject>
#include "QGCMapPolygon.h"
#include "QmlObjectListModel.h"
class
WimaFlyArea
:
public
QObject
{
...
...
@@ -15,28 +16,27 @@ public:
Q_PROPERTY
(
Q
String
mapVisualQML
READ
mapVisualQML
CONSTANT
)
Q_PROPERTY
(
bool
isReady
READ
isReady
NOTIFY
readyStateChanged
)
Q_
PROPERTY
(
QGCMapPolygon
flyAreaPolygon
READ
flyAreaPolygon
CONSTANT
)
Q_PROPERTY
(
Q
mlObjectListModel
*
polygons
READ
polygons
NOTIFY
polygonsChanged
)
Q_
INVOKABLE
void
append_WimaFlyArea
();
// Property Accessors
QString
mapVisualQML
(
void
)
const
{
return
QStringLiteral
(
"FlyAreaMapVisual.qml"
);
}
bool
isReady
(
void
)
{
return
_isReady
;}
QGCMapPolygon
flyAreaPolygon
(
void
)
{
return
_flyAreaPolygon
;}
QmlObjectListModel
*
polygons
(
void
)
{
return
_polygons
;}
// Methodes
void
setReady
(
);
void
_init
(
void
);
signals:
void
readyState
Changed
(
void
);
void
polygons
Changed
(
void
);
public
slots
:
private:
QGCMapPolygon
_flyAreaPolygon
;
bool
_isReady
;
QmlObjectListModel
*
_polygons
;
};
#endif // WIMAFLYAREA_H
src/QGCApplication.cc
View file @
e7ee7d09
...
...
@@ -438,7 +438,7 @@ void QGCApplication::_initCommon(void)
qmlRegisterUncreatableType
<
FactValueSliderListModel
>
(
"QGroundControl.FactControls"
,
1
,
0
,
"FactValueSliderListModel"
,
kRefOnly
);
qmlRegisterUncreatableType
<
QGCMapPolygon
>
(
"QGroundControl.FlightMap"
,
1
,
0
,
"QGCMapPolygon"
,
kRefOnly
);
qmlRegisterUncreatableType
<
WimaFlyArea
>
(
"QGroundControl.FlightMap"
,
1
,
0
,
"WimaFlyArea"
,
kRefOnly
);
//custom
qmlRegisterUncreatableType
<
QGCGeoBoundingCube
>
(
"QGroundControl.FlightMap"
,
1
,
0
,
"QGCGeoBoundingCube"
,
kRefOnly
);
qmlRegisterType
<
QGCMapCircle
>
(
"QGroundControl.FlightMap"
,
1
,
0
,
"QGCMapCircle"
);
...
...
@@ -465,6 +465,10 @@ void QGCApplication::_initCommon(void)
qmlRegisterType
<
GeoTagController
>
(
kQGCControllers
,
1
,
0
,
"GeoTagController"
);
qmlRegisterType
<
MavlinkConsoleController
>
(
kQGCControllers
,
1
,
0
,
"MavlinkConsoleController"
);
#endif
// Wima
qmlRegisterUncreatableType
<
WimaFlyArea
>
(
"Wima"
,
1
,
0
,
"WimaFlyArea"
,
kRefOnly
);
//custom
qmlRegisterType
<
WimaController
>
(
"Wima"
,
1
,
0
,
"WimaController"
);
//custom
// Register Qml Singletons
qmlRegisterSingletonType
<
QGroundControlQmlGlobal
>
(
"QGroundControl"
,
1
,
0
,
"QGroundControl"
,
qgroundcontrolQmlGlobalSingletonFactory
);
...
...
src/WimaView/WimaView.qml
View file @
e7ee7d09
...
...
@@ -28,6 +28,8 @@ import QGroundControl.ShapeFileHelper 1.0
import
QGroundControl
.
Airspace
1.0
import
QGroundControl
.
Airmap
1.0
import
Wima
1.0
/// Mission Editor
QGCView
{
...
...
@@ -110,6 +112,8 @@ QGCView {
property
bool
_firstRallyLoadComplete
:
false
property
bool
_firstLoadComplete
:
false
MapFitFunctions
{
id
:
mapFitFunctions
// The name for this id cannot be changed without breaking references outside of this code. Beware!
map
:
editorMap
...
...
@@ -201,6 +205,10 @@ QGCView {
}
WimaController
{
id
:
wimaController
Component.onCompleted
:
{
wimaController
.
start
()
}
}
PlanMasterController
{
...
...
@@ -530,12 +538,26 @@ QGCView {
}
//Add fly area
FlyAreaMapVisual
{
map
:
editorMap
qgcView
:
_qgcView
_flyAreaPolygon
:
_flyArea
.
flyAreaPolygon
}
Repeater
{
model
:
_flyArea
.
polygons
delegate
:
QGCMapPolygonVisuals
{
qgcView
:
_qgcView
///< QGCView for popping dialogs
mapControl
:
editorMap
///< Map control to place item in
mapPolygon
:
object
interiorColor
:
"
green
"
interiorOpacity
:
1
borderWidth
:
1
borderColor
:
"
white
"
Component.onCompleted
:
{
addInitialPolygon
()
}
}
onItemAdded
:
{
console
.
log
(
"
Item added
"
)
}
}
// Add the vehicles to the map
MapItemView
{
...
...
@@ -617,7 +639,7 @@ QGCView {
iconSource
:
"
/qmlimages/Target.svg
"
,
toggle
:
true
},
{
{
name
:
qsTr
(
"
No Fly
"
),
iconSource
:
"
/qmlimages/noFlyArea.svg
"
,
toggle
:
true
...
...
@@ -650,7 +672,8 @@ QGCView {
onClicked
:
{
switch
(
index
)
{
case
1
:
wimaController
.
initWimaFlyArea
();
_flyArea
.
append_WimaFlyArea
();
console
.
log
(
"
polygon count:
"
,
_flyArea
.
polygons
.
count
)
//addComplexItem(_missionController.complexMissionItemNames[2])
/*_addWaypointOnClick = checked
_addROIOnClick = false*/
...
...
@@ -1175,4 +1198,38 @@ QGCView {
}
}
}
Rectangle
{
id
:
debugMessageWindow
anchors.bottom
:
parent
.
bottom
width
:
parent
.
width
*
0.7
x
:
(
parent
.
width
-
width
)
/
2
height
:
150
radius
:
10
border.color
:
"
black
"
border.width
:
3
color
:
"
green
"
z
:
100
Text
{
id
:
debugTextTitle
anchors.top
:
parent
.
top
x
:
(
parent
.
width
-
width
)
/
2
text
:
qsTr
(
"
Debug Messages
"
)
}
Text
{
id
:
debugText
anchors.bottom
:
parent
.
bottom
x
:
(
parent
.
width
-
width
)
/
2
width
:
parent
.
width
*
0.95
height
:
parent
.
height
-
debugTextTitle
.
height
text
:
"
Polygon count:
"
+
wimaController
.
flyArea
.
polygons
.
dirty
;
}
}
}
// QGCVIew
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