package com.sw.mes.enumvalue;

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

public class StepEnum {

    /**
     * 任务状态 - 单晶运行工步
     */
    @Getter
    public enum StepNameEnum implements EnumValue.KeyValueInt {
        回熔(0, "回熔"),
        熔断(1, "熔断"),
        进入引晶(2, "进入引晶"),
        引断(3, "引断"),
        进入放肩(4, "进入放肩"),
        放断(5, "放断"),
        吊多晶(6, "吊多晶"),
        断提500(7, "断提<500"),
        断提1000(8, "断提>1000"),
        断提5001000(9, "断提500~1000"),
        拆炉工时(10, "拆炉工时"),
        合炉工时(11, "合炉工时"),
        抽真空(12, "抽真空"),
        调温工时(13, "调温工时"),
        二加工时(14, "二加工时"),
        取棒工时(15, "取棒工时"),
        加料工时(16, "加料工时"),
        拆装工时(17, "拆装工时"),
        放断调温工时(18, "放断调温工时"),
        等断调温工时(19, "等断调温工时"),
        引放工时(20, "引放工时"),
        熔径工时(21, "熔径工时");


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

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

        public static StepNameEnum getEnum(String value) {
            StepNameEnum[] enums = values();
            for (StepNameEnum enumz : enums) {
                if (String.valueOf(enumz.getKey()).equals(value)) {
                    return enumz;
                }
            }
            return null;
        }

        private int key;
        private String value;
    }
}
