From 1ac622e23ac9f633a219f842e75a4482e5653333 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 15 九月 2022 13:57:39 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/enums/SteTaskModeType.java |   94 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 94 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/zy/core/enums/SteTaskModeType.java b/src/main/java/com/zy/core/enums/SteTaskModeType.java
index 5e1af9e..74d5577 100644
--- a/src/main/java/com/zy/core/enums/SteTaskModeType.java
+++ b/src/main/java/com/zy/core/enums/SteTaskModeType.java
@@ -2,6 +2,7 @@
 
 import com.core.exception.CoolException;
 import com.zy.asrs.utils.Utils;
+import com.zy.core.model.protocol.SteProtocol;
 
 public enum SteTaskModeType {
 
@@ -99,4 +100,97 @@
         }
     }
 
+
+    // -----------------------------------------------
+
+    public static SteTaskModeType findOriginByLoc(SteProtocol steProtocol) {
+        switch (steProtocol.getRow()) {
+            case 1:
+            case 2:
+            case 3:
+            case 8:
+            case 9:
+            case 10:
+            case 11:
+            case 15:
+            case 16:
+            case 17:
+            case 18:
+                return SteTaskModeType.GO_ORIGIN;
+            case 4:
+            case 5:
+            case 6:
+            case 7:
+            case 12:
+            case 13:
+            case 14:
+            case 19:
+            case 20:
+            case 21:
+                return SteTaskModeType.BACK_ORIGIN;
+            default:
+                throw new CoolException("瑙f瀽绌挎杞﹀師鐐瑰畾浣嶅け璐�");
+        }
+    }
+
+    public static SteTaskModeType findInByLoc(SteProtocol steProtocol) {
+        switch (steProtocol.getRow()) {
+            case 1:
+            case 2:
+            case 3:
+            case 8:
+            case 9:
+            case 10:
+            case 11:
+            case 15:
+            case 16:
+            case 17:
+            case 18:
+                return SteTaskModeType.IN_RIGHT;
+            case 4:
+            case 5:
+            case 6:
+            case 7:
+            case 12:
+            case 13:
+            case 14:
+            case 19:
+            case 20:
+            case 21:
+                return SteTaskModeType.IN_LEFT;
+            default:
+                throw new CoolException("瑙f瀽绌挎杞﹀師鐐瑰畾浣嶅け璐�");
+        }
+    }
+
+    public static SteTaskModeType findOutByLoc(SteProtocol steProtocol) {
+        switch (steProtocol.getRow()) {
+            case 1:
+            case 2:
+            case 3:
+            case 8:
+            case 9:
+            case 10:
+            case 11:
+            case 15:
+            case 16:
+            case 17:
+            case 18:
+                return SteTaskModeType.OUT_RIGHT;
+            case 4:
+            case 5:
+            case 6:
+            case 7:
+            case 12:
+            case 13:
+            case 14:
+            case 19:
+            case 20:
+            case 21:
+                return SteTaskModeType.OUT_LEFT;
+            default:
+                throw new CoolException("瑙f瀽绌挎杞﹀師鐐瑰畾浣嶅け璐�");
+        }
+    }
+
 }

--
Gitblit v1.9.1