Clean up sats in view estimates

This commit is contained in:
Garth Vander Houwen 2022-10-04 18:47:12 -07:00
parent e095e053a5
commit 850fda3b2e
2 changed files with 11 additions and 5 deletions

View file

@ -54,12 +54,19 @@ class LocationHelper: NSObject, ObservableObject {
static var satsInView: Int {
var sats = 0
// If we have a position we have a sat
var sats = 1
if shared.locationManager.location?.verticalAccuracy ?? 0 > 0 {
sats = 4
if 0...60 ~= shared.locationManager.location?.horizontalAccuracy ?? 0{
if 0...15 ~= shared.locationManager.location?.horizontalAccuracy ?? 0{
sats = 12
} else if 16...30 ~= shared.locationManager.location?.horizontalAccuracy ?? 0{
sats = 10
} else if 31...45 ~= shared.locationManager.location?.horizontalAccuracy ?? 0{
sats = 8
} else if 46...60 ~= shared.locationManager.location?.horizontalAccuracy ?? 0{
sats = 6
}

View file

@ -125,11 +125,10 @@ struct PositionLog: View {
if clearPositions(destNum: node.num, context: context) {
print("Clear Position Log Failed")
print("Successfully Cleared Position Log")
} else {
print("Clear Position Log Failed")
}
}
}