From 7aa5444a36007fc463ef8a4a08ed1bed5bc3bfd3 Mon Sep 17 00:00:00 2001 From: lsh <lsh@163.com> Date: 星期一, 13 一月 2025 13:06:27 +0800 Subject: [PATCH] * --- src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 36 ++++++++++++++++++++++++++++++------ 1 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java index 48bdd94..c67ba24 100644 --- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java @@ -57,9 +57,31 @@ private Long acceleration; @Value("${constant-parameters.rgvCount}") private Long rgvCount; + @Value("${constant-parameters.rgvDate}") + private Double rgvDate; /** * 绔欑偣浠诲姟妫�娴� 鏇存柊灏忚溅浣嶇疆淇℃伅 */ + public synchronized void updateStePositionNearby1() { + for (RgvSlave rgvSlave:slaveProperties.getRgv()) { + RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgvSlave.getId()); + RgvProtocol rgvProtocol = rgvThread.getRgvProtocol(); + if (rgvProtocol == null) { + continue; + } + try{ + double finalVelocity = 0.0; // 鏈�缁堥�熷害 (m/s) + double distance = (Math.pow(finalVelocity, 2) - Math.pow(rgvProtocol.instantaneousSpeed/60, 2)) / (2 * acceleration); + BasDevpPosition basDevpPosition = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("dev_no", 111)); + if (distance*proportion > ((SortTheExecutionOfTheCarUtil.LatelyAndLessThan(basDevpPosition.getPlcPosition(),rgvProtocol.getRgvPos(),perimeter) + (rgvProtocol.instantaneousSpeed/60)*proportion*0.1))){ +// continue ; + } + } catch (Exception e){ + + } + } + } + public synchronized void updateStePositionNearby() { try{ List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", 1L)); @@ -255,12 +277,6 @@ if (rgvProtocol == null){ continue ; } - double finalVelocity = 0.0; // 鏈�缁堥�熷害 (m/s) - double distance = (Math.pow(finalVelocity, 2) - Math.pow(rgvProtocol.instantaneousSpeed/60, 2)) / (2 * acceleration); - BasDevpPosition basDevpPosition = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("dev_no", wrkMast.getSourceStaNo())); - if (distance*proportion > ((SortTheExecutionOfTheCarUtil.LatelyAndLessThan(basDevpPosition.getPlcPosition(),rgvProtocol.getRgvPos(),perimeter) + (rgvProtocol.instantaneousSpeed/60)*10000*0.5))){ - continue ; - } List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("rgv_no", rgvProtocol.getRgvNo()).eq("wrk_sts", 2L)); if (!wrkMasts.isEmpty()){ @@ -271,6 +287,14 @@ && (rgvProtocol.getStatusType() == RgvStatusType.IDLE || rgvProtocol.getStatusType() == RgvStatusType.ROAM) && rgvProtocol.getTaskNo1()==0 && rgvProtocol.getAlarm() == 0){ + if (rgvProtocol.getStatusType() == RgvStatusType.ROAM) { + double finalVelocity = 0.0; // 鏈�缁堥�熷害 (m/s) + double distance = (Math.pow(finalVelocity, 2) - Math.pow(rgvProtocol.instantaneousSpeed/60, 2)) / (2 * acceleration); + BasDevpPosition basDevpPosition = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("dev_no", wrkMast.getSourceStaNo())); + if (distance*proportion > ((SortTheExecutionOfTheCarUtil.LatelyAndLessThan(basDevpPosition.getPlcPosition(),rgvProtocol.getRgvPos(),perimeter) + (rgvProtocol.instantaneousSpeed/60)*proportion*rgvDate))){ + continue ; + } + } RgvCommand rgvCommand = new RgvCommand(); rgvCommand.setRgvNo(rgvProtocol.getRgvNo()); rgvCommand.setAckFinish1((short) 0); // 宸ヤ綅1浠诲姟瀹屾垚纭浣� -- Gitblit v1.9.1