| | |
| | | import com.ruoyi.alarm.global.domain.GuidePriorityQueue; |
| | | import com.ruoyi.alarm.global.domain.GuideTask; |
| | | import com.ruoyi.alarm.global.service.impl.QueueHandler; |
| | | import com.ruoyi.common.annotation.SdkOperate; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import com.ruoyi.common.utils.file.MimeTypeUtils; |
| | | import com.ruoyi.common.utils.spring.SpringUtils; |
| | |
| | | import com.ruoyi.utils.gis.GisUtil; |
| | | import com.ruoyi.utils.minio.MinioUtil; |
| | | import com.ruoyi.utils.sdk.common.GlobalVariable; |
| | | import com.ruoyi.utils.sdk.dhsdk.common.ErrorCode; |
| | | import com.ruoyi.utils.sdk.dhsdk.lib.NetSDKLib; |
| | | import com.ruoyi.utils.sdk.dhsdk.lib.enumeration.EM_NEW_CONFIG; |
| | | import com.ruoyi.utils.sdk.dhsdk.lib.enumeration.NET_EM_CFG_OPERATE_TYPE; |
| | |
| | | * 2023/10/17 8:28:13 |
| | | */ |
| | | @Override |
| | | public boolean pTZControl(CameraCmd cmd) { |
| | | @SdkOperate |
| | | public AjaxResult pTZControl(CameraCmd cmd) { |
| | | String cameraId = cmd.getCameraId(); |
| | | boolean enable = cmd.isEnable(); |
| | | Integer chanNo = cmd.getChanNo(); |
| | | Integer speed = cmd.getSpeed(); |
| | | Integer code = cmd.getCode(); |
| | | if (!GlobalVariable.loginMap.containsKey(cameraId)) { |
| | | return false; |
| | | return AjaxResult.error("设备未登录"); |
| | | } |
| | | NetSDKLib.LLong loginId = (NetSDKLib.LLong) GlobalVariable.loginMap.get(cameraId); |
| | | int dwStop; |
| | |
| | | boolean bool = PtzControlModule.ptzControl(loginId, chanNo - 1, dwPTZCommand, speed, speed, 0, dwStop); |
| | | if (!bool) { |
| | | log.error("控制失败,请稍后重试" + getErrorCodePrint()); |
| | | return AjaxResult.error(ErrorCode.getErrorCode(LoginModule.netsdk.CLIENT_GetLastError())); |
| | | } |
| | | return bool; |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean setPtz1(CameraCmd cmd) { |
| | | return false; |
| | | public AjaxResult setPtz1(CameraCmd cmd) { |
| | | return setPtz(cmd) ; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @修改人和其它信息 注意俯仰角度负值需要加上360得到的正值进行设置 |
| | | */ |
| | | @Override |
| | | public boolean setPtz(CameraCmd cmd) { |
| | | @SdkOperate |
| | | public AjaxResult setPtz(CameraCmd cmd) { |
| | | String cameraId = cmd.getCameraId(); |
| | | Integer chanNo = cmd.getChanNo(); |
| | | Map<String, Double> ptz = cmd.getPtzMap(); |
| | | if (!GlobalVariable.loginMap.containsKey(cameraId)) { |
| | | return false; |
| | | return AjaxResult.error("设备未登录"); |
| | | } |
| | | LLong loginId = (LLong) GlobalVariable.loginMap.get(cameraId); |
| | | try { |
| | | if(ptz.get("p")==null||ptz.get("t")==null||ptz.get("z")==null) |
| | | { |
| | | return AjaxResult.error("ptz参数不能为空"); |
| | | } |
| | | int p = (int) (ptz.get("p") * 10); |
| | | int t = (int) (ptz.get("t") * 10); |
| | | t = t > 900 ? 3600 - t : t * -1; |
| | |
| | | boolean bool = netsdk.CLIENT_DHPTZControlEx(loginId, chanNo - 1, NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_EXACTGOTO, p, t, z, 0); |
| | | if (!bool) { |
| | | log.error("控制失败,请稍后重试" + getErrorCodePrint()); |
| | | return AjaxResult.error(ErrorCode.getErrorCode(LoginModule.netsdk.CLIENT_GetLastError())); |
| | | } |
| | | return bool; |
| | | return AjaxResult.success(); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage()); |
| | | return false; |
| | | return AjaxResult.error(ex.getMessage()); |
| | | } |
| | | } |
| | | |
| | |
| | | * @修改人和其它信息 注意俯仰角度负值需要加上360得到的正值进行设置 |
| | | */ |
| | | @Override |
| | | @SdkOperate |
| | | public boolean setZeroPtz(CameraCmd cmd) { |
| | | String cameraId = cmd.getCameraId(); |
| | | Integer chanNo = cmd.getChanNo(); |
| | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getPtz1(CameraCmd cmd) { |
| | | return getPtz(cmd); |
| | | } |
| | | |
| | | /** |
| | | * @描述 短时录像 |
| | | * @参数 [userId, channelNum, enable] |