package com.zy.core.model.protocol;
|
|
import com.zy.core.enums.CrnForkPosType;
|
import com.zy.core.enums.CrnLiftPosType;
|
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 = 电脑模式
|
*/
|
public Short mode;
|
|
public CrnModeType modeType;
|
|
/**
|
* 1 = 急停
|
*/
|
public Short eStop;
|
|
/**
|
* 异常码
|
*/
|
public Short alarm;
|
|
/**
|
* 任务号
|
*/
|
public Short taskNo = 0;
|
|
/**
|
* 堆垛机当前状态
|
* 0:空闲,无任务
|
* 1:取货定位中
|
* 2:取货中
|
* 3:取货完成,放货定位中
|
* 4:放货中
|
* 5:回原点中
|
* 6:反原点
|
* 7:库位移位
|
* 90:任务完成等待WCS确认
|
* 99:报警
|
*/
|
public Short status;
|
|
/**
|
* 状态枚举
|
*/
|
public CrnStatusType statusType;
|
|
/**
|
* 堆垛机当前列号
|
*/
|
public Short bay;
|
|
/**
|
* 堆垛机当前层号
|
*/
|
public Short level;
|
|
/**
|
* 当前货叉位置
|
* 0 = 货叉原位
|
* 1 = 货叉在左侧
|
* 2 = 货叉在右侧
|
*/
|
public Short forkPos;
|
|
public CrnForkPosType forkPosType;
|
|
/**
|
* 当前载货台位置
|
* 0 = 下定位
|
* 1 = 上定位
|
*/
|
public Short liftPos;
|
|
public CrnLiftPosType liftPosType;
|
|
/**
|
* 走行在定位
|
* 0 = 在定位
|
* 1 = 不在定位
|
*/
|
public Short walkPos;
|
|
/**
|
* 堆垛机任务完成
|
*/
|
public Short taskFinish;
|
|
/**
|
* 载货台有物
|
*/
|
public Short loaded;
|
|
/**
|
* 异常码(数值显示)
|
*/
|
private Short alarm1;
|
|
/**
|
* 异常1
|
*/
|
private boolean[] error1;
|
|
private CrnError1 crnError1;
|
|
/**
|
* 异常2
|
*/
|
private boolean[] error2;
|
|
private CrnError2 crnError2;
|
|
/**
|
* 保留
|
*/
|
private Short temp1;
|
|
/**
|
* X行走线速度m/min
|
*/
|
private Float xSpeed;
|
|
/**
|
* Y行走线速度m/min
|
*/
|
private Float ySpeed;
|
|
/**
|
* Z行走线速度m/min
|
*/
|
private Float zSpeed;
|
|
/**
|
* 堆垛机累计走行距离km
|
*/
|
public Float xDistance;
|
|
/**
|
* 堆垛机累计升降距离km
|
*/
|
public Float yDistance;
|
|
/**
|
* 堆垛机累计走行时长h
|
*/
|
public Float xDuration;
|
|
/**
|
* 堆垛机累计升降时长h
|
*/
|
public Float yDuration;
|
|
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 setForkPos(Short forkPos) {
|
this.forkPos = forkPos;
|
this.forkPosType = CrnForkPosType.get(forkPos);
|
}
|
|
public void setForkPos(CrnForkPosType type) {
|
this.forkPosType = type;
|
this.forkPos = CrnForkPosType.get(type).id.shortValue();
|
}
|
|
public void setLiftPos(Short liftPos) {
|
this.liftPos = liftPos;
|
this.liftPosType = CrnLiftPosType.get(liftPos);
|
}
|
|
public void setLiftPos(CrnLiftPosType type) {
|
this.liftPosType = type;
|
this.liftPos = CrnLiftPosType.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();
|
}
|
|
public void setError1(boolean[] error1){
|
this.error1 = error1;
|
this.crnError1 = new CrnError1();
|
this.crnError1.stop = error1[0];
|
this.crnError1.xCoverErr = error1[1];
|
this.crnError1.yCoverErr = error1[2];
|
this.crnError1.zCoverErr = error1[3];
|
this.crnError1.rangeErr = error1[4];
|
this.crnError1.barcodeErr = error1[5];
|
this.crnError1.xFrontLimitErr = error1[6];
|
this.crnError1.xBackLimitErr = error1[7];
|
this.crnError1.yUpLimitErr = error1[8];
|
this.crnError1.yDownLimitErr = error1[9];
|
this.crnError1.zLeftLimitErr = error1[10];
|
this.crnError1.zRightLimitErr = error1[11];
|
this.crnError1.xLocationUpErr = error1[12];
|
this.crnError1.xLocationDownErr = error1[13];
|
this.crnError1.yLocationUpErr = error1[14];
|
this.crnError1.yLocationDownErr = error1[15];
|
}
|
|
public void setError2(boolean[] error2){
|
this.error2 = error2;
|
this.crnError2 = new CrnError2();
|
this.crnError2.zLocationUpErr = error2[0];
|
this.crnError2.zLocationDownErr = error2[1];
|
this.crnError2.wcsCommandErr = error2[2];
|
this.crnError2.leftWidthLimitErr = error2[3];
|
this.crnError2.rightWidthLimitErr = error2[4];
|
this.crnError2.leftLengthLimitErr = error2[5];
|
this.crnError2.rightLengthLimitErr = error2[6];
|
this.crnError2.highLimitErr = error2[7];
|
this.crnError2.leftTakeNoneErr = error2[8];
|
this.crnError2.rightTakeNoneErr = error2[9];
|
this.crnError2.leftPutLoadErr = error2[10];
|
this.crnError2.rightPutLoadErr = error2[11];
|
this.crnError2.startErr = error2[12];
|
this.crnError2.looseRopeErr = error2[13];
|
this.crnError2.safeDoorSwitchErr = error2[14];
|
this.crnError2.none = error2[15];
|
}
|
|
/**
|
* 最近一次入出库类型
|
* I:入库
|
* O:出库
|
*/
|
private String lastIo = "I";
|
|
}
|