From f3d38d729f05e11aa067bb0737c3aeb828a70947 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Mon, 8 May 2023 19:12:51 -0700 Subject: [PATCH] Additional 45 second intervals Add Noisy Environment badge on node details if (node.rssi > -115) && (node.snr <= -13) --- Meshtastic/Enums/IntervalEnums.swift | 6 +++++ .../Views/Helpers/Node/NodeInfoView.swift | 27 +++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/Meshtastic/Enums/IntervalEnums.swift b/Meshtastic/Enums/IntervalEnums.swift index aee8d0f0..68bdf882 100644 --- a/Meshtastic/Enums/IntervalEnums.swift +++ b/Meshtastic/Enums/IntervalEnums.swift @@ -54,6 +54,7 @@ enum SenderIntervals: Int, CaseIterable, Identifiable { case off = 0 case fifteenSeconds = 15 case thirtySeconds = 30 + case fortyFiveSeconds = 45 case oneMinute = 60 case fiveMinutes = 300 case tenMinutes = 600 @@ -70,6 +71,8 @@ enum SenderIntervals: Int, CaseIterable, Identifiable { return "interval.fifteen.seconds".localized case .thirtySeconds: return "interval.thirty.seconds".localized + case .fortyFiveSeconds: + return "interval.fortyfive.seconds".localized case .oneMinute: return "interval.one.minute".localized case .fiveMinutes: @@ -91,6 +94,7 @@ enum UpdateIntervals: Int, CaseIterable, Identifiable { case tenSeconds = 10 case fifteenSeconds = 15 case thirtySeconds = 30 + case fortyFiveSeconds = 45 case oneMinute = 60 case twoMinutes = 120 case fiveMinutes = 300 @@ -120,6 +124,8 @@ enum UpdateIntervals: Int, CaseIterable, Identifiable { return "interval.fifteen.seconds".localized case .thirtySeconds: return "interval.thirty.seconds".localized + case .fortyFiveSeconds: + return "interval.fortyfive.seconds".localized case .oneMinute: return "interval.one.minute".localized case .twoMinutes: diff --git a/Meshtastic/Views/Helpers/Node/NodeInfoView.swift b/Meshtastic/Views/Helpers/Node/NodeInfoView.swift index a829d27e..818e0d51 100644 --- a/Meshtastic/Views/Helpers/Node/NodeInfoView.swift +++ b/Meshtastic/Views/Helpers/Node/NodeInfoView.swift @@ -41,7 +41,7 @@ struct NodeInfoView: View { Text(String(hwModelString)) .foregroundColor(.gray) - .font(.largeTitle).fixedSize() + .font(.title).fixedSize() } } @@ -59,7 +59,19 @@ struct NodeInfoView: View { .font(.largeTitle) .foregroundColor(.gray) .fixedSize() + + if (node.rssi > -115) && (node.snr <= -13) { + Image(systemName: "waveform.slash") + .font(.title) + .foregroundColor(.orange) + .symbolRenderingMode(.hierarchical) + Text("Noisy Environment") + .font(.title3) + .foregroundColor(.orange) + .multilineTextAlignment(.center) + } } + } let deviceMetrics = node.telemetries?.filtered(using: NSPredicate(format: "metricsType == 0")) if deviceMetrics?.count ?? 0 >= 1 { @@ -152,7 +164,7 @@ struct NodeInfoView: View { .frame(width: 75, height: 75) .cornerRadius(5) Text(String(node.user!.hwModel ?? "unset".localized)) - .font(.callout).fixedSize() + .font(.caption).fixedSize() } } @@ -169,6 +181,17 @@ struct NodeInfoView: View { .font(.title2) .foregroundColor(.gray) .fixedSize() + + if (node.rssi > -115) && (node.snr <= -13) { + Image(systemName: "waveform.slash") + .font(.callout) + .foregroundColor(.orange) + .symbolRenderingMode(.hierarchical) + Text("Noisy Environment") + .font(.caption2) + .multilineTextAlignment(.center) + .foregroundColor(.orange) + } } }