Meshtastic-Apple/Meshtastic/Enums/PositionConfigEnums.swift

83 lines
1.9 KiB
Swift
Raw Normal View History

//
// GpsFormats.swift
// Meshtastic
//
// Copyright(c) Garth Vander Houwen 8/20/22.
//
import Foundation
enum GpsFormats: Int, CaseIterable, Identifiable {
case gpsFormatDec = 0
case gpsFormatDms = 1
case gpsFormatUtm = 2
case gpsFormatMgrs = 3
case gpsFormatOlc = 4
case gpsFormatOsgr = 5
var id: Int { self.rawValue }
var description: String {
2023-03-06 13:26:04 -08:00
switch self {
case .gpsFormatDec:
return "gpsformat.dec".localized
2023-03-06 13:26:04 -08:00
case .gpsFormatDms:
return "gpsformat.dms".localized
2023-03-06 13:26:04 -08:00
case .gpsFormatUtm:
return "gpsformat.utm".localized
2023-03-06 13:26:04 -08:00
case .gpsFormatMgrs:
return "gpsformat.mgrs".localized
2023-03-06 13:26:04 -08:00
case .gpsFormatOlc:
return "gpsformat.olc".localized
2023-03-06 13:26:04 -08:00
case .gpsFormatOsgr:
return "gpsformat.osgr".localized
}
}
func protoEnumValue() -> Config.DisplayConfig.GpsCoordinateFormat {
2023-03-06 10:33:18 -08:00
switch self {
2023-03-06 10:33:18 -08:00
case .gpsFormatDec:
2022-09-07 22:33:44 -07:00
return Config.DisplayConfig.GpsCoordinateFormat.dec
case .gpsFormatDms:
2022-09-07 22:33:44 -07:00
return Config.DisplayConfig.GpsCoordinateFormat.dms
case .gpsFormatUtm:
2022-09-07 22:33:44 -07:00
return Config.DisplayConfig.GpsCoordinateFormat.utm
case .gpsFormatMgrs:
2022-09-07 22:33:44 -07:00
return Config.DisplayConfig.GpsCoordinateFormat.mgrs
case .gpsFormatOlc:
2022-09-07 22:33:44 -07:00
return Config.DisplayConfig.GpsCoordinateFormat.olc
case .gpsFormatOsgr:
2022-09-07 22:33:44 -07:00
return Config.DisplayConfig.GpsCoordinateFormat.osgr
}
}
}
enum GpsAttemptTimes: Int, CaseIterable, Identifiable {
case fifteenMinutes = 900
case thirtyMinutes = 1800
case oneHour = 3600
2022-09-01 19:00:41 -07:00
case sixHours = 21600
case twelveHours = 43200
case twentyFourHours = 86400
var id: Int { self.rawValue }
var description: String {
2023-03-06 13:26:04 -08:00
switch self {
case .fifteenMinutes:
return "interval.fifteen.minutes".localized
2023-03-06 13:26:04 -08:00
case .thirtyMinutes:
return "interval.thirty.minutes".localized
2023-03-06 13:26:04 -08:00
case .oneHour:
return "interval.one.hour".localized
2023-03-06 13:26:04 -08:00
case .sixHours:
return "interval.six.hours".localized
2023-03-06 13:26:04 -08:00
case .twelveHours:
return "interval.twelve.hours".localized
2023-03-06 13:26:04 -08:00
case .twentyFourHours:
return "interval.twentyfour.hours".localized
}
}
}