| src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/zy/asrs/service/impl/TaskWrkServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/zy/core/model/RgvSlave.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/zy/core/thread/RgvThread.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/resources/application-prod.yml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -979,8 +979,11 @@ } // 判断堆垛机出库站状态 if (staProtocol.isAutoing() && !staProtocol.isLoading() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y") && staProtocol.getWorkNo() == 0 && staProtocol.isOutEnable()) { if (staProtocol.isAutoing() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y")) { // // 判断堆垛机出库站状态 // if (staProtocol.isAutoing() && !staProtocol.isLoading() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y") // && staProtocol.getWorkNo() == 0 && staProtocol.isOutEnable()) { // 命令下发区 -------------------------------------------------------------------------- // 堆垛机控制过滤 @@ -1082,6 +1085,8 @@ if (staProtocol.isOutEnable()){ CrnErrCache.updateCrnErr(crnProtocol.getCrnNo(), "没有可出"); } } else { CrnErrCache.updateCrnErr(crnProtocol.getCrnNo(), "出库站点:非自动"); } } } @@ -1568,9 +1573,15 @@ } if (rgvProtocolOther.statusEnable) { BasDevpPosition basDevpPosition = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("DEV_NO", staNo)); if (Math.abs(basDevpPosition.getPlcPosition()-rgvProtocol.getRgvPos()) long abs = Math.abs(Math.abs(basDevpPosition.getPlcPosition() - rgvProtocol.getRgvPos()) - Math.abs(basDevpPosition.getPlcPosition() - rgvProtocolOther.getRgvPos())); if (abs<100){ return true; } if (Math.abs(basDevpPosition.getPlcPosition() - rgvProtocol.getRgvPos()) >= Math.abs(basDevpPosition.getPlcPosition()-rgvProtocolOther.getRgvPos())){ Math.abs(basDevpPosition.getPlcPosition() - rgvProtocolOther.getRgvPos())){ return false; } } @@ -1594,6 +1605,12 @@ } if (rgvProtocolOther.statusEnable) { BasDevpPosition basDevpPosition = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("DEV_NO", staNo)); long abs = Math.abs(Math.abs(basDevpPosition.getPlcPosition() - rgvProtocol.getRgvPos()) - Math.abs(basDevpPosition.getPlcPosition() - rgvProtocolOther.getRgvPos())); if (abs<100){ return true; } if (Math.abs(basDevpPosition.getPlcPosition()-rgvProtocol.getRgvPos()) >= Math.abs(basDevpPosition.getPlcPosition()-rgvProtocolOther.getRgvPos())){ @@ -1618,7 +1635,6 @@ TaskWrk taskWrk = taskWrkService.selectByWrkNo(staProtocol.getWorkNo()); if (taskWrk != null) { Integer stano = staProtocol.getStaNo(); if (staProtocol.getSiteId() == 1004 || staProtocol.getSiteId()==1020){ // 尺寸检测异常 @@ -1682,6 +1698,21 @@ } } return taskWrk; } } else if (staProtocol.isAutoing() && staProtocol.getWorkNo() == 0 && !staProtocol.isLoading()){ if (inSta.isDirectionOther()){ StaProtocol staProtocolOther = devpThread.getStation().get(inSta.getStaNoOther()); if (staProtocolOther == null) { return null; } // 判断是否满足取货条件 if (staProtocolOther.isAutoing() && staProtocolOther.getWorkNo() != 0) { TaskWrk taskWrkOther = taskWrkService.selectByWrkNo(staProtocolOther.getWorkNo()); if (taskWrkOther != null) { return taskWrkOther; } } } } return null; @@ -1828,7 +1859,6 @@ if (rgvOtherIDLEOther2(rgvSlave)){ if (!rgvOtherIDLE2(rgvSlave,staList.get(0))){ System.out.println("运行就近跳过==="+rgvSlave.getId()+"==="); sign=true; } } src/main/java/com/zy/asrs/service/impl/TaskWrkServiceImpl.java
@@ -136,7 +136,7 @@ crnCommand.setDestinationPosX(Utils.getRowShort(taskWrk.getTargetPoint())); // 目标库位列 crnCommand.setDestinationPosY(Utils.getBayShort(taskWrk.getTargetPoint())); // 目标库位层 crnCommand.setDestinationPosZ(Utils.getLevShort(taskWrk.getTargetPoint())); // 目标库位排 crnCommand.setCommand((short)1); // crnCommand.setCommand((short)1); if (!MessageQueue.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(5, crnCommand))) { log.error("堆垛机命令生成失败,堆垛机号={},任务数据={}", taskWrk.getCrnNo(), JSON.toJSON(crnCommand)); throw new CoolException("堆垛机命令生成失败"); @@ -210,7 +210,7 @@ crnCommand.setDestinationPosX(crnStn.getBay().shortValue()); // 目标库位排 crnCommand.setDestinationPosY(crnStn.getLev().shortValue()); // 目标库位列 crnCommand.setDestinationPosZ(crnStn.getRow().shortValue()); // 目标库位层 crnCommand.setCommand((short)1); // crnCommand.setCommand((short)1); if (!MessageQueue.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(5, crnCommand))) { log.error("堆垛机命令生成失败,堆垛机号={},任务数据={}", taskWrk.getCrnNo(), JSON.toJSON(crnCommand)); throw new CoolException("堆垛机命令生成失败"); src/main/java/com/zy/core/model/RgvSlave.java
@@ -45,6 +45,12 @@ // RGV站点编号 private boolean direction; // RGV站点编号 private Integer staNoOther; // RGV站点编号 private boolean directionOther; // // 排 // private Integer row; // src/main/java/com/zy/core/thread/RgvThread.java
@@ -339,18 +339,18 @@ continue; } try { Thread.sleep(50); Thread.sleep(100); rgvRun = RgvRunCache.getRgvRun(); // System.out.println(JSON.toJSON(rgvRun)); // 休眠 1 秒 if (System.currentTimeMillis() - rgvRun.currentTimeMilliOld > 100) { rgvRun.currentTimeMilliOld = System.currentTimeMillis()+10; if (System.currentTimeMillis() - rgvRun.currentTimeMilliOld > 500) { rgvRun.currentTimeMilliOld = System.currentTimeMillis()+50; } else { continue; } if (!deviceDetection()) { rgvRun.currentTimeMilliOld = System.currentTimeMillis()+10; rgvRun.currentTimeMilliOld = System.currentTimeMillis()+50; rgvRun.setRgvNo(slave.getOtherId()); RgvRunCache.updateRgvStatus(rgvRun); if (!errorRgv.equals("无")){ @@ -367,20 +367,20 @@ rgvTaskProtocol = RgvTaskCache.getRgvStatus(slave.getId()); } if (!rgvProtocol.getStatusType().equals(RgvStatusType.IDLE) || (Math.abs(rgvProtocol.getRgvPos() - rgvProtocol.getRgvPosDestination())>100)){ rgvRun.currentTimeMilliOld = System.currentTimeMillis()+10; rgvRun.currentTimeMilliOld = System.currentTimeMillis()+50; rgvRun.setRgvNo(slave.getOtherId()); RgvRunCache.updateRgvStatus(rgvRun); continue; } if (rgvProtocol.getLoaded() == -1){ rgvRun.currentTimeMilliOld = System.currentTimeMillis()+10; rgvRun.currentTimeMilliOld = System.currentTimeMillis()+50; rgvRun.setRgvNo(slave.getOtherId()); RgvRunCache.updateRgvStatus(rgvRun); RgvErrCache.updateRgvErr(slave.getId(),"小车探物物状态异常"); continue; } if (rgvTaskProtocol.getAvoid() != 0) { rgvRun.currentTimeMilliOld = System.currentTimeMillis()+10; rgvRun.currentTimeMilliOld = System.currentTimeMillis()+50; rgvRun.setRgvNo(slave.getOtherId()); RgvRunCache.updateRgvStatus(rgvRun); continue; @@ -468,7 +468,7 @@ } } } rgvRun.currentTimeMilliOld = System.currentTimeMillis()+10; rgvRun.currentTimeMilliOld = System.currentTimeMillis()+50; rgvRun.setRgvNo(slave.getOtherId()); RgvRunCache.updateRgvStatus(rgvRun); } catch (Exception e) { @@ -480,7 +480,7 @@ // log.error("e2:"+e2.getMessage()); } rgvRun = RgvRunCache.getRgvRun(); rgvRun.currentTimeMilliOld = System.currentTimeMillis()+10; rgvRun.currentTimeMilliOld = System.currentTimeMillis()+50; rgvRun.setRgvNo(slave.getOtherId()); RgvRunCache.updateRgvStatus(rgvRun); continue; src/main/resources/application-prod.yml
@@ -101,76 +101,109 @@ rgvInSta[0]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1004 #执行方向(面朝轨道 定位值左小右大) true:左 false:右 direction: true staNoOther: 1005 directionOther: false rgvInSta[1]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1014 #执行方向(面朝轨道 定位值左小右大) true:左 false:右 direction: true staNoOther: 1016 directionOther: true rgvInSta[2]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1020 #执行方向(面朝轨道 定位值左小右大) true:左 false:右 direction: true staNoOther: 1021 directionOther: false rgvInSta[3]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1003 #执行方向(面朝轨道 定位值左小右大) true:左 false:右 direction: false staNoOther: 1003 directionOther: false rgvInSta[4]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1007 #执行方向(面朝轨道 定位值左小右大) true:左 false:右 direction: false staNoOther: 1007 directionOther: false rgvInSta[5]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1013 #执行方向(面朝轨道 定位值左小右大) true:左 false:右 direction: false staNoOther: 1013 directionOther: false rgvInSta[6]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1018 #执行方向(面朝轨道 定位值左小右大) true:左 false:右 direction: false staNoOther: 1018 directionOther: false rgvInSta[7]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1019 #执行方向(面朝轨道 定位值左小右大) true:左 false:右 direction: false staNoOther: 1019 directionOther: false #RGV目标站点 rgvOutSta[0]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1002 direction: true staNoOther: 1002 directionOther: false rgvOutSta[1]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1009 #执行方向(面朝轨道 定位值左小右大) true:左 false:右 direction: true staNoOther: 1009 directionOther: false rgvOutSta[2]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1001 direction: false staNoOther: 1001 directionOther: false rgvOutSta[3]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1006 direction: false staNoOther: 1006 directionOther: false rgvOutSta[4]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1008 direction: false staNoOther: 1008 directionOther: false rgvOutSta[5]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1017 direction: false staNoOther: 1017 directionOther: false rgvSuperSta[0]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1001 direction: false staNoOther: 1001 directionOther: false rgvSuperSta[1]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1002 direction: false staNoOther: 1002 directionOther: false # RGV穿梭车2 rgv[0]: id: 1 @@ -186,75 +219,107 @@ devpPlcId: ${wcs-slave.devp[0].id} staNo: 1004 direction: true staNoOther: 1005 directionOther: false rgvInSta[1]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1014 #执行方向(面朝轨道 定位值左小右大) true:左 false:右 direction: true staNoOther: 1016 directionOther: true rgvInSta[2]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1020 #执行方向(面朝轨道 定位值左小右大) true:左 false:右 direction: true staNoOther: 1021 directionOther: false rgvInSta[3]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1003 #执行方向(面朝轨道 定位值左小右大) true:左 false:右 direction: false staNoOther: 1003 directionOther: false rgvInSta[4]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1007 #执行方向(面朝轨道 定位值左小右大) true:左 false:右 direction: false staNoOther: 1007 directionOther: false rgvInSta[5]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1013 #执行方向(面朝轨道 定位值左小右大) true:左 false:右 direction: false staNoOther: 1013 directionOther: false rgvInSta[6]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1018 #执行方向(面朝轨道 定位值左小右大) true:左 false:右 direction: false staNoOther: 1018 directionOther: false rgvInSta[7]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1019 #执行方向(面朝轨道 定位值左小右大) true:左 false:右 direction: false staNoOther: 1019 directionOther: false #RGV目标站点 rgvOutSta[0]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1023 direction: true staNoOther: 1023 directionOther: false rgvOutSta[1]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1009 #执行方向(面朝轨道 定位值左小右大) true:左 false:右 direction: true staNoOther: 1009 directionOther: false rgvOutSta[2]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1022 direction: false staNoOther: 1022 directionOther: false rgvOutSta[3]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1006 direction: false staNoOther: 1006 directionOther: false rgvOutSta[4]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1008 direction: false staNoOther: 1008 directionOther: false rgvOutSta[5]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1017 direction: false staNoOther: 1017 directionOther: false rgvSuperSta[0]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1023 direction: false staNoOther: 1023 directionOther: false rgvSuperSta[1]: devpPlcId: ${wcs-slave.devp[0].id} staNo: 1022 direction: false staNoOther: 1022 directionOther: false barcode[0]: #条码扫描仪1004 port: 51236