|  |  |  | 
|---|
|  |  |  | package com.zy.core.model.protocol; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.zy.asrs.entity.BasCrnp; | 
|---|
|  |  |  | import com.zy.core.enums.*; | 
|---|
|  |  |  | 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; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Data | 
|---|
|  |  |  | public class CrnProtocol { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 堆垛机号 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private Integer crnNo; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 1 = 手动模式 | 
|---|
|  |  |  | 
|---|
|  |  |  | public Short walkPos; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 拨指位置 | 
|---|
|  |  |  | * 0 = 不在定位 | 
|---|
|  |  |  | * 1 = 上定位 | 
|---|
|  |  |  | * 2 = 下定位 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public Short fingerPos; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public CrnFingerPosType fingerPosType; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 堆垛机任务完成 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public Short taskFinish; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 载货台有物 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public Short loaded; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 异常码(数值显示) | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private Short alarm1; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private Short temp1; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private CrnTemp1 crnTemp1; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private Short temp2; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | this.status = CrnStatusType.get(type).id.shortValue(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setFingerPos(Short type) { | 
|---|
|  |  |  | this.fingerPos = type; | 
|---|
|  |  |  | this.fingerPosType = CrnFingerPosType.get(type); | 
|---|
|  |  |  | public Short getTemp1() { | 
|---|
|  |  |  | return temp1; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 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(); | 
|---|
|  |  |  | public void setTemp1(Short temp1) { | 
|---|
|  |  |  | this.temp1 = temp1; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public BasCrnp toSqlModel(BasCrnp basCrnp){ | 
|---|
|  |  |  | basCrnp.setCrnErr(alarm1.longValue()); | 
|---|
|  |  |  | if (alarm!=null) { | 
|---|
|  |  |  | basCrnp.setCrnErr(alarm.longValue()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | basCrnp.setWrkNo(taskNo.intValue()); | 
|---|
|  |  |  | return basCrnp; | 
|---|
|  |  |  | } | 
|---|