package com.mvc.constant;


public enum DeviceAlarmType {
    NoData_3days("1","连续3天没有收到数据"),
    NoData_today("2","当天没收到数据"),
    /*NoData_num3("3","当天不够三条,有16点"),
    NoData_16hour("4","当天不够三条,没有16点"),//一天一发,不再需要此类型*/
    NoEqual_three("5","数据识别3个值不一致"),
    Time_out30("6","设备工作时间超过30S"),
    Time_out45("7","设备工作时间超过45S"),
    Time_out60("8","设备工作时间超过60S"),
    Multi_Sns("9","多个设备sn对应一个遥测站"),
    error_mapping("10","遥测站台账SN不正确"),
    Low_voltage("11","电压低于3.5V");//2022-11-05 guozhao


    private String flag;
    private String desc;

    DeviceAlarmType(String flag, String desc) {
        this.flag = flag;
        this.desc = desc;
    }

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static  DeviceAlarmType findDeviceAlarmByflag(String flag){
        for (DeviceAlarmType alarmType: DeviceAlarmType.values()) {
            if (alarmType.flag.equals(flag)) {
                return  alarmType;
            }
        }
        return null;
    }
}
