Beispiel #1
0
        public PanTiltControlManager(CCTVDefaultInfoSync infoSync)
        {
            if (infoSync == null)
            {
                throw new ArgumentNullException("参数infoSync不能为空值null");
            }
            ClientHub = infoSync;
            _control  = new CameraControlManager(ClientHub, CCTV1Info);

            if (!ClientHub.HasRegisteredDefault(CCTVInfoType.StaticInfo))
            {
                ClientHub.RegisterDefault(CCTVInfoType.StaticInfo, TimeSpan.FromSeconds(60));
            }
            if (!ClientHub.HasRegisteredDefault(CCTVInfoType.ControlConfig))
            {
                ClientHub.RegisterDefault(CCTVInfoType.ControlConfig, TimeSpan.FromSeconds(60));
            }

            if (!ClientHub.HasRegisteredDefault(CCTVInfoType.GlobalInfo))
            {
                ClientHub.RegisterDefault(CCTVInfoType.GlobalInfo, TimeSpan.Zero, onGlobalInfoUpdate);
            }
            else
            {
                ClientHub.AddUpdateHandler(CCTVInfoType.GlobalInfo, onGlobalInfoUpdate);
                onGlobalInfoUpdate(null); //手动触发一次。
            }
        }