Commit 69d042e4 authored by Beat Küng's avatar Beat Küng

GPSRTKIndicator: update layout & text

Icon is not visible if no GPS is connected
Icon is red, as long as survey-in is active
parent 795c689b
...@@ -24,6 +24,7 @@ Item { ...@@ -24,6 +24,7 @@ Item {
width: (gpsValuesColumn.x + gpsValuesColumn.width) * 1.1 width: (gpsValuesColumn.x + gpsValuesColumn.width) * 1.1
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
visible: QGroundControl.gpsRtk.connected.value
Component { Component {
id: gpsInfo id: gpsInfo
...@@ -44,26 +45,36 @@ Item { ...@@ -44,26 +45,36 @@ Item {
QGCLabel { QGCLabel {
id: gpsLabel id: gpsLabel
text: (QGroundControl.gpsRtk.active.value) ? qsTr("Survey-in Active") : qsTr("RTK Active") text: (QGroundControl.gpsRtk.active.value) ? qsTr("Survey-in Active") : qsTr("RTK Streaming")
font.family: ScreenTools.demiboldFontFamily font.family: ScreenTools.demiboldFontFamily
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
} }
GridLayout { GridLayout {
id: gpsGrid id: gpsGrid
visible: (activeVehicle && activeVehicle.gps.count.value >= 0) visible: true
anchors.margins: ScreenTools.defaultFontPixelHeight anchors.margins: ScreenTools.defaultFontPixelHeight
columnSpacing: ScreenTools.defaultFontPixelWidth columnSpacing: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
columns: 2 columns: 2
QGCLabel { text: qsTr("GPS connected:") } QGCLabel {
QGCLabel { text: QGroundControl.gpsRtk.connected.value } text: qsTr("Duration:")
QGCLabel { text: qsTr("Survey-in Duration:") } visible: QGroundControl.gpsRtk.active.value
QGCLabel { text: QGroundControl.gpsRtk.currentDuration.value } }
QGCLabel { text: qsTr("Survey-in Accuracy:") } QGCLabel {
QGCLabel { text: QGroundControl.gpsRtk.currentAccuracy.value } text: QGroundControl.gpsRtk.currentDuration.value + ' s'
QGCLabel { text: qsTr("Number of Satellites:") } visible: QGroundControl.gpsRtk.active.value
}
QGCLabel {
text: qsTr("Current Accuracy:")
visible: QGroundControl.gpsRtk.active.value
}
QGCLabel {
text: (QGroundControl.gpsRtk.currentAccuracy.value/1000).toFixed(1) + ' m'
visible: QGroundControl.gpsRtk.active.value
}
QGCLabel { text: qsTr("Satellites:") }
QGCLabel { text: QGroundControl.gpsRtk.numSatellites.value } QGCLabel { text: QGroundControl.gpsRtk.numSatellites.value }
} }
} }
...@@ -84,8 +95,8 @@ Item { ...@@ -84,8 +95,8 @@ Item {
source: "/qmlimages/Gps.svg" source: "/qmlimages/Gps.svg"
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
sourceSize.height: height sourceSize.height: height
opacity: (activeVehicle && activeVehicle.gps.count.value >= 0) ? 1 : 0.5 opacity: 1
color: qgcPal.buttonText color: QGroundControl.gpsRtk.active.value ? qgcPal.colorRed : qgcPal.buttonText
} }
Column { Column {
...@@ -95,17 +106,15 @@ Item { ...@@ -95,17 +106,15 @@ Item {
anchors.left: gpsIcon.right anchors.left: gpsIcon.right
QGCLabel { QGCLabel {
anchors.horizontalCenter: hdopValue.horizontalCenter anchors.horizontalCenter: numSatValue.horizontalCenter
visible: activeVehicle && !isNaN(activeVehicle.gps.hdop.value)
color: qgcPal.buttonText color: qgcPal.buttonText
text: activeVehicle ? activeVehicle.gps.count.valueString : "" text: QGroundControl.gpsRtk.numSatellites.value
} }
QGCLabel { QGCLabel {
id: hdopValue id: numSatValue
visible: activeVehicle && !isNaN(activeVehicle.gps.hdop.value)
color: qgcPal.buttonText color: qgcPal.buttonText
text: activeVehicle ? activeVehicle.gps.hdop.value.toFixed(1) : "" text: qsTr("RTK")
} }
} }
......
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