Browse Source

Merge pull request #8626 from mavlink/NewWizardDoneModel

Plan: New wizard done model
QGC4.4
Don Gagne 5 years ago committed by GitHub
parent
commit
f711da2433
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      src/MissionManager/CorridorScanComplexItem.cc
  2. 1
      src/MissionManager/CorridorScanComplexItem.h
  3. 8
      src/MissionManager/QGCMapPolygon.cc
  4. 4
      src/MissionManager/QGCMapPolygon.h
  5. 8
      src/MissionManager/QGCMapPolyline.cc
  6. 4
      src/MissionManager/QGCMapPolyline.h
  7. 9
      src/MissionManager/StructureScanComplexItem.cc
  8. 1
      src/MissionManager/StructureScanComplexItem.h
  9. 10
      src/MissionManager/SurveyComplexItem.cc
  10. 2
      src/MissionManager/SurveyComplexItem.h
  11. 6
      src/PlanView/CorridorScanEditor.qml
  12. 5
      src/PlanView/FWLandingPatternEditor.qml
  13. 4
      src/PlanView/MissionItemEditor.qml
  14. 5
      src/PlanView/SimpleItemEditor.qml
  15. 6
      src/PlanView/StructureScanEditor.qml
  16. 14
      src/PlanView/SurveyItemEditor.qml

10
src/MissionManager/CorridorScanComplexItem.cc

@ -52,7 +52,8 @@ CorridorScanComplexItem::CorridorScanComplexItem(PlanMasterController* masterCon
connect(&_corridorPolyline, &QGCMapPolyline::pathChanged, this, &CorridorScanComplexItem::_rebuildCorridorPolygon); connect(&_corridorPolyline, &QGCMapPolyline::pathChanged, this, &CorridorScanComplexItem::_rebuildCorridorPolygon);
connect(&_corridorWidthFact, &Fact::valueChanged, 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()) { if (!kmlFile.isEmpty()) {
_corridorPolyline.loadKMLFile(kmlFile); _corridorPolyline.loadKMLFile(kmlFile);
@ -384,3 +385,10 @@ double CorridorScanComplexItem::_calcTransectSpacing(void) const
return transectSpacing; return transectSpacing;
} }
void CorridorScanComplexItem::_updateWizardMode(void)
{
if (_corridorPolyline.isValid() && !_corridorPolyline.traceMode()) {
setWizardMode(false);
}
}

1
src/MissionManager/CorridorScanComplexItem.h

@ -60,6 +60,7 @@ public:
private slots: private slots:
void _polylineDirtyChanged (bool dirty); void _polylineDirtyChanged (bool dirty);
void _rebuildCorridorPolygon (void); void _rebuildCorridorPolygon (void);
void _updateWizardMode (void);
// Overrides from TransectStyleComplexItem // Overrides from TransectStyleComplexItem
void _rebuildTransectsPhase1 (void) final; void _rebuildTransectsPhase1 (void) final;

8
src/MissionManager/QGCMapPolygon.cc

@ -598,3 +598,11 @@ QDomElement QGCMapPolygon::kmlPolygonElement(KMLDomDocument& domDocument)
return polygonElement; return polygonElement;
} }
void QGCMapPolygon::setTraceMode(bool traceMode)
{
if (traceMode != _traceMode) {
_traceMode = traceMode;
emit traceModeChanged(traceMode);
}
}

4
src/MissionManager/QGCMapPolygon.h

@ -39,7 +39,7 @@ public:
Q_PROPERTY(bool interactive READ interactive WRITE setInteractive NOTIFY interactiveChanged) Q_PROPERTY(bool interactive READ interactive WRITE setInteractive NOTIFY interactiveChanged)
Q_PROPERTY(bool isValid READ isValid NOTIFY isValidChanged) Q_PROPERTY(bool isValid READ isValid NOTIFY isValidChanged)
Q_PROPERTY(bool empty READ empty NOTIFY isEmptyChanged) 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 clear(void);
Q_INVOKABLE void appendVertex(const QGeoCoordinate& coordinate); Q_INVOKABLE void appendVertex(const QGeoCoordinate& coordinate);
@ -105,6 +105,7 @@ public:
bool interactive (void) const { return _interactive; } bool interactive (void) const { return _interactive; }
bool isValid (void) const { return _polygonModel.count() >= 3; } bool isValid (void) const { return _polygonModel.count() >= 3; }
bool empty (void) const { return _polygonModel.count() == 0; } bool empty (void) const { return _polygonModel.count() == 0; }
bool traceMode (void) const { return _traceMode; }
QVariantList path (void) const { return _polygonPath; } QVariantList path (void) const { return _polygonPath; }
QmlObjectListModel* qmlPathModel(void) { return &_polygonModel; } QmlObjectListModel* qmlPathModel(void) { return &_polygonModel; }
@ -115,6 +116,7 @@ public:
void setCenter (QGeoCoordinate newCenter); void setCenter (QGeoCoordinate newCenter);
void setCenterDrag (bool centerDrag); void setCenterDrag (bool centerDrag);
void setInteractive (bool interactive); void setInteractive (bool interactive);
void setTraceMode (bool traceMode);
static const char* jsonPolygonKey; static const char* jsonPolygonKey;

