| | |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.service.impl.MainServiceImpl; |
| | | import com.zy.asrs.utils.CommandUtils; |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import com.zy.core.CrnThread; |
| | | import com.zy.core.cache.MessageQueue; |
| | |
| | | crnCommand.setCommand((short) 0); // 任务完成确认位 |
| | | // 延时发送 |
| | | Thread.sleep(1000L); |
| | | if (CommandUtils.offer(SlaveType.Crn, crn.getId(), new Task(5, crnCommand), false)) { |
| | | if (MessageQueue.offer(SlaveType.Crn, crn.getId(), new Task(5, crnCommand))) { |
| | | return R.ok(); |
| | | } else { |
| | | throw new CoolException("命令下发失败"); |
| | |
| | | } |
| | | // 空闲判断 |
| | | // if (crnProtocol.getStatusType().equals(com.zy.core.enums.CrnStatusType.IDLE) && crnProtocol.getTaskNo() == 0) { |
| | | if (CommandUtils.offer(SlaveType.Crn, crn.getId(), new Task(4, command), false)) { |
| | | if (MessageQueue.offer(SlaveType.Crn, crn.getId(), new Task(4, command))) { |
| | | return true; |
| | | } else { |
| | | throw new CoolException("命令下发失败"); |
| | |
| | | } |
| | | // 空闲判断 |
| | | // if (crnProtocol.getStatusType().equals(com.zy.core.enums.CrnStatusType.IDLE) && crnProtocol.getTaskNo() == 0) { |
| | | if (CommandUtils.offer(SlaveType.Crn, crn.getId(), new Task(2, command), false)) { |
| | | if (MessageQueue.offer(SlaveType.Crn, crn.getId(), new Task(2, command))) { |
| | | return true; |
| | | } else { |
| | | throw new CoolException("命令下发失败"); |
| | |
| | | import com.zy.asrs.domain.vo.SiteTableVo; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.zy.asrs.utils.CommandUtils; |
| | | import com.zy.core.DevpThread; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.OutputQueue; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.SlaveType; |
| | |
| | | basDevp.setOutEnable(outEnable ? "Y" : "N"); |
| | | } |
| | | basDevpService.updateById(basDevp); |
| | | boolean result = CommandUtils.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | if (result) { |
| | | return R.ok(); |
| | | } else { |
| | |
| | | staProtocol.setWorkNo((short) 0); |
| | | staProtocol.setStaNo((short) 0); |
| | | basDevpService.updateById(basDevp); |
| | | boolean result = CommandUtils.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol)); |
| | | if (result) { |
| | | return R.ok(); |
| | | } else { |
| | |
| | | } |
| | | staProtocol.setWorkNo((short) 9999); |
| | | staProtocol.setStaNo(inSta.getStaNo().shortValue()); |
| | | boolean result = CommandUtils.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol)); |
| | | if (result) { |
| | | return R.ok(); |
| | | } else { |
| | |
| | | import com.zy.asrs.service.ApiLogService; |
| | | import com.zy.asrs.service.StaDescService; |
| | | import com.zy.asrs.service.TaskWrkService; |
| | | import com.zy.asrs.utils.CommandUtils; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.core.DevpThread; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.CrnTaskModeType; |
| | | import com.zy.core.enums.SlaveType; |
| | |
| | | crnCommand.setDestinationPosY(Utils.getBayShort(taskWrk.getTargetPoint())); // 目标库位层 |
| | | crnCommand.setDestinationPosZ(Utils.getLevShort(taskWrk.getTargetPoint())); // 目标库位排 |
| | | crnCommand.setCommand((short) 1); |
| | | if (!CommandUtils.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(5, crnCommand), false)) { |
| | | if (!MessageQueue.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(5, crnCommand))) { |
| | | log.error("堆垛机命令生成失败,堆垛机号={},任务数据={}", taskWrk.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | throw new CoolException("堆垛机命令生成失败"); |
| | | } else { |
| | |
| | | crnCommand.setDestinationPosY(crnStn.getLev().shortValue()); // 目标库位列 |
| | | crnCommand.setDestinationPosZ(crnStn.getRow().shortValue()); // 目标库位层 |
| | | crnCommand.setCommand((short) 1); |
| | | if (!CommandUtils.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(5, crnCommand))) { |
| | | if (!MessageQueue.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(5, crnCommand))) { |
| | | log.error("堆垛机命令生成失败,堆垛机号={},任务数据={}", taskWrk.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | throw new CoolException("堆垛机命令生成失败"); |
| | | } |
| | |
| | | StaProtocol staProtocol = devpThread.getStation().get(crnStn.getStaNo()).clone(); |
| | | staProtocol.setWorkNo(taskWrk.getWrkNo().shortValue()); |
| | | staProtocol.setStaNo((short) Integer.parseInt(taskWrk.getTargetPoint())); |
| | | if (!CommandUtils.offer(SlaveType.Devp, crnStn.getDevpPlcId(), new Task(3, staProtocol))) { |
| | | if (!MessageQueue.offer(SlaveType.Devp, crnStn.getDevpPlcId(), new Task(3, staProtocol))) { |
| | | log.error("输送线命令生成失败,堆垛机号={},任务数据={}", taskWrk.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | throw new CoolException("输送线命令生成失败"); |
| | | } |
| | |
| | | "hpPosition": 0, |
| | | "minBayNo": 1, |
| | | "floors": 1, |
| | | "racks": [{ |
| | | "racks": [ |
| | | { |
| | | "type": "rack", |
| | | "id": "rack7", |
| | | "top": 483, |
| | | "left": 800, |
| | | "width": 795, |
| | | "height": 23, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 22, |
| | | "hiddenArr": [1,22] |
| | | }, { |
| | | "type": "rack", |
| | | "id": "rack6", |
| | | "top": 460, |
| | | "left": 800, |
| | | "width": 795, |
| | | "height": 23, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 22, |
| | | "hiddenArr": [1,22] |
| | | }, { |
| | | "type": "rack", |
| | | "id": "rack5", |
| | | "top": 366, |
| | | "left": 800, |
| | | "width": 795, |
| | | "height": 23, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 22, |
| | | "hiddenArr": [1,22] |
| | | },{ |
| | | "type": "rack", |
| | | "id": "rack8", |
| | | "top": 389, |
| | | "left": 800, |
| | | "width": 795, |
| | | "height": 23, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 22, |
| | | "hiddenArr": [1,22] |
| | | },{ |
| | | "type": "rack", |
| | | "id": "rack7", |
| | | "top": 326, |
| | |
| | | }], |
| | | "crns": [{ |
| | | "type": "crane", |
| | | "id": "crn-3", |
| | | "text": "3", |
| | | "top": 423, |
| | | "left": 855, |
| | | "width": 93, |
| | | "height": 22 |
| | | },{ |
| | | "type": "crane", |
| | | "id": "crn-2", |
| | | "text": "2", |
| | | "top": 268, |
| | |
| | | "left": 855, |
| | | "width": 93, |
| | | "height": 22 |
| | | }, { |
| | | "type": "track", |
| | | "id": "lb_track3", |
| | | "text": "", |
| | | "top": 433, |
| | | "left": 769, |
| | | "width": 850, |
| | | "height": 2 |
| | | }, { |
| | | "type": "track", |
| | | "id": "lb_track2", |
| | |
| | | "height": 706, |
| | | "stns": [{ |
| | | "type": "stn", |
| | | "id": "site-100", |
| | | "text": "100", |
| | | "id": "site-102", |
| | | "text": "102", |
| | | "top": 99, |
| | | "left": 771, |
| | | "width": 62, |
| | |
| | | "id": "site-101", |
| | | "text": "101", |
| | | "top": 99, |
| | | "left": 707, |
| | | "left": 705, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-102", |
| | | "text": "102", |
| | | "top": 99, |
| | | "left": 643, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-103", |
| | | "text": "103", |
| | | "top": 99, |
| | | "left": 579, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-104", |
| | | "text": "104", |
| | | "top": 124, |
| | | "left": 579, |
| | | "width": 62, |
| | | "height": 34 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-125", |
| | | "text": "125", |
| | | "id": "site-105", |
| | | "text": "105", |
| | | "top": 160, |
| | | "left": 771, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-124", |
| | | "text": "124", |
| | | "id": "site-104", |
| | | "text": "104", |
| | | "top": 160, |
| | | "left": 707, |
| | | "left": 705, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-123", |
| | | "text": "123", |
| | | "top": 160, |
| | | "left": 643, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-122", |
| | | "text": "122", |
| | | "top": 160, |
| | | "left": 579, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-121", |
| | | "text": "121", |
| | | "top": 186, |
| | | "left": 579, |
| | | "width": 62, |
| | | "height": 42 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-120", |
| | |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-119", |
| | | "text": "119", |
| | | "top": 231, |
| | | "left": 707, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-118", |
| | | "text": "118", |
| | | "top": 231, |
| | | "left": 643, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-117", |
| | | "text": "117", |
| | | "top": 231, |
| | | "left": 579, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-116", |
| | | "text": "116", |
| | | "top": 256, |
| | | "left": 579, |
| | | "width": 62, |
| | | "height": 46 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-115", |
| | | "text": "115", |
| | | "top": 304, |
| | |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-114", |
| | | "text": "114", |
| | | "top": 304, |
| | | "left": 707, |
| | | "id": "site-1150", |
| | | "text": "1150", |
| | | "top": 460, |
| | | "left": 771, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-113", |
| | | "text": "113", |
| | | "top": 304, |
| | | "left": 643, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-112", |
| | | "text": "112", |
| | | "top": 304, |
| | | "left": 579, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-105", |
| | | "text": "105", |
| | | "top": 99, |
| | | "left": 515, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-106", |
| | | "text": "106", |
| | | "top": 124, |
| | | "left": 515, |
| | | "width": 62, |
| | | "height": 34 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-107", |
| | | "text": "107", |
| | | "top": 160, |
| | | "left": 515, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-108", |
| | | "text": "108", |
| | | "top": 186, |
| | | "left": 515, |
| | | "width": 62, |
| | | "height": 42 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-109", |
| | | "text": "109", |
| | | "top": 231, |
| | | "left": 515, |
| | | "width": 62, |
| | | "height": 70 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-110", |
| | | "text": "110", |
| | | "top": 304, |
| | | "left": 515, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-111", |
| | | "text": "111", |
| | | "top": 329, |
| | | "left": 515, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-1001", |
| | | "text": "1001", |
| | | "top": 99, |
| | | "left": 451, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-1002", |
| | | "text": "1002", |
| | | "top": 160, |
| | | "left": 451, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-1003", |
| | | "text": "1003", |
| | | "top": 231, |
| | | "left": 451, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-1004", |
| | | "text": "1004", |
| | | "top": 304, |
| | | "left": 451, |
| | | "width": 62, |
| | | "height": 23 |
| | | } ] |
| | | }] |
| | | }] |
| | | }] |
| | | } |