package com.gyee.alarm.model.vo;

public enum StatusDetailValue {
    //0	待机
    //1	手动停机
    //2	正常发电
    //3	发电降出力
    //4	故障
    //5	故障受累
    //6	检修
    //7	检修受累
    //8	限电降出力
    //9	限电停机
    //10	电网受累
    //11	环境受累
    //12	通讯中断
    //13	设备离线


    DJ(0.0, "待机"),
    SDTJ(1.0, "手动停机"),
    ZCFD(2.0, "正常发电"),
    FDJCL(3.0, "发电降出力"),
    GZ(4.0, "故障"),
    GZSL(5.0, "故障受累"),
    JX(6.0, "检修"),
    JXSL(7.0, "检修受累"),
    XDJCL(8.0, "限电降出力"),
    XDTJ(9.0, "限电停机"),
    DWSL(10.0, "电网受累"),
    HJSL(11.0, "环境受累"),
    TXZD(12.0, "通讯中断"),
    SBLX(13.0, "设备离线");

    private Double code;
    private String name;

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

    StatusDetailValue(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 (StatusDetailValue ele : values()) {
            if (ele.getCode().equals(code)) {
                return ele.getName();
            }
        }
        return null;
    }


}
