From d08e5f29d4aea9f160b45c86e0004efbf34c76bd Mon Sep 17 00:00:00 2001 From: Junjie <fallin.jie@qq.com> Date: 星期一, 31 七月 2023 13:54:37 +0800 Subject: [PATCH] 提升机 --- src/main/java/com/zy/asrs/domain/vo/LiftMsgTableVo.java | 87 --- src/main/java/com/zy/core/thread/LiftThread.java | 238 ++++----- src/main/java/com/zy/asrs/domain/vo/LiftStateTableVo.java | 240 ++-------- src/main/java/com/zy/core/model/protocol/LiftProtocol.java | 335 ++++----------- src/main/java/com/zy/asrs/entity/BasLift.java | 250 +++------- src/main/java/com/zy/asrs/controller/LiftController.java | 44 - src/main/webapp/views/lift.html | 81 +-- 7 files changed, 396 insertions(+), 879 deletions(-) diff --git a/src/main/java/com/zy/asrs/controller/LiftController.java b/src/main/java/com/zy/asrs/controller/LiftController.java index a45f231..c7caa1f 100644 --- a/src/main/java/com/zy/asrs/controller/LiftController.java +++ b/src/main/java/com/zy/asrs/controller/LiftController.java @@ -69,28 +69,17 @@ } vo.setTaskNo(liftProtocol.getTaskNo()); // 浠诲姟鍙� vo.setProtocolStatus(liftProtocol.getProtocolStatusType().id); - vo.setLiftLock(liftProtocol.getLiftLock()); - vo.setPositionArrivalFeedback(liftProtocol.getPositionArrivalFeedback()); - vo.setReady(liftProtocol.getReady()); - vo.setRunning(liftProtocol.getRunning()); - vo.setMode(liftProtocol.getMode()); - vo.setLineFrontHasStock(liftProtocol.getLineFrontHasStock()); - vo.setForwardRotationFeedback(liftProtocol.getForwardRotationFeedback()); - vo.setReverseFeedback(liftProtocol.getReverseFeedback()); - vo.setMotorOverload(liftProtocol.getMotorOverload()); - vo.setLineEndHasStock(liftProtocol.getLineEndHasStock()); - vo.setInConveyLineCardTrayAlarm(liftProtocol.getInConveyLineCardTrayAlarm()); - vo.setOutConveyLineCardTrayAlarm(liftProtocol.getOutConveyLineCardTrayAlarm()); - vo.setPlatPositionDeviationAlarm(liftProtocol.getPlatPositionDeviationAlarm()); - vo.setPlatTorqueDeviationAlarm(liftProtocol.getPlatTorqueDeviationAlarm()); - vo.setPlatShuttleCheck(liftProtocol.getPlatShuttleCheck()); - vo.setNotReady(liftProtocol.getNotReady()); - vo.setServoError1(liftProtocol.getServoError1()); - vo.setServoError2(liftProtocol.getServoError2()); - vo.setServoError3(liftProtocol.getServoError3()); - vo.setServoError4(liftProtocol.getServoError4()); - vo.setLiftActualSpeed(liftProtocol.getLiftActualSpeed()); - vo.setPakMk(liftProtocol.getPakMk()); + vo.setModel(liftProtocol.getModel()); + vo.setBusy(liftProtocol.getBusy()); + vo.setHasTray(liftProtocol.getHasTray()); + vo.setHasCar(liftProtocol.getHasCar()); + vo.setDeviceError(liftProtocol.getDeviceError()); + vo.setFrontOverrun(liftProtocol.getFrontOverrun()); + vo.setBackOverrun(liftProtocol.getBackOverrun()); + vo.setLeftOverrun(liftProtocol.getLeftOverrun()); + vo.setRightOverrun(liftProtocol.getRightOverrun()); + vo.setOverHeight(liftProtocol.getOverHeight()); + vo.setOverWeight(liftProtocol.getOverWeight()); } return R.ok().add(list); } @@ -116,13 +105,10 @@ vo.setWorkNo(liftProtocol.getTaskNo().intValue());//浠诲姟鍙� vo.setPakMk(liftProtocol.getPakMk()?"Y" : "N"); // 浣滀笟鏍囪 - vo.setLineFrontHasStock(liftProtocol.getLineFrontHasStock()); - vo.setForwardRotationFeedback(liftProtocol.getForwardRotationFeedback()); - vo.setReverseFeedback(liftProtocol.getReverseFeedback()); - vo.setMotorOverload(liftProtocol.getMotorOverload()); - vo.setLineEndHasStock(liftProtocol.getLineEndHasStock()); - vo.setInConveyLineCardTrayAlarm(liftProtocol.getInConveyLineCardTrayAlarm()); - vo.setOutConveyLineCardTrayAlarm(liftProtocol.getOutConveyLineCardTrayAlarm()); + vo.setLev(liftProtocol.getLev()); + vo.setTaskAddress(liftProtocol.getTaskAddress()); + vo.setDistAddress(liftProtocol.getDistAddress()); + vo.setCompleteTaskNo(liftProtocol.getCompleteTaskNo()); vo.setShuttleNo(liftProtocol.getShuttleNo().intValue()); } return R.ok().add(list); diff --git a/src/main/java/com/zy/asrs/domain/vo/LiftMsgTableVo.java b/src/main/java/com/zy/asrs/domain/vo/LiftMsgTableVo.java index b24c1c4..8b89b7b 100644 --- a/src/main/java/com/zy/asrs/domain/vo/LiftMsgTableVo.java +++ b/src/main/java/com/zy/asrs/domain/vo/LiftMsgTableVo.java @@ -15,99 +15,28 @@ private String pakMk = "-"; /** - * 杈撻�佺嚎鍓嶇鍏夌數鏈夎揣 - * 鏈夎揣涓�1锛屾棤璐т负0锛堝墠绔寚闈犺繎璐ф灦渚э級 + * 浠诲姟鍦板潃 */ - private Boolean lineFrontHasStock; + private Short taskAddress; /** - * 杈撻�佺嚎姝h浆鍙嶉 - * 姝h浆杩愯涓�1锛屽惁鍒欎负0 + * 鐩殑鍦板潃 */ - private Boolean forwardRotationFeedback; + private Short distAddress; /** - * 杈撻�佺嚎鍙嶈浆鍙嶉 - * 鍙嶈浆杩愯涓�1锛屽惁鍒欎负0 + * 宸插畬鎴愮殑浠诲姟鍙� */ - private Boolean reverseFeedback; + private Short completeTaskNo; /** - * 杈撻�佺嚎鐢垫満杩囪浇 - * 杩囪浇涓�0锛屾甯镐负1 + * 灞� */ - private Boolean motorOverload; - - /** - * 杈撻�佺嚎鏈鍏夌數鏈夎揣 - * 鏈夎揣涓�1锛屾棤璐т负0 - */ - private Boolean lineEndHasStock; - - /** - * 杩涜緭閫佺嚎鍗℃墭鐩樻姤璀� - * 鎶ヨ涓�1锛屾湭鎶ヨ涓�0 - */ - private Boolean inConveyLineCardTrayAlarm; - - /** - * 鍑鸿緭閫佺嚎鍗℃墭鐩樻姤璀� - * 鎶ヨ涓�1锛屾湭鎶ヨ涓�0 - */ - private Boolean outConveyLineCardTrayAlarm; + private Short lev; /** * 绌挎杞﹀彿 */ private Integer shuttleNo; - - public String getLineFrontHasStock$() { - if (this.lineFrontHasStock == null) { - return "N"; - } - return this.lineFrontHasStock ? "Y" : "N"; - } - - public String getForwardRotationFeedback$() { - if (this.forwardRotationFeedback == null) { - return "N"; - } - return this.forwardRotationFeedback ? "Y" : "N"; - } - - public String getReverseFeedback$() { - if (this.reverseFeedback == null) { - return "N"; - } - return this.reverseFeedback ? "Y" : "N"; - } - - public String getMotorOverload$() { - if (this.motorOverload == null) { - return "N"; - } - return this.motorOverload ? "Y" : "N"; - } - - public String getLineEndHasStock$() { - if (this.lineEndHasStock == null) { - return "N"; - } - return this.lineEndHasStock ? "Y" : "N"; - } - - public String getInConveyLineCardTrayAlarm$() { - if (this.inConveyLineCardTrayAlarm == null) { - return "N"; - } - return this.inConveyLineCardTrayAlarm ? "Y" : "N"; - } - - public String getOutConveyLineCardTrayAlarm$() { - if (this.outConveyLineCardTrayAlarm == null) { - return "N"; - } - return this.outConveyLineCardTrayAlarm ? "Y" : "N"; - } } diff --git a/src/main/java/com/zy/asrs/domain/vo/LiftStateTableVo.java b/src/main/java/com/zy/asrs/domain/vo/LiftStateTableVo.java index b29c880..ad38491 100644 --- a/src/main/java/com/zy/asrs/domain/vo/LiftStateTableVo.java +++ b/src/main/java/com/zy/asrs/domain/vo/LiftStateTableVo.java @@ -16,261 +16,145 @@ private Short taskNo = 0; /** + * 鍥涘悜绌挎杞﹀彿 + */ + private Short shuttleNo = 0; + + /** * 褰撳墠鎻愬崌鏈虹姸鎬侊紙鍐呴儴鑷垜缁存姢锛� */ private Integer protocolStatus; /** - * 鎻愬崌鏈洪攣瀹� + * 妯″紡 */ - private Boolean liftLock; + private Boolean model; /** - * 浣嶇疆鍒拌揪鍙嶉 + * 蹇欓棽 */ - private Short positionArrivalFeedback; + private Boolean busy; /** - * 鍑嗗灏辩华 - * 灏辩华涓�1锛屾湭灏辩华涓�0 + * 鏈夋墭鐩� */ - private Boolean ready; + private Boolean hasTray; /** - * 杩愯涓� - * 杩愯涓负1锛屾湭杩愯涓�0 + * 鏈夊皬杞� */ - private Boolean running; + private Boolean hasCar; /** - * 鑱旀満/鍗曟満 - * 鑱旀満涓�1锛屽崟鏈轰负0 + * 璁惧鏁呴殰 */ - private Boolean mode; + private Boolean deviceError; /** - * 杈撻�佺嚎鍓嶇鍏夌數鏈夎揣 - * 鏈夎揣涓�1锛屾棤璐т负0锛堝墠绔寚闈犺繎璐ф灦渚э級 + * 鍓嶈秴闄� */ - private Boolean lineFrontHasStock; + private Boolean frontOverrun; /** - * 杈撻�佺嚎姝h浆鍙嶉 - * 姝h浆杩愯涓�1锛屽惁鍒欎负0 + * 鍚庤秴闄� */ - private Boolean forwardRotationFeedback; + private Boolean backOverrun; /** - * 杈撻�佺嚎鍙嶈浆鍙嶉 - * 鍙嶈浆杩愯涓�1锛屽惁鍒欎负0 + * 宸﹁秴闄� */ - private Boolean reverseFeedback; + private Boolean leftOverrun; /** - * 杈撻�佺嚎鐢垫満杩囪浇 - * 杩囪浇涓�0锛屾甯镐负1 + * 鍙宠秴闄� */ - private Boolean motorOverload; + private Boolean rightOverrun; /** - * 杈撻�佺嚎鏈鍏夌數鏈夎揣 - * 鏈夎揣涓�1锛屾棤璐т负0 + * 瓒呴珮 */ - private Boolean lineEndHasStock; + private Boolean overHeight; /** - * 杩涜緭閫佺嚎鍗℃墭鐩樻姤璀� - * 鎶ヨ涓�1锛屾湭鎶ヨ涓�0 + * 瓒呴噸 */ - private Boolean inConveyLineCardTrayAlarm; + private Boolean overWeight; - /** - * 鍑鸿緭閫佺嚎鍗℃墭鐩樻姤璀� - * 鎶ヨ涓�1锛屾湭鎶ヨ涓�0 - */ - private Boolean outConveyLineCardTrayAlarm; - - /** - * 骞冲彴浣嶇疆鍋忓樊鎶ヨ - * 鎶ヨ涓�1锛屾湭鎶ヨ涓�0 - */ - private Boolean platPositionDeviationAlarm; - - /** - * 骞冲彴鎵煩鍋忓樊鎶ヨ - * 鎶ヨ涓�1锛屾湭鎶ヨ涓�0 - */ - private Boolean platTorqueDeviationAlarm; - - /** - * 骞冲彴鍥涘悜杞︽娴� - * 鏈夎溅涓�1锛屾棤杞︿负0 - */ - private Boolean platShuttleCheck; - - /** - * 鏈氨缁姸鎬� - * 1. 涓嶅湪鎸囧畾灞� - * 2. 鍥涜酱涓嶅悓姝� - * 3. 骞冲彴鍓嶉檺鍏夌數琚尅鍒帮紙闈犺繎璐ф灦锛� - * 4. 骞冲彴鍚庨檺鍏夌數琚尅鍒帮紙杩滅璐ф灦锛� - * 5. 骞冲彴涓婇檺浣嶆姤璀� - * 6. 骞冲彴涓嬮檺浣嶆姤璀� - * 7. 鐢垫煖鎬ュ仠鎶ヨ - * 8. 杈撻�佺嚎鍓嶉檺浣嶈鎸″埌锛堥潬杩戣揣鏋讹級 - * 9. 杈撻�佺嚎鍚庨檺浣嶈鎸″埌锛堣繙绂昏揣鏋讹級 - * 10. 瑙︽懜灞忕揣鎬ュ仠姝㈣鎸変笅 - * 11. 鍥涜酱鍔ㄥ姏绾挎柇绾� - * 12. 鍗曟満妯″紡 - * 13. 鍥涜酱鎶ヨ - * 14. 浣嶇疆鍋忓樊杩囧ぇ - * 15. 鎵煩鍋忓樊杩囧ぇ - * 16. 杈撻�佺嚎杩囪浇 - * 17. 杩涙彁鍗囨満鍗℃墭鐩� - * 18. 鍑烘彁鍗囨満鍗℃墭鐩� - */ - private Short notReady; - - /** - * 浼烘湇1閿欒 - */ - private Short servoError1; - - /** - * 浼烘湇2閿欒 - */ - private Short servoError2; - - /** - * 浼烘湇3閿欒 - */ - private Short servoError3; - - /** - * 浼烘湇4閿欒 - */ - private Short servoError4; - - /** - * 鎻愬崌鏈哄疄闄呴�熷害鍙嶉 - */ - private Short liftActualSpeed; - - /** - * 浣滀笟鏍囪 - */ - private Boolean pakMk = true; - - public String getLiftLock$() { - if (this.liftLock == null) { - return "N"; + public String getModel$() { + if (this.model == null) { + return "绂荤嚎"; } - return this.liftLock ? "Y" : "N"; + return this.model ? "鑷姩" : "鎵嬪姩"; } - public String getReady$() { - if (this.ready == null) { - return "N"; - } - return this.ready ? "Y" : "N"; - } - - public String getNotReady$() { - if (this.notReady == null) { + public String getBusy$() { + if (this.busy == null) { return "-"; } - return LiftNotReadyType.get((int) this.notReady).desc; + return this.busy ? "蹇欑" : "绌洪棽"; } - public String getRunning$() { - if (this.running == null) { - return "N"; + public String getHasTray$() { + if (this.hasTray == null) { + return "-"; } - return this.running ? "Y" : "N"; + return this.hasTray ? "Y" : "N"; } - public String getMode$() { - if (this.mode == null) { + public String getHasCar$() { + if (this.hasCar == null) { return "N"; } - return this.mode ? "Y" : "N"; + return this.hasCar ? "Y" : "N"; } - public String getLineFrontHasStock$() { - if (this.lineFrontHasStock == null) { + public String getDeviceError$() { + if (this.deviceError == null) { return "N"; } - return this.lineFrontHasStock ? "Y" : "N"; + return this.deviceError ? "Y" : "N"; } - public String getForwardRotationFeedback$() { - if (this.forwardRotationFeedback == null) { + public String getFrontOverrun$() { + if (this.frontOverrun == null) { return "N"; } - return this.forwardRotationFeedback ? "Y" : "N"; + return this.frontOverrun ? "Y" : "N"; } - public String getReverseFeedback$() { - if (this.reverseFeedback == null) { + public String getBackOverrun$() { + if (this.backOverrun == null) { return "N"; } - return this.reverseFeedback ? "Y" : "N"; + return this.backOverrun ? "Y" : "N"; } - public String getMotorOverload$() { - if (this.motorOverload == null) { + public String getLeftOverrun$() { + if (this.leftOverrun == null) { return "N"; } - return this.motorOverload ? "Y" : "N"; + return this.leftOverrun ? "Y" : "N"; } - public String getLineEndHasStock$() { - if (this.lineEndHasStock == null) { + public String getRightOverrun$() { + if (this.rightOverrun == null) { return "N"; } - return this.lineEndHasStock ? "Y" : "N"; + return this.rightOverrun ? "Y" : "N"; } - public String getInConveyLineCardTrayAlarm$() { - if (this.inConveyLineCardTrayAlarm == null) { + public String getOverHeight$() { + if (this.overHeight == null) { return "N"; } - return this.inConveyLineCardTrayAlarm ? "Y" : "N"; + return this.overHeight ? "Y" : "N"; } - public String getOutConveyLineCardTrayAlarm$() { - if (this.outConveyLineCardTrayAlarm == null) { + public String getOverWeight$() { + if (this.overWeight == null) { return "N"; } - return this.outConveyLineCardTrayAlarm ? "Y" : "N"; - } - - public String getPlatPositionDeviationAlarm$() { - if (this.platPositionDeviationAlarm == null) { - return "N"; - } - return this.platPositionDeviationAlarm ? "Y" : "N"; - } - - public String getPlatTorqueDeviationAlarm$() { - if (this.platTorqueDeviationAlarm == null) { - return "N"; - } - return this.platTorqueDeviationAlarm ? "Y" : "N"; - } - - public String getPlatShuttleCheck$() { - if (this.platShuttleCheck == null) { - return "N"; - } - return this.platShuttleCheck ? "Y" : "N"; - } - - public String getPakMk$() { - if (this.pakMk == null) { - return "N"; - } - return this.pakMk ? "Y" : "N"; + return this.overWeight ? "Y" : "N"; } public String getProtocolStatus$() { diff --git a/src/main/java/com/zy/asrs/entity/BasLift.java b/src/main/java/com/zy/asrs/entity/BasLift.java index 67aa7f2..2cddf57 100644 --- a/src/main/java/com/zy/asrs/entity/BasLift.java +++ b/src/main/java/com/zy/asrs/entity/BasLift.java @@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotations.TableField; import java.text.SimpleDateFormat; import java.util.Date; + +import com.zy.core.model.protocol.NyShuttleProtocol; import org.springframework.format.annotation.DateTimeFormat; import com.core.common.SpringUtils; import com.zy.system.service.UserService; @@ -72,152 +74,120 @@ private Boolean pakMk; /** - * 鎻愬崌鏈洪攣瀹� + * 鎻愬崌鏈哄潗鏍� */ - @ApiModelProperty(value= "鎻愬崌鏈洪攣瀹�") - @TableField("lift_lock") - private Boolean liftLock; + @ApiModelProperty(value= "鎻愬崌鏈哄潗鏍�") + @TableField("point") + private NyShuttleProtocol.NyShuttlePointClass point; /** - * 浣嶇疆鍒拌揪鍙嶉 + * 妯″紡 */ - @ApiModelProperty(value= "浣嶇疆鍒拌揪鍙嶉") - @TableField("position_arrival_feedback") - private Integer positionArrivalFeedback; + @ApiModelProperty(value= "妯″紡") + @TableField("model") + private Boolean model; /** - * 鍑嗗灏辩华 + * 蹇欓棽 */ - @ApiModelProperty(value= "鍑嗗灏辩华") - private Boolean ready; + @ApiModelProperty(value= "蹇欓棽") + @TableField("busy") + private Boolean busy; /** - * 杩愯涓� + * 鍓嶈秴闄� */ - @ApiModelProperty(value= "杩愯涓�") - private Boolean running; + @ApiModelProperty(value= "鍓嶈秴闄�") + @TableField("front_overrun") + private Boolean frontOverrun; /** - * 鑱旀満/鍗曟満 + * 鍚庤秴闄� */ - @ApiModelProperty(value= "鑱旀満/鍗曟満") - private Boolean mode; + @ApiModelProperty(value= "鍚庤秴闄�") + @TableField("back_overrun") + private Boolean backOverrun; /** - * 杈撻�佺嚎鍓嶇鍏夌數鏈夎揣 + * 宸﹁秴闄� */ - @ApiModelProperty(value= "杈撻�佺嚎鍓嶇鍏夌數鏈夎揣") - @TableField("line_front_has_stock") - private Boolean lineFrontHasStock; + @ApiModelProperty(value= "宸﹁秴闄�") + @TableField("left_overrun") + private Boolean leftOverrun; /** - * 杈撻�佺嚎姝h浆鍙嶉 + * 鍙宠秴闄� */ - @ApiModelProperty(value= "杈撻�佺嚎姝h浆鍙嶉") - @TableField("forward_rotation_feedback") - private Boolean forwardRotationFeedback; + @ApiModelProperty(value= "鍙宠秴闄�") + @TableField("right_overrun") + private Boolean rightOverrun; /** - * 杈撻�佺嚎鍙嶈浆鍙嶉 + * 瓒呴珮 */ - @ApiModelProperty(value= "杈撻�佺嚎鍙嶈浆鍙嶉") - @TableField("reverse_feedback") - private Boolean reverseFeedback; + @ApiModelProperty(value= "瓒呴珮") + @TableField("over_height") + private Boolean overHeight; /** - * 杈撻�佺嚎鐢垫満杩囪浇 + * 瓒呴噸 */ - @ApiModelProperty(value= "杈撻�佺嚎鐢垫満杩囪浇") - @TableField("motor_overload") - private Boolean motorOverload; + @ApiModelProperty(value= "瓒呴噸") + @TableField("over_weight") + private Boolean overWeight; /** - * 杈撻�佺嚎鏈鍏夌數鏈夎揣 + * 鏈夋墭鐩� */ - @ApiModelProperty(value= "杈撻�佺嚎鏈鍏夌數鏈夎揣") - @TableField("line_end_has_stock") - private Boolean lineEndHasStock; + @ApiModelProperty(value= "鏈夋墭鐩�") + @TableField("has_tray") + private Boolean hasTray; /** - * 杩涜緭閫佺嚎鍗℃墭鐩樻姤璀� + * 鏈夊皬杞� */ - @ApiModelProperty(value= "杩涜緭閫佺嚎鍗℃墭鐩樻姤璀�") - @TableField("in_convey_line_card_tray_alarm") - private Boolean inConveyLineCardTrayAlarm; + @ApiModelProperty(value= "鏈夊皬杞�") + @TableField("has_car") + private Boolean hasCar; /** - * 鍑鸿緭閫佺嚎鍗℃墭鐩樻姤璀� + * 璁惧鏁呴殰 */ - @ApiModelProperty(value= "鍑鸿緭閫佺嚎鍗℃墭鐩樻姤璀�") - @TableField("out_convey_line_card_tray_alarm") - private Boolean outConveyLineCardTrayAlarm; + @ApiModelProperty(value= "璁惧鏁呴殰") + @TableField("device_error") + private Boolean deviceError; /** - * 骞冲彴浣嶇疆鍋忓樊鎶ヨ + * 浠诲姟鍦板潃 */ - @ApiModelProperty(value= "骞冲彴浣嶇疆鍋忓樊鎶ヨ") - @TableField("plat_position_deviation_alarm") - private Boolean platPositionDeviationAlarm; + @ApiModelProperty(value= "浠诲姟鍦板潃") + @TableField("task_address") + private Integer taskAddress; /** - * 骞冲彴鎵煩鍋忓樊鎶ヨ + * 鐩殑鍦板潃 */ - @ApiModelProperty(value= "骞冲彴鎵煩鍋忓樊鎶ヨ") - @TableField("plat_torque_deviation_alarm") - private Boolean platTorqueDeviationAlarm; + @ApiModelProperty(value= "鐩殑鍦板潃") + @TableField("dist_address") + private Integer distAddress; /** - * 骞冲彴鍥涘悜杞︽娴� + * 宸插畬鎴愪换鍔″彿 */ - @ApiModelProperty(value= "骞冲彴鍥涘悜杞︽娴�") - @TableField("plat_shuttle_check") - private Boolean platShuttleCheck; + @ApiModelProperty(value= "宸插畬鎴愪换鍔″彿") + @TableField("complete_task_no") + private Integer completeTaskNo; /** - * 鏈氨缁姸鎬� + * 妤煎眰 */ - @ApiModelProperty(value= "鏈氨缁姸鎬�") - @TableField("not_ready") - private Integer notReady; - - /** - * 浼烘湇1閿欒 - */ - @ApiModelProperty(value= "浼烘湇1閿欒") - @TableField("servo_error1") - private Integer servoError1; - - /** - * 浼烘湇2閿欒 - */ - @ApiModelProperty(value= "浼烘湇2閿欒") - @TableField("servo_error2") - private Integer servoError2; - - /** - * 浼烘湇3閿欒 - */ - @ApiModelProperty(value= "浼烘湇3閿欒") - @TableField("servo_error3") - private Integer servoError3; - - /** - * 浼烘湇4閿欒 - */ - @ApiModelProperty(value= "浼烘湇4閿欒") - @TableField("servo_error4") - private Integer servoError4; - - /** - * 鎻愬崌鏈哄疄闄呴�熷害鍙嶉 - */ - @ApiModelProperty(value= "鎻愬崌鏈哄疄闄呴�熷害鍙嶉") - @TableField("lift_actual_speed") - private Integer liftActualSpeed; + @ApiModelProperty(value= "妤煎眰") + @TableField("lev") + private Integer lev; public BasLift() {} - public BasLift(Integer liftNo,Integer status,Integer wrkNo,Date updateTime,Long updateBy,String memo,Boolean pakMk,Boolean liftLock,Integer positionArrivalFeedback,Boolean ready,Boolean running,Boolean mode,Boolean lineFrontHasStock,Boolean forwardRotationFeedback,Boolean reverseFeedback,Boolean motorOverload,Boolean lineEndHasStock,Boolean inConveyLineCardTrayAlarm,Boolean outConveyLineCardTrayAlarm,Boolean platPositionDeviationAlarm,Boolean platTorqueDeviationAlarm,Boolean platShuttleCheck,Integer notReady,Integer servoError1,Integer servoError2,Integer servoError3,Integer servoError4,Integer liftActualSpeed) { + public BasLift(Integer liftNo, Integer status, Integer wrkNo, Date updateTime, Long updateBy, String memo, Boolean pakMk, NyShuttleProtocol.NyShuttlePointClass point, Boolean model, Boolean busy, Boolean frontOverrun, Boolean backOverrun, Boolean leftOverrun, Boolean rightOverrun, Boolean overHeight, Boolean overWeight, Boolean hasTray, Boolean hasCar, Boolean deviceError, Integer taskAddress, Integer distAddress, Integer completeTaskNo, Integer lev) { this.liftNo = liftNo; this.status = status; this.wrkNo = wrkNo; @@ -225,59 +195,23 @@ this.updateBy = updateBy; this.memo = memo; this.pakMk = pakMk; - this.liftLock = liftLock; - this.positionArrivalFeedback = positionArrivalFeedback; - this.ready = ready; - this.running = running; - this.mode = mode; - this.lineFrontHasStock = lineFrontHasStock; - this.forwardRotationFeedback = forwardRotationFeedback; - this.reverseFeedback = reverseFeedback; - this.motorOverload = motorOverload; - this.lineEndHasStock = lineEndHasStock; - this.inConveyLineCardTrayAlarm = inConveyLineCardTrayAlarm; - this.outConveyLineCardTrayAlarm = outConveyLineCardTrayAlarm; - this.platPositionDeviationAlarm = platPositionDeviationAlarm; - this.platTorqueDeviationAlarm = platTorqueDeviationAlarm; - this.platShuttleCheck = platShuttleCheck; - this.notReady = notReady; - this.servoError1 = servoError1; - this.servoError2 = servoError2; - this.servoError3 = servoError3; - this.servoError4 = servoError4; - this.liftActualSpeed = liftActualSpeed; + this.point = point; + this.model = model; + this.busy = busy; + this.frontOverrun = frontOverrun; + this.backOverrun = backOverrun; + this.leftOverrun = leftOverrun; + this.rightOverrun = rightOverrun; + this.overHeight = overHeight; + this.overWeight = overWeight; + this.hasTray = hasTray; + this.hasCar = hasCar; + this.deviceError = deviceError; + this.taskAddress = taskAddress; + this.distAddress = distAddress; + this.completeTaskNo = completeTaskNo; + this.lev = lev; } - -// BasLift basLift = new BasLift( -// null, // 鎻愬崌鏈哄彿[闈炵┖] -// null, // 褰撳墠鎻愬崌鏈虹姸鎬� -// null, // 浠诲姟鍙� -// null, // 淇敼鏃堕棿 -// null, // 淇敼浜哄憳 -// null, // 澶囨敞 -// null, // 浣滀笟鏍囪 -// null, // 鎻愬崌鏈洪攣瀹� -// null, // 浣嶇疆鍒拌揪鍙嶉 -// null, // 鍑嗗灏辩华 -// null, // 杩愯涓� -// null, // 鑱旀満/鍗曟満 -// null, // 杈撻�佺嚎鍓嶇鍏夌數鏈夎揣 -// null, // 杈撻�佺嚎姝h浆鍙嶉 -// null, // 杈撻�佺嚎鍙嶈浆鍙嶉 -// null, // 杈撻�佺嚎鐢垫満杩囪浇 -// null, // 杈撻�佺嚎鏈鍏夌數鏈夎揣 -// null, // 杩涜緭閫佺嚎鍗℃墭鐩樻姤璀� -// null, // 鍑鸿緭閫佺嚎鍗℃墭鐩樻姤璀� -// null, // 骞冲彴浣嶇疆鍋忓樊鎶ヨ -// null, // 骞冲彴鎵煩鍋忓樊鎶ヨ -// null, // 骞冲彴鍥涘悜杞︽娴� -// null, // 鏈氨缁姸鎬� -// null, // 浼烘湇1閿欒 -// null, // 浼烘湇2閿欒 -// null, // 浼烘湇3閿欒 -// null, // 浼烘湇4閿欒 -// null // 鎻愬崌鏈哄疄闄呴�熷害鍙嶉 -// ); public String getUpdateTime$(){ if (Cools.isEmpty(this.updateTime)){ @@ -293,24 +227,6 @@ return String.valueOf(user.getUsername()); } return null; - } - - public void setPositionArrivalFeedback(Integer lev) { - switch (lev) { - case 1: - case 2: - this.positionArrivalFeedback = 1; - break; - case 4: - this.positionArrivalFeedback = 2; - break; - case 8: - this.positionArrivalFeedback = 3; - break; - case 16: - this.positionArrivalFeedback = 4; - break; - } } diff --git a/src/main/java/com/zy/core/model/protocol/LiftProtocol.java b/src/main/java/com/zy/core/model/protocol/LiftProtocol.java index a080395..abc2b26 100644 --- a/src/main/java/com/zy/core/model/protocol/LiftProtocol.java +++ b/src/main/java/com/zy/core/model/protocol/LiftProtocol.java @@ -5,8 +5,6 @@ import lombok.Data; import lombok.extern.slf4j.Slf4j; -import java.util.Date; - /** * 鎻愬崌鏈� */ @@ -18,11 +16,6 @@ * 鎻愬崌鏈哄彿 */ private Short liftNo; - - /** - * 鎻愬崌鏈哄唴閮ㄤ簩缁寸爜 - */ - private Short barcode = 1661; /** * 浠诲姟鍙� @@ -45,145 +38,79 @@ private LiftProtocolStatusType protocolStatusType = LiftProtocolStatusType.IDLE; /** + * 妯″紡 + */ + private Boolean model; + + /** + * 蹇欓棽 + */ + private Boolean busy; + + /** + * 鍓嶈秴闄� + */ + private Boolean frontOverrun; + + /** + * 鍚庤秴闄� + */ + private Boolean backOverrun; + + /** + * 宸﹁秴闄� + */ + private Boolean leftOverrun; + + /** + * 鍙宠秴闄� + */ + private Boolean rightOverrun; + + /** + * 瓒呴珮 + */ + private Boolean overHeight; + + /** + * 瓒呴噸 + */ + private Boolean overWeight; + + /** + * 鏈夋墭鐩� + */ + private Boolean hasTray; + + /** + * 鏈夊皬杞� + */ + private Boolean hasCar; + + /** + * 璁惧鏁呴殰 + */ + private Boolean deviceError; + + /** + * 浠诲姟鍦板潃 + */ + private Short taskAddress; + + /** + * 鐩殑鍦板潃 + */ + private Short distAddress; + + /** + * 宸插畬鎴愮殑浠诲姟鍙� + */ + private Short completeTaskNo; + + /** * 灞� */ private Short lev; - - /** - * 鎻愬崌鏈洪攣瀹� - */ - private Boolean liftLock; - - /** - * 浣嶇疆鍒拌揪鍙嶉 - */ - private Short positionArrivalFeedback; - - /** - * 鍑嗗灏辩华 - * 灏辩华涓�1锛屾湭灏辩华涓�0 - */ - private Boolean ready; - - /** - * 杩愯涓� - * 杩愯涓负1锛屾湭杩愯涓�0 - */ - private Boolean running; - - /** - * 鑱旀満/鍗曟満 - * 鑱旀満涓�1锛屽崟鏈轰负0 - */ - private Boolean mode; - - /** - * 杈撻�佺嚎鍓嶇鍏夌數鏈夎揣 - * 鏈夎揣涓�1锛屾棤璐т负0锛堝墠绔寚闈犺繎璐ф灦渚э級 - */ - private Boolean lineFrontHasStock; - - /** - * 杈撻�佺嚎姝h浆鍙嶉 - * 姝h浆杩愯涓�1锛屽惁鍒欎负0 - */ - private Boolean forwardRotationFeedback; - - /** - * 杈撻�佺嚎鍙嶈浆鍙嶉 - * 鍙嶈浆杩愯涓�1锛屽惁鍒欎负0 - */ - private Boolean reverseFeedback; - - /** - * 杈撻�佺嚎鐢垫満杩囪浇 - * 杩囪浇涓�0锛屾甯镐负1 - */ - private Boolean motorOverload; - - /** - * 杈撻�佺嚎鏈鍏夌數鏈夎揣 - * 鏈夎揣涓�1锛屾棤璐т负0 - */ - private Boolean lineEndHasStock; - - /** - * 杩涜緭閫佺嚎鍗℃墭鐩樻姤璀� - * 鎶ヨ涓�1锛屾湭鎶ヨ涓�0 - */ - private Boolean inConveyLineCardTrayAlarm; - - /** - * 鍑鸿緭閫佺嚎鍗℃墭鐩樻姤璀� - * 鎶ヨ涓�1锛屾湭鎶ヨ涓�0 - */ - private Boolean outConveyLineCardTrayAlarm; - - /** - * 骞冲彴浣嶇疆鍋忓樊鎶ヨ - * 鎶ヨ涓�1锛屾湭鎶ヨ涓�0 - */ - private Boolean platPositionDeviationAlarm; - - /** - * 骞冲彴鎵煩鍋忓樊鎶ヨ - * 鎶ヨ涓�1锛屾湭鎶ヨ涓�0 - */ - private Boolean platTorqueDeviationAlarm; - - /** - * 骞冲彴鍥涘悜杞︽娴� - * 鏈夎溅涓�1锛屾棤杞︿负0 - */ - private Boolean platShuttleCheck; - - /** - * 鏈氨缁姸鎬� - * 1. 涓嶅湪鎸囧畾灞� - * 2. 鍥涜酱涓嶅悓姝� - * 3. 骞冲彴鍓嶉檺鍏夌數琚尅鍒帮紙闈犺繎璐ф灦锛� - * 4. 骞冲彴鍚庨檺鍏夌數琚尅鍒帮紙杩滅璐ф灦锛� - * 5. 骞冲彴涓婇檺浣嶆姤璀� - * 6. 骞冲彴涓嬮檺浣嶆姤璀� - * 7. 鐢垫煖鎬ュ仠鎶ヨ - * 8. 杈撻�佺嚎鍓嶉檺浣嶈鎸″埌锛堥潬杩戣揣鏋讹級 - * 9. 杈撻�佺嚎鍚庨檺浣嶈鎸″埌锛堣繙绂昏揣鏋讹級 - * 10. 瑙︽懜灞忕揣鎬ュ仠姝㈣鎸変笅 - * 11. 鍥涜酱鍔ㄥ姏绾挎柇绾� - * 12. 鍗曟満妯″紡 - * 13. 鍥涜酱鎶ヨ - * 14. 浣嶇疆鍋忓樊杩囧ぇ - * 15. 鎵煩鍋忓樊杩囧ぇ - * 16. 杈撻�佺嚎杩囪浇 - * 17. 杩涙彁鍗囨満鍗℃墭鐩� - * 18. 鍑烘彁鍗囨満鍗℃墭鐩� - */ - private Short notReady; - - /** - * 浼烘湇1閿欒 - */ - private Short servoError1; - - /** - * 浼烘湇2閿欒 - */ - private Short servoError2; - - /** - * 浼烘湇3閿欒 - */ - private Short servoError3; - - /** - * 浼烘湇4閿欒 - */ - private Short servoError4; - - /** - * 鎻愬崌鏈哄疄闄呴�熷害鍙嶉 - */ - private Short liftActualSpeed; /** * 浣滀笟鏍囪 @@ -191,43 +118,9 @@ private Boolean pakMk = true; /** - * 鍥涘悜绌挎杞﹁皟搴︽彁鍗囨満鏃讹紝闇�瑕侀攣瀹氭鏍囪 - */ - private Boolean securityMk = false; - - /** * 浠诲姟鍛戒护 */ private LiftAssignCommand assignCommand; - - /** - * 鍑哄叆搴撴ā寮忥紝1锛氬叆搴擄紝2锛氬嚭搴� - */ - private Integer outInModel; - - /** - * 鍑哄叆搴撴ā寮忚捣濮嬬珯鐐� - */ - private Integer startSta; - - /** - * 鍑哄叆搴撴ā寮忕洰鏍囩珯鐐� - */ - private Integer distSta; - - /** - * 鍑哄叆搴撴ā寮忔鏁� - */ - private Integer outInModelStep; - - /** - * 宸ヤ綔鏃堕棿 - */ - private Date wrkTime; - - public Short getLiftLockShortValue() { - return liftLock ? (short) 1 : (short) 0; - } /** * 璁剧疆鎻愬崌鏈虹姸鎬� @@ -248,22 +141,19 @@ // 鏄惁澶勪簬绌洪棽寰呭懡鐘舵�� public Boolean isIdle(Short taskNo) { if(this.taskNo == null - || this.liftLock == null - || this.ready == null - || this.running == null - || this.mode == null + || this.busy == null + || this.model == null + || this.deviceError == null || this.pakMk == null ){ return false; } boolean res = (this.taskNo == 0 || this.taskNo.intValue() == taskNo.intValue()) - && !this.liftLock -// && this.ready - && !this.running - && this.mode + && !this.busy + && this.model && this.pakMk.equals(true) - && !this.securityMk + && !this.deviceError ; return res; } @@ -271,22 +161,19 @@ // 鏄惁澶勪簬绌洪棽寰呭懡鐘舵�� public Boolean isIdle() { if(this.taskNo == null - || this.liftLock == null - || this.ready == null - || this.running == null - || this.mode == null + || this.busy == null + || this.model == null + || this.deviceError == null || this.pakMk == null ){ return false; } boolean res = this.taskNo == 0 - && !this.liftLock -// && this.ready - && !this.running - && this.mode + && !this.busy + && this.model && this.pakMk.equals(true) - && !this.securityMk + && !this.deviceError ; return res; } @@ -294,64 +181,20 @@ // 鏄惁澶勪簬绌洪棽寰呭懡鐘舵�侊紝涓嶅垽鏂换鍔″彿 public Boolean isIdleNoTask() { if(this.taskNo == null - || this.liftLock == null - || this.ready == null - || this.running == null - || this.mode == null + || this.busy == null + || this.model == null + || this.deviceError == null || this.pakMk == null ){ return false; } - boolean res = !this.liftLock -// && this.ready - && !this.running - && this.mode - && this.pakMk - && !this.securityMk + boolean res = !this.busy + && this.model + && this.pakMk.equals(true) + && !this.deviceError ; return res; - } - - public void setPositionArrivalFeedback(Short position) { - Short lev = null; - switch (position) { - case 1: - lev = 1; - break; - case 4: - lev = 2; - break; - case 8: - lev = 3; - break; - case 16: - lev = 4; - break; - } - this.lev = lev;//灞傞珮 - this.positionArrivalFeedback = position;//浣嶇疆鍒拌揪鍙嶉 - } - - public Integer getPositionArrivalFeedback$() { - if (this.positionArrivalFeedback == null) { - return null; - } - - switch (this.positionArrivalFeedback) { - case 1: - return 1; - case 2: - return 2; - case 4: - return 3; - case 8: - return 4; - case 16: - return 5; - } - - return null; } diff --git a/src/main/java/com/zy/core/thread/LiftThread.java b/src/main/java/com/zy/core/thread/LiftThread.java index 8e1f381..9503c0e 100644 --- a/src/main/java/com/zy/core/thread/LiftThread.java +++ b/src/main/java/com/zy/core/thread/LiftThread.java @@ -118,12 +118,12 @@ readStatus(); //鎻愬崌鏈哄浜庤繍琛岀姸鎬侊紝灏嗘爣璁扮疆涓簍rue - if (liftProtocol.getRunning()) { + if (liftProtocol.getBusy()) { liftProtocol.setPakMk(true); } //鎻愬崌鏈哄浜庢湭杩愯銆佸氨缁�佹爣璁皌rue銆佹湁浠诲姟鍙� - if (!liftProtocol.getRunning() + if (!liftProtocol.getBusy() && liftProtocol.getPakMk() && liftProtocol.getTaskNo() != 0) { //杩樻湁鏈畬鎴愮殑鍛戒护 @@ -136,7 +136,7 @@ private void readStatus() { try { - OperateResultExOne<byte[]> result = siemensS7Net.Read("DB100.200", (short) 24); + OperateResultExOne<byte[]> result = siemensS7Net.Read("M100.0", (short) 28); if (result.IsSuccess) { if (null == liftProtocol) { liftProtocol = new LiftProtocol(); @@ -145,97 +145,74 @@ //----------璇诲彇鎻愬崌鏈虹姸鎬�----------- //鑾峰彇鏁版嵁 -// byte[] content = result.Content; -// //鎻愬崌鏈洪攣瀹� -// liftProtocol.setLiftLock(CommonUtils.shortToBoolean(modbusTcpNet.getByteTransform().TransInt16(content, 0))); -// //浣嶇疆鍒拌揪鍙嶉 -// liftProtocol.setPositionArrivalFeedback(modbusTcpNet.getByteTransform().TransInt16(content,2)); -// -// -// byte b1 = modbusTcpNet.getByteTransform().TransByte(content, 5); -// byte b2 = modbusTcpNet.getByteTransform().TransByte(content, 4); -// int[] datas1 = CommonUtils.byteToBits(b1); -// int[] datas2 = CommonUtils.byteToBits(b2); -// //鍑嗗灏辩华 -// liftProtocol.setReady(CommonUtils.intToBoolean(datas1[0])); -// //杩愯涓� -// liftProtocol.setRunning(CommonUtils.intToBoolean(datas1[1])); -// //鑱旀満/鍗曟満 -// liftProtocol.setMode(CommonUtils.intToBoolean(datas1[2])); -// //杈撻�佺嚎鍓嶇鍏夌數鏈夎揣 -// liftProtocol.setLineFrontHasStock(CommonUtils.intToBoolean(datas1[3])); -// //杈撻�佺嚎姝h浆鍙嶉 -// liftProtocol.setForwardRotationFeedback(CommonUtils.intToBoolean(datas1[4])); -// //杈撻�佺嚎鍙嶈浆鍙嶉 -// liftProtocol.setReverseFeedback(CommonUtils.intToBoolean(datas1[5])); -// //杈撻�佺嚎鐢垫満杩囪浇 -// liftProtocol.setMotorOverload(CommonUtils.intToBoolean(datas1[6])); -// //杈撻�佺嚎鏈鍏夌數鏈夎揣 -// liftProtocol.setLineEndHasStock(CommonUtils.intToBoolean(datas1[7])); -// //杩涜緭閫佺嚎鍗℃墭鐩樻姤璀� -// liftProtocol.setInConveyLineCardTrayAlarm(CommonUtils.intToBoolean(datas2[0])); -// //鍑鸿緭閫佺嚎鍗℃墭鐩樻姤璀� -// liftProtocol.setOutConveyLineCardTrayAlarm(CommonUtils.intToBoolean(datas2[1])); -// //骞冲彴浣嶇疆鍋忓樊鎶ヨ -// liftProtocol.setPlatPositionDeviationAlarm(CommonUtils.intToBoolean(datas2[2])); -// //骞冲彴鎵煩鍋忓樊鎶ヨ -// liftProtocol.setPlatTorqueDeviationAlarm(CommonUtils.intToBoolean(datas2[3])); -// //骞冲彴鍥涘悜杞︽娴� -// liftProtocol.setPlatShuttleCheck(CommonUtils.intToBoolean(datas2[4])); -// -// //鏈氨缁姸鎬� -// liftProtocol.setNotReady(modbusTcpNet.getByteTransform().TransInt16(content,6)); -// //浼烘湇1閿欒 -// liftProtocol.setServoError1(modbusTcpNet.getByteTransform().TransInt16(content,8)); -// //浼烘湇2閿欒 -// liftProtocol.setServoError2(modbusTcpNet.getByteTransform().TransInt16(content,10)); -// //浼烘湇3閿欒 -// liftProtocol.setServoError3(modbusTcpNet.getByteTransform().TransInt16(content,12)); -// //浼烘湇4閿欒 -// liftProtocol.setServoError4(modbusTcpNet.getByteTransform().TransInt16(content,14)); -// //鎻愬崌鏈哄疄闄呴�熷害鍙嶉 -// liftProtocol.setLiftActualSpeed(modbusTcpNet.getByteTransform().TransInt16(content,16)); -// -// ///璇诲彇鎻愬崌鏈虹姸鎬�-end -// -// //灏嗘彁鍗囨満鐘舵�佷繚瀛樿嚦鏁版嵁搴� -// BasLiftService liftService = SpringUtils.getBean(BasLiftService.class); -// BasLift basLift = liftService.selectById(liftProtocol.getLiftNo()); -// if (basLift == null) { -// basLift = new BasLift(); -// //鎻愬崌鏈哄彿 -// basLift.setLiftNo(slave.getId()); -// liftService.insert(basLift); -// } -// basLift.setStatus(liftProtocol.getProtocolStatus()); -// basLift.setWrkNo(liftProtocol.getTaskNo().intValue()); -// basLift.setUpdateTime(new Date()); -// basLift.setPakMk(liftProtocol.getPakMk()); -// basLift.setLiftLock(liftProtocol.getLiftLock()); -// basLift.setPositionArrivalFeedback(liftProtocol.getPositionArrivalFeedback().intValue()); -// basLift.setReady(liftProtocol.getReady()); -// basLift.setRunning(liftProtocol.getRunning()); -// basLift.setMode(liftProtocol.getMode()); -// basLift.setLineFrontHasStock(liftProtocol.getLineFrontHasStock()); -// basLift.setForwardRotationFeedback(liftProtocol.getForwardRotationFeedback()); -// basLift.setReverseFeedback(liftProtocol.getReverseFeedback()); -// basLift.setMotorOverload(liftProtocol.getMotorOverload()); -// basLift.setLineEndHasStock(liftProtocol.getLineEndHasStock()); -// basLift.setInConveyLineCardTrayAlarm(liftProtocol.getInConveyLineCardTrayAlarm()); -// basLift.setOutConveyLineCardTrayAlarm(liftProtocol.getOutConveyLineCardTrayAlarm()); -// basLift.setPlatPositionDeviationAlarm(liftProtocol.getPlatPositionDeviationAlarm()); -// basLift.setPlatTorqueDeviationAlarm(liftProtocol.getPlatTorqueDeviationAlarm()); -// basLift.setPlatShuttleCheck(liftProtocol.getPlatShuttleCheck()); -// basLift.setNotReady(liftProtocol.getNotReady().intValue()); -// basLift.setServoError1(liftProtocol.getServoError1().intValue()); -// basLift.setServoError2(liftProtocol.getServoError2().intValue()); -// basLift.setServoError3(liftProtocol.getServoError3().intValue()); -// basLift.setServoError4(liftProtocol.getServoError4().intValue()); -// basLift.setLiftActualSpeed(liftProtocol.getLiftActualSpeed().intValue()); -// if (liftService.updateById(basLift)) { -// OutputQueue.LIFT.offer(MessageFormat.format("銆恵0}銆慬id:{1}] <<<<< 瀹炴椂鏁版嵁鏇存柊鎴愬姛",DateUtils.convert(new Date()), slave.getId())); -//// log.info(MessageFormat.format("銆恵0}銆慬id:{1}] <<<<< 瀹炴椂鏁版嵁鏇存柊鎴愬姛",DateUtils.convert(new Date()), slave.getId())); -// } + byte[] content = result.Content; + //妯″紡 + liftProtocol.setModel(siemensS7Net.getByteTransform().TransBool(content, 0)); + //蹇欓棽 + liftProtocol.setBusy(siemensS7Net.getByteTransform().TransBool(content, 1)); + //鍓嶈秴闄� + liftProtocol.setFrontOverrun(siemensS7Net.getByteTransform().TransBool(content, 7)); + //鍚庤秴闄� + liftProtocol.setBackOverrun(siemensS7Net.getByteTransform().TransBool(content, 8)); + //宸﹁秴闄� + liftProtocol.setLeftOverrun(siemensS7Net.getByteTransform().TransBool(content, 9)); + //鍙宠秴闄� + liftProtocol.setRightOverrun(siemensS7Net.getByteTransform().TransBool(content, 10)); + //瓒呴珮 + liftProtocol.setOverHeight(siemensS7Net.getByteTransform().TransBool(content, 11)); + //瓒呴噸 + liftProtocol.setOverWeight(siemensS7Net.getByteTransform().TransBool(content, 12)); + //鏈夋墭鐩� + liftProtocol.setHasTray(siemensS7Net.getByteTransform().TransBool(content, 16)); + //鏈夊皬杞� + liftProtocol.setHasCar(siemensS7Net.getByteTransform().TransBool(content, 17)); + //璁惧鏁呴殰 + liftProtocol.setDeviceError(siemensS7Net.getByteTransform().TransBool(content, 18)); + //浠诲姟鍙� + liftProtocol.setTaskNo(siemensS7Net.getByteTransform().TransInt16(content, 19)); + //浠诲姟鍦板潃 + liftProtocol.setTaskAddress(siemensS7Net.getByteTransform().TransInt16(content, 21)); + //鐩殑鍦板潃 + liftProtocol.setDistAddress(siemensS7Net.getByteTransform().TransInt16(content, 21)); + //宸插畬鎴愪换鍔″彿 + liftProtocol.setCompleteTaskNo(siemensS7Net.getByteTransform().TransInt16(content, 23)); + //褰撳墠妤煎眰 + liftProtocol.setLev(siemensS7Net.getByteTransform().TransInt16(content, 25)); + + ///璇诲彇鎻愬崌鏈虹姸鎬�-end + + //灏嗘彁鍗囨満鐘舵�佷繚瀛樿嚦鏁版嵁搴� + BasLiftService liftService = SpringUtils.getBean(BasLiftService.class); + BasLift basLift = liftService.selectById(liftProtocol.getLiftNo()); + if (basLift == null) { + basLift = new BasLift(); + //鎻愬崌鏈哄彿 + basLift.setLiftNo(slave.getId()); + liftService.insert(basLift); + } + basLift.setStatus(liftProtocol.getProtocolStatus()); + basLift.setWrkNo(liftProtocol.getTaskNo().intValue()); + basLift.setUpdateTime(new Date()); + basLift.setPakMk(liftProtocol.getPakMk()); + basLift.setModel(liftProtocol.getModel()); + basLift.setBusy(liftProtocol.getBusy()); + basLift.setFrontOverrun(liftProtocol.getFrontOverrun()); + basLift.setBackOverrun(liftProtocol.getBackOverrun()); + basLift.setLeftOverrun(liftProtocol.getLeftOverrun()); + basLift.setRightOverrun(liftProtocol.getRightOverrun()); + basLift.setOverHeight(liftProtocol.getOverHeight()); + basLift.setOverWeight(liftProtocol.getOverWeight()); + basLift.setHasTray(liftProtocol.getHasTray()); + basLift.setHasCar(liftProtocol.getHasCar()); + basLift.setDeviceError(liftProtocol.getDeviceError()); + basLift.setTaskAddress(liftProtocol.getTaskAddress().intValue()); + basLift.setDistAddress(liftProtocol.getDistAddress().intValue()); + basLift.setCompleteTaskNo(liftProtocol.getCompleteTaskNo().intValue()); + basLift.setLev(liftProtocol.getLev().intValue()); + if (liftService.updateById(basLift)) { + OutputQueue.LIFT.offer(MessageFormat.format("銆恵0}銆慬id:{1}] <<<<< 瀹炴椂鏁版嵁鏇存柊鎴愬姛",DateUtils.convert(new Date()), slave.getId())); +// log.info(MessageFormat.format("銆恵0}銆慬id:{1}] <<<<< 瀹炴椂鏁版嵁鏇存柊鎴愬姛",DateUtils.convert(new Date()), slave.getId())); + } }else { OutputQueue.LIFT.offer(MessageFormat.format("銆恵0}銆憑1}鎻愬崌鏈簆lc鐘舵�佷俊鎭け璐�", DateUtils.convert(new Date()), slave.getId())); @@ -419,42 +396,42 @@ int size = commands.size(); LiftAssignCommand assignCommand = redisCommand.getAssignCommand(); - if (commandStep != 0) { - //鍒ゆ柇涓婁竴鏉℃寚浠ゆ槸鍚﹀畬鎴� - LiftCommand command = commands.get(commandStep - 1); - if (command.getRun().intValue() == 1) { - //鎻愬崌鏈哄崌闄嶅懡浠� - if (command.getDistPosition().intValue() == liftProtocol.getPositionArrivalFeedback().intValue()) { - //鎻愬崌鏈虹洰鏍囨ゼ灞傚拰瀹為檯妤煎眰鐩稿悓锛屽垯璁ゅ畾鍛戒护瀹屾垚 - command.setComplete(true); - } - } else if (command.getRun().intValue() == 2 || command.getRun().intValue() == 3) { - //鏃犺揣姝h浆锛屾湁璐ф杞� - if (!liftProtocol.getForwardRotationFeedback()) { - //杈撻�佺嚎姝h浆鍙嶉涓嶅湪杩愯涓紝璁ゅ畾鍛戒护瀹屾垚 - command.setComplete(true); - } - } else if (command.getRun().intValue() == 6 || command.getRun().intValue() == 7) { - //鏈夎揣鍙嶈浆锛屾棤璐у弽杞� - if (!liftProtocol.getReverseFeedback()) { - //杈撻�佺嚎鍙嶈浆鍙嶉涓嶅湪杩愯涓紝璁ゅ畾鍛戒护瀹屾垚 - command.setComplete(true); - } - } else if (command.getRun().intValue() == 4) { - //杈撻�佺嚎鍋滄 - if (!liftProtocol.getForwardRotationFeedback() && !liftProtocol.getReverseFeedback()) { - //杈撻�佺嚎姝h浆鍙嶈浆閮戒笉鍦ㄨ繍琛屼腑锛岃瀹氬懡浠ゅ畬鎴� - command.setComplete(true); - } - } - //浠诲姟鏁版嵁淇濆瓨鍒皉edis - redisUtil.set("lift_wrk_no_" + redisCommand.getWrkNo(), JSON.toJSONString(redisCommand)); - - if (!command.getComplete()) { - //涓婁竴鏉′换鍔℃湭瀹屾垚锛岀姝笅鍙戝懡浠� - return false; - } - } +// if (commandStep != 0) { +// //鍒ゆ柇涓婁竴鏉℃寚浠ゆ槸鍚﹀畬鎴� +// LiftCommand command = commands.get(commandStep - 1); +// if (command.getRun().intValue() == 1) { +// //鎻愬崌鏈哄崌闄嶅懡浠� +// if (command.getDistPosition().intValue() == liftProtocol.getPositionArrivalFeedback().intValue()) { +// //鎻愬崌鏈虹洰鏍囨ゼ灞傚拰瀹為檯妤煎眰鐩稿悓锛屽垯璁ゅ畾鍛戒护瀹屾垚 +// command.setComplete(true); +// } +// } else if (command.getRun().intValue() == 2 || command.getRun().intValue() == 3) { +// //鏃犺揣姝h浆锛屾湁璐ф杞� +// if (!liftProtocol.getForwardRotationFeedback()) { +// //杈撻�佺嚎姝h浆鍙嶉涓嶅湪杩愯涓紝璁ゅ畾鍛戒护瀹屾垚 +// command.setComplete(true); +// } +// } else if (command.getRun().intValue() == 6 || command.getRun().intValue() == 7) { +// //鏈夎揣鍙嶈浆锛屾棤璐у弽杞� +// if (!liftProtocol.getReverseFeedback()) { +// //杈撻�佺嚎鍙嶈浆鍙嶉涓嶅湪杩愯涓紝璁ゅ畾鍛戒护瀹屾垚 +// command.setComplete(true); +// } +// } else if (command.getRun().intValue() == 4) { +// //杈撻�佺嚎鍋滄 +// if (!liftProtocol.getForwardRotationFeedback() && !liftProtocol.getReverseFeedback()) { +// //杈撻�佺嚎姝h浆鍙嶈浆閮戒笉鍦ㄨ繍琛屼腑锛岃瀹氬懡浠ゅ畬鎴� +// command.setComplete(true); +// } +// } +// //浠诲姟鏁版嵁淇濆瓨鍒皉edis +// redisUtil.set("lift_wrk_no_" + redisCommand.getWrkNo(), JSON.toJSONString(redisCommand)); +// +// if (!command.getComplete()) { +// //涓婁竴鏉′换鍔℃湭瀹屾垚锛岀姝笅鍙戝懡浠� +// return false; +// } +// } //鍙栧嚭鍛戒护 LiftCommand command = commands.get(commandStep); @@ -503,7 +480,6 @@ return false; }else { News.info("鎻愬崌鏈哄懡浠や笅鍙戞垚鍔燂紝鎻愬崌鏈哄彿={}锛屼换鍔℃暟鎹�={}", command.getLiftNo(), JSON.toJSON(command)); - liftProtocol.setWrkTime(new Date());//鏇存柊宸ヤ綔鏃堕棿 //灏嗘爣璁扮疆涓篺alse(闃叉閲嶅彂) liftProtocol.setPakMk(false); diff --git a/src/main/webapp/views/lift.html b/src/main/webapp/views/lift.html index 76a83f2..581a76d 100644 --- a/src/main/webapp/views/lift.html +++ b/src/main/webapp/views/lift.html @@ -29,20 +29,17 @@ <th>鎻愬崌鏈�</th> <th>宸ヤ綔鍙�</th> <th>浠诲姟鐘舵��</th> - <th>鎻愬崌鏈洪攣瀹�</th> - <th>浣嶇疆鍒拌揪鍙嶉</th> - <th>鍑嗗灏辩华</th> - <th>杩愯涓�</th> - <th>鑱旀満/鍗曟満</th> - <th>骞冲彴浣嶇疆鍋忓樊鎶ヨ</th> - <th>骞冲彴鎵煩鍋忓樊鎶ヨ</th> - <th>骞冲彴鍥涘悜杞︽娴�</th> - <th>鏈氨缁姸鎬�</th> - <th>浼烘湇1閿欒</th> - <th>浼烘湇2閿欒</th> - <th>浼烘湇3閿欒</th> - <th>浼烘湇4閿欒</th> - <th>鎻愬崌鏈哄疄闄呴�熷害鍙嶉</th> + <th>妯″紡</th> + <th>蹇欓棽</th> + <th>鏈夋墭鐩�</th> + <th>鏈夊皬杞�</th> + <th>璁惧鏁呴殰</th> + <th>鍓嶈秴闄�</th> + <th>鍚庤秴闄�</th> + <th>宸﹁秴闄�</th> + <th>鍙宠秴闄�</th> + <th>瓒呴珮</th> + <th>瓒呴噸</th> </tr> </thead> <tbody> @@ -57,13 +54,10 @@ <tr> <th>鎻愬崌鏈�</th> <th>宸ヤ綔鍙�</th> - <th>杈撻�佺嚎鍓嶇鍏夌數鏈夎揣</th> - <th>杈撻�佺嚎姝h浆鍙嶉</th> - <th>杈撻�佺嚎鍙嶈浆鍙嶉</th> - <th>杈撻�佺嚎鐢垫満杩囪浇</th> - <th>杈撻�佺嚎鏈鍏夌數鏈夎揣</th> - <th>杩涜緭閫佺嚎鍗℃墭鐩樻姤璀�</th> - <th>鍑鸿緭閫佺嚎鍗℃墭鐩樻姤璀�</th> + <th>浠诲姟鍦板潃</th> + <th>鐩殑鍦板潃</th> + <th>宸插畬鎴愮殑浠诲姟鍙�</th> + <th>灞�</th> <th>浣滀笟鏍囪</th> <th>绌挎杞﹀彿</th> </tr> @@ -104,11 +98,6 @@ <option value="2">杈撻�佺嚎浣嶇疆</option> </select> <button class="item" onclick="liftOperator(1)">绉诲姩鎻愬崌鏈�</button> - <button class="item" onclick="liftOperator(3)">鏃犺揣姝h浆</button> - <button class="item" onclick="liftOperator(4)">鏃犺揣鍙嶈浆</button> - <button class="item" onclick="liftOperator(5)">鏈夎揣姝h浆</button> - <button class="item" onclick="liftOperator(6)">鏈夎揣鍙嶈浆</button> - <button class="item" onclick="liftOperator(7)">閾炬潯鍋滄</button> <button class="item" onclick="liftOperator(0)">澶嶄綅</button> </div> </fieldset> @@ -263,20 +252,17 @@ setVal(tr.children("td").eq(0), table[i-1].liftNo); setVal(tr.children("td").eq(1), table[i-1].taskNo); setVal(tr.children("td").eq(2), table[i-1].protocolStatus$); - setVal(tr.children("td").eq(3), table[i-1].liftLock$); - setVal(tr.children("td").eq(4), table[i-1].positionArrivalFeedback); - setVal(tr.children("td").eq(5), table[i-1].ready$); - setVal(tr.children("td").eq(6), table[i-1].running$); - setVal(tr.children("td").eq(7), table[i-1].mode$); - setVal(tr.children("td").eq(8), table[i-1].platPositionDeviationAlarm$); - setVal(tr.children("td").eq(9), table[i-1].platTorqueDeviationAlarm$); - setVal(tr.children("td").eq(10), table[i-1].platShuttleCheck$); - setVal(tr.children("td").eq(11), table[i-1].notReady$); - setVal(tr.children("td").eq(12), table[i-1].servoError1); - setVal(tr.children("td").eq(13), table[i-1].servoError2); - setVal(tr.children("td").eq(14), table[i-1].servoError3); - setVal(tr.children("td").eq(15), table[i-1].servoError4); - setVal(tr.children("td").eq(16), table[i-1].liftActualSpeed); + setVal(tr.children("td").eq(3), table[i-1].model$); + setVal(tr.children("td").eq(4), table[i-1].busy$); + setVal(tr.children("td").eq(5), table[i-1].hasTray$); + setVal(tr.children("td").eq(6), table[i-1].hasCar$); + setVal(tr.children("td").eq(7), table[i-1].deviceError$); + setVal(tr.children("td").eq(8), table[i-1].frontOverrun$); + setVal(tr.children("td").eq(9), table[i-1].backOverrun$); + setVal(tr.children("td").eq(10), table[i-1].leftOverrun$); + setVal(tr.children("td").eq(11), table[i-1].rightOverrun$); + setVal(tr.children("td").eq(12), table[i-1].overHeight$); + setVal(tr.children("td").eq(13), table[i-1].overWeight$); } } else if (res.code === 403){ window.location.href = baseUrl+"/login"; @@ -305,15 +291,12 @@ var tr = tableEl.find("tr").eq(i); setVal(tr.children("td").eq(0), table[i-1].liftNo); setVal(tr.children("td").eq(1), table[i-1].workNo); - setVal(tr.children("td").eq(2), table[i-1].lineFrontHasStock$); - setVal(tr.children("td").eq(3), table[i-1].forwardRotationFeedback$); - setVal(tr.children("td").eq(4), table[i-1].reverseFeedback$); - setVal(tr.children("td").eq(5), table[i-1].motorOverload$); - setVal(tr.children("td").eq(6), table[i-1].lineEndHasStock$); - setVal(tr.children("td").eq(7), table[i-1].inConveyLineCardTrayAlarm$); - setVal(tr.children("td").eq(8), table[i-1].outConveyLineCardTrayAlarm$); - setVal(tr.children("td").eq(9), table[i-1].pakMk); - setVal(tr.children("td").eq(10), table[i-1].shuttleNo); + setVal(tr.children("td").eq(2), table[i-1].taskAddress); + setVal(tr.children("td").eq(3), table[i-1].distAddress); + setVal(tr.children("td").eq(4), table[i-1].completeTaskNo); + setVal(tr.children("td").eq(5), table[i-1].lev); + setVal(tr.children("td").eq(6), table[i-1].pakMk); + setVal(tr.children("td").eq(7), table[i-1].shuttleNo); } } else if (res.code === 403){ window.location.href = baseUrl+"/login"; -- Gitblit v1.9.1