package com.njcn.process.enums;

import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * 指标参数类型枚举
 */
@Getter
public enum SteadyIndicatorEnum {

    Negative_Voltage("phase_Voltage", "负序电压不平衡度超标"),
    Interhar_Voltage("Interharmonic_Voltage", "间谐波电压超标"),
    Neg_Current("Neg_Current", "负序电流超标"),
    Fre_Deviation("Frequency_Dev", "频率偏差超标"),
    Voltage_Dev("Voltage_Dev", "电压偏差超标"),
    Har_Current("Harmonic_Current", "谐波电流超标"),
    Voltage_Fluc("Flicker", "电压波动与闪变超标"),
    Har_Voltage("Harmonic_Voltage", "谐波电压超标"),

    Thd_V("Thd_V","电压总谐波畸变率")


            ;

    private final String code;

    private final String message;

    SteadyIndicatorEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public static SteadyIndicatorEnum getSteadyIndicatorEnumByCode(String code) {
        for (SteadyIndicatorEnum steadyIndicatorEnum : SteadyIndicatorEnum.values()) {
            if (StringUtils.equals(code, steadyIndicatorEnum.getCode())) {
                return steadyIndicatorEnum;
            }
        }
        return null;
    }
}
