From 5d9b25b0aa8762f651a6da85919bfdb4d2714e15 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Sun, 25 Feb 2024 00:36:03 -0800 Subject: [PATCH] Polish up the reduced position accuracy --- Meshtastic/Persistence/UpdateCoreData.swift | 1 + Meshtastic/Views/Nodes/Helpers/Map/NodeMapSwiftUI.swift | 2 +- Meshtastic/Views/Nodes/MeshMap.swift | 2 +- Meshtastic/Views/Settings/Channels.swift | 1 - Meshtastic/Views/Settings/Config/PositionConfig.swift | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Meshtastic/Persistence/UpdateCoreData.swift b/Meshtastic/Persistence/UpdateCoreData.swift index fdf3334c..269cea3c 100644 --- a/Meshtastic/Persistence/UpdateCoreData.swift +++ b/Meshtastic/Persistence/UpdateCoreData.swift @@ -256,6 +256,7 @@ func upsertPositionPacket (packet: MeshPacket, context: NSManagedObjectContext) position.satsInView = Int32(positionMessage.satsInView) position.speed = Int32(positionMessage.groundSpeed * UInt32(3.6)) position.heading = Int32(positionMessage.groundTrack) + position.precisionBits = Int32(positionMessage.precisionBits) if positionMessage.timestamp != 0 { position.time = Date(timeIntervalSince1970: TimeInterval(Int64(positionMessage.timestamp))) } else { diff --git a/Meshtastic/Views/Nodes/Helpers/Map/NodeMapSwiftUI.swift b/Meshtastic/Views/Nodes/Helpers/Map/NodeMapSwiftUI.swift index 62ba5ab9..1ce1c603 100644 --- a/Meshtastic/Views/Nodes/Helpers/Map/NodeMapSwiftUI.swift +++ b/Meshtastic/Views/Nodes/Helpers/Map/NodeMapSwiftUI.swift @@ -106,7 +106,7 @@ struct NodeMapSwiftUI: View { let radius : CLLocationDistance = pp?.precisionMeters ?? 0 if radius > 0.0 { MapCircle(center: position.coordinate, radius: radius) - .foregroundStyle(Color(nodeColor).opacity(0.60)) + .foregroundStyle(Color(nodeColor).opacity(0.25)) } } Annotation(position.latest ? node.user?.shortName ?? "?": "", coordinate: position.coordinate) { diff --git a/Meshtastic/Views/Nodes/MeshMap.swift b/Meshtastic/Views/Nodes/MeshMap.swift index 09e99044..1859993a 100644 --- a/Meshtastic/Views/Nodes/MeshMap.swift +++ b/Meshtastic/Views/Nodes/MeshMap.swift @@ -122,7 +122,7 @@ struct MeshMap: View { let radius : CLLocationDistance = pp?.precisionMeters ?? 0 if radius > 0.0 { MapCircle(center: position.coordinate, radius: radius) - .foregroundStyle(Color(nodeColor).opacity(0.60)) + .foregroundStyle(Color(nodeColor).opacity(0.25)) } } /// Routes diff --git a/Meshtastic/Views/Settings/Channels.swift b/Meshtastic/Views/Settings/Channels.swift index d8bd3818..48c1b7ee 100644 --- a/Meshtastic/Views/Settings/Channels.swift +++ b/Meshtastic/Views/Settings/Channels.swift @@ -335,7 +335,6 @@ struct Channels: View { positionPrecision = 14 } hasChanges = true - } .onChange(of: positionPrecision) { _ in hasChanges = true diff --git a/Meshtastic/Views/Settings/Config/PositionConfig.swift b/Meshtastic/Views/Settings/Config/PositionConfig.swift index 112b7c14..9f96ef8b 100644 --- a/Meshtastic/Views/Settings/Config/PositionConfig.swift +++ b/Meshtastic/Views/Settings/Config/PositionConfig.swift @@ -82,7 +82,7 @@ struct PositionConfig: View { VStack(alignment: .leading) { Picker("Broadcast Interval", selection: $positionBroadcastSeconds) { ForEach(UpdateIntervals.allCases) { at in - if at.rawValue >= 900 { + if at.rawValue >= 300 { Text(at.description) } }