diff --git a/src/MissionManager/CorridorScanComplexItem.cc b/src/MissionManager/CorridorScanComplexItem.cc index 01a4b3c2879a04456b00f6b7d53ce2f486a0f73a..ba5dae0275f39ebdf84f8290b1dc980f9a1801b7 100644 --- a/src/MissionManager/CorridorScanComplexItem.cc +++ b/src/MissionManager/CorridorScanComplexItem.cc @@ -41,18 +41,19 @@ CorridorScanComplexItem::CorridorScanComplexItem(PlanMasterController* masterCon _cameraCalc.distanceToSurface()->setRawValue(qgcApp()->toolbox()->settingsManager()->appSettings()->defaultMissionItemAltitude()->rawValue()); } - connect(&_corridorWidthFact, &Fact::valueChanged, this, &CorridorScanComplexItem::_setDirty); - connect(&_corridorPolyline, &QGCMapPolyline::pathChanged, this, &CorridorScanComplexItem::_setDirty); + connect(&_corridorWidthFact, &Fact::valueChanged, this, &CorridorScanComplexItem::_setDirty); + connect(&_corridorPolyline, &QGCMapPolyline::pathChanged, this, &CorridorScanComplexItem::_setDirty); - connect(&_cameraCalc, &CameraCalc::distanceToSurfaceRelativeChanged, this, &CorridorScanComplexItem::coordinateHasRelativeAltitudeChanged); - connect(&_cameraCalc, &CameraCalc::distanceToSurfaceRelativeChanged, this, &CorridorScanComplexItem::exitCoordinateHasRelativeAltitudeChanged); + connect(&_cameraCalc, &CameraCalc::distanceToSurfaceRelativeChanged, this, &CorridorScanComplexItem::coordinateHasRelativeAltitudeChanged); + connect(&_cameraCalc, &CameraCalc::distanceToSurfaceRelativeChanged, this, &CorridorScanComplexItem::exitCoordinateHasRelativeAltitudeChanged); - connect(&_corridorPolyline, &QGCMapPolyline::dirtyChanged, this, &CorridorScanComplexItem::_polylineDirtyChanged); + connect(&_corridorPolyline, &QGCMapPolyline::dirtyChanged, this, &CorridorScanComplexItem::_polylineDirtyChanged); - connect(&_corridorPolyline, &QGCMapPolyline::pathChanged, this, &CorridorScanComplexItem::_rebuildCorridorPolygon); - connect(&_corridorWidthFact, &Fact::valueChanged, this, &CorridorScanComplexItem::_rebuildCorridorPolygon); + connect(&_corridorPolyline, &QGCMapPolyline::pathChanged, this, &CorridorScanComplexItem::_rebuildCorridorPolygon); + connect(&_corridorWidthFact, &Fact::valueChanged, this, &CorridorScanComplexItem::_rebuildCorridorPolygon); - connect(&_corridorPolyline, &QGCMapPolyline::isValidChanged,this, &CorridorScanComplexItem::readyForSaveStateChanged); + connect(&_corridorPolyline, &QGCMapPolyline::isValidChanged, this, &CorridorScanComplexItem::_updateWizardMode); + connect(&_corridorPolyline, &QGCMapPolyline::traceModeChanged, this, &CorridorScanComplexItem::_updateWizardMode); if (!kmlFile.isEmpty()) { _corridorPolyline.loadKMLFile(kmlFile); @@ -384,3 +385,10 @@ double CorridorScanComplexItem::_calcTransectSpacing(void) const return transectSpacing; } + +void CorridorScanComplexItem::_updateWizardMode(void) +{ + if (_corridorPolyline.isValid() && !_corridorPolyline.traceMode()) { + setWizardMode(false); + } +} diff --git a/src/MissionManager/CorridorScanComplexItem.h b/src/MissionManager/CorridorScanComplexItem.h index 00080ac5b090b7ae4ee2c637f8f594e47c4803b6..4b20fe99bf906abe1ed44da2d068c075996f2d75 100644 --- a/src/MissionManager/CorridorScanComplexItem.h +++ b/src/MissionManager/CorridorScanComplexItem.h @@ -58,8 +58,9 @@ public: static const char* corridorWidthName; private slots: - void _polylineDirtyChanged (bool dirty); - void _rebuildCorridorPolygon (void); + void _polylineDirtyChanged (bool dirty); + void _rebuildCorridorPolygon (void); + void _updateWizardMode (void); // Overrides from TransectStyleComplexItem void _rebuildTransectsPhase1 (void) final; diff --git a/src/MissionManager/QGCMapPolygon.cc b/src/MissionManager/QGCMapPolygon.cc index f1c1a1b262a87d8e5ac17ba582ed1eadc316156b..aa78ffebe0a6d6c32638694be0de1dca3dc05420 100644 --- a/src/MissionManager/QGCMapPolygon.cc +++ b/src/MissionManager/QGCMapPolygon.cc @@ -598,3 +598,11 @@ QDomElement QGCMapPolygon::kmlPolygonElement(KMLDomDocument& domDocument) return polygonElement; } + +void QGCMapPolygon::setTraceMode(bool traceMode) +{ + if (traceMode != _traceMode) { + _traceMode = traceMode; + emit traceModeChanged(traceMode); + } +} diff --git a/src/MissionManager/QGCMapPolygon.h b/src/MissionManager/QGCMapPolygon.h index 132e9888e0824b73e7830592c52a7d2e3d388e10..ac26923b866adb6a40a43e829a4c6f66cce6beae 100644 --- a/src/MissionManager/QGCMapPolygon.h +++ b/src/MissionManager/QGCMapPolygon.h @@ -39,7 +39,7 @@ public: Q_PROPERTY(bool interactive READ interactive WRITE setInteractive NOTIFY interactiveChanged) Q_PROPERTY(bool isValid READ isValid NOTIFY isValidChanged) Q_PROPERTY(bool empty READ empty NOTIFY isEmptyChanged) - Q_PROPERTY(bool traceMode MEMBER _traceMode NOTIFY traceModeChanged) + Q_PROPERTY(bool traceMode READ traceMode WRITE setTraceMode NOTIFY traceModeChanged) Q_INVOKABLE void clear(void); Q_INVOKABLE void appendVertex(const QGeoCoordinate& coordinate); @@ -105,6 +105,7 @@ public: bool interactive (void) const { return _interactive; } bool isValid (void) const { return _polygonModel.count() >= 3; } bool empty (void) const { return _polygonModel.count() == 0; } + bool traceMode (void) const { return _traceMode; } QVariantList path (void) const { return _polygonPath; } QmlObjectListModel* qmlPathModel(void) { return &_polygonModel; } @@ -115,6 +116,7 @@ public: void setCenter (QGeoCoordinate newCenter); void setCenterDrag (bool centerDrag); void setInteractive (bool interactive); + void setTraceMode (bool traceMode); static const char* jsonPolygonKey; diff --git a/src/MissionManager/QGCMapPolyline.cc b/src/MissionManager/QGCMapPolyline.cc index abbfd9b8c39db00b47b39e74b1dbe84fba159b75..f063a0125495868208ec12ef0ba85b5128207f49 100644 --- a/src/MissionManager/QGCMapPolyline.cc +++ b/src/MissionManager/QGCMapPolyline.cc @@ -431,3 +431,11 @@ void QGCMapPolyline::_endResetIfNotActive(void) endReset(); } } + +void QGCMapPolyline::setTraceMode(bool traceMode) +{ + if (traceMode != _traceMode) { + _traceMode = traceMode; + emit traceModeChanged(traceMode); + } +} diff --git a/src/MissionManager/QGCMapPolyline.h b/src/MissionManager/QGCMapPolyline.h index ac8ceab2315cbab7e69d4a13062c7d0ac2868d7f..aff17cbc71ebe92780fd51363c4027c004437e3b 100644 --- a/src/MissionManager/QGCMapPolyline.h +++ b/src/MissionManager/QGCMapPolyline.h @@ -32,7 +32,7 @@ public: Q_PROPERTY(bool interactive READ interactive WRITE setInteractive NOTIFY interactiveChanged) Q_PROPERTY(bool isValid READ isValid NOTIFY isValidChanged) Q_PROPERTY(bool empty READ empty NOTIFY isEmptyChanged) - Q_PROPERTY(bool traceMode MEMBER _traceMode NOTIFY traceModeChanged) + Q_PROPERTY(bool traceMode READ traceMode WRITE setTraceMode NOTIFY traceModeChanged) Q_INVOKABLE void clear(void); Q_INVOKABLE void appendVertex(const QGeoCoordinate& coordinate); @@ -89,6 +89,7 @@ public: QVariantList path (void) const { return _polylinePath; } bool isValid (void) const { return _polylineModel.count() >= 2; } bool empty (void) const { return _polylineModel.count() == 0; } + bool traceMode (void) const { return _traceMode; } QmlObjectListModel* qmlPathModel(void) { return &_polylineModel; } QmlObjectListModel& pathModel (void) { return _polylineModel; } @@ -96,6 +97,7 @@ public: void setPath (const QList& path); void setPath (const QVariantList& path); void setInteractive (bool interactive); + void setTraceMode (bool traceMode); static const char* jsonPolylineKey; diff --git a/src/MissionManager/StructureScanComplexItem.cc b/src/MissionManager/StructureScanComplexItem.cc index 187442f5e510cf18e6d1abdd1f256885fcb7eab6..e5d2545bdf692a214594a501a30b5359bbdc2aff 100644 --- a/src/MissionManager/StructureScanComplexItem.cc +++ b/src/MissionManager/StructureScanComplexItem.cc @@ -71,6 +71,8 @@ StructureScanComplexItem::StructureScanComplexItem(PlanMasterController* masterC connect(&_structurePolygon, &QGCMapPolygon::dirtyChanged, this, &StructureScanComplexItem::_polygonDirtyChanged); connect(&_structurePolygon, &QGCMapPolygon::pathChanged, this, &StructureScanComplexItem::_rebuildFlightPolygon); connect(&_structurePolygon, &QGCMapPolygon::isValidChanged, this, &StructureScanComplexItem::readyForSaveStateChanged); + connect(&_structurePolygon, &QGCMapPolygon::isValidChanged, this, &StructureScanComplexItem::_updateWizardMode); + connect(&_structurePolygon, &QGCMapPolygon::traceModeChanged, this, &StructureScanComplexItem::_updateWizardMode); connect(&_structurePolygon, &QGCMapPolygon::countChanged, this, &StructureScanComplexItem::_updateLastSequenceNumber); connect(&_layersFact, &Fact::valueChanged, this, &StructureScanComplexItem::_updateLastSequenceNumber); @@ -626,3 +628,10 @@ StructureScanComplexItem::ReadyForSaveState StructureScanComplexItem::readyForSa { return _structurePolygon.isValid() && !_wizardMode ? ReadyForSave : NotReadyForSaveData; } + +void StructureScanComplexItem::_updateWizardMode(void) +{ + if (_structurePolygon.isValid() && !_structurePolygon.traceMode()) { + setWizardMode(false); + } +} diff --git a/src/MissionManager/StructureScanComplexItem.h b/src/MissionManager/StructureScanComplexItem.h index 2060eb853661e1d83f840f6d797c50c3f20e7cb4..68ced54c38a04d663563c7b30d11c939bcbe184f 100644 --- a/src/MissionManager/StructureScanComplexItem.h +++ b/src/MissionManager/StructureScanComplexItem.h @@ -117,17 +117,18 @@ signals: private slots: void _setDirty(void); - void _polygonDirtyChanged (bool dirty); - void _flightPathChanged (void); - void _clearInternal (void); - void _updateCoordinateAltitudes (void); - void _rebuildFlightPolygon (void); - void _recalcCameraShots (void); - void _recalcLayerInfo (void); - void _updateLastSequenceNumber (void); - void _updateGimbalPitch (void); - void _signalTopBottomAltChanged (void); - void _recalcScanDistance (void); + void _polygonDirtyChanged (bool dirty); + void _flightPathChanged (void); + void _clearInternal (void); + void _updateCoordinateAltitudes (void); + void _rebuildFlightPolygon (void); + void _recalcCameraShots (void); + void _recalcLayerInfo (void); + void _updateLastSequenceNumber (void); + void _updateGimbalPitch (void); + void _signalTopBottomAltChanged (void); + void _recalcScanDistance (void); + void _updateWizardMode (void); private: void _setCameraShots(int cameraShots); diff --git a/src/MissionManager/SurveyComplexItem.cc b/src/MissionManager/SurveyComplexItem.cc index 7232f759f4359d1c2753b6e59e9c7f798dd128fb..050f92dd08a8b9a43b6cef977da16025a9382736 100644 --- a/src/MissionManager/SurveyComplexItem.cc +++ b/src/MissionManager/SurveyComplexItem.cc @@ -99,6 +99,9 @@ SurveyComplexItem::SurveyComplexItem(PlanMasterController* masterController, boo connect(&_splitConcavePolygonsFact, &Fact::valueChanged, this, &SurveyComplexItem::_rebuildTransects); connect(this, &SurveyComplexItem::refly90DegreesChanged, this, &SurveyComplexItem::_rebuildTransects); + connect(&_surveyAreaPolygon, &QGCMapPolygon::isValidChanged, this, &SurveyComplexItem::_updateWizardMode); + connect(&_surveyAreaPolygon, &QGCMapPolygon::traceModeChanged, this, &SurveyComplexItem::_updateWizardMode); + // FIXME: Shouldn't these be in TransectStyleComplexItem? They are also in CorridorScanComplexItem constructur connect(&_cameraCalc, &CameraCalc::distanceToSurfaceRelativeChanged, this, &SurveyComplexItem::coordinateHasRelativeAltitudeChanged); connect(&_cameraCalc, &CameraCalc::distanceToSurfaceRelativeChanged, this, &SurveyComplexItem::exitCoordinateHasRelativeAltitudeChanged); @@ -1428,3 +1431,10 @@ double SurveyComplexItem::additionalTimeDelay (void) const return hoverTime; } + +void SurveyComplexItem::_updateWizardMode(void) +{ + if (_surveyAreaPolygon.isValid() && !_surveyAreaPolygon.traceMode()) { + setWizardMode(false); + } +} diff --git a/src/MissionManager/SurveyComplexItem.h b/src/MissionManager/SurveyComplexItem.h index 916ff600d2a6435183826cd4c06486b67c7271f8..40eb1632382001b7ff2adc824aeb0771bb1bb8f1 100644 --- a/src/MissionManager/SurveyComplexItem.h +++ b/src/MissionManager/SurveyComplexItem.h @@ -80,10 +80,12 @@ signals: void refly90DegreesChanged(bool refly90Degrees); private slots: + void _updateWizardMode (void); + // Overrides from TransectStyleComplexItem - void _rebuildTransectsPhase1 (void) final; - void _recalcComplexDistance (void) final; - void _recalcCameraShots (void) final; + void _rebuildTransectsPhase1 (void) final; + void _recalcComplexDistance (void) final; + void _recalcCameraShots (void) final; private: enum CameraTriggerCode { diff --git a/src/PlanView/CorridorScanEditor.qml b/src/PlanView/CorridorScanEditor.qml index efb504e667d74320c6c97c00a6eae7e21d768807..d4cde246c69e1a34cdcc316bb3c033510c04cd51 100644 --- a/src/PlanView/CorridorScanEditor.qml +++ b/src/PlanView/CorridorScanEditor.qml @@ -68,15 +68,19 @@ Rectangle { text: qsTr("Use the Polyline Tools to create the polyline which defines the corridor.") } + /* + Trial of new "done" model so leaving for now in case it comes back QGCButton { text: qsTr("Done With Polyline") Layout.fillWidth: true enabled: missionItem.corridorPolyline.isValid && !missionItem.corridorPolyline.traceMode onClicked: { missionItem.wizardMode = false - editorRoot.selectNextNotReadyItem() + // Trial of no auto select next item + //editorRoot.selectNextNotReadyItem() } } + */ } Column { diff --git a/src/PlanView/FWLandingPatternEditor.qml b/src/PlanView/FWLandingPatternEditor.qml index 783ac035970cdfd2de88c8dcb49261ad7922b698..9f6534e5ed069f690173d97daaa2a32075999e74 100644 --- a/src/PlanView/FWLandingPatternEditor.qml +++ b/src/PlanView/FWLandingPatternEditor.qml @@ -312,12 +312,13 @@ Rectangle { } QGCButton { - text: qsTr("Done Adjusting") + text: qsTr("Done") Layout.fillWidth: true onClicked: { missionItem.wizardMode = false missionItem.landingDragAngleOnly = false - editorRoot.selectNextNotReadyItem() + // Trial of no auto select next item + //editorRoot.selectNextNotReadyItem() } } } diff --git a/src/PlanView/MissionItemEditor.qml b/src/PlanView/MissionItemEditor.qml index 11640573c752b4e73f61c5ac5bcfcb62affb34ee..7bdc51e2fd503d793defbcf5da29e9043040c0db 100644 --- a/src/PlanView/MissionItemEditor.qml +++ b/src/PlanView/MissionItemEditor.qml @@ -20,7 +20,7 @@ Rectangle { color: _currentItem ? qgcPal.missionItemEditor : qgcPal.windowShade radius: _radius opacity: _currentItem ? 1.0 : 0.7 - border.width: _readyForSave ? 0 : 1 + border.width: _readyForSave ? 0 : 2 border.color: qgcPal.warningText property var map ///< Map control @@ -87,7 +87,7 @@ Rectangle { Rectangle { id: notReadyForSaveIndicator anchors.verticalCenter: parent.verticalCenter - width: readyForSaveLabel.contentHeight + width: _hamburgerSize height: width border.width: 1 border.color: qgcPal.warningText diff --git a/src/PlanView/SimpleItemEditor.qml b/src/PlanView/SimpleItemEditor.qml index 966a02765bf5098a97a0f63f98d9b670cf53fa49..8b3a269d1228d4b4a9cca87ff45a39d6016f3bea 100644 --- a/src/PlanView/SimpleItemEditor.qml +++ b/src/PlanView/SimpleItemEditor.qml @@ -91,12 +91,13 @@ Rectangle { } QGCButton { - text: qsTr("Done Adjusting") + text: qsTr("Done") Layout.fillWidth: true visible: !initialClickLabel.visible onClicked: { missionItem.wizardMode = false - editorRoot.selectNextNotReadyItem() + // Trial of no auto select next item + //editorRoot.selectNextNotReadyItem() } } diff --git a/src/PlanView/StructureScanEditor.qml b/src/PlanView/StructureScanEditor.qml index 09ccf281d94403bd0029f287662958522feb2584..60f222d65dc080f317e5c96447f1edaa3b3ed1a9 100644 --- a/src/PlanView/StructureScanEditor.qml +++ b/src/PlanView/StructureScanEditor.qml @@ -69,15 +69,19 @@ Rectangle { text: qsTr("Use the Polygon Tools to create the polygon which outlines the structure.") } + /* + Trial of new "done" model so leaving for now in case it comes back QGCButton { text: qsTr("Done With Polygon") Layout.fillWidth: true enabled: missionItem.structurePolygon.isValid && !missionItem.structurePolygon.traceMode onClicked: { missionItem.wizardMode = false - editorRoot.selectNextNotReadyItem() + // Trial of no auto select next item + //editorRoot.selectNextNotReadyItem() } } + */ } Column { diff --git a/src/PlanView/SurveyItemEditor.qml b/src/PlanView/SurveyItemEditor.qml index 1826045410e2c95ef4781c0a22096a08fb328c6f..12b8c3d2f3d1e37e113b6844f63bf2f60154e1bd 100644 --- a/src/PlanView/SurveyItemEditor.qml +++ b/src/PlanView/SurveyItemEditor.qml @@ -29,7 +29,7 @@ Rectangle { property var _vehicle: QGroundControl.multiVehicleManager.activeVehicle ? QGroundControl.multiVehicleManager.activeVehicle : QGroundControl.multiVehicleManager.offlineEditingVehicle property real _cameraMinTriggerInterval: missionItem.cameraCalc.minTriggerInterval.rawValue property bool _polygonDone: false - property string _doneAdjusting: qsTr("Done Adjusting") + property string _doneAdjusting: qsTr("Done") property bool _presetsAvailable: missionItem.presetNames.length !== 0 function polygonCaptureStarted() { @@ -77,6 +77,8 @@ Rectangle { text: qsTr("Use the Polygon Tools to create the polygon which outlines your survey area.") } + /* + Trial of new "done" model so leaving for now in case it comes back QGCButton { text: qsTr("Done With Polygon") Layout.fillWidth: true @@ -84,13 +86,17 @@ Rectangle { onClicked: { if (!_presetsAvailable) { missionItem.wizardMode = false - editorRoot.selectNextNotReadyItem() + // Trial of no auto select next item + //editorRoot.selectNextNotReadyItem() } _polygonDone = true } } + */ } + /* + Trial of new "done" model so leaving for now in case it comes back ColumnLayout { Layout.fillWidth: true spacing: _margin @@ -166,10 +172,12 @@ Rectangle { enabled: missionItem.surveyAreaPolygon.isValid onClicked: { missionItem.wizardMode = false - editorRoot.selectNextNotReadyItem() + // Trial of no auto select next item + //editorRoot.selectNextNotReadyItem() } } } + */ } Column {