| | |
| | | } |
| | | |
| | | private void acceptorThread() { |
| | | if(!enableFake){ |
| | | return; |
| | | } |
| | | |
| | | Thread acceptorThread = new Thread(() -> { |
| | | log.info("{}:acceptorThread is start"); |
| | | try { |
| | |
| | | } |
| | | |
| | | private void fakeCommandThread() { |
| | | if(!enableFake){ |
| | | return; |
| | | } |
| | | |
| | | Thread fakeCommandThread = new Thread(() -> { |
| | | while (true) { |
| | | try { |
| | |
| | | } |
| | | |
| | | private synchronized void initFakeDeviceServer(FakeDeviceUtils fakeDeviceUtils) { |
| | | if(!enableFake){ |
| | | return; |
| | | } |
| | | |
| | | List<DeviceConfig> deviceConfigs = fakeDeviceUtils.getFakeDeviceConfig(); |
| | | for (DeviceConfig device : deviceConfigs) { |
| | | if (!device.getDeviceType().equals(String.valueOf(SlaveType.Shuttle))) { |
| | |
| | | fakeCommandMap.remove(key); |
| | | new Thread(() -> { |
| | | try { |
| | | log.info("Fake Shuttle Command Running: {}", JSON.toJSONString(command)); |
| | | JSONObject fakeStatus = fakeStatusMap.get(key); |
| | | String commandType = command.getString("commandType"); |
| | | if (commandType == null) { |