From baaa88dbec1c5f808ab7317cee9f197a810c5871 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Wed, 31 May 2023 21:39:56 -0700 Subject: [PATCH] Properly acknowledge in the environment metrics graph that sometimes Canada is not frozen --- Meshtastic/Views/Messages/UserMessageList.swift | 2 +- Meshtastic/Views/Nodes/EnvironmentMetricsLog.swift | 7 +++++-- Meshtastic/Views/Settings/AdminMessageList.swift | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Meshtastic/Views/Messages/UserMessageList.swift b/Meshtastic/Views/Messages/UserMessageList.swift index edf84dfc..2ad25e52 100644 --- a/Meshtastic/Views/Messages/UserMessageList.swift +++ b/Meshtastic/Views/Messages/UserMessageList.swift @@ -182,7 +182,7 @@ struct UserMessageList: View { if message.realACK { Text("\(ackErrorVal?.display ?? "Empty Ack Error")").font(.caption2).foregroundColor(.gray) } else { - Text("Implicit ACK from Unknown Node").font(.caption2).foregroundColor(.orange) + Text("Implicit ACK from another node").font(.caption2).foregroundColor(.orange) } } else if currentUser && message.ackError == 0 { // Empty Error diff --git a/Meshtastic/Views/Nodes/EnvironmentMetricsLog.swift b/Meshtastic/Views/Nodes/EnvironmentMetricsLog.swift index 2856554d..14a07c1e 100644 --- a/Meshtastic/Views/Nodes/EnvironmentMetricsLog.swift +++ b/Meshtastic/Views/Nodes/EnvironmentMetricsLog.swift @@ -27,7 +27,10 @@ struct EnvironmentMetricsLog: View { let chartData = environmentMetrics .filter { $0.time != nil && $0.time! >= oneWeekAgo! } .sorted { $0.time! < $1.time! } - + let locale = NSLocale.current as NSLocale + let localeUnit = locale.object(forKey: NSLocale.Key(rawValue: "kCFLocaleTemperatureUnitKey")) + var format: UnitTemperature = localeUnit as? String ?? "Celsius" == "Fahrenheit" ? .fahrenheit : .celsius + NavigationStack { if chartData.count > 0 { @@ -69,7 +72,7 @@ struct EnvironmentMetricsLog: View { .chartXAxis(content: { AxisMarks(position: .top) }) - .chartYScale(domain: 0...125) + .chartYScale(domain: format == .celsius ? -20...50 : 0...125) .chartForegroundStyleScale([ "Temperature" : .clear ]) diff --git a/Meshtastic/Views/Settings/AdminMessageList.swift b/Meshtastic/Views/Settings/AdminMessageList.swift index 585e1e60..ea9a8951 100644 --- a/Meshtastic/Views/Settings/AdminMessageList.swift +++ b/Meshtastic/Views/Settings/AdminMessageList.swift @@ -23,6 +23,7 @@ struct AdminMessageList: View { var body: some View { let localeDateFormat = DateFormatter.dateFormat(fromTemplate: "yyMMddjmmssa", options: 0, locale: Locale.current) let dateFormatString = (localeDateFormat ?? "MM/dd/YY j:mm:ss a") + List { if user != nil { @@ -47,7 +48,7 @@ struct AdminMessageList: View { .foregroundColor(am.receivedACK ? .gray : .red) .font(.caption2) } else { - Text("Implicit ACK from Unknown Node") + Text("Implicit ACK from another node") .foregroundColor(.orange) .font(.caption2) }