From 0362c0c8502a81fc974afb8d2aff85d9efd7bbb1 Mon Sep 17 00:00:00 2001 From: ‘liusuyi’ <1951119284@qq.com> Date: 星期四, 29 六月 2023 17:28:22 +0800 Subject: [PATCH] 修改报警逻辑 增加优先级队列 --- ard-work/src/main/java/com/ruoyi/device/hiksdk/service/impl/HikClientServiceImpl.java | 25 ++++++++++++++++++++++--- 1 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ard-work/src/main/java/com/ruoyi/device/hiksdk/service/impl/HikClientServiceImpl.java b/ard-work/src/main/java/com/ruoyi/device/hiksdk/service/impl/HikClientServiceImpl.java index c488645..9a5e8ed 100644 --- a/ard-work/src/main/java/com/ruoyi/device/hiksdk/service/impl/HikClientServiceImpl.java +++ b/ard-work/src/main/java/com/ruoyi/device/hiksdk/service/impl/HikClientServiceImpl.java @@ -210,7 +210,7 @@ log.debug("鍔犺浇lib瀹屾垚锛�"); List<ArdCameras> ardCameras = ardCamerasMapper.selectArdCamerasListNoDataScope(new ArdCameras()); for (ArdCameras camera : ardCameras) { - Thread.sleep(100); + Thread.sleep(500); login(camera); } } catch (Exception ex) { @@ -596,7 +596,7 @@ double p = b.setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue(); double t = c.setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue(); double z = d.setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue(); - log.debug("T鍨傜洿鍙傛暟涓�: " + p + "P姘村钩鍙傛暟涓�: " + t + "Z鍙樺�嶅弬鏁颁负: " + z); +// log.debug("T鍨傜洿鍙傛暟涓�: " + p + "P姘村钩鍙傛暟涓�: " + t + "Z鍙樺�嶅弬鏁颁负: " + z); Map<String, Object> ptzMap = new HashMap<>(); ptzMap.put("p", p); ptzMap.put("t", t); @@ -605,7 +605,7 @@ } else { int code = hCNetSDK.NET_DVR_GetLastError(); log.info("鎺у埗澶辫触,璇风◢鍚庨噸璇�" + code); - return null; + return new HashMap<>(); } } @@ -1014,6 +1014,25 @@ return bool; } + public String getFocusMode(CameraCmd cmd) + { + String cameraId = cmd.getCameraId(); + Integer channelNum = cmd.getChannelNum(); + if (!GlobalVariable.loginMap.containsKey(cameraId)) { + return ""; + } + Integer userId = GlobalVariable.loginMap.get(cameraId); + NET_DVR_FOCUSMODE_CFG struFocusMode = new NET_DVR_FOCUSMODE_CFG(); + Pointer point = struFocusMode.getPointer(); + IntByReference ibrBytesReturned = new IntByReference(0); + boolean b_GetCameraParam = hCNetSDK.NET_DVR_GetDVRConfig(userId, NET_DVR_GET_FOCUSMODECFG, channelNum, point, struFocusMode.size(), ibrBytesReturned); + if (!b_GetCameraParam) { + System.out.println("鑾峰彇鍓嶇鍙傛暟澶辫触锛岄敊璇爜锛�" + hCNetSDK.NET_DVR_GetLastError()); + } + struFocusMode.read(); + log.info("褰撳墠鑱氱劍妯″紡锛�" + struFocusMode.byFocusMode); + return String.valueOf(struFocusMode.byFocusMode); + } /** * @鎻忚堪 浜戝彴鍔犵儹寮�鍏� * @鍙傛暟 [userId, channelNum, enable] -- Gitblit v1.9.3