Commit f30d265c authored by Gus Grubba's avatar Gus Grubba

Tidying up Mission Settings and Survey Settings

parent 8a3ee28d
......@@ -38,6 +38,7 @@ Rectangle {
property bool _showCruiseSpeed: !_missionVehicle.multiRotor
property bool _showHoverSpeed: _missionVehicle.multiRotor || missionController.vehicle.vtol
property bool _multipleFirmware: QGroundControl.supportedFirmwareCount > 2
property real _fieldWidth: ScreenTools.defaultFontPixelWidth * 16
readonly property string _firmwareLabel: qsTr("Firmware:")
readonly property string _vehicleLabel: qsTr("Vehicle:")
......@@ -53,6 +54,7 @@ Rectangle {
QGCLabel {
text: qsTr("Planned Home Position")
color: qgcPal.buttonHighlight
}
Rectangle {
......@@ -64,29 +66,19 @@ Rectangle {
Repeater {
model: missionItem.textFieldFacts
Item {
width: valuesColumn.width
height: textField.height
QGCLabel {
id: textFieldLabel
anchors.baseline: textField.baseline
text: object.name
}
FactTextField {
id: textField
RowLayout {
anchors.left: parent.left
anchors.right: parent.right
width: _editFieldWidth
spacing: _margin
QGCLabel { text: object.name; Layout.fillWidth: true }
FactTextField {
Layout.preferredWidth: _fieldWidth
showUnits: true
fact: object
visible: !_root.readOnly
}
FactLabel {
anchors.baseline: textFieldLabel.baseline
anchors.right: parent.right
Layout.preferredWidth: _fieldWidth
fact: object
visible: _root.readOnly
}
......@@ -102,7 +94,8 @@ Rectangle {
}
QGCLabel {
text: qsTr("Vehicle Info:")
text: qsTr("Vehicle Info")
color: qgcPal.buttonHighlight
visible: _multipleFirmware
}
......@@ -125,72 +118,93 @@ Rectangle {
QGCLabel {
text: _firmwareLabel
visible: _showOfflineEditingCombos
Layout.fillWidth: true
}
FactComboBox {
Layout.fillWidth: true
fact: QGroundControl.offlineEditingFirmwareType
indexModel: false
visible: _showOfflineEditingCombos
Layout.preferredWidth: _fieldWidth
}
QGCLabel {
text: _firmwareLabel
visible: !_showOfflineEditingCombos
Layout.fillWidth: true
}
QGCLabel {
text: _missionVehicle.firmwareTypeString
visible: !_showOfflineEditingCombos
Layout.preferredWidth: _fieldWidth
}
QGCLabel {
text: _vehicleLabel
visible: _showOfflineEditingCombos
Layout.fillWidth: true
}
FactComboBox {
id: offlineVehicleCombo
Layout.fillWidth: true
fact: QGroundControl.offlineEditingVehicleType
indexModel: false
visible: _showOfflineEditingCombos
Layout.preferredWidth: _fieldWidth
}
QGCLabel {
text: _vehicleLabel
visible: !_showOfflineEditingCombos
Layout.fillWidth: true
}
QGCLabel {
text: _missionVehicle.vehicleTypeString
visible: !_showOfflineEditingCombos
Layout.preferredWidth: _fieldWidth
}
QGCLabel {
Layout.row: 2
text: qsTr("Cruise speed:")
visible: _showCruiseSpeed
Layout.fillWidth: true
}
FactTextField {
Layout.fillWidth: true
fact: QGroundControl.offlineEditingCruiseSpeed
visible: _showCruiseSpeed
Layout.preferredWidth: _fieldWidth
}
QGCLabel {
Layout.row: 3
text: qsTr("Hover speed:")
visible: _showHoverSpeed
Layout.fillWidth: true
}
FactTextField {
Layout.fillWidth: true
fact: QGroundControl.offlineEditingHoverSpeed
visible: _showHoverSpeed
Layout.preferredWidth: _fieldWidth
}
} // GridLayout
RowLayout {
anchors.left: parent.left
anchors.right: parent.right
spacing: _margin
visible: !_multipleFirmware
QGCLabel { text: qsTr("Hover speed:"); Layout.fillWidth: true }
FactTextField {
Layout.preferredWidth: _fieldWidth
fact: QGroundControl.offlineEditingHoverSpeed
}
}
QGCLabel {
width: parent.width
wrapMode: Text.WordWrap
font.pointSize: ScreenTools.smallFontPointSize
visible: _multipleFirmware
text: qsTr("Speeds are only for time calculations. Actual vehicle will not be affected.")
text: qsTr("Speeds are only used for time calculations. Actual vehicle speed will not be affected.")
horizontalAlignment: Text.AlignHCenter
}
Rectangle {
......@@ -201,6 +215,7 @@ Rectangle {
}
QGCButton {
width: parent.width * 0.9
text: qsTr("Set Home To Map Center")
onClicked: editorRoot.moveHomeToMapCenter()
anchors.horizontalCenter: parent.horizontalCenter
......
......@@ -22,8 +22,9 @@ Rectangle {
//property real availableWidth ///< Width for control
//property var missionItem ///< Mission Item for editor
property real _margin: ScreenTools.defaultFontPixelWidth / 2
property real _margin: ScreenTools.defaultFontPixelWidth * 0.25
property int _cameraIndex: 1
property real _fieldWidth: ScreenTools.defaultFontPixelWidth * 10.5
readonly property int _gridTypeManual: 0
readonly property int _gridTypeCustomCamera: 1
......@@ -46,6 +47,14 @@ Rectangle {
ListElement {
text: qsTr("Custom Camera Grid")
}
ListElement {
text: qsTr("Typhoon H CGO3+")
sensorWidth: 6.264
sensorHeight: 4.698
imageWidth: 4000
imageHeight: 3000
focalLength: 14
}
ListElement {
text: qsTr("Sony ILCE-QX1") //http://www.sony.co.uk/electronics/interchangeable-lens-cameras/ilce-qx1-body-kit/specifications
sensorWidth: 23.2 //http://www.sony.com/electronics/camera-lenses/sel16f28/specifications
......@@ -96,7 +105,7 @@ Rectangle {
var imageHeight = missionItem.cameraResolutionHeight.rawValue
var altitude = missionItem.gridAltitude.rawValue
var groundResolution = missionItem.groundResolution.rawValue
var groundResolution= missionItem.groundResolution.rawValue
var frontalOverlap = missionItem.frontalOverlap.rawValue
var sideOverlap = missionItem.sideOverlap.rawValue
......@@ -238,25 +247,6 @@ Rectangle {
anchors.right: parent.right
spacing: _margin
QGCLabel {
anchors.left: parent.left
anchors.right: parent.right
wrapMode: Text.WordWrap
font.pointSize: ScreenTools.smallFontPointSize
text: gridTypeCombo.currentIndex == 0 ?
qsTr("Create a flight path which covers a polygonal area by specifying all grid parameters.") :
qsTr("Create a flight path which fully covers a polygonal area using camera specifications.")
}
QGCLabel { text: qsTr("Camera:") }
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
height: 1
color: qgcPal.text
}
QGCComboBox {
id: gridTypeCombo
anchors.left: parent.left
......@@ -296,6 +286,16 @@ Rectangle {
}
}
QGCLabel { text: qsTr("Camera"); color: qgcPal.buttonHighlight; visible: gridTypeCombo.currentIndex !== _gridTypeManual}
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
height: 1
color: qgcPal.text
visible: gridTypeCombo.currentIndex !== _gridTypeManual
}
// Camera based grid ui
Column {
anchors.left: parent.left
......@@ -305,6 +305,7 @@ Rectangle {
Row {
spacing: _margin
anchors.horizontalCenter: parent.horizontalCenter
QGCRadioButton {
id: cameraOrientationLandscape
......@@ -322,82 +323,104 @@ Rectangle {
}
Column {
id: custCameraCol
anchors.left: parent.left
anchors.right: parent.right
spacing: _margin
visible: gridTypeCombo.currentIndex == _gridTypeCustomCamera
GridLayout {
columns: 3
columnSpacing: _margin
rowSpacing: _margin
property real _fieldWidth: ScreenTools.defaultFontPixelWidth * 10
visible: gridTypeCombo.currentIndex === _gridTypeCustomCamera
QGCLabel { }
QGCLabel { text: qsTr("Width") }
QGCLabel { text: qsTr("Height") }
RowLayout {
anchors.left: parent.left
anchors.right: parent.right
spacing: _margin
Item { Layout.fillWidth: true }
QGCLabel {
Layout.preferredWidth: _root._fieldWidth
text: qsTr("Width")
}
QGCLabel {
Layout.preferredWidth: _root._fieldWidth
text: qsTr("Height")
}
}
QGCLabel { text: qsTr("Sensor:") }
RowLayout {
anchors.left: parent.left
anchors.right: parent.right
spacing: _margin
QGCLabel { text: qsTr("Sensor:"); Layout.fillWidth: true }
FactTextField {
Layout.preferredWidth: parent._fieldWidth
Layout.preferredWidth: _root._fieldWidth
fact: missionItem.cameraSensorWidth
}
FactTextField {
Layout.preferredWidth: parent._fieldWidth
Layout.preferredWidth: _root._fieldWidth
fact: missionItem.cameraSensorHeight
}
}
QGCLabel { text: qsTr("Image:") }
RowLayout {
anchors.left: parent.left
anchors.right: parent.right
spacing: _margin
QGCLabel { text: qsTr("Image:"); Layout.fillWidth: true }
FactTextField {
Layout.preferredWidth: parent._fieldWidth
Layout.preferredWidth: _root._fieldWidth
fact: missionItem.cameraResolutionWidth
}
FactTextField {
Layout.preferredWidth: parent._fieldWidth
Layout.preferredWidth: _root._fieldWidth
fact: missionItem.cameraResolutionHeight
}
}
FactTextFieldRow {
RowLayout {
anchors.left: parent.left
anchors.right: parent.right
spacing: _margin
QGCLabel {
text: missionItem.cameraFocalLength.name + ":"
Layout.fillWidth: true
}
FactTextField {
Layout.preferredWidth: _root._fieldWidth
fact: missionItem.cameraFocalLength
}
} // Column - custom camera
}
QGCLabel { text: qsTr("Image Overlap") }
} // Column - custom camera
Row {
RowLayout {
anchors.left: parent.left
anchors.right: parent.right
spacing: _margin
Item {
width: ScreenTools.defaultFontPixelWidth * 2
height: 1
Item { Layout.fillWidth: true }
QGCLabel {
Layout.preferredWidth: _root._fieldWidth
text: qsTr("Frontal")
}
QGCLabel {
anchors.baseline: frontalOverlapField.baseline
text: qsTr("Frontal:")
Layout.preferredWidth: _root._fieldWidth
text: qsTr("Side")
}
}
RowLayout {
anchors.left: parent.left
anchors.right: parent.right
spacing: _margin
QGCLabel { text: qsTr("Overlap:"); Layout.fillWidth: true }
FactTextField {
id: frontalOverlapField
width: ScreenTools.defaultFontPixelWidth * 7
Layout.preferredWidth: _root._fieldWidth
fact: missionItem.frontalOverlap
}
QGCLabel {
anchors.baseline: frontalOverlapField.baseline
text: qsTr("Side:")
}
FactTextField {
width: frontalOverlapField.width
Layout.preferredWidth: _root._fieldWidth
fact: missionItem.sideOverlap
}
}
QGCLabel { text: qsTr("Grid:") }
QGCLabel { text: qsTr("Grid"); color: qgcPal.buttonHighlight;}
Rectangle {
anchors.left: parent.left
......@@ -406,12 +429,36 @@ Rectangle {
color: qgcPal.text
}
FactTextFieldGrid {
RowLayout {
anchors.left: parent.left
anchors.right: parent.right
columnSpacing: _margin
rowSpacing: _margin
factList: [ missionItem.gridAngle, missionItem.turnaroundDist ]
spacing: _margin
QGCLabel {
text: missionItem.gridAngle.name + ":"
Layout.fillWidth: true
anchors.verticalCenter: parent.verticalCenter
}
FactTextField {
fact: missionItem.gridAngle
anchors.verticalCenter: parent.verticalCenter
Layout.preferredWidth: _root._fieldWidth
}
}
RowLayout {
anchors.left: parent.left
anchors.right: parent.right
spacing: _margin
QGCLabel {
text: missionItem.turnaroundDist.name + ":"
Layout.fillWidth: true
anchors.verticalCenter: parent.verticalCenter
}
FactTextField {
fact: missionItem.turnaroundDist
anchors.verticalCenter: parent.verticalCenter
Layout.preferredWidth: _root._fieldWidth
}
}
QGCLabel {
......@@ -429,18 +476,19 @@ Rectangle {
QGCRadioButton {
id: fixedAltitudeRadio
anchors.baseline: gridAltitudeField.baseline
text: qsTr("Altitude:")
checked: missionItem.fixedValueIsAltitude
exclusiveGroup: fixedValueGroup
onClicked: missionItem.fixedValueIsAltitude = true
Layout.fillWidth: true
anchors.verticalCenter: parent.verticalCenter
}
FactTextField {
id: gridAltitudeField
Layout.fillWidth: true
fact: missionItem.gridAltitude
enabled: fixedAltitudeRadio.checked
Layout.preferredWidth: _root._fieldWidth
anchors.verticalCenter: parent.verticalCenter
}
}
......@@ -451,18 +499,19 @@ Rectangle {
QGCRadioButton {
id: fixedGroundResolutionRadio
anchors.baseline: groundResolutionField.baseline
text: qsTr("Ground res:")
checked: !missionItem.fixedValueIsAltitude
exclusiveGroup: fixedValueGroup
onClicked: missionItem.fixedValueIsAltitude = false
Layout.fillWidth: true
anchors.verticalCenter: parent.verticalCenter
}
FactTextField {
id: groundResolutionField
Layout.fillWidth: true
fact: missionItem.groundResolution
enabled: fixedGroundResolutionRadio.checked
Layout.preferredWidth: _root._fieldWidth
anchors.verticalCenter: parent.verticalCenter
}
}
}
......@@ -474,7 +523,7 @@ Rectangle {
spacing: _margin
visible: gridTypeCombo.currentIndex == _gridTypeManual
QGCLabel { text: qsTr("Grid:") }
QGCLabel { text: qsTr("Grid"); color: qgcPal.buttonHighlight;}
Rectangle {
anchors.left: parent.left
......@@ -486,7 +535,7 @@ Rectangle {
FactTextFieldGrid {
anchors.left: parent.left
anchors.right: parent.right
columnSpacing: _margin
columnSpacing: _margin * 10
rowSpacing: _margin
factList: [ missionItem.gridAngle, missionItem.gridSpacing, missionItem.gridAltitude, missionItem.turnaroundDist ]
}
......@@ -498,7 +547,7 @@ Rectangle {
onClicked: missionItem.gridAltitudeRelative = checked
}
QGCLabel { text: qsTr("Camera:") }
QGCLabel { text: qsTr("Camera"); color: qgcPal.buttonHighlight;}
Rectangle {
anchors.left: parent.left
......@@ -529,7 +578,7 @@ Rectangle {
}
}
QGCLabel { text: qsTr("Polygon:") }
QGCLabel { text: qsTr("Polygon"); color: qgcPal.buttonHighlight;}
Rectangle {
anchors.left: parent.left
......@@ -540,8 +589,10 @@ Rectangle {
Row {
spacing: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
QGCButton {
width: _root.width * 0.45
text: editorMap.polygonDraw.drawingPolygon ? qsTr("Finish Draw") : qsTr("Draw")
visible: !editorMap.polygonDraw.adjustingPolygon
enabled: ((editorMap.polygonDraw.drawingPolygon && editorMap.polygonDraw.polygonReady) || !editorMap.polygonDraw.drawingPolygon)
......@@ -556,6 +607,7 @@ Rectangle {
}
QGCButton {
width: _root.width * 0.4
text: editorMap.polygonDraw.adjustingPolygon ? qsTr("Finish Adjust") : qsTr("Adjust")
visible: missionItem.polygonPath.length > 0 && !editorMap.polygonDraw.drawingPolygon
......@@ -569,7 +621,7 @@ Rectangle {
}
}
QGCLabel { text: qsTr("Statistics:") }
QGCLabel { text: qsTr("Statistics"); color: qgcPal.buttonHighlight;}
Rectangle {
anchors.left: parent.left
......@@ -585,11 +637,19 @@ Rectangle {
QGCLabel { text: qsTr("Survey area:") }
QGCLabel { text: QGroundControl.squareMetersToAppSettingsAreaUnits(missionItem.coveredArea).toFixed(2) + " " + QGroundControl.appSettingsAreaUnitsString }
QGCLabel { text: qsTr("# shots:") }
QGCLabel { text: qsTr("Photo count:") }
QGCLabel { text: missionItem.cameraShots }
QGCLabel { text: qsTr("Shot interval:") }
QGCLabel { text: missionItem.timeBetweenShots.toFixed(1) + " " + qsTr("secs")}
QGCLabel { text: qsTr("Photo interval:") }
QGCLabel {
text: {
var timeVal = missionItem.timeBetweenShots
if(!isFinite(timeVal) || missionItem.cameraShots === 0) {
return qsTr("N/A")
}
return timeVal.toFixed(1) + " " + qsTr("secs")
}
}
}
}
}
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