From f1bf5ab7e410cef022a0323dce7cd05e0ebf7ca9 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Fri, 26 Feb 2016 10:32:19 -0800 Subject: [PATCH] Update gps indicator to hdop, new hdop boundaries --- src/Vehicle/Vehicle.cc | 4 ++++ src/ui/toolbar/MainToolBar.qml | 6 +++--- src/ui/toolbar/MainToolBarIndicators.qml | 12 ++++++------ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc index 7a9e01d82..c6f3f82c6 100644 --- a/src/Vehicle/Vehicle.cc +++ b/src/Vehicle/Vehicle.cc @@ -1283,6 +1283,10 @@ VehicleGPSFactGroup::VehicleGPSFactGroup(QObject* parent) _addFact(&_courseOverGroundFact, _courseOverGroundFactName); _addFact(&_lockFact, _lockFactName); _addFact(&_countFact, _countFactName); + + _hdopFact.setRawValue(std::numeric_limits::quiet_NaN()); + _vdopFact.setRawValue(std::numeric_limits::quiet_NaN()); + _courseOverGroundFact.setRawValue(std::numeric_limits::quiet_NaN()); } void VehicleGPSFactGroup::setVehicle(Vehicle* vehicle) diff --git a/src/ui/toolbar/MainToolBar.qml b/src/ui/toolbar/MainToolBar.qml index 88128af86..fdbd1c530 100644 --- a/src/ui/toolbar/MainToolBar.qml +++ b/src/ui/toolbar/MainToolBar.qml @@ -243,7 +243,7 @@ Rectangle { color: colorWhite } QGCLabel { - text: activeVehicle ? (activeVehicle.gps.hdop.value < 10000 ? activeVehicle.gps.hdop.valueString : "N/A") : "N/A" + text: activeVehicle ? activeVehicle.gps.hdop.valueString : "--.--" color: colorWhite } QGCLabel { @@ -251,7 +251,7 @@ Rectangle { color: colorWhite } QGCLabel { - text: activeVehicle ? (activeVehicle.gps.vdop.value < 10000 ? activeVehicle.gps.vdop.valueString : "N/A") : "N/A" + text: activeVehicle ? activeVehicle.gps.vdop.valueString : "--.--" color: colorWhite } QGCLabel { @@ -259,7 +259,7 @@ Rectangle { color: colorWhite } QGCLabel { - text: activeVehicle ? activeVehicle.gps.courseOverGround.valueString : "N/A" + text: activeVehicle ? activeVehicle.gps.courseOverGround.valueString : "--.--" color: colorWhite } } diff --git a/src/ui/toolbar/MainToolBarIndicators.qml b/src/ui/toolbar/MainToolBarIndicators.qml index a52b28a6b..fab64e789 100644 --- a/src/ui/toolbar/MainToolBarIndicators.qml +++ b/src/ui/toolbar/MainToolBarIndicators.qml @@ -35,13 +35,13 @@ Row { spacing: tbSpacing * 2 function getSatStrength(hdop) { - if (hdop < 3) + if (hdop <= 1.0) return 100 - if (hdop < 6) + if (hdop <= 1.4) return 75 - if (hdop < 11) + if (hdop <= 1.8) return 50 - if (hdop < 21) + if (hdop <= 3.0) return 25 return 0 } @@ -181,8 +181,8 @@ Row { } } QGCLabel { - text: (activeVehicle && activeVehicle.gps.count.value >= 0) ? activeVehicle.gps.count.valueString : "" - visible: (activeVehicle && activeVehicle.gps.count.value >= 0) + text: activeVehicle ? activeVehicle.gps.hdop.valueString : "" + visible: activeVehicle && !isNaN(activeVehicle.gps.hdop.value) font.pixelSize: tbFontSmall color: colorWhite anchors.top: parent.top -- 2.22.0