| | |
| | | import com.zy.core.model.*; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.thread.*; |
| | | import com.zy.core.thread.impl.NyShuttleThread; |
| | | import com.zy.core.thread.impl.ZyForkLiftThread; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | |
| | | for (Slave devp : slaveProperties.getDevp()) { |
| | | MessageQueue.init(SlaveType.Devp, devp); |
| | | } |
| | | for (Slave devp2 : slaveProperties.getDevp2()) { |
| | | MessageQueue.init(SlaveType.Devp2, devp2); |
| | | } |
| | | for (Slave devp3 : slaveProperties.getDevp3()) { |
| | | MessageQueue.init(SlaveType.Devp3, devp3); |
| | | } |
| | | // 初始化条码扫描仪mq |
| | | for (Slave barcode : slaveProperties.getBarcode()) { |
| | | MessageQueue.init(SlaveType.Barcode, barcode); |
| | |
| | | for (Slave car : slaveProperties.getCar()) { |
| | | MessageQueue.init(SlaveType.Car, car); |
| | | } |
| | | // 初始化提升机mq |
| | | for (Slave lift : slaveProperties.getLift()) { |
| | | MessageQueue.init(SlaveType.Lift, lift); |
| | | // 初始化货叉提升机mq |
| | | for (Slave forkLift : slaveProperties.getForkLift()) { |
| | | MessageQueue.init(SlaveType.ForkLift, forkLift); |
| | | } |
| | | // 初始化四向穿梭车mq |
| | | for (Slave shuttle : slaveProperties.getShuttle()) { |
| | |
| | | new Thread((Runnable) devpThread).start(); |
| | | SlaveConnection.put(SlaveType.Devp, devp.getId(), devpThread); |
| | | } |
| | | // 初始化提升机 |
| | | News.info("初始化提升机........................................................"); |
| | | for (LiftSlave liftSlave : slaveProperties.getLift()) { |
| | | LiftThread liftThread = new LiftThread(liftSlave, redisUtil); |
| | | new Thread(liftThread).start(); |
| | | SlaveConnection.put(SlaveType.Lift, liftSlave.getId(), liftThread); |
| | | // 初始化货叉提升机 |
| | | News.info("初始化货叉提升机........................................................"); |
| | | for (ForkLiftSlave forkLiftSlave : slaveProperties.getForkLift()) { |
| | | ZyForkLiftThread forkLiftThread = new ZyForkLiftThread(forkLiftSlave, redisUtil); |
| | | new Thread(forkLiftThread).start(); |
| | | SlaveConnection.put(SlaveType.ForkLift, forkLiftSlave.getId(), forkLiftThread); |
| | | } |
| | | // 初始化四向穿梭车 |
| | | News.info("初始化四向穿梭车......................................................"); |