Handle default hop limit

This commit is contained in:
Garth Vander Houwen 2023-04-22 22:55:58 -07:00
parent 0c9acee6d6
commit 9faead1d6a
2 changed files with 4 additions and 4 deletions

View file

@ -106,7 +106,7 @@ struct DeviceMetricsLog: View {
Text("\(String(format: "%.2f", dm.voltage))")
}
TableColumn("channel.utilization") { dm in
Text(String(format: "%.2f", dm.channelUtilization))
Text("\(String(format: "%.2f", dm.channelUtilization))%")
}
TableColumn("airtime") { dm in
Text("\(String(format: "%.2f", dm.airUtilTx))%")

View file

@ -32,7 +32,7 @@ struct LoRaConfig: View {
@State var hasChanges = false
@State var region: Int = 0
@State var modemPreset = 0
@State var hopLimit = 0
@State var hopLimit = 3
@State var txPower = 0
@State var txEnabled = true
@State var usePreset = true
@ -140,7 +140,7 @@ struct LoRaConfig: View {
Picker("Number of hops", selection: $hopLimit) {
ForEach(1..<8) {
Text("\($0)")
.tag($0 == 3 ? 0 : $0)
.tag($0 == 0 ? 3 : $0)
}
}
.pickerStyle(DefaultPickerStyle())
@ -284,7 +284,7 @@ struct LoRaConfig: View {
}
}
func setLoRaValues() {
self.hopLimit = Int(node?.loRaConfig?.hopLimit ?? 0)
self.hopLimit = Int(node?.loRaConfig?.hopLimit ?? 3)
self.region = Int(node?.loRaConfig?.regionCode ?? 0)
self.usePreset = node?.loRaConfig?.usePreset ?? true
self.modemPreset = Int(node?.loRaConfig?.modemPreset ?? 0)