1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
| package com.flightfeather.uav.socket.eunm
|
| /**
| * 走航监测设备类型
| */
| enum class UWDeviceType(val value: String, val des: String) {
| UAV("0b", "无人机设备"),
| VEHICLE("0a", "车载设备"),
| BOAT("0c", "无人船设备"),
| GRID("0d", "网格化设备");
|
| companion object {
| /**
| * 根据设备编号获取设备类型
| */
| fun getType(deviceCode: String?): UWDeviceType? = fromValue(deviceCode?.substring(0, 2))
|
| fun fromValue(value: String?): UWDeviceType? = when (value) {
| UAV.value -> UAV
| VEHICLE.value -> VEHICLE
| BOAT.value -> BOAT
| GRID.value -> GRID
| else -> null
| }
| }
| }
|
|