自动化立体仓库 - WCS系统
#
Junjie
2025-03-13 8cefc269417c56c19c0e7a27ae02d584396fb3a5
#
3个文件已修改
31 ■■■■ 已修改文件
src/main/java/com/zy/core/ServerBootstrap.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/Slave.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/ServerBootstrap.java
@@ -1,5 +1,6 @@
package com.zy.core;
import com.core.exception.CoolException;
import com.zy.common.utils.RedisUtil;
import com.zy.core.cache.MessageQueue;
import com.zy.core.cache.SlaveConnection;
@@ -61,16 +62,29 @@
        // 初始化货叉提升机
        News.info("初始化货叉提升机........................................................");
        for (ForkLiftSlave forkLiftSlave : slaveProperties.getForkLift()) {
            ZyForkLiftThread forkLiftThread = new ZyForkLiftThread(forkLiftSlave, redisUtil);
            new Thread(forkLiftThread).start();
            SlaveConnection.put(SlaveType.ForkLift, forkLiftSlave.getId(), forkLiftThread);
            ThreadHandler thread = null;
            if (forkLiftSlave.getThreadImpl().equals("ZyForkLiftThread")) {
                thread = new ZyForkLiftThread(forkLiftSlave, redisUtil);
            } else {
                throw new CoolException("未知的线程实现");
            }
            new Thread(thread).start();
            SlaveConnection.put(SlaveType.ForkLift, forkLiftSlave.getId(), thread);
        }
        // 初始化四向穿梭车
        News.info("初始化四向穿梭车......................................................");
        for (ShuttleSlave shuttleSlave : slaveProperties.getShuttle()) {
            NyShuttleThread shuttleThread = new NyShuttleThread(shuttleSlave,redisUtil);
            new Thread(shuttleThread).start();
            SlaveConnection.put(SlaveType.Shuttle, shuttleSlave.getId(), shuttleThread);
            ThreadHandler thread = null;
            if (shuttleSlave.getThreadImpl().equals("NyShuttleThread")) {
                thread = new NyShuttleThread(shuttleSlave, redisUtil);
            } else {
                throw new CoolException("未知的线程实现");
            }
            new Thread(thread).start();
            SlaveConnection.put(SlaveType.Shuttle, shuttleSlave.getId(), thread);
        }
    }
src/main/java/com/zy/core/Slave.java
@@ -14,4 +14,6 @@
    private Integer port;
    private String threadImpl;
}
src/main/resources/application.yml
@@ -51,6 +51,7 @@
    port: 8888
    rack: 0
    slot: 0
    threadImpl: NyShuttleThread
  # 四向穿梭车2
  shuttle[1]:
    id: 2
@@ -58,6 +59,7 @@
    port: 8888
    rack: 0
    slot: 0
    threadImpl: NyShuttleThread
  # 货叉提升机1
  forkLift[0]:
    id: 1
@@ -65,6 +67,7 @@
    port: 102
    rack: 0
    slot: 0
    threadImpl: ZyForkLiftThread
    staRow: 9
    staBay: 6
    sta[0]: