Ejemplo n.º 1
0
        public virtual bool StartCtrl(PTZCommand cmd, int speed)
        {
            lock (mCtrlLockObj)
            {
                if (!IsCtrl)
                {
                    IsCtrl      = true;
                    CtrlCommand = TranslatePTZCommand((int)cmd);

                    if (speed < MinSpeed)
                    {
                        CtrlSpeed = MinSpeed;
                    }
                    else if (speed > MaxSpeed)
                    {
                        CtrlSpeed = MaxSpeed;
                    }
                    else
                    {
                        CtrlSpeed = speed;
                    }

                    return(DoStartCtrl(CtrlCommand, CtrlSpeed));
                }
                return(false);
            }
        }
Ejemplo n.º 2
0
        public OResult <Boolean> StopPTZControl(PTZCommand cmd, Int32 speed = 4)
        {
            try
            {
                var succ = CHCNetSDK.NET_DVR_PTZControlWithSpeed_Other(_userId, _loginRequest.ChannelNo, (UInt32)cmd, 1, (UInt32)speed);
                if (!succ)
                {
                    return(new OResult <Boolean>(false, HkvsErrorCode.GetLastErrorCode(), $"停止摄像头移动失败:{HkvsErrorCode.GetLastErrorMessage()}"));
                }

                return(new OResult <Boolean>(true));
            }
            catch (Exception ex)
            {
                return(new OResult <Boolean>(false, ex));
            }
        }
Ejemplo n.º 3
0
        public void PtzControl(PTZCommand ptzcmd, int dwSpeed, string deviceId)
        {
            try
            {
                //logger.Debug("PtzControl started.");

                foreach (var item in _nodeMonitorService.ToArray())
                {
                    if (item.Key.Equals(deviceId))
                    {
                        item.Value.PtzContrl(ptzcmd, dwSpeed);
                    }
                }
                //logger.Debug("PtzControl halted.");
            }
            catch (Exception excp)
            {
                logger.Error("Exception PtzControl: " + excp.Message);
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// PTZ Control
 /// </summary>
 /// <param name="ptzCommand"></param>
 /// <param name="speed"></param>
 /// <param name="deviceid"></param>
 public void PtzControl(PTZCommand ptzCommand, int speed, string deviceid)
 {
     _sipCoreMessageService.PtzControl(ptzCommand, speed, deviceid);
 }
Ejemplo n.º 5
0
 public static extern int OpenSDK_PTZCtrlEx(IntPtr intptrSessionID, IntPtr intptrDevSerial, int intChannel, PTZCommand enCommand, PTZAction enAction, int iSpeed);
Ejemplo n.º 6
0
 [DllImport(@"OpenNetStream.dll")]//SDK云台控制
 public static extern int OpenSDK_PTZCtrl(IntPtr szSessionId, string szAccessToken, string szCameraId, PTZCommand enCommand, PTZAction enAction, int iSpeed, IntPtr pNSCBMsg);
Ejemplo n.º 7
0
 public virtual bool StartCtrl(PTZCommand cmd)
 {
     return(StartCtrl(cmd, 0));
 }
Ejemplo n.º 8
0
 public static extern int OpenSDK_PTZCtrl(IntPtr sid, string accessToken, string cameraId, PTZCommand command,
                                          PTZACtion action, int speed, uint pNscbMsg);
Ejemplo n.º 9
0
 /// <summary>
 /// 云台控制
 /// </summary>
 /// <param name="cameraId"></param>
 /// <param name="command"></param>
 /// <param name="action"></param>
 /// <param name="speed"></param>
 /// <returns></returns>
 public static int PtzCtrl(string cameraId, PTZCommand command,
                           PTZACtion action, int speed)
 => HkSdk.OpenSDK_PTZCtrl(_sessionId, AccessToken, cameraId, command, action, speed, 0);