Meshtastic-Apple/Meshtastic/Enums/PositionConfigEnums.swift

87 lines
1.8 KiB
Swift
Raw Permalink Normal View History

//
// GpsFormats.swift
// Meshtastic
//
// Copyright(c) Garth Vander Houwen 8/20/22.
//
import Foundation
import MeshtasticProtobufs
enum GpsUpdateIntervals: Int, CaseIterable, Identifiable {
case thirtySeconds = 30
case oneMinute = 60
2024-03-27 16:06:24 -07:00
case twoMinutes = 120
case fiveMinutes = 300
case tenMinutes = 600
case fifteenMinutes = 900
case thirtyMinutes = 1800
case oneHour = 3600
case sixHours = 21600
case twelveHours = 43200
case twentyFourHours = 86400
case maxInt32 = 2147483647
var id: Int { self.rawValue }
var description: String {
switch self {
case .thirtySeconds:
2025-05-07 23:09:50 -07:00
return "Thirty Seconds".localized
case .oneMinute:
2025-05-07 23:09:50 -07:00
return "One Minute".localized
2024-03-27 16:06:24 -07:00
case .twoMinutes:
2025-05-07 23:09:50 -07:00
return "Two Minutes".localized
case .fiveMinutes:
2025-05-07 23:09:50 -07:00
return "Five Minutes".localized
case .tenMinutes:
2025-05-07 23:09:50 -07:00
return "Ten Minutes".localized
case .fifteenMinutes:
2025-05-07 23:09:50 -07:00
return "Fifteen Minutes".localized
case .thirtyMinutes:
2025-05-07 23:09:50 -07:00
return "Thirty Minutes".localized
case .oneHour:
2025-05-07 23:09:50 -07:00
return "One Hour".localized
case .sixHours:
2025-05-07 23:09:50 -07:00
return "Six Hours".localized
case .twelveHours:
2025-05-07 23:09:50 -07:00
return "Twelve Hours".localized
case .twentyFourHours:
2025-05-07 23:09:50 -07:00
return "Twenty Four Hours".localized
case .maxInt32:
2025-05-07 23:09:50 -07:00
return "On Boot Only".localized
}
}
}
enum GpsMode: Int, CaseIterable, Equatable {
case enabled = 1
case disabled = 0
case notPresent = 2
var id: Int { self.rawValue }
var description: String {
switch self {
case .disabled:
2025-04-27 09:32:59 -07:00
return "Disabled".localized
case .enabled:
2025-04-27 15:15:39 -07:00
return "Enabled".localized
case .notPresent:
2025-04-27 09:57:49 -07:00
return "Not Present".localized
}
}
func protoEnumValue() -> Config.PositionConfig.GpsMode {
switch self {
case .enabled:
return Config.PositionConfig.GpsMode.enabled
case .disabled:
return Config.PositionConfig.GpsMode.disabled
case .notPresent:
return Config.PositionConfig.GpsMode.notPresent
}
}
}