예제 #1
0
        public ChannelMgr()
        {
            InitializeComponent();
            _ChannelManageViewModel                 = new ChannelManageViewModel();
            this.DataContext                        = _ChannelManageViewModel;
            listViewCaptureResults.ItemsSource      = _ListMyCapFaceLogWithImg;
            listViewContIdentifyResults.ItemsSource = _ListIdentifyResults;
            ResetServerRealtimeCapInfo              = new ManualResetEvent(false);
            ResetServerRealtimeCmpInfo              = new ManualResetEvent(false);
            //初始化OCX控件载体
            for (int i = 0; i < 16; i++)
            {
                WindowsFormsHost wfh = new WindowsFormsHost();
                wfh.Tag = null;
                wFHList.Add(wfh);
            }
            //初始化默认分屏
            SetVideoGridScreen(1);
            //打开客户端服务,接收业务服务器上传的实时抓拍和实时识别结果
            Thread ThreadStarServer = new System.Threading.Thread(new ParameterizedThreadStart(StartServer));

            ThreadStarServer.SetApartmentState(ApartmentState.STA);
            ThreadStarServer.Start();
            //域值设置
            int threshold = thirft.QueryThreshold();

            if (threshold == -1)
            {
                _ChannelManageViewModel.SelectedThreshold = Convert.ToInt32(ConfigurationManager.AppSettings["阈值"]) - 1;
            }
            else
            {
                if (Login.ClientType != "1")
                {
                    _ChannelManageViewModel.SelectedThreshold = threshold - 1;
                }
                else
                {
                    double trueThreshold = Math.Sqrt(threshold) * 10;
                    trueThreshold = Math.Round(trueThreshold, 0, MidpointRounding.AwayFromZero);
                    _ChannelManageViewModel.SelectedThreshold = Convert.ToInt32(trueThreshold) - 1;
                }
            }
            //根据客户端类型来修改客户端
            if (Login.ClientType == "1")
            {
                btnAddPassageWay.Visibility    = Visibility.Hidden;
                btnModifyPassageWay.Visibility = Visibility.Hidden;
                btnDeletePassageWay.Visibility = Visibility.Hidden;
                comboAutoSend.Visibility       = Visibility.Hidden;
                comboThreshold.IsEnabled       = false;
                _ChannelManageViewModel.RefreshChannelList();
            }
            if (Login.ClientType == "2")
            {
                comboAutoSend.Visibility = Visibility.Hidden;
            }
        }
예제 #2
0
 public VideoPreview(ChannelManageViewModel _viewModel)
 {
     InitializeComponent();
     viewModel = _viewModel;
     IniVideo();
     listViewContIdentifyResults.ItemsSource =
         FaceSysByMvvm.Views.ChannelManager.ChannelManage._ListIdentifyResults.Where(c => c.ChannelName == _viewModel.CurrentPointChannelListItem.MyChannelCfg.Name);
     this.MouseLeftButtonDown += MainWindow_MouseLeftButtonDown;
 }