From b2141320243f2be393236a3c4f53376583179325 Mon Sep 17 00:00:00 2001
From: zwl <1051256694@qq.com>
Date: 星期一, 16 三月 2026 10:36:36 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/thread/impl/ZySiemensCrnThread.java | 89 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 89 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/zy/core/thread/impl/ZySiemensCrnThread.java b/src/main/java/com/zy/core/thread/impl/ZySiemensCrnThread.java
index b680358..b7320d4 100644
--- a/src/main/java/com/zy/core/thread/impl/ZySiemensCrnThread.java
+++ b/src/main/java/com/zy/core/thread/impl/ZySiemensCrnThread.java
@@ -78,8 +78,13 @@
if (task != null) {
step = task.getStep();
}
+
if (step == 2) {
sendCommand((CrnCommand) task.getData());
+ }else if (step == 4) {
+ sendCommand2((CrnCommand) task.getData());
+ }else if (step == 5) {
+ sendCommand3((CrnCommand) task.getData());
}
Thread.sleep(100);
@@ -178,6 +183,8 @@
crnProtocol.setYDistance(crnStatus.getYDistance());
crnProtocol.setXDuration(crnStatus.getXDuration());
crnProtocol.setYDuration(crnStatus.getYDuration());
+ crnProtocol.setWeight(crnStatus.getWeight());
+ crnProtocol.setDb110Data(crnStatus.getDb110Data());
OutputQueue.CRN.offer(MessageFormat.format("銆恵0}銆慬id:{1}] <<<<< 瀹炴椂鏁版嵁鏇存柊鎴愬姛",DateUtils.convert(new Date()), deviceConfig.getDeviceNo()));
@@ -331,4 +338,86 @@
}
}
}
+
+ /**
+ * 绠$悊绔欑偣鐨勭櫧鐏儏鍐�
+ * 1(浜紝闂儊锛屼笂浣嶄笅鍙戜换鍔�)
+ * 榛樿0(鏆�)
+ * @param command
+ * @return
+ */
+
+ @Override
+ public synchronized CommandResponse sendCommand2(CrnCommand command) {
+ this.crnProtocol.setLastCommandTime(System.currentTimeMillis());
+ CommandResponse response = null;
+ try {
+ response = zyCrnConnectDriver.sendCommand2(command);
+ return response;
+ } finally {
+ String sourceLocNo = Utils.getLocNo(command.getSourcePosX(), command.getSourcePosY(), command.getSourcePosZ());
+ String targetLocNo = Utils.getLocNo(command.getDestinationPosX(), command.getDestinationPosY(), command.getDestinationPosZ());
+ BasCrnpOptService bean = SpringUtils.getBean(BasCrnpOptService.class);
+ ZyCrnStatusEntity statusEntity = zyCrnConnectDriver.getStatus();
+ BasCrnpOpt basCrnpOpt = new BasCrnpOpt(
+ command.getTaskNo().intValue(),
+ command.getCrnNo(),
+ new Date(),
+ String.valueOf(command.getTaskMode()),
+ sourceLocNo,
+ targetLocNo,
+ null,
+ null,
+ null,
+ JSON.toJSONString(command),
+ JSON.toJSONString(statusEntity),
+ 1,
+ JSON.toJSONString(response)
+ );
+ if (bean != null) {
+ bean.insert(basCrnpOpt);
+ }
+ }
+ }
+
+ /**
+ * 绠$悊绔欑偣鐨勯粍鑹叉寜閽姸鎬佸強棰滆壊
+ * 1:浜哄伐鎸夋寜閽‘璁�
+ * 2:涓婁綅鏈烘帴鏀跺畬鎴愶紝杩愯缁�
+ * 0:浠诲姟缁撴潫涓婁綅鏈烘竻闄ょ姸鎬�
+ * @param command
+ * @return
+ */
+ @Override
+ public synchronized CommandResponse sendCommand3(CrnCommand command) {
+ this.crnProtocol.setLastCommandTime(System.currentTimeMillis());
+ CommandResponse response = null;
+ try {
+ response = zyCrnConnectDriver.sendCommand3(command);
+ return response;
+ } finally {
+ String sourceLocNo = Utils.getLocNo(command.getSourcePosX(), command.getSourcePosY(), command.getSourcePosZ());
+ String targetLocNo = Utils.getLocNo(command.getDestinationPosX(), command.getDestinationPosY(), command.getDestinationPosZ());
+ BasCrnpOptService bean = SpringUtils.getBean(BasCrnpOptService.class);
+ ZyCrnStatusEntity statusEntity = zyCrnConnectDriver.getStatus();
+ BasCrnpOpt basCrnpOpt = new BasCrnpOpt(
+ command.getTaskNo().intValue(),
+ command.getCrnNo(),
+ new Date(),
+ String.valueOf(command.getTaskMode()),
+ sourceLocNo,
+ targetLocNo,
+ null,
+ null,
+ null,
+ JSON.toJSONString(command),
+ JSON.toJSONString(statusEntity),
+ 1,
+ JSON.toJSONString(response)
+ );
+ if (bean != null) {
+ bean.insert(basCrnpOpt);
+ }
+ }
+ }
}
--
Gitblit v1.9.1