|  |  |  | 
|---|
|  |  |  | package com.zy.core.model.protocol; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.zy.asrs.entity.BasCrnp; | 
|---|
|  |  |  | import com.zy.core.enums.CrnForkPosType; | 
|---|
|  |  |  | import com.zy.core.enums.CrnLiftPosType; | 
|---|
|  |  |  | import com.zy.core.enums.CrnModeType; | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Data | 
|---|
|  |  |  | public class CrnProtocol { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private Integer crnNo; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 1 = 手动模式 | 
|---|
|  |  |  | 
|---|
|  |  |  | public Short walkPos; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 堆垛机任务完成 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public Short taskFinish; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 载货台有物 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public Short loaded; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 异常码(数值显示) | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private Short alarm1; | 
|---|
|  |  |  | private Short temp1; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private CrnTemp1 crnTemp1; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private Short temp2; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private Short temp3; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private Short temp4; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 异常1 | 
|---|
|  |  |  | 
|---|
|  |  |  | 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 Short getTemp1() { | 
|---|
|  |  |  | return temp1; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 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]; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setError3(boolean[] error3) { | 
|---|
|  |  |  | this.error3 = error3; | 
|---|
|  |  |  | this.crnError3 = new CrnError3(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setError4(boolean[] error4) { | 
|---|
|  |  |  | this.error4 = error4; | 
|---|
|  |  |  | this.crnError4 = new CrnError4(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setError5(boolean[] error5) { | 
|---|
|  |  |  | this.error5 = error5; | 
|---|
|  |  |  | this.crnError5 = new CrnError5(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setError6(boolean[] error6) { | 
|---|
|  |  |  | this.error6 = error6; | 
|---|
|  |  |  | this.crnError6 = new CrnError6(); | 
|---|
|  |  |  | public void setTemp1(Short temp1) { | 
|---|
|  |  |  | this.temp1 = temp1; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private String lastIo = "I"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public BasCrnp toSqlModel(BasCrnp basCrnp){ | 
|---|
|  |  |  | if (alarm!=null) { | 
|---|
|  |  |  | basCrnp.setCrnErr(alarm.longValue()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | basCrnp.setWrkNo(taskNo.intValue()); | 
|---|
|  |  |  | return basCrnp; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setxSpeed(Short xSpeed) { | 
|---|
|  |  |  | this.xSpeed = Float.valueOf(xSpeed); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setySpeed(Short ySpeed) { | 
|---|
|  |  |  | this.ySpeed = Float.valueOf(ySpeed); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setzSpeed(Short zSpeed) { | 
|---|
|  |  |  | this.zSpeed = Float.valueOf(zSpeed); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setxDistance(Short xDistance) { | 
|---|
|  |  |  | this.xDistance = Float.valueOf(xDistance); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setyDistance(Short yDistance) { | 
|---|
|  |  |  | this.yDistance = Float.valueOf(yDistance); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setxDuration(Short xDuration) { | 
|---|
|  |  |  | this.xDuration = Float.valueOf(xDuration); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setyDuration(Short yDuration) { | 
|---|
|  |  |  | this.yDuration = Float.valueOf(yDuration); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|