package com.gyee.alarm.model.vo;

public enum StatusValue {

    //0	待机
    //1	运行
    //2	故障
    //3	检修
    //4	限电
    //5	受累
    //6	离线

    DJ(0.0, "待机"),
    YX(1.0, "运行"),
    GZ(2.0, "故障"),
    JX(3.0, "检修"),
    XD(4.0, "限电"),
    SL(5.0, "受累"),
    LX(6.0, "离线");

    private Double code;
    private String name;

    StatusValue(Double code) {
        this.code = code;
    }

    StatusValue(Double code, String name) {
        this.code = code;
        this.name = name;
    }

    public Double getCode() {
        return code;
    }

    public void setCode(Double code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    /**
     * 根据code获取message
     *
     * @param code
     * @return
     */
    public static String getNmaeByCode(Double code) {
        for (StatusValue ele : values()) {
            if (ele.getCode().equals(code)) {
                return ele.getName();
            }
        }
        return null;
    }


}
