/*
 *  Copyright 2019-2025 Tz
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package me.zhengjie.modules.security.config.enums;

/**
 * PreviousStatus与CurrentStatus定义
 */
public enum CurrentStatusEnum {

	SDCP_MACHINE_STATUS_DEFAULT(-1, "默认/断开"),
	SDCP_MACHINE_STATUS_IDLE(0, "空闲"),
	SDCP_MACHINE_STATUS_PRINTING(1, "执行打印任务中"),
	SDCP_MACHINE_STATUS_PREPARE(2,  "打印准备过程中"), //
	SDCP_MACHINE_STATUS_SPADE(3, "铲件过程中"),
	;

	private Integer code;
	private String text;

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	CurrentStatusEnum(Integer code, String text) {
		this.code = code;
		this.text = text;
	}

	public static CurrentStatusEnum getEnumByNum(int value) {
		for (CurrentStatusEnum os : CurrentStatusEnum.values()) {
			if (value == os.getCode()) {
				return os;
			}
		}
		return null;
	}
}
