mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Move gps debug data to debug only view
This commit is contained in:
parent
71d0ff535a
commit
8c4d1330f4
3 changed files with 9 additions and 42 deletions
|
|
@ -18604,9 +18604,6 @@
|
|||
},
|
||||
"Sats" : {
|
||||
|
||||
},
|
||||
"Sats %lld" : {
|
||||
|
||||
},
|
||||
"Sats Estimate %lld" : {
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,13 @@ struct AppData: View {
|
|||
var body: some View {
|
||||
|
||||
VStack {
|
||||
|
||||
Section(header: Text("phone.gps")) {
|
||||
if #available(iOS 17.0, macOS 14.0, *) {
|
||||
GPSStatus()
|
||||
}
|
||||
}
|
||||
Divider()
|
||||
Button(action: {
|
||||
let container = NSPersistentContainer(name: "Meshtastic")
|
||||
guard let url = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first else {
|
||||
|
|
@ -47,7 +54,9 @@ struct AppData: View {
|
|||
.buttonStyle(.bordered)
|
||||
.buttonBorderShape(.capsule)
|
||||
.controlSize(.large)
|
||||
Divider()
|
||||
}
|
||||
|
||||
List(files, id: \.self) { file in
|
||||
HStack {
|
||||
VStack(alignment: .leading ) {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ struct AppSettings: View {
|
|||
@EnvironmentObject var bleManager: BLEManager
|
||||
@ObservedObject var tileManager = OfflineTileManager.shared
|
||||
@State var totalDownloadedTileSize = ""
|
||||
@StateObject var locationHelper = LocationHelper()
|
||||
@State private var isPresentingCoreDataResetConfirm = false
|
||||
@State private var isPresentingDeleteMapTilesConfirm = false
|
||||
var body: some View {
|
||||
|
|
@ -24,44 +23,6 @@ struct AppSettings: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
Section(header: Text("phone.gps")) {
|
||||
if #available(iOS 17.0, macOS 14.0, *) {
|
||||
GPSStatus()
|
||||
} else {
|
||||
let accuracy = Measurement(value: locationHelper.locationManager.location?.horizontalAccuracy ?? 300, unit: UnitLength.meters)
|
||||
let altitiude = Measurement(value: locationHelper.locationManager.location?.altitude ?? 0, unit: UnitLength.meters)
|
||||
let speed = Measurement(value: locationHelper.locationManager.location?.speed ?? 0, unit: UnitSpeed.kilometersPerHour)
|
||||
HStack {
|
||||
Label("Accuracy \(accuracy.formatted())", systemImage: "scope")
|
||||
.font(.footnote)
|
||||
Label("Sats \(LocationHelper.satsInView)", systemImage: "sparkles")
|
||||
.font(.footnote)
|
||||
}
|
||||
Label("Coordinate \(String(format: "%.5f", locationHelper.locationManager.location?.coordinate.latitude ?? 0)), \(String(format: "%.5f", locationHelper.locationManager.location?.coordinate.longitude ?? 0))", systemImage: "mappin")
|
||||
.font(.footnote)
|
||||
.textSelection(.enabled)
|
||||
if locationHelper.locationManager.location?.verticalAccuracy ?? 0 > 0 {
|
||||
Label("Altitude \(altitiude.formatted())", systemImage: "mountain.2")
|
||||
.font(.footnote)
|
||||
}
|
||||
if locationHelper.locationManager.location?.courseAccuracy ?? 0 > 0 {
|
||||
let degrees = Angle.degrees(locationHelper.locationManager.location?.course ?? 0)
|
||||
Label {
|
||||
let heading = Measurement(value: degrees.degrees, unit: UnitAngle.degrees)
|
||||
Text("Heading: \(heading.formatted(.measurement(width: .narrow)))")
|
||||
} icon: {
|
||||
Image(systemName: "location.north")
|
||||
.symbolRenderingMode(.hierarchical)
|
||||
.rotationEffect(degrees)
|
||||
}
|
||||
.font(.footnote)
|
||||
}
|
||||
if locationHelper.locationManager.location?.speedAccuracy ?? 0 > 0 {
|
||||
Label("Speed \(speed.formatted())", systemImage: "speedometer")
|
||||
.font(.footnote)
|
||||
}
|
||||
}
|
||||
}
|
||||
Section(header: Text("App Data")) {
|
||||
Button {
|
||||
isPresentingCoreDataResetConfirm = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue