| | |
| | | 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; |
| | |
| | | */ |
| | | @Override |
| | | @SdkOperate |
| | | public boolean pTZControl(CameraCmd cmd) { |
| | | 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) { |
| | | public AjaxResult setPtz1(CameraCmd cmd) { |
| | | return setPtz(cmd) ; |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | @SdkOperate |
| | | public boolean setPtz(CameraCmd cmd) { |
| | | 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 { |
| | |
| | | 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()); |
| | | } |
| | | } |
| | | |