8
src/MissionManager/QGCMapPolyline.cc

@ -431,3 +431,11 @@ void QGCMapPolyline::_endResetIfNotActive(void)
endReset(); endReset();
} }
} }
void QGCMapPolyline::setTraceMode(bool traceMode)
{
if (traceMode != _traceMode) {
_traceMode = traceMode;
emit traceModeChanged(traceMode);
}
}

4
src/MissionManager/QGCMapPolyline.h

@ -32,7 +32,7 @@ public:
Q_PROPERTY(bool interactive READ interactive WRITE setInteractive NOTIFY interactiveChanged) Q_PROPERTY(bool interactive READ interactive WRITE setInteractive NOTIFY interactiveChanged)
Q_PROPERTY(bool isValid READ isValid NOTIFY isValidChanged) Q_PROPERTY(bool isValid READ isValid NOTIFY isValidChanged)
Q_PROPERTY(bool empty READ empty NOTIFY isEmptyChanged) 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 clear(void);
Q_INVOKABLE void appendVertex(const QGeoCoordinate& coordinate); Q_INVOKABLE void appendVertex(const QGeoCoordinate& coordinate);
@ -89,6 +89,7 @@ public:
QVariantList path (void) const { return _polylinePath; } QVariantList path (void) const { return _polylinePath; }
bool isValid (void) const { return _polylineModel.count() >= 2; } bool isValid (void) const { return _polylineModel.count() >= 2; }
bool empty (void) const { return _polylineModel.count() == 0; } bool empty (void) const { return _polylineModel.count() == 0; }
bool traceMode (void) const { return _traceMode; }
QmlObjectListModel* qmlPathModel(void) { return &_polylineModel; } QmlObjectListModel* qmlPathModel(void) { return &_polylineModel; }
QmlObjectListModel& pathModel (void) { return _polylineModel; } QmlObjectListModel& pathModel (void) { return _polylineModel; }
@ -96,6 +97,7 @@ public:
void setPath (const QList<QGeoCoordinate>& path); void setPath (const QList<QGeoCoordinate>& path);
void setPath (const QVariantList& path); void setPath (const QVariantList& path);
void setInteractive (bool interactive); void setInteractive (bool interactive);
void setTraceMode (bool traceMode);
static const char* jsonPolylineKey; static const char* jsonPolylineKey;

9
src/MissionManager/StructureScanComplexItem.cc

@ -71,6 +71,8 @@ StructureScanComplexItem::StructureScanComplexItem(PlanMasterController* masterC
connect(&_structurePolygon, &QGCMapPolygon::dirtyChanged, this, &StructureScanComplexItem::_polygonDirtyChanged); connect(&_structurePolygon, &QGCMapPolygon::dirtyChanged, this, &StructureScanComplexItem::_polygonDirtyChanged);
connect(&_structurePolygon, &QGCMapPolygon::pathChanged, this, &StructureScanComplexItem::_rebuildFlightPolygon); connect(&_structurePolygon, &QGCMapPolygon::pathChanged, this, &StructureScanComplexItem::_rebuildFlightPolygon);
connect(&_structurePolygon, &QGCMapPolygon::isValidChanged, this, &StructureScanComplexItem::readyForSaveStateChanged); 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(&_structurePolygon, &QGCMapPolygon::countChanged, this, &StructureScanComplexItem::_updateLastSequenceNumber);
connect(&_layersFact, &Fact::valueChanged, this, &StructureScanComplexItem::_updateLastSequenceNumber); connect(&_layersFact, &Fact::valueChanged, this, &StructureScanComplexItem::_updateLastSequenceNumber);
@ -626,3 +628,10 @@ StructureScanComplexItem::ReadyForSaveState StructureScanComplexItem::readyForSa
{ {
return _structurePolygon.isValid() && !_wizardMode ? ReadyForSave : NotReadyForSaveData; return _structurePolygon.isValid() && !_wizardMode ? ReadyForSave : NotReadyForSaveData;
} }
void StructureScanComplexItem::_updateWizardMode(void)
{
if (_structurePolygon.isValid() && !_structurePolygon.traceMode()) {
setWizardMode(false);
}
}

1
src/MissionManager/StructureScanComplexItem.h

@ -128,6 +128,7 @@ private slots:
void _updateGimbalPitch (void); void _updateGimbalPitch (void);
void _signalTopBottomAltChanged (void); void _signalTopBottomAltChanged (void);
void _recalcScanDistance (void); void _recalcScanDistance (void);
void _updateWizardMode (void);
private: private:
void _setCameraShots(int cameraShots); void _setCameraShots(int cameraShots);

10
src/MissionManager/SurveyComplexItem.cc

@ -99,6 +99,9 @@ SurveyComplexItem::SurveyComplexItem(PlanMasterController* masterController, boo
connect(&_splitConcavePolygonsFact, &Fact::valueChanged, this, &SurveyComplexItem::_rebuildTransects); connect(&_splitConcavePolygonsFact, &Fact::valueChanged, this, &SurveyComplexItem::_rebuildTransects);
connect(this, &SurveyComplexItem::refly90DegreesChanged, 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 // 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::coordinateHasRelativeAltitudeChanged);
connect(&_cameraCalc, &CameraCalc::distanceToSurfaceRelativeChanged, this, &SurveyComplexItem::exitCoordinateHasRelativeAltitudeChanged); connect(&_cameraCalc, &CameraCalc::distanceToSurfaceRelativeChanged, this, &SurveyComplexItem::exitCoordinateHasRelativeAltitudeChanged);
@ -1428,3 +1431,10 @@ double SurveyComplexItem::additionalTimeDelay (void) const
return hoverTime; return hoverTime;
} }
void SurveyComplexItem::_updateWizardMode(void)
{
if (_surveyAreaPolygon.isValid() && !_surveyAreaPolygon.traceMode()) {
setWizardMode(false);
}
}

2
src/MissionManager/SurveyComplexItem.h

@ -80,6 +80,8 @@ signals:
void refly90DegreesChanged(bool refly90Degrees); void refly90DegreesChanged(bool refly90Degrees);
private slots: private slots:
void _updateWizardMode (void);
// Overrides from TransectStyleComplexItem // Overrides from TransectStyleComplexItem
void _rebuildTransectsPhase1 (void) final; void _rebuildTransectsPhase1 (void) final;
void _recalcComplexDistance (void) final; void _recalcComplexDistance (void) final;

6
src/PlanView/CorridorScanEditor.qml

@ -68,15 +68,19 @@ Rectangle {
text: qsTr("Use the Polyline Tools to create the polyline which defines the corridor.") 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 { QGCButton {
text: qsTr("Done With Polyline") text: qsTr("Done With Polyline")
Layout.fillWidth: true Layout.fillWidth: true
enabled: missionItem.corridorPolyline.isValid && !missionItem.corridorPolyline.traceMode enabled: missionItem.corridorPolyline.isValid && !missionItem.corridorPolyline.traceMode
onClicked: { onClicked: {
missionItem.wizardMode = false missionItem.wizardMode = false
editorRoot.selectNextNotReadyItem() // Trial of no auto select next item
//editorRoot.selectNextNotReadyItem()
} }
} }
*/
} }
Column { Column {

5
src/PlanView/FWLandingPatternEditor.qml

@ -312,12 +312,13 @@ Rectangle {
} }
QGCButton { QGCButton {
text: qsTr("Done Adjusting") text: qsTr("Done")
Layout.fillWidth: true Layout.fillWidth: true
onClicked: { onClicked: {
missionItem.wizardMode = false missionItem.wizardMode = false
missionItem.landingDragAngleOnly = false missionItem.landingDragAngleOnly = false
editorRoot.selectNextNotReadyItem() // Trial of no auto select next item
//editorRoot.selectNextNotReadyItem()
} }
} }
} }

4
src/PlanView/MissionItemEditor.qml

