public override bool Ptz_DirCamera(VideoControl vc, PTZ.DirDirection dirDirection, int hSpeed, int vSpeed)
        {
            ControlInfo_Preview info = this.m_ControlTable[vc] as ControlInfo_Preview;

            if (info == null)
            {
                return(false);
            }

            int    hspeed = hSpeed * 64 / 256;
            int    vspeed = vSpeed * 64 / 256;
            string ptzCmd = "";

            PTZ.DirDirection d = dirDirection;
            if (d == PTZ.DirDirection.Stop)
            {
                d = (PTZ.DirDirection)info.LastDirection;
            }
            switch (d)
            {
            case PTZ.DirDirection.Left:
                ptzCmd = "LEFT";
                break;

            case PTZ.DirDirection.Right:
                ptzCmd = "RIGHT";
                break;

            case PTZ.DirDirection.Down:
                ptzCmd = "DOWN";
                break;

            case PTZ.DirDirection.Up:
                ptzCmd = "UP";
                break;

            case PTZ.DirDirection.LeftUp:
                ptzCmd = "LEFT_UP";
                break;

            case PTZ.DirDirection.LeftDown:
                ptzCmd = "LEFT_DOWN";
                break;

            case PTZ.DirDirection.RightUp:
                ptzCmd = "RIGHT_UP";
                break;

            case PTZ.DirDirection.RightDown:
                ptzCmd = "RIGHT_DOWN";
                break;
            }
            if (dirDirection == PTZ.DirDirection.Stop)
            {
                ptzCmd += "_STOP";
            }
            info.LastDirection = (int)dirDirection;

            return(Hik_Open8200API.Std_PtzCtrl((int)info.LoginHandle, info.Camera.CameraCode, ptzCmd, hspeed, 0, 0) >= 0 ? true : false);
        }
Example #2
0
 public virtual bool Ptz_DirCamera(VideoControl vc, PTZ.DirDirection dirDirection, int hSpeed, int vSpeed)
 {
     this.LogModule?.Error("不支持云台控制");
     return(false);
 }