| | |
| | | try { |
| | | ArdCameras cameras = ardCamerasService.selectArdCamerasById(cameraId); |
| | | double[] cameraPositon = new double[]{cameras.getLongitude(), cameras.getLatitude(), cameras.getAltitude()}; |
| | | double[] targetPositions = cmd.getTargetPosition(); |
| | | double[] targetPositions = new double[]{cmd.getTargetPosition().getLongitude(), cmd.getTargetPosition().getLatitude()}; |
| | | double[] cameraPTZ = GisUtil.getCameraPTZ(cameraPositon, targetPositions, 20, 150); |
| | | String p = String.valueOf((int) (cameraPTZ[0] * 10)); |
| | | String t = String.valueOf((int) (cameraPTZ[1] * 10)); |
| | |
| | | NET_DVR_CAMERAPARAMCFG_EX struDayNigh = new NET_DVR_CAMERAPARAMCFG_EX(); |
| | | Pointer point = struDayNigh.getPointer(); |
| | | IntByReference ibrBytesReturned = new IntByReference(0); |
| | | boolean b_GetCameraParam = hCNetSDK.NET_DVR_GetDVRConfig(userId, NET_DVR_GET_CCDPARAMCFG_EX, chanNo, point, struDayNigh.size(), ibrBytesReturned); |
| | | boolean b_GetCameraParam = hCNetSDK.NET_DVR_GetDVRConfig(userId, NET_DVR_GET_CCDPARAMCFG, chanNo, point, struDayNigh.size(), ibrBytesReturned); |
| | | if (!b_GetCameraParam) { |
| | | log.error("获取前端参数失败,错误码:" + hCNetSDK.NET_DVR_GetLastError()); |
| | | } |
| | |
| | | daynight.byDayNightFilterTime = 60; |
| | | struDayNigh.struDayNight = daynight; |
| | | struDayNigh.write(); |
| | | boolean bool = hCNetSDK.NET_DVR_SetDVRConfig(userId, NET_DVR_SET_CCDPARAMCFG_EX, chanNo, point, struDayNigh.size()); |
| | | boolean bool = hCNetSDK.NET_DVR_SetDVRConfig(userId, NET_DVR_SET_CCDPARAMCFG, chanNo, point, struDayNigh.size()); |
| | | if (!bool) { |
| | | int code = hCNetSDK.NET_DVR_GetLastError(); |
| | | log.error("设置夜视失败 ErrorCode:{},ErrorInfo:{}",code, SdkErrorCodeEnum.getDescByCode(code)); |