From 0ca9e0a106d9cb93ef780fdeb3bfbd399fd7c4f5 Mon Sep 17 00:00:00 2001 From: Valentin Platzgummer Date: Thu, 21 Mar 2019 15:49:55 +0100 Subject: [PATCH] fly area working --- src/MissionManager/QGCMapPolygonVisuals.qml | 2 +- src/MissionManager/WimaController.h | 1 - src/MissionManager/WimaFlyArea.cc | 6 +++++ src/MissionManager/WimaFlyArea.h | 3 ++- src/WimaView/FlyAreaPolygonMapVisual.qml | 1 - src/WimaView/WimaView.qml | 25 ++++++++++++--------- 6 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/MissionManager/QGCMapPolygonVisuals.qml b/src/MissionManager/QGCMapPolygonVisuals.qml index ae559317d..ba70fc361 100644 --- a/src/MissionManager/QGCMapPolygonVisuals.qml +++ b/src/MissionManager/QGCMapPolygonVisuals.qml @@ -1,4 +1,4 @@ -/**************************************************************************** +/**************************************************************************** * * (c) 2009-2016 QGROUNDCONTROL PROJECT * diff --git a/src/MissionManager/WimaController.h b/src/MissionManager/WimaController.h index 59d42be77..0b404d307 100644 --- a/src/MissionManager/WimaController.h +++ b/src/MissionManager/WimaController.h @@ -20,7 +20,6 @@ public: //Property Accessors WimaFlyArea *flyArea (void) { return _flyArea; } //QmlObjectListModel* visualItems (void) { return _visualItems; } - QString QMLView Q_INVOKABLE void start(void); diff --git a/src/MissionManager/WimaFlyArea.cc b/src/MissionManager/WimaFlyArea.cc index 92d1d3a74..90a418095 100644 --- a/src/MissionManager/WimaFlyArea.cc +++ b/src/MissionManager/WimaFlyArea.cc @@ -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(_polygons->get(i)); + polygon->setInteractive(false); + } _polygons->append(newPolygon); diff --git a/src/MissionManager/WimaFlyArea.h b/src/MissionManager/WimaFlyArea.h index 089b5d02d..9ea9ecc2d 100644 --- a/src/MissionManager/WimaFlyArea.h +++ b/src/MissionManager/WimaFlyArea.h @@ -34,7 +34,8 @@ signals: public slots: private: - QmlObjectListModel *_polygons; + QmlObjectListModel* _polygons; + QGCMapPolygon* _isCurrentPolygon; }; diff --git a/src/WimaView/FlyAreaPolygonMapVisual.qml b/src/WimaView/FlyAreaPolygonMapVisual.qml index 5eabc85a9..d7a5ef001 100644 --- a/src/WimaView/FlyAreaPolygonMapVisual.qml +++ b/src/WimaView/FlyAreaPolygonMapVisual.qml @@ -69,7 +69,6 @@ Item { qgcView: _root.qgcView mapControl: map mapPolygon: _flyAreaPolygon - interactive: true borderWidth: 1 borderColor: "black" interiorColor: "green" diff --git a/src/WimaView/WimaView.qml b/src/WimaView/WimaView.qml index 91db40d78..fff8bd9cc 100644 --- a/src/WimaView/WimaView.qml +++ b/src/WimaView/WimaView.qml @@ -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 -- 2.22.0