| | |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.task.ShuttleExecuteScheduler; |
| | | import com.zy.core.thread.TrafficControlThread; |
| | | import com.zy.core.thread.impl.NyLiftThread; |
| | | import com.zy.core.thread.impl.NyShuttleThread; |
| | | import com.zy.core.thread.impl.TrafficControlImplThread; |
| | | import com.zy.core.thread.impl.ZyForkLiftThread; |
| | |
| | | for (DeviceConfig forkLift : forkLiftList) { |
| | | MessageQueue.init(SlaveType.ForkLift, forkLift.getDeviceNo()); |
| | | } |
| | | // 初始化提升机mq |
| | | List<DeviceConfig> liftList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Lift))); |
| | | for (DeviceConfig lift : liftList) { |
| | | MessageQueue.init(SlaveType.Lift, lift.getDeviceNo()); |
| | | } |
| | | // 初始化四向穿梭车mq |
| | | List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Shuttle))); |
| | |
| | | } |
| | | } |
| | | |
| | | // 初始化提升机 |
| | | News.info("初始化提升机........................................................"); |
| | | List<DeviceConfig> liftList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Lift))); |
| | | for (DeviceConfig deviceConfig : liftList) { |
| | | BasLift basLift = basLiftService.selectOne(new EntityWrapper<BasLift>().eq("lift_no", deviceConfig.getDeviceNo())); |
| | | if (basLift == null) { |
| | | throw new CoolException("未配置提升机数据"); |
| | | } |
| | | |
| | | ThreadHandler thread = null; |
| | | if (deviceConfig.getThreadImpl().equals("NyLiftThread")) { |
| | | thread = new NyLiftThread(deviceConfig, basLift.getPoint$(), basLift.getStationList$(), redisUtil); |
| | | } else { |
| | | throw new CoolException("未知的线程实现"); |
| | | } |
| | | |
| | | new Thread(thread).start(); |
| | | SlaveConnection.put(SlaveType.Lift, deviceConfig.getDeviceNo(), thread); |
| | | |
| | | if (deviceConfig.getFake() == 1) { |
| | | fakeDevices.add(deviceConfig); |
| | | }else { |
| | | allDevices.add(deviceConfig); |
| | | } |
| | | } |
| | | |
| | | // 初始化四向穿梭车 |
| | | News.info("初始化四向穿梭车......................................................"); |
| | | List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |