| | |
| | | String status = getText(itemDevice, "Status"); |
| | | if (status != null) { |
| | | // ONLINE OFFLINE HIKVISION DS-7716N-E4 NVR的兼容性处理 |
| | | if (status.equals("ON") || status.equals("On") || status.equals("ONLINE") || status.equals("OK")) { |
| | | if (status.equalsIgnoreCase("ON") || status.equalsIgnoreCase("On") || status.equalsIgnoreCase("ONLINE") || status.equalsIgnoreCase("OK")) { |
| | | deviceChannel.setStatus(true); |
| | | } |
| | | if (status.equals("OFF") || status.equals("Off") || status.equals("OFFLINE")) { |
| | | if (status.equalsIgnoreCase("OFF") || status.equalsIgnoreCase("Off") || status.equalsIgnoreCase("OFFLINE")) { |
| | | deviceChannel.setStatus(false); |
| | | } |
| | | }else { |
| | | deviceChannel.setStatus(true); |
| | | } |
| | | |
| | | // logger.info("状态字符串: {}", status); |
| | | // logger.info("状态结果: {}", deviceChannel.isStatus()); |
| | | // 经度 |
| | | String longitude = getText(itemDevice, "Longitude"); |
| | | if (NumericUtil.isDouble(longitude)) { |
| | |
| | | String ptzTypeFromInfo = XmlUtil.getText(info, "PTZType"); |
| | | if(!ObjectUtils.isEmpty(ptzTypeFromInfo)){ |
| | | try { |
| | | deviceChannel.setPTZType(Integer.parseInt(ptzTypeFromInfo)); |
| | | deviceChannel.setPtzType(Integer.parseInt(ptzTypeFromInfo)); |
| | | }catch (NumberFormatException e){ |
| | | logger.warn("[xml解析] 从通道数据info中获取PTZType失败: {}", ptzTypeFromInfo); |
| | | } |
| | | } |
| | | } else { |
| | | try { |
| | | deviceChannel.setPTZType(Integer.parseInt(ptzType)); |
| | | deviceChannel.setPtzType(Integer.parseInt(ptzType)); |
| | | }catch (NumberFormatException e){ |
| | | logger.warn("[xml解析] 从通道数据中获取PTZType失败: {}", ptzType); |
| | | } |