| | |
| | | package com.zy.core.model.protocol; |
| | | |
| | | import com.zy.asrs.entity.BasCrnp; |
| | | import com.zy.core.enums.*; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | |
| | | * 1 = 手动模式 |
| | | * 2 = 自动模式 |
| | | * 3 = 电脑模式 |
| | | * 4 = 手动模式启动中 |
| | | * 5 = 自动模式启动中 |
| | | * 6 = 电脑模式启动中 |
| | | */ |
| | | public short mode; |
| | | public Short mode; |
| | | |
| | | public CrnModeType modeType; |
| | | |
| | | /** |
| | | * 1 = 急停 |
| | | */ |
| | | public short eStop; |
| | | public Short eStop; |
| | | |
| | | /** |
| | | * 异常码 |
| | | */ |
| | | public short alarm; |
| | | public Short alarm; |
| | | |
| | | /** |
| | | * 任务号 |
| | | */ |
| | | public short taskNo; |
| | | public Short taskNo = 0; |
| | | |
| | | /** |
| | | * 堆垛机当前状态 |
| | | * 0 = 未知 |
| | | * 1 = 空闲 |
| | | * 2 = 检查任务数据 |
| | | * 3 = 定位到取货位 |
| | | * 7 = 取货完成 |
| | | * 8 = 等待调度柜允许 |
| | | * 9 = 移动到放货位置 |
| | | * 10 = 放货中 |
| | | * 13 = 搬运完成 |
| | | * 14 = 空载避让 |
| | | * 15 = 检查任务数据 |
| | | * 20 = 检查源位置 |
| | | * 21 = 检查目标位置 |
| | | * 50 = 移动任务 |
| | | * 98 = 任务完成,wcs未确认 |
| | | * 99 = 报警 |
| | | * 0:空闲,无任务 |
| | | * 1:取货定位中 |
| | | * 2:取货中 |
| | | * 3:取货完成,放货定位中 |
| | | * 4:放货中 |
| | | * 5:回原点中 |
| | | * 6:反原点 |
| | | * 7:库位移位 |
| | | * 90:任务完成等待WCS确认 |
| | | * 99:报警 |
| | | */ |
| | | public short status; |
| | | public Short status; |
| | | |
| | | /** |
| | | * 状态枚举 |
| | | */ |
| | | public CrnStatusType statusType; |
| | | |
| | | /** |
| | | * 堆垛机当前列号 |
| | | */ |
| | | public short bay; |
| | | public Short bay; |
| | | |
| | | /** |
| | | * 堆垛机当前层号 |
| | | */ |
| | | public short level; |
| | | public Short level; |
| | | |
| | | /** |
| | | * 当前货叉位置 |
| | |
| | | * 1 = 货叉在左侧 |
| | | * 2 = 货叉在右侧 |
| | | */ |
| | | public short forkPos; |
| | | public Short forkPos; |
| | | |
| | | public CrnForkPosType forkPosType; |
| | | |
| | | /** |
| | | * 当前载货台位置 |
| | | * 0 = 下定位 |
| | | * 1 = 上定位 |
| | | */ |
| | | public short liftPos; |
| | | public Short liftPos; |
| | | |
| | | public CrnLiftPosType liftPosType; |
| | | |
| | | /** |
| | | * 走行在定位 |
| | | * 0 = 在定位 |
| | | * 1 = 不在定位 |
| | | */ |
| | | public short walkPos; |
| | | public Short walkPos; |
| | | |
| | | /** |
| | | * 拨指位置 |
| | | * 0 = 不在定位 |
| | | * 1 = 上定位 |
| | | * 2 = 下定位 |
| | | */ |
| | | public Short fingerPos; |
| | | |
| | | public CrnFingerPosType fingerPosType; |
| | | |
| | | /** |
| | | * 堆垛机任务完成 |
| | | */ |
| | | public short taskFinish; |
| | | public Short taskFinish; |
| | | |
| | | /** |
| | | * 载货台有物 |
| | | */ |
| | | public short loaded; |
| | | public Short loaded; |
| | | |
| | | /** |
| | | * 堆垛机累计走行距离 |
| | | * 异常码(数值显示) |
| | | */ |
| | | public int xDistance; |
| | | private Short alarm1; |
| | | |
| | | private Short temp1; |
| | | |
| | | private Short temp2; |
| | | |
| | | private Short temp3; |
| | | |
| | | private Short temp4; |
| | | |
| | | /** |
| | | * 堆垛机累计升降距离 |
| | | * 异常1 |
| | | */ |
| | | public int yDistance; |
| | | private boolean[] error1; |
| | | |
| | | private CrnError1 crnError1; |
| | | |
| | | /** |
| | | * 堆垛机累计运行时长 |
| | | * 异常2 |
| | | */ |
| | | public int duration; |
| | | private boolean[] error2; |
| | | |
| | | private CrnError2 crnError2; |
| | | |
| | | /** |
| | | * 异常3 |
| | | */ |
| | | private boolean[] error3; |
| | | |
| | | private CrnError3 crnError3; |
| | | |
| | | /** |
| | | * 异常4 |
| | | */ |
| | | private boolean[] error4; |
| | | |
| | | private CrnError4 crnError4; |
| | | |
| | | /** |
| | | * 异常5 |
| | | */ |
| | | private boolean[] error5; |
| | | |
| | | private CrnError5 crnError5; |
| | | |
| | | /** |
| | | * 异常6 |
| | | */ |
| | | private boolean[] error6; |
| | | |
| | | private CrnError6 crnError6; |
| | | |
| | | /** |
| | | * 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 setFingerPos(Short type) { |
| | | this.fingerPos = type; |
| | | this.fingerPosType = CrnFingerPosType.get(type); |
| | | } |
| | | |
| | | public void setError1(boolean[] error1){ |
| | | this.error1 = error1; |
| | | this.crnError1 = new CrnError1(); |
| | | this.crnError1.remoteStop = error1[0]; |
| | | this.crnError1.mainStop = error1[1]; |
| | | this.crnError1.controlStop = error1[2]; |
| | | this.crnError1.xCoverErr = error1[3]; |
| | | this.crnError1.yCoverErr = error1[4]; |
| | | this.crnError1.zCoverErr = error1[5]; |
| | | this.crnError1.laserErr = error1[6]; |
| | | this.crnError1.barcodeErr = error1[7]; |
| | | this.crnError1.xFrontLimitErr = error1[8]; |
| | | this.crnError1.xBackLimitErr = error1[9]; |
| | | this.crnError1.yUpLimitErr = error1[10]; |
| | | this.crnError1.yDownLimitErr = error1[11]; |
| | | this.crnError1.zLeftLimitErr = error1[12]; |
| | | this.crnError1.zRightLimitErr = error1[13]; |
| | | this.crnError1.leftOverWidthErr1 = error1[14]; |
| | | this.crnError1.leftOverWidthErr2 = error1[15]; |
| | | } |
| | | |
| | | public void setError2(boolean[] error2){ |
| | | this.error2 = error2; |
| | | this.crnError2 = new CrnError2(); |
| | | this.crnError2.leftOverLenErr1 = error2[0]; |
| | | this.crnError2.leftOverLenErr2 = error2[1]; |
| | | this.crnError2.leftOverHighErr = error2[2]; |
| | | this.crnError2.rightOverWidthErr1 = error2[3]; |
| | | this.crnError2.rightOverWidthErr2 = error2[4]; |
| | | this.crnError2.rightOverLenErr1 = error2[5]; |
| | | this.crnError2.rightOverLenErr2 = error2[6]; |
| | | this.crnError2.rightOverHighErr = error2[7]; |
| | | this.crnError2.leftLooseRopeErr = error2[8]; |
| | | this.crnError2.rightLooseRopeErr = error2[9]; |
| | | this.crnError2.frontDoorErr = error2[10]; |
| | | this.crnError2.backDoorErr = error2[11]; |
| | | this.crnError2.startupErr = error2[12]; |
| | | this.crnError2.xFrontLocaUpErr = error2[13]; |
| | | this.crnError2.xFrontLocaDownErr = error2[14]; |
| | | this.crnError2.xBackLocaUpErr = error2[15]; |
| | | } |
| | | |
| | | public void setError3(boolean[] error3) { |
| | | this.error3 = error3; |
| | | this.crnError3 = new CrnError3(); |
| | | this.crnError3.xBackLocaDownErr = error3[0]; |
| | | this.crnError3.yUpLocaUpErr = error3[1]; |
| | | this.crnError3.yUpLocaDownErr = error3[2]; |
| | | this.crnError3.yDownLocaUpErr = error3[3]; |
| | | this.crnError3.yDownLocaDownErr = error3[4]; |
| | | this.crnError3.zLeftLocaUpErr = error3[5]; |
| | | this.crnError3.zLeftLocaDownErr = error3[6]; |
| | | this.crnError3.zRightLocaUpErr = error3[7]; |
| | | this.crnError3.zRightLocaDownErr = error3[8]; |
| | | this.crnError3.leftTakeNoneErr = error3[9]; |
| | | this.crnError3.rightTakeNoneErr = error3[10]; |
| | | this.crnError3.leftTakeThenLoadErr = error3[11]; |
| | | this.crnError3.rightTakeThenLoadErr = error3[12]; |
| | | this.crnError3.leftPutAndLoadErr = error3[13]; |
| | | this.crnError3.rightPutAndLoadErr = error3[14]; |
| | | this.crnError3.leftPutThenNoneErr = error3[15]; |
| | | } |
| | | |
| | | public void setError4(boolean[] error4) { |
| | | this.error4 = error4; |
| | | this.crnError4 = new CrnError4(); |
| | | this.crnError4.rightPutThenNoneErr = error4[0]; |
| | | this.crnError4.xLooseBrakeTimeout = error4[1]; |
| | | this.crnError4.yLooseBrakeTimeout = error4[2]; |
| | | this.crnError4.zLooseBrakeTimeout = error4[3]; |
| | | } |
| | | |
| | | public void setError5(boolean[] error5) { |
| | | this.error5 = error5; |
| | | this.crnError5 = new CrnError5(); |
| | | } |
| | | |
| | | public void setError6(boolean[] error6) { |
| | | this.error6 = error6; |
| | | this.crnError6 = new CrnError6(); |
| | | } |
| | | |
| | | /** |
| | | * 最近一次入出库类型 |
| | | * I:入库 |
| | | * O:出库 |
| | | */ |
| | | private String lastIo = "I"; |
| | | |
| | | |
| | | public BasCrnp toSqlModel(BasCrnp basCrnp){ |
| | | basCrnp.setCrnErr(alarm1.longValue()); |
| | | basCrnp.setWrkNo(taskNo.intValue()); |
| | | return basCrnp; |
| | | } |
| | | } |