| | |
| | | if(fakeDeviceUtils == null){ |
| | | continue; |
| | | } |
| | | |
| | | FakeThread fakeThread1 = (FakeThread) SlaveConnection.get(SlaveType.FakeThread, 1); |
| | | |
| | | List<DeviceConfig> deviceConfigs = fakeDeviceUtils.getFakeDeviceConfig(); |
| | | for (DeviceConfig device : deviceConfigs) { |
| | | excuteFakeCommand(String.valueOf(SlaveType.Lift) + device.getDeviceNo()); |
| | | if (!device.getDeviceType().equals(String.valueOf(SlaveType.Lift))) { |
| | | continue; |
| | | } |
| | | |
| | | String key = String.valueOf(SlaveType.Lift) + device.getDeviceNo(); |
| | | |
| | | if(fakeThread1 != null){ |
| | | int hasCar = 0; |
| | | ConcurrentHashMap<String, JSONObject> shuttleFakeStatusMap1 = fakeThread1.getFakeStatusMap(); |
| | | for (Map.Entry<String, JSONObject> entry : shuttleFakeStatusMap1.entrySet()) { |
| | | JSONObject statusData = entry.getValue(); |
| | | String currentCode = statusData.getString("currentCode"); |
| | | JSONObject point = JSON.parseObject(currentCode); |
| | | String currentPoint = point.getInteger("x") + "-" + point.getInteger("y"); |
| | | if (device.getOtherData().toString().equals(currentPoint)) { |
| | | hasCar = 1; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | JSONObject fakeStatus = fakeStatusMap.get(key); |
| | | fakeStatus.put("hasCar", hasCar); |
| | | fakeStatusMap.put(key, fakeStatus); |
| | | } |
| | | |
| | | excuteFakeCommand(key); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |