/// <summary> /// 生成视频数据统一管理对象,由外界传入同步服务实例。 /// </summary> /// <param name="clientHub"></param> private VideoSourceManager(CCTVDefaultInfoSync clientHub) : this() { if (clientHub == null) { throw new ArgumentNullException("参数 " + nameof(clientHub) + " 不能为空值null"); } _clientHub = clientHub; if (!clientHub.HasRegisteredDefault(CCTVInfoType.GlobalInfo)) { _clientHub.RegisterDefaultWithoutUpdate(CCTVInfoType.GlobalInfo); } if (!clientHub.HasRegisteredDefault(CCTVInfoType.StaticInfo)) { _clientHub.RegisterDefaultWithoutUpdate(CCTVInfoType.StaticInfo); } if (!clientHub.HasRegisteredDefault(CCTVInfoType.ServerInfo)) { _clientHub.RegisterDefaultWithoutUpdate(CCTVInfoType.ServerInfo); } if (!clientHub.HasRegisteredDefault(CCTVInfoType.DeviceInfo)) { _clientHub.RegisterDefaultWithoutUpdate(CCTVInfoType.DeviceInfo); } findCurrentServer(); }
private void init() { string webApiBaseUri = ConfigHandler.GetValue <VideoInfoPlugin>("WebApiBaseUri"); ClientHub = new CCTVDefaultInfoSync(webApiBaseUri); ClientHub.RegisterDefault(CCTVInfoType.GlobalInfo, TimeSpan.Zero, onGlobalInfoUpdate); ClientHub.RegisterDefaultWithoutUpdate(CCTVInfoType.StaticInfo); ClientHub.RegisterDefaultWithoutUpdate(CCTVInfoType.ControlConfig); _lastSITick = _lastCCTick = Environment.TickCount; ClientHub.UpdateAllDefault(); }
private VideoSourceManager(string staticInfoBaseAddress) : this() { _clientHub = new CCTVDefaultInfoSync(staticInfoBaseAddress); _clientHub.RegisterDefaultWithoutUpdate(CCTVInfoType.GlobalInfo); _clientHub.RegisterDefaultWithoutUpdate(CCTVInfoType.StaticInfo); _clientHub.RegisterDefaultWithoutUpdate(CCTVInfoType.ServerInfo); _clientHub.RegisterDefaultWithoutUpdate(CCTVInfoType.DeviceInfo); _autoGenHub = true; findCurrentServer(); }
private void MainWindow_Loaded(object sender, RoutedEventArgs e) { _hub = new CCTVDefaultInfoSync(WebApiUrl); _hub.RegisterDefaultWithoutUpdate(CCTVInfoType.GlobalInfo); _hub.RegisterDefaultWithoutUpdate(CCTVInfoType.StaticInfo); _hub.RegisterDefaultWithoutUpdate(CCTVInfoType.DynamicInfo); _hub.RegisterDefaultWithoutUpdate(CCTVInfoType.OnlineStatus); _hub.RegisterDefaultWithoutUpdate(CCTVInfoType.HierarchyInfo); CCTVHierarchyNode[] root = _hub.GetAllHierarchyRoots(); Console.WriteLine(""); }
public InfoService() { ClientHub = new CCTVDefaultInfoSync(Configurations.Instance.InfoServiceAddress); SyncParams <Gateway> gwSP = new SyncParams <Gateway>("GBT28181/Gateway", Timeout.InfiniteTimeSpan); SyncParams <Platform> platSP = new SyncParams <Platform>("GBT28181/Platform", Timeout.InfiniteTimeSpan); SyncParams <SipIdMap> simSP = new SyncParams <SipIdMap>("GBT28181/DeviceIdMap", Timeout.InfiniteTimeSpan); ClientHub.RegisterSynchronizer <Gateway>(gwSP); ClientHub.RegisterSynchronizer <Platform>(platSP); ClientHub.RegisterSynchronizer <SipIdMap>(simSP); ClientHub.RegisterDefaultWithoutUpdate(CCTVInfoType.StaticInfo); ClientHub.RegisterDefaultWithoutUpdate(CCTVInfoType.ControlConfig); ClientHub.RegisterDefaultWithoutUpdate(CCTVInfoType.UserPrivilege); }
private NodesManager() { string baseAddress = System.Configuration.ConfigurationManager.AppSettings["StaticInfoAddress"]; _hub = new CCTVDefaultInfoSync(baseAddress); _hub.RegisterDefaultWithoutUpdate(CCTVInfoType.HierarchyInfo); SyncParams <StorageSource> param = new SyncParams <StorageSource>("CenterStorage", TimeSpan.FromSeconds(10)); _hub.RegisterSynchronizer(param); }
private void init() { if (string.IsNullOrEmpty(WebApiBaseUri)) { return; } Console.WriteLine(WebApiBaseUri); ClientHub = new CCTVDefaultInfoSync(WebApiBaseUri); ClientHub.RegisterDefaultWithoutUpdate(CCTVInfoType.GlobalInfo); ClientHub.RegisterDefault(CCTVInfoType.HierarchyInfo, TimeSpan.FromSeconds(5)); ClientHub.RegisterDefault(CCTVInfoType.StaticInfo, TimeSpan.FromSeconds(10)); ClientHub.RegisterDefault(CCTVInfoType.OnlineStatus, TimeSpan.FromSeconds(5)); ClientHub.RegisterDefault(CCTVInfoType.DynamicInfo, TimeSpan.FromSeconds(5)); ClientHub.RegisterDefault(CCTVInfoType.ControlConfig, TimeSpan.FromSeconds(15)); ClientHub.RegisterDefault(CCTVInfoType.VideoTrackInfo, TimeSpan.FromSeconds(10)); ClientHub.RegisterDefaultWithoutUpdate(CCTVInfoType.UserPrivilege); if (_fromConfig) { UserManager.Instance.SubscribeLongin(userLogin); } CameraControl = new PanTiltControlManager(ClientHub); }
private void init() { ClientHub = new CCTVDefaultInfoSync(WebApiBaseUri); ClientHub.RegisterDefaultWithoutUpdate(CCTVInfoType.UserInfo); }