Browse Source

Merge pull request #2900 from DonLakeFlyer/GPSIndicator

Update gps indicator to hdop, new hdop boundaries
QGC4.4
Don Gagne 9 years ago
parent
commit
07aed8ffc4
  1. 4
      src/Vehicle/Vehicle.cc
  2. 6
      src/ui/toolbar/MainToolBar.qml
  3. 12
      src/ui/toolbar/MainToolBarIndicators.qml

4
src/Vehicle/Vehicle.cc

@ -1283,6 +1283,10 @@ VehicleGPSFactGroup::VehicleGPSFactGroup(QObject* parent) @@ -1283,6 +1283,10 @@ VehicleGPSFactGroup::VehicleGPSFactGroup(QObject* parent)
_addFact(&_courseOverGroundFact, _courseOverGroundFactName);
_addFact(&_lockFact, _lockFactName);
_addFact(&_countFact, _countFactName);
_hdopFact.setRawValue(std::numeric_limits<float>::quiet_NaN());
_vdopFact.setRawValue(std::numeric_limits<float>::quiet_NaN());
_courseOverGroundFact.setRawValue(std::numeric_limits<float>::quiet_NaN());
}
void VehicleGPSFactGroup::setVehicle(Vehicle* vehicle)

6
src/ui/toolbar/MainToolBar.qml

@ -243,7 +243,7 @@ Rectangle { @@ -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 { @@ -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 { @@ -259,7 +259,7 @@ Rectangle {
color: colorWhite
}
QGCLabel {
text: activeVehicle ? activeVehicle.gps.courseOverGround.valueString : "N/A"
text: activeVehicle ? activeVehicle.gps.courseOverGround.valueString : "--.--"
color: colorWhite
}
}

12
src/ui/toolbar/MainToolBarIndicators.qml

@ -35,13 +35,13 @@ Row { @@ -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 { @@ -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

Loading…
Cancel
Save