Additional 45 second intervals

Add Noisy Environment badge on node details if (node.rssi > -115) && (node.snr <= -13)
This commit is contained in:
Garth Vander Houwen 2023-05-08 19:12:51 -07:00
parent 7cc3e2c5e4
commit f3d38d729f
2 changed files with 31 additions and 2 deletions

View file

@ -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:

View file

@ -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)
}
}
}