From 3efe34fdc1dfe58e16c8689faf086b38b2d73e83 Mon Sep 17 00:00:00 2001
From: zwl <1051256694@qq.com>
Date: 星期一, 16 三月 2026 16:41:36 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/jxhcwcs-version1.0' into jxhcwcs-version1.0
---
src/main/java/com/zy/core/network/fake/ZyCrnFakeConnect.java | 62 +++++++++++++++++++------------
1 files changed, 38 insertions(+), 24 deletions(-)
diff --git a/src/main/java/com/zy/core/network/fake/ZyCrnFakeConnect.java b/src/main/java/com/zy/core/network/fake/ZyCrnFakeConnect.java
index 6aa6da4..3413d40 100644
--- a/src/main/java/com/zy/core/network/fake/ZyCrnFakeConnect.java
+++ b/src/main/java/com/zy/core/network/fake/ZyCrnFakeConnect.java
@@ -29,6 +29,7 @@
@Override
public boolean disconnect() {
+ try { executor.shutdownNow(); } catch (Exception ignore) {}
return true;
}
@@ -52,6 +53,16 @@
}
response.setResult(true);
return response;
+ }
+
+ @Override
+ public CommandResponse sendCommand2(CrnCommand command) {
+ return null;
+ }
+
+ @Override
+ public CommandResponse sendCommand3(CrnCommand command) {
+ return null;
}
private void commandTaskComplete(CrnCommand command) {
@@ -84,14 +95,14 @@
int taskNo = command.getTaskNo().intValue();
this.crnStatus.setTaskNo(taskNo);
+ this.crnStatus.setMode(taskMode);
this.crnStatus.setStatus(CrnStatusType.FETCH_MOVING.id);
moveY(this.crnStatus.getBay(), sourcePosY);
moveZ(this.crnStatus.getLevel(), sourcePosZ);
this.crnStatus.setStatus(CrnStatusType.FETCHING.id);
- try {
- Thread.sleep(2000);
- } catch (InterruptedException e) {
- e.printStackTrace();
+ sleep(2000);
+ if (Thread.currentThread().isInterrupted()) {
+ return;
}
this.crnStatus.setLoaded(1);
@@ -99,10 +110,9 @@
moveY(this.crnStatus.getBay(), destinationPosY);
moveZ(this.crnStatus.getLevel(), destinationPosZ);
this.crnStatus.setStatus(CrnStatusType.PUTTING.id);
- try {
- Thread.sleep(2000);
- } catch (InterruptedException e) {
- e.printStackTrace();
+ sleep(2000);
+ if (Thread.currentThread().isInterrupted()) {
+ return;
}
this.crnStatus.setLoaded(0);
this.crnStatus.setStatus(CrnStatusType.WAITING.id);
@@ -115,10 +125,9 @@
for(int i = 0; i < moveLength; i++) {
initSourcePosZ++;
this.crnStatus.setLevel(initSourcePosZ);
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- e.printStackTrace();
+ sleep(1000);
+ if (Thread.currentThread().isInterrupted()) {
+ return;
}
}
}else {
@@ -127,10 +136,9 @@
for(int i = 0; i < moveLength; i++) {
initSourcePosZ--;
this.crnStatus.setLevel(initSourcePosZ);
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- e.printStackTrace();
+ sleep(1000);
+ if (Thread.currentThread().isInterrupted()) {
+ return;
}
}
}
@@ -143,10 +151,9 @@
for(int i = 0; i < moveLength; i++) {
initSourcePosY++;
this.crnStatus.setBay(initSourcePosY);
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- e.printStackTrace();
+ sleep(1000);
+ if (Thread.currentThread().isInterrupted()) {
+ return;
}
}
}else {
@@ -155,12 +162,19 @@
for(int i = 0; i < moveLength; i++) {
initSourcePosY--;
this.crnStatus.setBay(initSourcePosY);
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- e.printStackTrace();
+ sleep(1000);
+ if (Thread.currentThread().isInterrupted()) {
+ return;
}
}
}
}
+
+ private void sleep(long ms) {
+ try {
+ Thread.sleep(ms);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ }
+ }
}
--
Gitblit v1.9.1