Ejemplo n.º 1
0
        public string GetHtml(string camId, IPCameraBase cam)
        {
            PTZProfile profile = GetProfile();

            if (profile == null)
            {
                return("PTZ Profile Not Found");
            }
            if (typeof(PTZSpecV1) == profile.spec.GetType())
            {
                PTZSpecV1 spec = (PTZSpecV1)profile.spec;

                HtmlOptions options = new HtmlOptions();
                options.showPtzArrows    = true;
                options.showPtzDiagonals = spec.EnableDiagonals;

                options.panDelay  = (int)(spec.PanRunTimeMs * 0.9);
                options.tiltDelay = (int)(spec.TiltRunTimeMs * 0.9);

                options.showZoomButtons = spec.EnableZoom;

                options.showZoomInLong   = !string.IsNullOrWhiteSpace(spec.zoomInLong);
                options.showZoomInMedium = !string.IsNullOrWhiteSpace(spec.zoomInMedium);
                options.showZoomInShort  = !string.IsNullOrWhiteSpace(spec.zoomInShort);

                options.showZoomOutLong   = !string.IsNullOrWhiteSpace(spec.zoomOutLong);
                options.showZoomOutMedium = !string.IsNullOrWhiteSpace(spec.zoomOutMedium);
                options.showZoomOutShort  = !string.IsNullOrWhiteSpace(spec.zoomOutShort);

                options.zoomShortDelay  = spec.ZoomRunTimeShortMs;
                options.zoomMediumDelay = spec.ZoomRunTimeMediumMs;
                options.zoomLongDelay   = spec.ZoomRunTimeLongMs;

                options.showPresets = spec.EnablePresets;
                int i = 0;
                options.gettablePresets[i++] = !string.IsNullOrWhiteSpace(spec.load_preset_1);
                options.gettablePresets[i++] = !string.IsNullOrWhiteSpace(spec.load_preset_2);
                options.gettablePresets[i++] = !string.IsNullOrWhiteSpace(spec.load_preset_3);
                options.gettablePresets[i++] = !string.IsNullOrWhiteSpace(spec.load_preset_4);
                options.gettablePresets[i++] = !string.IsNullOrWhiteSpace(spec.load_preset_5);
                options.gettablePresets[i++] = !string.IsNullOrWhiteSpace(spec.load_preset_6);
                options.gettablePresets[i++] = !string.IsNullOrWhiteSpace(spec.load_preset_7);
                options.gettablePresets[i++] = !string.IsNullOrWhiteSpace(spec.load_preset_8);
                i = 0;
                options.settablePresets[i++] = !string.IsNullOrWhiteSpace(spec.save_preset_1);
                options.settablePresets[i++] = !string.IsNullOrWhiteSpace(spec.save_preset_2);
                options.settablePresets[i++] = !string.IsNullOrWhiteSpace(spec.save_preset_3);
                options.settablePresets[i++] = !string.IsNullOrWhiteSpace(spec.save_preset_4);
                options.settablePresets[i++] = !string.IsNullOrWhiteSpace(spec.save_preset_5);
                options.settablePresets[i++] = !string.IsNullOrWhiteSpace(spec.save_preset_6);
                options.settablePresets[i++] = !string.IsNullOrWhiteSpace(spec.save_preset_7);
                options.settablePresets[i++] = !string.IsNullOrWhiteSpace(spec.save_preset_8);

                options.showZoomLevels = false;

                return(PTZHtml.GetHtml(camId, cam, options));
            }
            return("Unsupported PTZ Profile");
        }
Ejemplo n.º 2
0
 public string GetHtml(string camId, IPCameraBase cam)
 {
     return(PTZHtml.GetHtml(camId, cam, new HtmlOptions()));
 }