src/main/java/com/zy/core/model/protocol/CrnError1.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/zy/core/model/protocol/CrnError2.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/zy/core/model/protocol/CrnProtocol.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/zy/core/thread/CrnThread.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/zy/core/model/protocol/CrnError1.java
New file @@ -0,0 +1,59 @@ package com.zy.core.model.protocol; import lombok.Data; /** * Created by vincent on 2020/8/17 */ @Data public class CrnError1 { // 急停 public boolean stop; // X行走变频器故障 public boolean xCoverErr; // Y升降变频器故障 public boolean yCoverErr; // Z货叉变频器故障 public boolean zCoverErr; // 激光测距仪故障 public boolean rangeErr; // 条码阅读器故障 public boolean barcodeErr; // X前极限到位 public boolean xFrontLimitErr; // X后极限到位 public boolean xBackLimitErr; // Y上极限到位 public boolean yUpLimitErr; // Y下极限到位 public boolean yDownLimitErr; // Z左极限到位 public boolean zLeftLimitErr; // Z右极限到位 public boolean zRightLimitErr; // X定位超上限 public boolean xLocationUpErr; // X定位超下限 public boolean xLocationDownErr; // Y定位超上限 public boolean yLocationUpErr; // Y定位超下限 public boolean yLocationDownErr; } src/main/java/com/zy/core/model/protocol/CrnError2.java
New file @@ -0,0 +1,59 @@ package com.zy.core.model.protocol; import lombok.Data; /** * Created by vincent on 2020/8/17 */ @Data public class CrnError2 { // Z定位超上限 public boolean zLocationUpErr; // Z定位超下限 public boolean zLocationDownErr; // WCS命令异常 public boolean wcsCommandErr; // 左超宽 public boolean leftWidthLimitErr; // 右超宽 public boolean rightWidthLimitErr; // 左超长 public boolean leftLengthLimitErr; // 右超长 public boolean rightLengthLimitErr; // 超高 public boolean highLimitErr; // 左取货伸叉时无货 public boolean leftTakeNoneErr; // 右取货升叉时无货 public boolean rightTakeNoneErr; // 左放货伸叉时有货 public boolean leftPutLoadErr; // 右放货伸叉时有货 public boolean rightPutLoadErr; // 启动错误 public boolean startErr; // 松绳报警 public boolean looseRopeErr; // 安全门开关报警 public boolean safeDoorSwitchErr; // -- public boolean none; } src/main/java/com/zy/core/model/protocol/CrnProtocol.java
@@ -110,12 +110,16 @@ /** * 异常1 */ private Short error1; private boolean[] error1; private CrnError1 crnError1; /** * 异常2 */ private Short error2; private boolean[] error2; private CrnError2 crnError2; /** * 保留 @@ -197,6 +201,48 @@ 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:入库 src/main/java/com/zy/core/thread/CrnThread.java
@@ -127,8 +127,9 @@ // crnProtocol.setTaskFinish(siemensNet.getByteTransform().TransInt16(result.Content, 16)); crnProtocol.setLoaded(siemensNet.getByteTransform().TransInt16(result.Content, 18)); crnProtocol.setAlarm1(siemensNet.getByteTransform().TransInt16(result.Content, 20)); crnProtocol.setError1(siemensNet.getByteTransform().TransInt16(result.Content, 22)); crnProtocol.setError2(siemensNet.getByteTransform().TransInt16(result.Content, 24)); // 异常信息 crnProtocol.setError1(siemensNet.getByteTransform().TransBool(result.Content, 22, 2)); crnProtocol.setError2(siemensNet.getByteTransform().TransBool(result.Content, 24, 2)); crnProtocol.setTemp1(siemensNet.getByteTransform().TransInt16(result.Content, 26)); crnProtocol.setXSpeed(siemensNet.getByteTransform().TransInt16(result.Content, 28)); crnProtocol.setYSpeed(siemensNet.getByteTransform().TransInt16(result.Content, 30));