From a0ab8f79cb2f8c8e76cb497085419fc9159a539f Mon Sep 17 00:00:00 2001 From: Valentin Platzgummer Date: Sat, 17 Oct 2020 15:45:53 +0200 Subject: [PATCH] mimor changes --- src/FlightDisplay/FlightDisplayViewMap.qml | 1 - src/Wima/WimaPlaner.cc | 4 ++++ src/Wima/WimaPlaner.h | 3 +++ src/WimaView/WimaView.qml | 21 ++------------------- 4 files changed, 9 insertions(+), 20 deletions(-) diff --git a/src/FlightDisplay/FlightDisplayViewMap.qml b/src/FlightDisplay/FlightDisplayViewMap.qml index 37b0e54d3..b3faab35d 100644 --- a/src/FlightDisplay/FlightDisplayViewMap.qml +++ b/src/FlightDisplay/FlightDisplayViewMap.qml @@ -223,7 +223,6 @@ FlightMap { coordList.push(vertex) } } - console.log(coordList) fitMapViewportToAllCoordinates(coordList) } } diff --git a/src/Wima/WimaPlaner.cc b/src/Wima/WimaPlaner.cc index 2c3582b31..5e4672cfe 100644 --- a/src/Wima/WimaPlaner.cc +++ b/src/Wima/WimaPlaner.cc @@ -69,6 +69,8 @@ WimaPlaner::WimaPlaner(QObject *parent) &WimaPlaner::needsUpdateChanged); connect(this->_stateMachine.get(), &StateMachine::surveyReadyChanged, this, &WimaPlaner::readyForSynchronizationChanged); + connect(this->_stateMachine.get(), &StateMachine::surveyReadyChanged, this, + &WimaPlaner::surveyReadyChanged); } WimaPlaner::~WimaPlaner() {} @@ -158,6 +160,8 @@ bool WimaPlaner::readyForSynchronization() { return this->_stateMachine->surveyReady(); } +bool WimaPlaner::surveyReady() { return this->_stateMachine->surveyReady(); } + bool WimaPlaner::progressLocked() { return this->_progressLocked; } void WimaPlaner::removeArea(int index) { diff --git a/src/Wima/WimaPlaner.h b/src/Wima/WimaPlaner.h index eb13a6fa3..2682bc95e 100644 --- a/src/Wima/WimaPlaner.h +++ b/src/Wima/WimaPlaner.h @@ -55,6 +55,7 @@ public: Q_PROPERTY(bool needsUpdate READ needsUpdate NOTIFY needsUpdateChanged) Q_PROPERTY(bool readyForSynchronization READ readyForSynchronization NOTIFY readyForSynchronizationChanged) + Q_PROPERTY(bool surveyReady READ surveyReady NOTIFY surveyReadyChanged) Q_PROPERTY(bool progressLocked READ progressLocked WRITE setProgressLocked NOTIFY progressLockedChanged) @@ -72,6 +73,7 @@ public: bool synchronized(); bool needsUpdate(); bool readyForSynchronization(); + bool surveyReady(); bool progressLocked(); // Property setters @@ -118,6 +120,7 @@ signals: void synchronizedChanged(void); void needsUpdateChanged(void); void readyForSynchronizationChanged(void); + void surveyReadyChanged(void); void progressLockedChanged(); private slots: diff --git a/src/WimaView/WimaView.qml b/src/WimaView/WimaView.qml index 5c8f71336..95e062402 100644 --- a/src/WimaView/WimaView.qml +++ b/src/WimaView/WimaView.qml @@ -439,7 +439,7 @@ QGCView { onAcceptedForLoad: { wimaPlaner.loadFromFile(file) - editorMap.center = wimaPlaner.joinedAreaCenter; + mapFitFunctions.fitMapViewportToAreas() close() } } @@ -637,23 +637,6 @@ QGCView { z: QGroundControl.zOrderMapItems - 1 } } - - /* - GeoFenceMapVisuals { - map: editorMap - myGeoFenceController: _geoFenceController - interactive: _editingLayer == _layerGeoFence - homePosition: _missionController.plannedHomePosition - planView: true - } - - RallyPointMapVisuals { - map: editorMap - myRallyPointController: _rallyPointController - interactive: _editingLayer == _layerRallyPoints - planView: true - }*/ - // Airspace overlap support MapItemView { model: _airspaceEnabled && QGroundControl.airspaceManager.airspaceVisible ? QGroundControl.airspaceManager.airspaces.circles : [] @@ -983,7 +966,7 @@ QGCView { anchors.verticalCenter: parent.verticalCenter onCheckedChanged:{ - if (!checked){ + if (!checked && !wimaPlaner.surveyReady){ wimaPlaner.update() } } -- 2.22.0