Skip to content

Commit

Permalink
Move gps debug data to debug only view
Browse files Browse the repository at this point in the history
  • Loading branch information
garthvh committed Jul 9, 2024
1 parent 71d0ff5 commit 8c4d133
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 42 deletions.
3 changes: 0 additions & 3 deletions Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -18604,9 +18604,6 @@
},
"Sats" : {

},
"Sats %lld" : {

},
"Sats Estimate %lld" : {

Expand Down
9 changes: 9 additions & 0 deletions Meshtastic/Views/Settings/AppData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -47,7 +54,9 @@ struct AppData: View {
.buttonStyle(.bordered)
.buttonBorderShape(.capsule)
.controlSize(.large)
Divider()
}

List(files, id: \.self) { file in
HStack {
VStack(alignment: .leading ) {
Expand Down
39 changes: 0 additions & 39 deletions Meshtastic/Views/Settings/AppSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down

0 comments on commit 8c4d133

Please sign in to comment.