@ -20,7 +20,7 @@ Rectangle {
color: _currentItem ? qgcPal.missionItemEditor : qgcPal.windowShade color: _currentItem ? qgcPal.missionItemEditor : qgcPal.windowShade
radius: _radius radius: _radius
opacity: _currentItem ? 1.0 : 0.7 opacity: _currentItem ? 1.0 : 0.7
border.width: _readyForSave ? 0 : 1 border.width: _readyForSave ? 0 : 2
border.color: qgcPal.warningText border.color: qgcPal.warningText
property var map ///< Map control property var map ///< Map control
@ -87,7 +87,7 @@ Rectangle {
Rectangle { Rectangle {
id: notReadyForSaveIndicator id: notReadyForSaveIndicator
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: readyForSaveLabel.contentHeight width: _hamburgerSize
height: width height: width
border.width: 1 border.width: 1
border.color: qgcPal.warningText border.color: qgcPal.warningText

5
src/PlanView/SimpleItemEditor.qml

@ -91,12 +91,13 @@ Rectangle {
} }
QGCButton { QGCButton {
text: qsTr("Done Adjusting") text: qsTr("Done")
Layout.fillWidth: true Layout.fillWidth: true
visible: !initialClickLabel.visible visible: !initialClickLabel.visible
onClicked: { onClicked: {
missionItem.wizardMode = false missionItem.wizardMode = false
editorRoot.selectNextNotReadyItem() // Trial of no auto select next item
//editorRoot.selectNextNotReadyItem()
} }
} }

6
src/PlanView/StructureScanEditor.qml

@ -69,15 +69,19 @@ Rectangle {
text: qsTr("Use the Polygon Tools to create the polygon which outlines the structure.") 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 { QGCButton {
text: qsTr("Done With Polygon") text: qsTr("Done With Polygon")
Layout.fillWidth: true Layout.fillWidth: true
enabled: missionItem.structurePolygon.isValid && !missionItem.structurePolygon.traceMode enabled: missionItem.structurePolygon.isValid && !missionItem.structurePolygon.traceMode
onClicked: { onClicked: {
missionItem.wizardMode = false missionItem.wizardMode = false
editorRoot.selectNextNotReadyItem() // Trial of no auto select next item
//editorRoot.selectNextNotReadyItem()
} }
} }
*/
} }
Column { Column {

14
src/PlanView/SurveyItemEditor.qml

@ -29,7 +29,7 @@ Rectangle {
property var _vehicle: QGroundControl.multiVehicleManager.activeVehicle ? QGroundControl.multiVehicleManager.activeVehicle : QGroundControl.multiVehicleManager.offlineEditingVehicle property var _vehicle: QGroundControl.multiVehicleManager.activeVehicle ? QGroundControl.multiVehicleManager.activeVehicle : QGroundControl.multiVehicleManager.offlineEditingVehicle
property real _cameraMinTriggerInterval: missionItem.cameraCalc.minTriggerInterval.rawValue property real _cameraMinTriggerInterval: missionItem.cameraCalc.minTriggerInterval.rawValue
property bool _polygonDone: false property bool _polygonDone: false
property string _doneAdjusting: qsTr("Done Adjusting") property string _doneAdjusting: qsTr("Done")
property bool _presetsAvailable: missionItem.presetNames.length !== 0 property bool _presetsAvailable: missionItem.presetNames.length !== 0
function polygonCaptureStarted() { function polygonCaptureStarted() {
@ -77,6 +77,8 @@ Rectangle {
text: qsTr("Use the Polygon Tools to create the polygon which outlines your survey area.") 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 { QGCButton {
text: qsTr("Done With Polygon") text: qsTr("Done With Polygon")
Layout.fillWidth: true Layout.fillWidth: true
@ -84,13 +86,17 @@ Rectangle {
onClicked: { onClicked: {
if (!_presetsAvailable) { if (!_presetsAvailable) {
missionItem.wizardMode = false missionItem.wizardMode = false
editorRoot.selectNextNotReadyItem() // Trial of no auto select next item
//editorRoot.selectNextNotReadyItem()
} }
_polygonDone = true _polygonDone = true
} }
} }
*/
} }
/*
Trial of new "done" model so leaving for now in case it comes back
ColumnLayout { ColumnLayout {
Layout.fillWidth: true Layout.fillWidth: true
spacing: _margin spacing: _margin
@ -166,10 +172,12 @@ Rectangle {
enabled: missionItem.surveyAreaPolygon.isValid enabled: missionItem.surveyAreaPolygon.isValid
onClicked: { onClicked: {
missionItem.wizardMode = false missionItem.wizardMode = false
editorRoot.selectNextNotReadyItem() // Trial of no auto select next item
//editorRoot.selectNextNotReadyItem()
} }
} }
} }
*/
} }
Column { Column {

Loading…
Cancel
Save