示例#1
0
 public void AbsoluteMove(string profile, PTZVector position)
 {
     RunInBackground(new Action(() =>
     {
         Client.AbsoluteMove(profile, position, null);
     }));
 }
示例#2
0
 public void GotoPosition(string profileToken, PTZ.PTZVector position)
 {
     Client.AbsoluteMove(profileToken, position, new PTZ.PTZSpeed());
     //Client.AbsoluteMove(profileToken, position, new PTZ.PTZSpeed
     //{
     //    PanTilt = new PTZ.Vector2D
     //    {
     //        x = (float)(ptzPanSpeedMax * percentSpeed),
     //        y = (float)(ptzPanSpeedMax * percentSpeed)
     //    }
     //});
 }
示例#3
0
        public void AbosuteRelativeIncrementalMove(
            bool absolute,
            string profile,
            decimal xmin,
            decimal xmax,
            decimal ymin,
            decimal ymax,
            decimal zmin,
            decimal zmax)
        {
            RunInBackground(new Action(() =>
            {
                PTZVector vector     = new PTZVector();
                vector.PanTilt       = new Vector2D();
                vector.PanTilt.space = absolute ?
                                       "http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace" :
                                       "http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace";
                vector.Zoom       = new Vector1D();
                vector.Zoom.space = absolute ?
                                    "http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace" :
                                    "http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace";

                for (decimal x = xmin; x <= xmax; x += (decimal)0.2)
                {
                    for (decimal y = ymin; y <= ymax; y += (decimal)0.2)
                    {
                        for (decimal z = zmin; z <= zmax; z += (decimal)0.2)
                        {
                            vector.PanTilt.x = (float)x;
                            vector.PanTilt.y = (float)y;
                            vector.Zoom.x    = (float)z;
                            if (absolute)
                            {
                                Client.AbsoluteMove(profile, vector, null);
                            }
                            else
                            {
                                Client.RelativeMove(profile, vector, null);
                            }
                            Thread.Sleep(300);
                        }
                    }
                }
            }));
        }