diff --git a/src/FlightDisplay/FlightDisplayViewMap.qml b/src/FlightDisplay/FlightDisplayViewMap.qml index 37b0e54d3c2696bdaa1db3ee3fe803c706af8b0d..b3faab35d9543d45d74fa92b3f4e4738a1f5c73b 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 2c3582b315f4464539d1b431c758f5d450c53800..5e4672cfe41078fa139ca0ed97caee8cce358ed7 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 eb13a6fa31860dbd67b96c0265799ac060d86eab..2682bc95e2cbb681dd6d44b560b43b425fb40941 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 5c8f7133654227f80eb071917099a5e80693f855..95e062402c38149b25f35dff3432639411f12a45 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() } }