package com.inspect.metadata.montdata.montenum;

import lombok.Getter;

@Getter
public enum PatrolDeviceStaDataEnum {
    BatPwr("1", "电池电量低"),
    BatPwr_0("1-0", "正常"),
    BatPwr_1("1-1", "低"),
    CommSta("2", "通信状态异常"),
    CommSta_0("2-0", "正常"),
    CommSta_1("2-1", "异常"),
    UlsonStopErr("3", "超声停障"),
    UlsonStopErr_0("3-0", "正常"),
    UlsonStopErr_1("3-1", "异常"),
    DriveErr("4", "驱动异常"),
    DriveErr_0("4-0", "正常"),
    DriveErr_1("4-1", "异常"),
    FaultAlm("21", "故障报警"),
    FaultAlm_0("21-0", "正常"),
    FaultAlm_1("21-1", "报警"),
    RunState("41", "运行状态"),
    RunState_1("41-1", "空闲状态"),
    RunState_2("41-2", "巡视状态"),
    RunState_3("41-3", "充电状态"),
    RunState_4("41-4", "检修状态"),
    CtlModel("61", "控制模式"),
    CtlModel_1("61-1", "任务模式"),
    CtlModel_2("61-2", "紧急定位模式"),
    CtlModel_3("61-3", "后台遥控模式"),
    CtlModel_4("61-4", "手持遥控模式"),
    CtlStat("81", "控制权状态"),
    CtlStat_0("81-0", "空闲"),
    CtlStat_1("81-1", "获得"),
    RotStat("101", "轮转状态"),
    RotStat_0("101-0", "空闲"),
    RotStat_1("101-1", "值班"),
    FliSta("201", "飞行状态"),
    FliSta_1("201-1", "待命"),
    FliSta_2("201-2", "准备起飞"),
    FliSta_3("201-3", "飞行中"),
    FliSta_4("201-4", "返航"),
    FliSta_5("201-5", "着陆");

    private String typeCode;
    private String targetValue;

    private PatrolDeviceStaDataEnum(String typeCode, String targetValue) {
        this.typeCode = typeCode;
        this.targetValue = targetValue;
    }

    public static String getTargetValueByTypeCode(String typeCode) {
        PatrolDeviceStaDataEnum[] var1 = values();
        int var2 = var1.length;

        for (int var3 = 0; var3 < var2; ++var3) {
            PatrolDeviceStaDataEnum c = var1[var3];
            if (c.typeCode.equals(typeCode)) {
                return c.getTargetValue();
            }
        }

        return null;
    }

    public static String getNameByTypeCode(String typeCode) {
        PatrolDeviceStaDataEnum[] var1 = values();
        int var2 = var1.length;

        for (int var3 = 0; var3 < var2; ++var3) {
            PatrolDeviceStaDataEnum c = var1[var3];
            if (c.typeCode.equals(typeCode)) {
                return c.name();
            }
        }

        return null;
    }

    public static PatrolDeviceStaDataEnum getEnumObjectByTypeCode(String typeCode) {
        PatrolDeviceStaDataEnum[] var1 = values();
        int var2 = var1.length;

        for (int var3 = 0; var3 < var2; ++var3) {
            PatrolDeviceStaDataEnum c = var1[var3];
            if (c.typeCode.equals(typeCode)) {
                return c;
            }
        }

        return null;
    }

    public static void main(String[] args) {
        String a = getNameByTypeCode("1");
        System.out.println(a);
        PatrolDeviceStaDataEnum enumM = getEnumObjectByTypeCode("2");
        System.out.println(enumM.name());
        System.out.println(enumM.getTargetValue());
    }
}
