package com.wdkl.ncs.android.middleware.tcp.enums;

/**
 * @author wuyunfeng
 * 2021-05-12 09:49
 * 设备类型枚举
 */

public enum DeviceTypeEnum {

    NURSE_HOST(1, "护士主机"),
    DOCTOR_HOST(2, "医生主机"),
    DOOR_DEVICE(3, "门口机"),
    DIGIT_BED_DEVICE(4, "病床分机"),
    LCD_SCREEN(5, "LCD走廊屏"),
    LED_SCREEN(6, "LED点阵屏"),
    NURSE_WATCH(7, "护士移动"),
    WORKER_WATCH(8, "护工移动"),
    USER_WATCH(9, "用户移动"),
    CELL_PHONE(10, "手机App"),
    TRANSFER_DEVICE(11, "总线转换盒"),
    SIMULATE_BED_DEVICE(12, "模拟分机"),
    SIMULATE_EMERGENCY_BUTTON(13, "模拟紧急按钮"),
    SIMULATE_DOOR_LIGHT(14, "模拟门灯"),
    REMOTE_CONTROL(15, "遥控器"),
    BEACON(16, "信标"),
    INFORMATION_BOARD(17, "信息看版"),
    ENTRACE_GUARD(18,"门禁设备"),
    VISITATION(19,"探视机"),
    RS485_TRANSFER(20,"485转换盒"),
    EMERGENCY_BUTTON(21, "紧急按钮"),
    RS485_DEER_DEVICE(22,"485门口分机"),
    ALARM_BODY_INDUCTIVE(23, "红外报警器"),
    ALARM_WATER_OVERFLOW(24, "用水监控器"),
    ALARM_HOUSEHOLD_GAS(25, "家用燃气报警器"),
    ALARM_HOUSEHOLD_SMOKE(26, "家用烟雾报警器"),
    ALARM_BUTTON_SOS(27, "一键报警器"),
    DOOR_LOCK(30, "门磁传感器");
    private int value;
    private String typeName;


    DeviceTypeEnum(int value, String typeName) {
        this.value = value;
        this.typeName = typeName;
    }

    public int value() {
        return this.value;
    }

    public String typeName() {
        return this.typeName;
    }

    /**
     * 通过typeName 转换成枚举
     *
     * @param typeName
     * @return
     */
    public static DeviceTypeEnum parse(String typeName) {
        DeviceTypeEnum[] values = DeviceTypeEnum.values();
        for (DeviceTypeEnum value : values) {
            if (value.typeName().equals(typeName)) {
                return value;
            }
        }
        return null;
    }

    /**
     * 通过value值转换成枚举
     *
     * @param value
     * @return
     */
    public static DeviceTypeEnum parse(int value) {
        DeviceTypeEnum[] values = DeviceTypeEnum.values();
        for (DeviceTypeEnum deviceTypeEnum : values) {
            if (deviceTypeEnum.value() == value) {
                return deviceTypeEnum;
            }
        }
        return null;
    }


}
