| | |
| | | import com.zy.core.thread.impl.LfdZyForkLiftMasterThread; |
| | | import com.zy.core.thread.impl.NyShuttleThread; |
| | | import com.zy.core.utils.DeviceMsgUtils; |
| | | import com.zy.core.utils.FakeDeviceUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | |
| | | private RedisUtil redisUtil; |
| | | @Autowired |
| | | private DeviceMsgUtils deviceMsgUtils; |
| | | @Autowired |
| | | private FakeDeviceUtils fakeDeviceUtils; |
| | | |
| | | |
| | | @PostConstruct |
| | |
| | | initMq(); |
| | | // 初始化下位机线程 |
| | | initThread(); |
| | | // 初始化虚拟设备线程 |
| | | initFakeThread(); |
| | | News.info("核心控制层已启动..............................................."); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | private void initFakeThread(){ |
| | | String fakeDeviceConfig = fakeDeviceUtils.getFakeDeviceConfig(); |
| | | if(null != fakeDeviceConfig){ |
| | | List<DeviceConfig> deviceConfigs = JSON.parseArray(fakeDeviceConfig, DeviceConfig.class); |
| | | for (DeviceConfig device : deviceConfigs) { |
| | | if (device.getDeviceType().equals(String.valueOf(SlaveType.ForkLift))) { |
| | | initForkLiftThread(device); |
| | | } else if (device.getDeviceType().equals(String.valueOf(SlaveType.Shuttle))) { |
| | | initShuttleThread(device); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | @PreDestroy |
| | | public void destroy() { |