From 4790be9d288a84a38b10e143c8433b7becc62404 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 11 十二月 2025 13:10:42 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/ServerBootstrap.java | 56 +++++++++++++++++++++++++++-----------------------------
1 files changed, 27 insertions(+), 29 deletions(-)
diff --git a/src/main/java/com/zy/core/ServerBootstrap.java b/src/main/java/com/zy/core/ServerBootstrap.java
index d9f526d..52b9b1d 100644
--- a/src/main/java/com/zy/core/ServerBootstrap.java
+++ b/src/main/java/com/zy/core/ServerBootstrap.java
@@ -4,17 +4,14 @@
import com.zy.core.cache.MessageQueue;
import com.zy.core.cache.SlaveConnection;
import com.zy.core.enums.SlaveType;
-import com.zy.core.model.CrnSlave;
import com.zy.core.model.DevpSlave;
-import com.zy.core.model.LedSlave;
-import com.zy.core.model.RgvSlave;
import com.zy.core.properties.SlaveProperties;
-import com.zy.core.thread.*;
+import com.zy.core.thread.BarcodeThread;
+import com.zy.core.thread.SiemensDevpThread;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.DependsOn;
import org.springframework.scheduling.annotation.Async;
-import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
@@ -33,12 +30,13 @@
@Autowired
private SlaveProperties slaveProperties;
@Autowired
- private MainProcess mainProcess;
+ private CtuMainProcess ctuMainProcess;
public static final Map<CrnThread, Thread> map = new ConcurrentHashMap<>();
/**
* PostConstruct浼氬湪鍔犺浇servlet鐨勬椂鍊欒繍琛屼竴娆�
+ *
* @throws InterruptedException
*/
@PostConstruct
@@ -52,15 +50,15 @@
// 鍒濆鍖栦笅浣嶆満绾跨▼
initThread();
// 寮�濮嬩富娴佺▼杩涚▼
- mainProcess.start();
+ ctuMainProcess.start();
News.info("鏍稿績鎺у埗灞傚凡鍚姩...............................................");
}
- private void initMq(){
+ private void initMq() {
// 鍒濆鍖栧爢鍨涙満mq
- for (Slave crn : slaveProperties.getCrn()) {
- MessageQueue.init(SlaveType.Crn, crn);
- }
+// for (Slave crn : slaveProperties.getCrn()) {
+// MessageQueue.init(SlaveType.Crn, crn);
+// }
// 鍒濆鍖朢gv灏忚溅mq
// for (Slave rgv : slaveProperties.getRgv()) {
// MessageQueue.init(SlaveType.Rgv, rgv);
@@ -74,9 +72,9 @@
MessageQueue.init(SlaveType.Barcode, barcode);
}
// 鍒濆鍖朙ed鐏痬q
- for (Slave led : slaveProperties.getLed()) {
- MessageQueue.init(SlaveType.Led, led);
- }
+// for (Slave led : slaveProperties.getLed()) {
+// MessageQueue.init(SlaveType.Led, led);
+// }
// 鍒濆鍖栫绉癿q
// for (Slave scale : slaveProperties.getScale()) {
// MessageQueue.init(SlaveType.Scale, scale);
@@ -87,14 +85,14 @@
// }
}
- private void initThread(){
+ private void initThread() {
// 鍒濆鍖栧爢鍨涙満绾跨▼
- News.info("鍒濆鍖栧爢鍨涙満绾跨▼...................................................");
- for (CrnSlave crn : slaveProperties.getCrn()) {
- CrnThread crnThread = new SiemensCrnThread(crn);
- new Thread((Runnable) crnThread).start();
- SlaveConnection.put(SlaveType.Crn, crn.getId(), crnThread);
- }
+// News.info("鍒濆鍖栧爢鍨涙満绾跨▼...................................................");
+// for (CrnSlave crn : slaveProperties.getCrn()) {
+// CrnThread crnThread = new SiemensCrnThread(crn);
+// new Thread((Runnable) crnThread).start();
+// SlaveConnection.put(SlaveType.Crn, crn.getId(), crnThread);
+// }
// 鍒濆鍖栫┛姊溅绾跨▼
// log.info("鍒濆鍖朢GV绾跨▼...................................................");
// for (RgvSlave rgv : slaveProperties.getRgv()) {
@@ -113,16 +111,16 @@
News.info("鍒濆鍖栨潯鐮佹壂鎻忎华绾跨▼...................................................");
for (Slave barcode : slaveProperties.getBarcode()) {
BarcodeThread barcodeThread = new BarcodeThread(barcode);
-// new Thread(barcodeThread).start();
+ new Thread(barcodeThread).start();
SlaveConnection.put(SlaveType.Barcode, barcode.getId(), barcodeThread);
}
- // 鍒濆鍖朙ED绾跨▼
- News.info("鍒濆鍖朙ED绾跨▼...................................................");
- for (LedSlave led : slaveProperties.getLed()) {
- LedThread ledThread = new LedThread(led);
- new Thread(ledThread).start();
- SlaveConnection.put(SlaveType.Led, led.getId(), ledThread);
- }
+// // 鍒濆鍖朙ED绾跨▼
+// News.info("鍒濆鍖朙ED绾跨▼...................................................");
+// for (LedSlave led : slaveProperties.getLed()) {
+// LedThread ledThread = new LedThread(led);
+// new Thread(ledThread).start();
+// SlaveConnection.put(SlaveType.Led, led.getId(), ledThread);
+// }
// 鍒濆鍖栫绉ょ嚎绋�
// News.info("鍒濆鍖栫绉ょ嚎绋�...................................................");
// for (Slave scale : slaveProperties.getScale()) {
--
Gitblit v1.9.1