Commit 1d1d8624 authored by Don Gagne's avatar Don Gagne

Add stats area, rework polygon buttons

parent 8d78b7e3
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.2 import QtQuick.Controls 1.2
import QGroundControl 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
import QGroundControl.Vehicle 1.0 import QGroundControl.Vehicle 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
...@@ -38,7 +39,7 @@ Rectangle { ...@@ -38,7 +39,7 @@ Rectangle {
} }
Repeater { Repeater {
model: [ missionItem.gridAltitude, missionItem.gridAngle, missionItem.gridSpacing ] model: [ missionItem.gridAngle, missionItem.gridSpacing, missionItem.gridAltitude ]
Item { Item {
anchors.left: parent.left anchors.left: parent.left
...@@ -114,31 +115,64 @@ Rectangle { ...@@ -114,31 +115,64 @@ Rectangle {
onPolygonAdjustVertex: missionItem.adjustPolygonCoordinate(vertexIndex, vertexCoordinate) onPolygonAdjustVertex: missionItem.adjustPolygonCoordinate(vertexIndex, vertexCoordinate)
} }
QGCButton { QGCLabel { text: qsTr("Polygon:") }
text: editorMap.polygonDraw.drawingPolygon ? qsTr("Finish Draw") : qsTr("Draw Polygon")
enabled: ((editorMap.polygonDraw.drawingPolygon && editorMap.polygonDraw.polygonReady) || !editorMap.polygonDraw.drawingPolygon) &&
!editorMap.polygonDraw.adjustingPolygon
onClicked: { Rectangle {
if (editorMap.polygonDraw.drawingPolygon) { anchors.left: parent.left
editorMap.polygonDraw.finishCapturePolygon() anchors.right: parent.right
} else { height: 1
editorMap.polygonDraw.startCapturePolygon() color: qgcPal.text
}
Row {
spacing: ScreenTools.defaultFontPixelWidth
QGCButton {
text: editorMap.polygonDraw.drawingPolygon ? qsTr("Finish Draw") : qsTr("Draw")
visible: !editorMap.polygonDraw.adjustingPolygon
enabled: ((editorMap.polygonDraw.drawingPolygon && editorMap.polygonDraw.polygonReady) || !editorMap.polygonDraw.drawingPolygon)
onClicked: {
if (editorMap.polygonDraw.drawingPolygon) {
editorMap.polygonDraw.finishCapturePolygon()
} else {
editorMap.polygonDraw.startCapturePolygon()
}
} }
} }
}
QGCButton { QGCButton {
text: editorMap.polygonDraw.adjustingPolygon ? qsTr("Finish Adjust") : qsTr("Adjust Polygon") text: editorMap.polygonDraw.adjustingPolygon ? qsTr("Finish Adjust") : qsTr("Adjust")
enabled: !editorMap.polygonDraw.drawingPolygon visible: missionItem.polygonPath.length > 0 && !editorMap.polygonDraw.drawingPolygon
onClicked: { onClicked: {
if (editorMap.polygonDraw.adjustingPolygon) { if (editorMap.polygonDraw.adjustingPolygon) {
editorMap.polygonDraw.finishAdjustPolygon() editorMap.polygonDraw.finishAdjustPolygon()
} else { } else {
editorMap.polygonDraw.startAdjustPolygon(missionItem.polygonPath) editorMap.polygonDraw.startAdjustPolygon(missionItem.polygonPath)
}
} }
} }
} }
QGCLabel { text: qsTr("Statistics:") }
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
height: 1
color: qgcPal.text
}
Grid {
columns: 2
spacing: ScreenTools.defaultFontPixelWidth
QGCLabel { text: qsTr("Survey area:") }
QGCLabel { text: QGroundControl.squareMetersToAppSettingsAreaUnits(missionItem.coveredArea).toFixed(2) + " " + QGroundControl.appSettingsAreaUnitsString }
QGCLabel { text: qsTr("# shots:") }
QGCLabel { text: missionItem.cameraShots }
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment