mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Add tdeck SVG
This commit is contained in:
parent
940be1e88d
commit
0b61527112
4 changed files with 65 additions and 4 deletions
12
Meshtastic/Assets.xcassets/TDECK.imageset/Contents.json
vendored
Normal file
12
Meshtastic/Assets.xcassets/TDECK.imageset/Contents.json
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "t-deck.svg",
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
1
Meshtastic/Assets.xcassets/TDECK.imageset/t-deck.svg
vendored
Normal file
1
Meshtastic/Assets.xcassets/TDECK.imageset/t-deck.svg
vendored
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 23 KiB |
|
|
@ -176,6 +176,54 @@ enum RegionCodes: Int, CaseIterable, Identifiable {
|
|||
return 100
|
||||
}
|
||||
}
|
||||
var isCountry: Bool {
|
||||
switch self {
|
||||
case .unset:
|
||||
return false
|
||||
case .us:
|
||||
return true
|
||||
case .eu433:
|
||||
return false
|
||||
case .eu868:
|
||||
return false
|
||||
case .cn:
|
||||
return true
|
||||
case .jp:
|
||||
return true
|
||||
case .anz:
|
||||
return false
|
||||
case .kr:
|
||||
return true
|
||||
case .tw:
|
||||
return true
|
||||
case .ru:
|
||||
return true
|
||||
case .in:
|
||||
return true
|
||||
case .nz865:
|
||||
return true
|
||||
case .th:
|
||||
return true
|
||||
case .ua433:
|
||||
return true
|
||||
case .ua868:
|
||||
return true
|
||||
case .lora24:
|
||||
return false
|
||||
case .my433:
|
||||
return true
|
||||
case .my919:
|
||||
return true
|
||||
case .sg923:
|
||||
return true
|
||||
case .ph433:
|
||||
return true
|
||||
case .ph868:
|
||||
return true
|
||||
case .ph915:
|
||||
return true
|
||||
}
|
||||
}
|
||||
func protoEnumValue() -> Config.LoRaConfig.RegionCode {
|
||||
|
||||
switch self {
|
||||
|
|
|
|||
|
|
@ -347,8 +347,8 @@ struct MQTTConfig: View {
|
|||
nearbyTopics = []
|
||||
let geocoder = CLGeocoder()
|
||||
if LocationsHandler.shared.locationsArray.count > 0 {
|
||||
let region = RegionCodes(rawValue: Int(node?.loRaConfig?.regionCode ?? 0))?.topic
|
||||
defaultTopic = "msh/" + (region ?? "UNSET")
|
||||
let region = RegionCodes(rawValue: Int(node?.loRaConfig?.regionCode ?? 0))
|
||||
defaultTopic = "msh/" + (region?.topic ?? "UNSET")
|
||||
geocoder.reverseGeocodeLocation(LocationsHandler.shared.locationsArray.first!, completionHandler: {(placemarks, error) in
|
||||
if let error {
|
||||
Logger.services.error("Failed to reverse geocode location: \(error.localizedDescription)")
|
||||
|
|
@ -357,8 +357,8 @@ struct MQTTConfig: View {
|
|||
|
||||
if let placemarks = placemarks, let placemark = placemarks.first {
|
||||
let cc = locale.region?.identifier ?? "UNK"
|
||||
/// Country Topic unless you are US
|
||||
if placemark.isoCountryCode ?? "unknown" != cc {
|
||||
/// Country Topic unless your region is a country
|
||||
if !(region?.isCountry ?? false) {
|
||||
let countryTopic = defaultTopic + "/" + (placemark.isoCountryCode ?? "")
|
||||
if !countryTopic.isEmpty {
|
||||
nearbyTopics.append(countryTopic)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue