From affb8562a53bdf52b71f3857eba706c3f9ca63c1 Mon Sep 17 00:00:00 2001 From: Junjie <540245094@qq.com> Date: 星期五, 08 十二月 2023 13:05:55 +0800 Subject: [PATCH] # --- src/main/java/com/zy/common/utils/ShuttleDispatchUtils.java | 41 ++++++++++++++++++++++++++++++++++++++++- 1 files changed, 40 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/zy/common/utils/ShuttleDispatchUtils.java b/src/main/java/com/zy/common/utils/ShuttleDispatchUtils.java index c753b9d..6006693 100644 --- a/src/main/java/com/zy/common/utils/ShuttleDispatchUtils.java +++ b/src/main/java/com/zy/common/utils/ShuttleDispatchUtils.java @@ -92,7 +92,7 @@ continue; } - if (!checkChargeWrk(shuttle.getId())) { + if (checkChargeWrk(shuttle.getId())) { continue;//瀛樺湪鍏呯數浠诲姟锛岃繃婊ゅ皬杞� } @@ -467,4 +467,43 @@ return true;//鏃犲厖鐢典换鍔℃斁琛� || 鍘诲厖鐢垫々涓斁琛� } + /** + * 鑾峰彇妤煎眰鍙敤灏忚溅鏁伴噺 + */ + public int getShuttleCountByLev(int lev) { + int count = 0; + for (ShuttleSlave slave : slaveProperties.getShuttle()) { + //鑾峰彇鍥涘悜绌挎杞︾嚎绋� + NyShuttleThread shuttleThread = (NyShuttleThread) SlaveConnection.get(SlaveType.Shuttle, slave.getId()); + if (shuttleThread == null) { + continue; + } + + NyShuttleProtocol shuttleProtocol = shuttleThread.getShuttleProtocol(); + if (shuttleProtocol == null || shuttleProtocol.getShuttleNo() == null) { + continue; + } + + if (checkChargeWrk(slave.getId())) { + continue;//瀛樺湪鍏呯數浠诲姟锛岃繃婊ゅ皬杞� + } + + if (shuttleProtocol.getWorkingMode() == 0) { + continue;//鎵嬪姩鐘舵�� + } + + if (shuttleProtocol.getSuspendState() == 1) { + //灏忚溅澶勪簬绠″埗涓� + continue; + } + + if (shuttleProtocol.getPoint().getZ() == lev) { + //鍚屼竴妤煎眰鍙敤灏忚溅 + count++; + continue; + } + } + return count; + } + } -- Gitblit v1.9.1