package com.sw.mes.enumvalue;

import com.sw.mes.core.enums.EnumValue;
import lombok.Getter;

import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

public class EnumValuesEap {

    /**
     * 信号来源
     */
    @Getter
    public enum SignalSource implements EnumValue.KeyValueInt {
        PC(1, "PC"),
        EAP(2, "EAP");

        private SignalSource(int key, String value) {
            this.key = key;
            this.value = value;
        }

        public static String getText(int value) {
            SignalSource[] businessModeEnums = values();
            for (SignalSource businessModeEnum : businessModeEnums) {
                if (businessModeEnum.getKey() == value) {
                    return businessModeEnum.getValue();
                }
            }
            return null;
        }

        private int key;
        private String value;
        public static SignalSource getEnum(int value) {
            SignalSource[] businessModeEnums = values();
            for (SignalSource businessModeEnum : businessModeEnums) {
                if (businessModeEnum.getKey() == value) {
                    return businessModeEnum;
                }
            }
            return null;
        }
    }

    /**
     * eap信号类型
     */
    @Getter
    public enum EapSignalType implements EnumValue.KeyValueInt {
        取段结晶(1, "取段结晶"), 熔料(2, "熔料"), 开炉(3, "开炉"), 停炉(4, "停炉")
        , 抽真空(5, "抽真空"), 取段稳温(6, "取段稳温"), 焖锅漏硅(7, "焖锅漏硅"), 备料(8, "备料")
        ,预装料(9, "预装料");

        private EapSignalType(int key, String value) {
            this.key = key;
            this.value = value;
        }

        public static String getText(int value) {
            EapSignalType[] businessModeEnums = values();
            for (EapSignalType businessModeEnum : businessModeEnums) {
                if (businessModeEnum.getKey() == value) {
                    return businessModeEnum.getValue();
                }
            }
            return null;
        }

        private int key;
        private String value;
        public static EapSignalType getEnum(int value) {
            EapSignalType[] businessModeEnums = values();
            for (EapSignalType businessModeEnum : businessModeEnums) {
                if (businessModeEnum.getKey() == value) {
                    return businessModeEnum;
                }
            }
            return null;
        }
    }
}
