| | |
| | | import com.zy.core.model.*; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.thread.*; |
| | | import com.zy.core.thread.impl.LfdZyForkLiftMasterThread; |
| | | import com.zy.core.thread.impl.LfdZyForkLiftSlaveThread; |
| | | import com.zy.core.thread.impl.NyShuttleThread; |
| | | import com.zy.core.thread.impl.ZyForkLiftThread; |
| | | import com.zy.core.thread.impl.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | |
| | | for (Slave forkLift : slaveProperties.getForkLift()) { |
| | | MessageQueue.init(SlaveType.ForkLift, forkLift); |
| | | } |
| | | // 初始化提升机mq |
| | | for (Slave forkLift : slaveProperties.getForkLift()) { |
| | | MessageQueue.init(SlaveType.Lift, forkLift); |
| | | } |
| | | // 初始化四向穿梭车mq |
| | | for (Slave shuttle : slaveProperties.getShuttle()) { |
| | | MessageQueue.init(SlaveType.Shuttle, shuttle); |
| | |
| | | SlaveConnection.put(SlaveType.ForkLiftMaster, forkLiftSlave.getId(), thread); |
| | | } |
| | | |
| | | // 初始化提升机 |
| | | for (LiftSlave slave : slaveProperties.getLift()) { |
| | | News.info("初始化提升机........................................................"); |
| | | ThreadHandler thread = null; |
| | | if (slave.getThreadImpl().equals("NyLiftThread")) { |
| | | thread = new NyLiftThread(slave, redisUtil); |
| | | } else { |
| | | throw new CoolException("未知的线程实现"); |
| | | } |
| | | |
| | | new Thread(thread).start(); |
| | | SlaveConnection.put(SlaveType.Lift, slave.getId(), thread); |
| | | } |
| | | |
| | | // 初始化四向穿梭车 |
| | | for (ShuttleSlave shuttleSlave : slaveProperties.getShuttle()) { |
| | | News.info("初始化四向穿梭车......................................................"); |