Ejemplo n.º 1
0
        public void Zoom(ZoomDirection direction, ZoomAmount amount)
        {
            int boxSize = 200;

            if (amount == ZoomAmount.Short)
            {
                boxSize = 750;
            }
            else if (amount == ZoomAmount.Medium)
            {
                boxSize = 250;
            }
            else if (amount == ZoomAmount.Long)
            {
                boxSize = 50;
            }

            HttpPost(url, GetPTZJSONString("34323638666239302D396463362D3131", 500, 500, boxSize, boxSize, direction == ZoomDirection.In));
        }
Ejemplo n.º 2
0
        public void Zoom(ZoomDirection direction, ZoomAmount amount)
        {
            PTZProfile profile = GetProfile();

            if (profile == null)
            {
                return;
            }
            if (typeof(PTZSpecV1) == profile.spec.GetType())
            {
                PTZSpecV1 spec     = (PTZSpecV1)profile.spec;
                string    url      = null;
                int       waitTime = 0;
                if (direction == ZoomDirection.In)
                {
                    if (amount == ZoomAmount.Short && !string.IsNullOrWhiteSpace(spec.zoomInShort))
                    {
                        waitTime = spec.ZoomRunTimeShortMs;
                        url      = spec.zoomInShort;
                    }
                    else if (amount == ZoomAmount.Medium && !string.IsNullOrWhiteSpace(spec.zoomInMedium))
                    {
                        waitTime = spec.ZoomRunTimeMediumMs;
                        url      = spec.zoomInMedium;
                    }
                    else if (amount == ZoomAmount.Long && !string.IsNullOrWhiteSpace(spec.zoomInLong))
                    {
                        waitTime = spec.ZoomRunTimeLongMs;
                        url      = spec.zoomInLong;
                    }
                }
                else if (direction == ZoomDirection.Out)
                {
                    if (amount == ZoomAmount.Short && !string.IsNullOrWhiteSpace(spec.zoomOutShort))
                    {
                        waitTime = spec.ZoomRunTimeShortMs;
                        url      = spec.zoomOutShort;
                    }
                    else if (amount == ZoomAmount.Medium && !string.IsNullOrWhiteSpace(spec.zoomOutMedium))
                    {
                        waitTime = spec.ZoomRunTimeMediumMs;
                        url      = spec.zoomOutMedium;
                    }
                    else if (amount == ZoomAmount.Long && !string.IsNullOrWhiteSpace(spec.zoomOutLong))
                    {
                        waitTime = spec.ZoomRunTimeLongMs;
                        url      = spec.zoomOutLong;
                    }
                }
                if (string.IsNullOrWhiteSpace(url))
                {
                    return;
                }

                SimpleProxy.GetData(urlBase + url, camSpec.ptz_username, camSpec.ptz_password);

                if (spec.SendStopCommandAfterZoom && !string.IsNullOrWhiteSpace(spec.stopZoom))
                {
                    Thread.Sleep(waitTime);
                    SimpleProxy.GetData(urlBase + spec.stopZoom, camSpec.ptz_username, camSpec.ptz_password);
                }
            }
        }
Ejemplo n.º 3
0
 public void Zoom(ZoomDirection direction, ZoomAmount amount)
 {
     return;
 }