Commit 5e051cb0 authored by dogmaphobic's avatar dogmaphobic

GPS Indicator fixes.

parent 6006dc32
......@@ -190,16 +190,22 @@ Rectangle {
function getGpsLockStatus() {
if(activeVehicle) {
if(activeVehicle.satelliteLock == 0) {
return "No Satellite Link"
}
if(activeVehicle.satelliteLock == 1) {
return "No GPS Lock"
if(activeVehicle.satelliteLock < 2) {
return "No Satellite Lock"
}
if(activeVehicle.satelliteLock == 2) {
return "2D Lock"
}
return "3D Lock"
if(activeVehicle.satelliteLock == 3) {
return "3D Lock"
}
if(activeVehicle.satelliteLock == 4) {
return "3D Lock with Differential"
}
if(activeVehicle.satelliteLock == 5) {
return "3D Lock with Relative Positioning"
}
return "Unkown Lock Type (" + activeVehicle.satelliteLock + ")"
}
return "N/A"
}
......@@ -226,14 +232,14 @@ Rectangle {
anchors.centerIn: parent
QGCLabel {
id: gpsLabel
text: (activeVehicle && (activeVehicle.satelliteCount > 0)) ? "GPS Status" : "GPS Data Unavailable"
text: (activeVehicle && activeVehicle.satelliteCount >= 0) ? "GPS Status" : "GPS Data Unavailable"
font.weight:Font.DemiBold
color: colorWhite
anchors.horizontalCenter: parent.horizontalCenter
}
GridLayout {
id: gpsGrid
visible: (activeVehicle && (activeVehicle.satelliteCount > 0))
visible: (activeVehicle && activeVehicle.satelliteCount >= 0)
anchors.margins: ScreenTools.defaultFontPixelHeight
columnSpacing: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
......
......@@ -176,7 +176,7 @@ Row {
smooth: true
width: mainWindow.tbCellHeight * 0.65
height: mainWindow.tbCellHeight * 0.5
opacity: activeVehicle ? (activeVehicle.satelliteCount < 1 ? 0.5 : 1) : 0.5
opacity: (activeVehicle && activeVehicle.satelliteCount >= 0) ? 1 : 0.5
anchors.verticalCenter: parent.verticalCenter
}
SignalStrength {
......@@ -186,10 +186,10 @@ Row {
}
}
QGCLabel {
text: activeVehicle ? activeVehicle.satelliteCount : 0
text: (activeVehicle && activeVehicle.satelliteCount >= 0) ? activeVehicle.satelliteCount : ""
visible: (activeVehicle && activeVehicle.satelliteCount >= 0)
font.pixelSize: tbFontSmall
color: colorWhite
opacity: activeVehicle ? (activeVehicle.satelliteCount < 1 ? 0.5 : 1) : 0.5
anchors.top: parent.top
anchors.leftMargin: gpsIcon.width
anchors.left: parent.left
......
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