From 13843641d6a040e593a31d692a8bed010db683ab Mon Sep 17 00:00:00 2001 From: Valentin Platzgummer Date: Mon, 8 Feb 2021 15:44:13 +0100 Subject: [PATCH] 0 tiles error message added --- nemo_dummy_temp.py | 0 .../geometry/MeasurementArea.cc | 12 ++++++++++-- src/MeasurementComplexItem/qml/AreaDataEditor.qml | 4 ++-- .../qml/MeasurementItemEditor.qml | 6 +----- src/MeasurementComplexItem/qml/NemoEditor.qml | 2 +- 5 files changed, 14 insertions(+), 10 deletions(-) create mode 100644 nemo_dummy_temp.py diff --git a/nemo_dummy_temp.py b/nemo_dummy_temp.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/MeasurementComplexItem/geometry/MeasurementArea.cc b/src/MeasurementComplexItem/geometry/MeasurementArea.cc index ed0757323..8aa02a047 100644 --- a/src/MeasurementComplexItem/geometry/MeasurementArea.cc +++ b/src/MeasurementComplexItem/geometry/MeasurementArea.cc @@ -326,7 +326,13 @@ bool MeasurementArea::loadFromJson(const QJsonObject &json, bool MeasurementArea::isCorrect() { if (GeoArea::isCorrect()) { if (ready()) { - return true; + if (_tiles->count() > 0) { + return true; + } else { + setErrorString(tr("Not able to create tiles. This indicates that the " + "tile parameters must be adjusted. Reducing the Min. " + "Area parameter might deliver the desired result.")); + } } else if (_toManyTiles) { setErrorString( tr("Calculation would yield to many tiles, please adjust the tile " @@ -627,8 +633,10 @@ bool getTiles(const FPolygon &area, Length tileHeight, Length tileWidth, minimalBoundingBox(area, bbox); } - if (bbox.corners.outer().size() < 5) + if (bbox.corners.outer().size() < 5) { return false; + } + double bboxWidth = bbox.width; double bboxHeight = bbox.height; FPoint origin = bbox.corners.outer()[0]; diff --git a/src/MeasurementComplexItem/qml/AreaDataEditor.qml b/src/MeasurementComplexItem/qml/AreaDataEditor.qml index d6828d2aa..2457174eb 100644 --- a/src/MeasurementComplexItem/qml/AreaDataEditor.qml +++ b/src/MeasurementComplexItem/qml/AreaDataEditor.qml @@ -218,8 +218,8 @@ Rectangle { wrapMode: Text.WordWrap horizontalAlignment: Text.AlignLeft text: qsTr("Use the Intersection button to clip the Measurement Area(s). -Use the Reset button to restore the areas to the state before entering this tab. -Use the Abort button to reset the areas and leave the tab.") +Use the Reset button to restore the areas to the state before entering this tab." +) Layout.fillWidth: true Layout.columnSpan: parent.columns } diff --git a/src/MeasurementComplexItem/qml/MeasurementItemEditor.qml b/src/MeasurementComplexItem/qml/MeasurementItemEditor.qml index f5efc1751..7752fb927 100644 --- a/src/MeasurementComplexItem/qml/MeasurementItemEditor.qml +++ b/src/MeasurementComplexItem/qml/MeasurementItemEditor.qml @@ -43,6 +43,7 @@ Rectangle { anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right + spacing: _margin QGCTabBar { id: tabBar @@ -78,11 +79,6 @@ Rectangle { visible: tabBar.currentIndex === tabBar.areaEditorIndex missionItem: _root._missionItem availableWidth: mainColumn.width - onVisibleChanged:{ - if (visible){ - _missionItem.startEditing() - } - } } MCI.ParameterEditor { diff --git a/src/MeasurementComplexItem/qml/NemoEditor.qml b/src/MeasurementComplexItem/qml/NemoEditor.qml index 8e4219341..51895a7aa 100644 --- a/src/MeasurementComplexItem/qml/NemoEditor.qml +++ b/src/MeasurementComplexItem/qml/NemoEditor.qml @@ -179,7 +179,7 @@ Rectangle { id: hintLabel wrapMode: Text.WordWrap horizontalAlignment: Text.AlignLeft - text: qsTr("Use this tab to connect to a device implementing the Nemo Interface. + text: qsTr("Use this tab to connect to a device implementing the Nemointerface. Use the Random button to simulate measurement progress.") Layout.fillWidth: true Layout.columnSpan: parent.columns -- 2.22.0