From f4b367ae8aad24e56d8e79fe03b7eec9d4f28d7d Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期三, 19 十一月 2025 08:57:25 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/utils/Utils.java | 64 +++++++++++++++++++++++++++++++
1 files changed, 63 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/zy/asrs/utils/Utils.java b/src/main/java/com/zy/asrs/utils/Utils.java
index e82cac2..8089e58 100644
--- a/src/main/java/com/zy/asrs/utils/Utils.java
+++ b/src/main/java/com/zy/asrs/utils/Utils.java
@@ -6,6 +6,7 @@
import java.text.DecimalFormat;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
/**
@@ -20,6 +21,31 @@
return 0f;
}
return (float) Arith.multiplys(2, f, 1);
+ }
+
+ public static Integer getStaNoByLocNo(String locNo) {
+ HashMap<String, Integer> map = new HashMap<>();
+ map.put("0100101", 102);
+ map.put("0100202", 103);
+ map.put("0100102", 104);
+ map.put("0100203", 105);
+ map.put("0100103", 106);
+ map.put("0100204", 107);
+ map.put("0100104", 108);
+ map.put("0100205", 109);
+ map.put("0100105", 110);
+ map.put("0100206", 111);
+ map.put("0100106", 112);
+ map.put("0100207", 113);
+ map.put("0100107", 114);
+ map.put("0100208", 115);
+ map.put("0100108", 116);
+ map.put("0100209", 117);
+ map.put("0100109", 118);
+ map.put("0100210", 119);
+ map.put("0100110", 120);
+
+ return map.get(locNo);
}
public static String zerofill(String msg, Integer count){
@@ -122,7 +148,25 @@
}
return zerofill(String.valueOf(targetRow), 2) + shallowLoc.substring(2);
}
-
+ /**
+ * 鑾峰彇 娴呭簱浣嶅搴旂殑娣卞簱浣嶅彿,濡傛灉娌℃湁娣卞簱浣嶏紝鍒欒繑鍥炰负绌�
+ */
+ public static String getDeepLoc2(SlaveProperties slaveProperties, String shallowLoc) {
+ int row = getRow(shallowLoc);
+ boolean deepLoc = isDeepLoc(slaveProperties, row);//鍒ゆ柇鏄惁涓烘繁搴撲綅
+ if (deepLoc) {
+ return null;
+ }
+ if (row == 1 || row == 6) {
+ return null;
+ }
+ //2,8,11,15,19,23
+ if (row == 5 || row == 8 || row == 12 || row == 16 || row == 20 || row == 24) {
+ return zerofill(String.valueOf(row - 1), 2) + shallowLoc.substring(2);
+ } else {
+ return zerofill(String.valueOf(row + 1), 2) + shallowLoc.substring(2);
+ }
+ }
/**
* 鑾峰彇 娴呭簱浣嶆帓瀵瑰簲鐨勬繁搴撲綅鎺�
*/
@@ -164,6 +208,24 @@
}
+ /**
+ * 閫氳繃搴撲綅鍙疯幏鍙栨墍鍦ㄥ贩閬�
+ */
+ public static int getLaneByLocNo(String locNo) {
+ int row = Utils.getRow(locNo);
+ switch (row) {
+ case 1:
+ case 2:
+ case 3:
+ return 1;
+ case 4:
+ case 5:
+ case 6:
+ return 2;
+ }
+ return 0;
+ }
+
public static void main(String[] args) {
SlaveProperties slaveProperties = new SlaveProperties();
slaveProperties.setDoubleDeep(true);
--
Gitblit v1.9.1