package com.casic.missiles.modular.system.dto;


public enum DeviceTypeEnum {
    Well("井盖状态监测仪", 1),
    Liquid("液位监测仪", 2),
    WasteGas("有害气体监测仪", 3),
    Methane("燃气智能监测终端", 4),
    TempHumi("温湿度监测仪", 5),
    Dig("开挖监测仪", 6),
    WellLocator("井盖定位监测仪", 7),
    WaterMeter("远传水表", 8),
    CorrEnv("保温层下腐蚀环境监测仪", 9),
    CorrRate("保温层下腐蚀速率监测仪", 10),
    TempPressure("温度压力监测仪", 11),
    FireHydrant("消防栓防盗水监测仪", 12),
    Concentrator("数据集中器", 13),
    Noise("噪声记录仪", 14),
    LG("燃气智能监测终端(一体化)", 15),
    Tube("管盯", 16);

    // 成员变量
    private String name;
    private int index;

    // 构造方法
    private DeviceTypeEnum(String name, int index) {
        this.name = name;
        this.index = index;
    }


    public String getName() {
        return name;
    }

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

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public static DeviceTypeEnum getByIndex(String index) {
        try {
            for (DeviceTypeEnum deviceTypeEnum : values()) {
                if (deviceTypeEnum.index == Integer.parseInt(index)) {
                    return deviceTypeEnum;
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    //覆盖方法
    @Override
    public String toString() {
        return this.name;
    }
}