From ffadc8c0bf9b71d450bc3eb6144b9f0f51d4c3f0 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Tue, 24 Sep 2024 17:17:42 -0700 Subject: [PATCH] Hook up the wheel of traceroutes --- Localizable.xcstrings | 3 -- Meshtastic/Resources/DeviceHardware.json | 16 ++++++++ Meshtastic/Views/Nodes/TraceRouteLog.swift | 46 +++++++--------------- 3 files changed, 31 insertions(+), 34 deletions(-) diff --git a/Localizable.xcstrings b/Localizable.xcstrings index 78871f94..95809869 100644 --- a/Localizable.xcstrings +++ b/Localizable.xcstrings @@ -15,9 +15,6 @@ }, " 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/Resources/DeviceHardware.json b/Meshtastic/Resources/DeviceHardware.json index cbad8df9..eaf5db0b 100644 --- a/Meshtastic/Resources/DeviceHardware.json +++ b/Meshtastic/Resources/DeviceHardware.json @@ -391,6 +391,22 @@ "activelySupported": true, "displayName": "Heltec Vision Master E290" }, + { + "hwModel": 69, + "hwModelSlug": "HELTEC_MESH_NODE_T114", + "platformioTarget": "heltec-mesh-node-t114", + "architecture": "nrf52840", + "activelySupported": false, + "displayName": "Heltec Mesh Node T114" + }, + { + "hwModel": 70, + "hwModelSlug": "SENSECAP_INDICATOR", + "platformioTarget": "seeed-sensecap-indicator", + "architecture": "esp32-s3", + "activelySupported": true, + "displayName": "SenseCAP Indicator" + }, { "hwModel": 71, "hwModelSlug": "TRACKER_T1000_E", diff --git a/Meshtastic/Views/Nodes/TraceRouteLog.swift b/Meshtastic/Views/Nodes/TraceRouteLog.swift index 0b385205..c2a32870 100644 --- a/Meshtastic/Views/Nodes/TraceRouteLog.swift +++ b/Meshtastic/Views/Nodes/TraceRouteLog.swift @@ -26,16 +26,10 @@ 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() - 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 + var modemPreset: ModemPresets = ModemPresets(rawValue: UserDefaults.modemPreset) ?? ModemPresets.longFast + @State private var indexes: Int = 0 @State var angle: Angle = .zero - //@State var radius: CGFloat = 175.00 @State var animation: Animation? var body: some View { @@ -99,6 +93,7 @@ struct TraceRouteLog: View { // Set the view rotation animation after the view appeared, // to avoid animating initial rotation DispatchQueue.main.async { + indexes = (selectedRoute?.hops?.array.count ?? 0) * 2 animation = .easeInOut(duration: 1.0) withAnimation(.easeInOut(duration: 2.0)) { angle = (angle == .degrees(-90) ? .degrees(-90) : .degrees(-90)) @@ -181,39 +176,28 @@ struct TraceRouteLog: View { }) } @ViewBuilder func contents(animation: Animation? = nil) -> some View { - ForEach(0..