package com.cpp.web.domain.station.enums;

import com.baomidou.mybatisplus.annotation.IEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 设备数据对象类型枚举
 * lastModify
 * 2020.3.26  修唯   枚举名修改，新增发电站类型，删除各种功率，设备数，开机容量等类型
 *
 * @author zzy
 * @version 1.0
 * @since 2019/8/19 8:59
 */
@Getter
@AllArgsConstructor
public enum EquipmentTypeEnum implements IEnum<String> {

    /**
     * 场站也视为设备类型的一种
     */
    POWERSTATION(0, "发电站"),
    WEATHERSTATION(1, "气象站"),
    INVERTER(2, "逆变器"),
    WINDTOWER(3, "测风塔"),
    WINDTURBINE(4, "风机"),
    FORECASTDATA(5, "预测数据"),
    BOOSTERSTATION(6, "主升压变"),
    AGC_AVC(7, "AGC_AVC"),
    BWD(8, "并网点"),
    CYB(9, "厂用变"),
    JDX(10, "集电线"),
    SYZMX(11, "升压站母线"),
    WGBC(12, "无功补偿"),
    DLQ(13, "断路器"),
    DZ(14, "刀闸"),
    JDDZ(15, "接地刀闸"),
    DXFDJ(16, "等效发电机");

    private Integer code;
    private String message;


    public static EquipmentTypeEnum valueOf(Integer code) {
        switch (code) {
            case 0:
                return POWERSTATION;
            case 1:
                return WEATHERSTATION;
            case 2:
                return INVERTER;
            case 3:
                return WINDTOWER;
            case 4:
                return WINDTURBINE;
            case 5:
                return FORECASTDATA;
            case 6:
                return BOOSTERSTATION;
            case 7:
                return AGC_AVC;
            case 8:
                return BWD;
            case 9:
                return CYB;
            case 10:
                return JDX;
            case 11:
                return SYZMX;
            case 12:
                return WGBC;
            case 13:
                return DLQ;
            case 14:
                return DZ;
            case 15:
                return JDDZ;
            case 16:
                return DXFDJ;
            default:
                return null;
        }
    }

    @Override
    public String getValue() {
        return this.name();
    }
}
