| | |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.thread.impl.ZySiemensCrnThread; |
| | | import com.zy.core.thread.impl.ZyStationThread; |
| | | import com.zy.core.thread.impl.ZyRgvThread; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | |
| | | SlaveConnection.put(SlaveType.Crn, deviceConfig.getDeviceNo(), thread); |
| | | } |
| | | |
| | | News.info("初始化输送站........................................................"); |
| | | List<DeviceConfig> devpList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Devp))); |
| | | for (DeviceConfig deviceConfig : devpList) { |
| | | ThreadHandler thread = null; |
| | | if (deviceConfig.getThreadImpl().equals("ZyStationThread")) { |
| | | thread = new ZyStationThread(deviceConfig, redisUtil); |
| | | } else { |
| | | throw new CoolException("未知的线程实现"); |
| | | } |
| | | |
| | | new Thread(thread).start(); |
| | | SlaveConnection.put(SlaveType.Devp, deviceConfig.getDeviceNo(), thread); |
| | | } |
| | | |
| | | News.info("初始化RGV........................................................"); |
| | | List<DeviceConfig> rgvList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Rgv))); |
| | | for (DeviceConfig deviceConfig : rgvList) { |
| | | ThreadHandler thread = null; |
| | | if (deviceConfig.getThreadImpl().equals("ZyRgvThread")) { |
| | | thread = new ZyRgvThread(deviceConfig, redisUtil); |
| | | } else { |
| | | throw new CoolException("未知的线程实现"); |
| | | } |
| | | |
| | | new Thread(thread).start(); |
| | | SlaveConnection.put(SlaveType.Rgv, deviceConfig.getDeviceNo(), thread); |
| | | } |
| | | |
| | | } |
| | | |
| | | |