Add MQTT to trace route string

This commit is contained in:
Garth Vander Houwen 2024-02-27 21:16:44 -08:00
parent b2d034ecfc
commit e59df5f486
2 changed files with 11 additions and 9 deletions

View file

@ -676,7 +676,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
if hopNode != nil {
hopNodes.append(traceRouteHop)
}
routeString += "\(hopNode?.user?.longName ?? "unknown".localized) --> "
routeString += "\(hopNode?.user?.longName ?? "unknown".localized) \(hopNode?.viaMqtt ?? false ? "MQTT" : "") --> "
}
routeString += traceRoute?.node?.user?.longName ?? "unknown".localized
traceRoute?.routeText = routeString

View file

@ -100,6 +100,15 @@ struct NodeMapSwiftUI: View {
ForEach(positionArray, id: \.id) { position in
let pf = PositionFlags(rawValue: Int(position.nodePosition?.metadata?.positionFlags ?? 771))
let headingDegrees = Angle.degrees(Double(position.heading))
/// Reduced Precision Map Circle
if position.latest && 11...16 ~= position.precisionBits {
let pp = PositionPrecision(rawValue: Int(position.precisionBits))
let radius : CLLocationDistance = pp?.precisionMeters ?? 0
if radius > 0.0 {
MapCircle(center: position.coordinate, radius: radius)
.foregroundStyle(Color(nodeColor).opacity(0.25))
}
}
Annotation(position.latest ? node.user?.shortName ?? "?": "", coordinate: position.coordinate) {
LazyVStack {
if position.latest {
@ -256,7 +265,7 @@ struct NodeMapSwiftUI: View {
if node.positions?.count ?? 0 > 1 {
position = .automatic
} else {
position = .camera(MapCamera(centerCoordinate: mostRecent!.coordinate, distance: 150, heading: 0, pitch: 60))
position = .camera(MapCamera(centerCoordinate: mostRecent!.coordinate, distance: 5000, heading: 0, pitch: 60))
}
if self.scene == nil {
Task {
@ -322,13 +331,6 @@ struct NodeMapSwiftUI: View {
.foregroundColor(.accentColor)
.buttonStyle(.borderedProminent)
}
#if targetEnvironment(macCatalyst)
/// Hide non fuctional catalyst controls
// MapZoomStepper(scope: mapScope)
// .mapControlVisibility(.visible)
// MapPitchSlider(scope: mapScope)
// .mapControlVisibility(.visible)
#endif
}
.controlSize(.regular)
.padding(5)