From 720e0926fa1c94b952c26e111206c5d6e1ed5ba2 Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期二, 21 四月 2026 15:59:49 +0800
Subject: [PATCH] Merge branch 'master' of http://47.97.1.152:5880/r/zy-wcs-master
---
src/main/java/com/zy/core/network/fake/ZyDualCrnFakeConnect.java | 45 +++++++++++++++++++++++++++------------------
1 files changed, 27 insertions(+), 18 deletions(-)
diff --git a/src/main/java/com/zy/core/network/fake/ZyDualCrnFakeConnect.java b/src/main/java/com/zy/core/network/fake/ZyDualCrnFakeConnect.java
index 79762ed..6f1d124 100644
--- a/src/main/java/com/zy/core/network/fake/ZyDualCrnFakeConnect.java
+++ b/src/main/java/com/zy/core/network/fake/ZyDualCrnFakeConnect.java
@@ -23,6 +23,14 @@
private DualCrnCommand station1LastCommand = null;
private DualCrnCommand station2LastCommand = null;
+ private long commandWaitMs() { return FakeConfigSupport.getLong(FakeConfigKeys.FAKE_DUAL_CRN_COMMAND_WAIT_MS); }
+ private long transferDurationMs() { return FakeConfigSupport.getLong(FakeConfigKeys.FAKE_DUAL_CRN_TRANSFER_DURATION_MS); }
+ private long pickDurationMs() { return FakeConfigSupport.getLong(FakeConfigKeys.FAKE_DUAL_CRN_PICK_DURATION_MS); }
+ private long putDurationMs() { return FakeConfigSupport.getLong(FakeConfigKeys.FAKE_DUAL_CRN_PUT_DURATION_MS); }
+ private long levelStepDurationMs() { return FakeConfigSupport.getLong(FakeConfigKeys.FAKE_DUAL_CRN_LEVEL_STEP_DURATION_MS); }
+ private long bayStepDurationMs() { return FakeConfigSupport.getLong(FakeConfigKeys.FAKE_DUAL_CRN_BAY_STEP_DURATION_MS); }
+ private long resetDurationMs() { return FakeConfigSupport.getLong(FakeConfigKeys.FAKE_DUAL_CRN_RESET_DURATION_MS); }
+
public ZyDualCrnFakeConnect(DeviceConfig deviceConfig) {
this.deviceConfig = deviceConfig;
this.crnStatus = JSON.parseObject(deviceConfig.getFakeInitStatus(), ZyDualCrnStatusEntity.class);
@@ -68,6 +76,7 @@
}
private void commandTaskComplete(DualCrnCommand command) {
+ sleep(resetDurationMs());
if(command.getStation() == 1) {
if (crnStatus.getLoaded() == 0) {
this.crnStatus.setTaskNo(0);
@@ -90,7 +99,7 @@
if (station2LastCommand == null) {
this.crnStatus.setStatusTwo(DualCrnStatusType.IDLE.id);
}else {
- if (station1LastCommand.getTaskMode().intValue() == DualCrnTaskModeType.PICK.id) {
+ if (station2LastCommand.getTaskMode().intValue() == DualCrnTaskModeType.PICK.id) {
this.crnStatus.setStatusTwo(DualCrnStatusType.FETCH_COMPLETE.id);
}else {
this.crnStatus.setStatusTwo(DualCrnStatusType.IDLE.id);
@@ -116,7 +125,7 @@
break;
}
- sleep(200);
+ sleep(commandWaitMs());
}
if(command.getStation() == 1) {
@@ -128,7 +137,7 @@
}else {
this.crnStatus.setTaskNoTwo(taskNo);
this.crnStatus.setStatusTwo(DualCrnStatusType.PUT_MOVING.id);
- this.crnStatus.setTaskReceive(1);
+ this.crnStatus.setTaskReceiveTwo(1);
moveYZ(this.crnStatus.getBay(), destinationPosY, this.crnStatus.getLevel(), destinationPosZ, command.getStation());
this.crnStatus.setStatusTwo(DualCrnStatusType.WAITING.id);
}
@@ -156,7 +165,7 @@
break;
}
- sleep(200);
+ sleep(commandWaitMs());
}
if(command.getStation() == 1) {
@@ -166,7 +175,7 @@
moveYZ(this.crnStatus.getBay(), sourcePosY,this.crnStatus.getLevel(), sourcePosZ,command.getStation());
this.crnStatus.setStatus(DualCrnStatusType.FETCHING.id);
- sleep(2000);
+ sleep(transferDurationMs());
if (Thread.currentThread().isInterrupted()) {
return;
}
@@ -175,7 +184,7 @@
this.crnStatus.setStatus(DualCrnStatusType.PUT_MOVING.id);
moveYZ(this.crnStatus.getBay(), destinationPosY,this.crnStatus.getLevel(), destinationPosZ, command.getStation());
this.crnStatus.setStatus(DualCrnStatusType.PUTTING.id);
- sleep(2000);
+ sleep(transferDurationMs());
if (Thread.currentThread().isInterrupted()) {
return;
}
@@ -190,7 +199,7 @@
moveYZ(this.crnStatus.getBay(), sourcePosY,this.crnStatus.getLevel(), sourcePosZ, command.getStation());
this.crnStatus.setStatusTwo(DualCrnStatusType.FETCHING.id);
- sleep(2000);
+ sleep(transferDurationMs());
if (Thread.currentThread().isInterrupted()) {
return;
}
@@ -199,7 +208,7 @@
this.crnStatus.setStatusTwo(DualCrnStatusType.PUT_MOVING.id);
moveYZ(this.crnStatus.getBay(), destinationPosY,this.crnStatus.getLevel(), destinationPosZ, command.getStation());
this.crnStatus.setStatusTwo(DualCrnStatusType.PUTTING.id);
- sleep(2000);
+ sleep(transferDurationMs());
if (Thread.currentThread().isInterrupted()) {
return;
}
@@ -229,7 +238,7 @@
break;
}
- sleep(200);
+ sleep(commandWaitMs());
}
if(command.getStation() == 1) {
@@ -239,7 +248,7 @@
moveYZ(this.crnStatus.getBay(), destinationPosY,this.crnStatus.getLevel(), destinationPosZ, command.getStation());
this.crnStatus.setStatus(DualCrnStatusType.FETCHING.id);
- sleep(3000);
+ sleep(pickDurationMs());
if (Thread.currentThread().isInterrupted()) {
return;
}
@@ -254,7 +263,7 @@
moveYZ(this.crnStatus.getBay(), destinationPosY,this.crnStatus.getLevel(), destinationPosZ, command.getStation());
this.crnStatus.setStatusTwo(DualCrnStatusType.FETCHING.id);
- sleep(3000);
+ sleep(pickDurationMs());
if (Thread.currentThread().isInterrupted()) {
return;
}
@@ -284,7 +293,7 @@
break;
}
- sleep(200);
+ sleep(commandWaitMs());
}
if(command.getStation() == 1) {
@@ -294,7 +303,7 @@
moveYZ(this.crnStatus.getBay(), destinationPosY,this.crnStatus.getLevel(), destinationPosZ, command.getStation());
this.crnStatus.setStatus(DualCrnStatusType.PUTTING.id);
- sleep(3000);
+ sleep(putDurationMs());
if (Thread.currentThread().isInterrupted()) {
return;
}
@@ -309,7 +318,7 @@
moveYZ(this.crnStatus.getBay(), destinationPosY,this.crnStatus.getLevel(), destinationPosZ, command.getStation());
this.crnStatus.setStatusTwo(DualCrnStatusType.PUTTING.id);
- sleep(3000);
+ sleep(putDurationMs());
if (Thread.currentThread().isInterrupted()) {
return;
}
@@ -329,7 +338,7 @@
for(int i = 0; i < moveLength; i++) {
initSourcePosZ++;
this.crnStatus.setLevel(initSourcePosZ);
- sleep(1000);
+ sleep(levelStepDurationMs());
if (Thread.currentThread().isInterrupted()) {
return;
}
@@ -341,7 +350,7 @@
initSourcePosZ--;
this.crnStatus.setLevel(initSourcePosZ);
this.crnStatus.setLevel(initSourcePosZ);
- sleep(1000);
+ sleep(levelStepDurationMs());
if (Thread.currentThread().isInterrupted()) {
return;
}
@@ -356,7 +365,7 @@
for(int i = 0; i < moveLength; i++) {
initSourcePosY++;
this.crnStatus.setBay(initSourcePosY);
- sleep(500);
+ sleep(bayStepDurationMs());
if (Thread.currentThread().isInterrupted()) {
return;
}
@@ -367,7 +376,7 @@
for(int i = 0; i < moveLength; i++) {
initSourcePosY--;
this.crnStatus.setBay(initSourcePosY);
- sleep(500);
+ sleep(bayStepDurationMs());
if (Thread.currentThread().isInterrupted()) {
return;
}
--
Gitblit v1.9.1