From c400a2273a810a05d3bbece96284e3c09f9dd617 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Tue, 24 Sep 2024 16:15:42 -0700 Subject: [PATCH] Leave wheel of traceroute mockup --- Localizable.xcstrings | 3 +++ Meshtastic/Views/Nodes/TraceRouteLog.swift | 29 ++++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Localizable.xcstrings b/Localizable.xcstrings index 95809869..78871f94 100644 --- a/Localizable.xcstrings +++ b/Localizable.xcstrings @@ -15,6 +15,9 @@ }, " Whether or not use INPUT_PULLUP mode for GPIO pin. Only applicable if the board uses pull-up resistors on the pin" : { + }, + "-12dB" : { + }, ": %@" : { diff --git a/Meshtastic/Views/Nodes/TraceRouteLog.swift b/Meshtastic/Views/Nodes/TraceRouteLog.swift index 87e101f1..0b385205 100644 --- a/Meshtastic/Views/Nodes/TraceRouteLog.swift +++ b/Meshtastic/Views/Nodes/TraceRouteLog.swift @@ -26,9 +26,16 @@ struct TraceRouteLog: View { @State var mapStyle: MapStyle = MapStyle.standard(elevation: .realistic, emphasis: MapStyle.StandardEmphasis.muted, pointsOfInterest: .all, showsTraffic: true) @State var position = MapCameraPosition.automatic let distanceFormatter = MKDistanceFormatter() - let modemPreset: ModemPresets = ModemPresets(rawValue: UserDefaults.modemPreset) ?? ModemPresets.longFast + var modemPreset: ModemPresets = ModemPresets(rawValue: UserDefaults.modemPreset) ?? ModemPresets.longFast + + /// Mockup Values + let colors: [Color] = [.yellow, .orange, .red, .pink, .purple, .blue, .cyan, .green] + let nums: [Int64] = [366311664, 0, 3662955168, 0, 3663982804, 0, 4202719792, 0, 603700594, 0, 836212501, 0, 3663116644, 0, 8362955168] + let snr: [Double] = [-115.00, 17.5, 7.0, 8.9, -24.0, 5.5, 6.0, 7.5] + @State private var hops: Int = 16 /// Max of 16 (2 8 hop routes) /// State for the circle of routes @State var angle: Angle = .zero + //@State var radius: CGFloat = 175.00 @State var animation: Animation? var body: some View { @@ -76,7 +83,7 @@ struct TraceRouteLog: View { .font(idiom == .phone ? .headline : .largeTitle) } } - if selectedRoute?.hops?.count ?? 2 > 3 { + if true { // selectedRoute?.hops?.count ?? 2 > 3 { HStack(alignment: .center) { GeometryReader { geometry in let size = ((geometry.size.width >= geometry.size.height ? geometry.size.height : geometry.size.width) / 2) - (idiom == .phone ? 50 : 70) @@ -174,6 +181,24 @@ struct TraceRouteLog: View { }) } @ViewBuilder func contents(animation: Animation? = nil) -> some View { + ForEach(0..