package com.zy.core.model.protocol;
|
|
import com.zy.core.enums.CrnModeType;
|
import com.zy.core.enums.CrnStatusType;
|
import lombok.Data;
|
|
/**
|
* Created by vincent on 2020/8/7
|
*/
|
@Data
|
public class CrnProtocol {
|
|
/**
|
* 1 = 手动模式
|
* 2 = 自动模式
|
* 3 = 电脑模式
|
* 4 = 手动模式启动中
|
* 5 = 自动模式启动中
|
* 6 = 电脑模式启动中
|
*/
|
public short mode;
|
|
public CrnModeType modeType;
|
|
/**
|
* 1 = 急停
|
*/
|
public short eStop;
|
|
/**
|
* 异常码
|
*/
|
public short alarm;
|
|
/**
|
* 任务号
|
*/
|
public short taskNo;
|
|
/**
|
* 堆垛机当前状态
|
* 0 = 未知
|
* 1 = 空闲
|
* 2 = 检查任务数据
|
* 3 = 定位到取货位
|
* 7 = 取货完成
|
* 8 = 等待调度柜允许
|
* 9 = 移动到放货位置
|
* 10 = 放货中
|
* 13 = 搬运完成
|
* 14 = 空载避让
|
* 15 = 检查任务数据
|
* 20 = 检查源位置
|
* 21 = 检查目标位置
|
* 50 = 移动任务
|
* 98 = 任务完成,wcs未确认
|
* 99 = 报警
|
*/
|
public short status;
|
|
/**
|
* 状态枚举
|
*/
|
public CrnStatusType statusType;
|
|
/**
|
* 堆垛机当前列号
|
*/
|
public short bay;
|
|
/**
|
* 堆垛机当前层号
|
*/
|
public short level;
|
|
/**
|
* 当前货叉位置
|
* 0 = 货叉原位
|
* 1 = 货叉在左侧
|
* 2 = 货叉在右侧
|
*/
|
public short forkPos;
|
|
/**
|
* 当前载货台位置
|
* 0 = 下定位
|
* 1 = 上定位
|
*/
|
public short liftPos;
|
|
/**
|
* 走行在定位
|
* 0 = 在定位
|
* 1 = 不在定位
|
*/
|
public short walkPos;
|
|
/**
|
* 堆垛机任务完成
|
*/
|
public short taskFinish;
|
|
/**
|
* 载货台有物
|
*/
|
public short loaded;
|
|
/**
|
* 堆垛机累计走行距离
|
*/
|
public int xDistance;
|
|
/**
|
* 堆垛机累计升降距离
|
*/
|
public int yDistance;
|
|
/**
|
* 堆垛机累计运行时长
|
*/
|
public int duration;
|
|
public void setMode(Short mode) {
|
this.mode = mode;
|
this.modeType = CrnModeType.get(mode);
|
}
|
|
public void setMode(CrnModeType type) {
|
this.modeType = type;
|
this.mode = CrnModeType.get(type).id.shortValue();
|
}
|
|
public void setStatus(Short status){
|
this.status = status;
|
this.statusType = CrnStatusType.get(status);
|
}
|
|
public void setStatus(CrnStatusType type){
|
this.statusType = type;
|
this.status = CrnStatusType.get(type).id.shortValue();
|
}
|
|
}
|