private void Window_Loaded(object sender, RoutedEventArgs e) { string basePath = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "ClientConfig"); string configPath = System.IO.Path.Combine(basePath, _curConfigFilename); //默认为第一位 _curCameraConfig.Position = "1"; // 加载配置 ConfigReader cfgReader = new ConfigReader(configPath); Model.VideoConfig cfg = ConfigReader.ReadVideoConfig(); Model.FtpConfig phCfg = ConfigReader.ReadPhotoConfig(); cfg.CameraList.Clear(); cfg.CameraList.Add(_curCameraConfig); //打开摄像头 List <IntPtr> handelList = new List <IntPtr>(); handelList.Add(VideoPictureBox.Handle); _curVideoController = new VideoController(phCfg, cfg, handelList); _curVideoController.OnShowErrMsg += _curVideoController_OnShowErrMsg; _curVideoController.Open(); _curVideoController.Start(); }
private void ReadVideoConfig() { string basePath = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "CarMeasureClient"); string configPath = System.IO.Path.Combine(basePath, "SystemConfig.xml"); Talent.Measure.DomainModel.ConfigReader cfgReader1 = new Talent.Measure.DomainModel.ConfigReader(configPath); cfg = ConfigReader.ReadVideoConfig(); cfg.CameraList = (from r in cfg.CameraList select r).OrderBy(c => c.Position).ToList(); }
/// <summary> /// 加载视频配置(某称点视频列表集合) /// </summary> private void LoadVideoList() { cfg = InitReadVideoConfig(); videoList.ItemsSource = cfg.CameraList; }