Commit 0ca9e0a1 authored by Valentin Platzgummer's avatar Valentin Platzgummer

fly area working

parent ddf64f6f
/****************************************************************************
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
......
......@@ -20,7 +20,6 @@ public:
//Property Accessors
WimaFlyArea *flyArea (void) { return _flyArea; }
//QmlObjectListModel* visualItems (void) { return _visualItems; }
QString QMLView
Q_INVOKABLE void start(void);
......
......@@ -25,6 +25,12 @@ void WimaFlyArea::_init()
void WimaFlyArea::append_WimaFlyArea()
{
QGCMapPolygon *newPolygon = new QGCMapPolygon();
newPolygon->setInteractive(true);
for (int i = 0; i < _polygons->count(); i++) {
QGCMapPolygon* polygon = qobject_cast<QGCMapPolygon*>(_polygons->get(i));
polygon->setInteractive(false);
}
_polygons->append(newPolygon);
......
......@@ -34,7 +34,8 @@ signals:
public slots:
private:
QmlObjectListModel *_polygons;
QmlObjectListModel* _polygons;
QGCMapPolygon* _isCurrentPolygon;
};
......
......@@ -69,7 +69,6 @@ Item {
qgcView: _root.qgcView
mapControl: map
mapPolygon: _flyAreaPolygon
interactive: true
borderWidth: 1
borderColor: "black"
interiorColor: "green"
......
......@@ -112,8 +112,6 @@ 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
......@@ -1201,7 +1199,7 @@ QGCView {
height: 150
radius: 10
border.color: "black"
border.width: 3
border.width: 2
color: "green"
z:100
......@@ -1213,15 +1211,20 @@ QGCView {
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;
Column {
id: debugMessageText
Repeater{
model: _flyArea.polygons
delegate: Rectangle{
color: "lightsteelblue"
radius: 5
Text {
text: object.interactive
}
}
}
}
}
} // QGCVIew
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment