Exemple #1
0
        /// <summary>
        /// 开始
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ButtonPlayByTime_Click(object sender, RoutedEventArgs e)
        {
            DateTime?startTime = dptPlayStartTime.Value;
            DateTime?endTime   = dptPlayEndTime.Value;

            if (startTime == null || endTime == null || startTime >= endTime)
            {
                return;
            }
            if (_curVideoPlayBackController != null)
            {
                _curVideoPlayBackController.PlayStop();
            }
            var getCamera = videoList.SelectedItem as Camera;

            if (getCamera != null)
            {
                ReadNVRConfig();
                VideoConfig gCfg = InfoExchange.Clone(cfg); //InitReadVideoConfig();
                gCfg.CameraList.Clear();
                getCamera.Position = "1";
                getCamera.Ip       = nvrConfig.Ip;
                getCamera.PassWord = nvrConfig.PassWord;
                getCamera.UserName = nvrConfig.UserName;
                getCamera.Port     = nvrConfig.Port;

                #region 日志
                string msg = string.Format("Ip={0},Port={1},UserName={2},PassWord={3},Channel={4}", nvrConfig.Ip, nvrConfig.Port, nvrConfig.UserName, nvrConfig.PassWord, getCamera.Channel);

                LogModel log = new LogModel()
                {
                    CreateTime   = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                    Direction    = LogConstParam.Directions_OutIn,
                    FunctionName = "ReadNVRConfig()",
                    Level        = LogConstParam.LogLevel_Error,
                    Msg          = msg
                };
                Talent.ClinetLog.SysLog.Log(JsonConvert.SerializeObject(log));
                #endregion
                //getCamera.Ip = dvrIp;
                //getCamera.PassWord = dvrPassW;
                //getCamera.UserName = dvrUserId;
                //getCamera.Channel = getCamera.DvrChannel;
                //System.Windows.Forms.MessageBox.Show(getCamera.Channel);
                //gCfg.VideoDriver=@"IoDllNew\hk\Talent.Video.HKVideo.dll";
                gCfg.CameraList.Add(getCamera);
                _curVideoPlayBackController = new VideoPlayBackController(gCfg, videoHis.Handle);
                _curVideoPlayBackController.OnShowErrMsg += _curVideoPlayBackController_OnShowErrMsg;
                _curVideoPlayBackController.PlayByTime(startTime.Value, endTime.Value);

                this.ButtonPlayPause.Content = "暂停";
            }
            else
            {
                //请选择
            }
        }
Exemple #2
0
        /// <summary>
        /// 毛重视频播放
        /// </summary>
        private void OpenMaoVideo()
        {
            if (this.showType == 0 || this.showType == 2)
            {
                if (weightModel != null && !string.IsNullOrEmpty(weightModel.grosstime))
                {
                    if (maoVideoPlayBackController != null)
                    {
                        maoVideoPlayBackController.PlayStop();
                    }
                    DateTime startTime = dptMZPlayStartTime.Value.Value; // DateTime.Parse(weightModel.JiMaoDate);
                    DateTime endTime   = dptMZPlayEndTime.Value.Value;   //startTime.AddMinutes(5);//计毛结束时间不晓得服务那边是否有,暂时先给计毛时间加5分钟作为计毛结束时间
                    if (endTime <= startTime)
                    {
                        return;
                    }
                    var getCamera = maoVideoList.SelectedItem as Camera;
                    if (getCamera != null)
                    {
                        //Talent.ClinetLog.SysLog.Log("选择了视频:" + getCamera.VideoName);
                        if (this.maoVideoConfig != null)
                        {
                            VideoConfig gCfg = InfoExchange.Clone <VideoConfig>(this.maoVideoConfig);
                            gCfg.CameraList.Clear();
                            //Talent.ClinetLog.SysLog.Log("清空摄像头列表");
                            getCamera.Position = "1";

                            getCamera.Ip       = maoNvrConfig.Ip;
                            getCamera.Port     = maoNvrConfig.Port;
                            getCamera.UserName = maoNvrConfig.UserName;
                            getCamera.PassWord = maoNvrConfig.PassWord;
                            //Talent.ClinetLog.SysLog.Log(string.Format("摄像头信息赋值,Ip={0};Port={1}", getCamera.Ip, getCamera.Port));
                            gCfg.CameraList.Add(getCamera);
                            //Talent.ClinetLog.SysLog.Log("准备构造摄像头Controller");
                            maoVideoPlayBackController = new VideoPlayBackController(gCfg, maoVideoHis.Handle);
                            //Talent.ClinetLog.SysLog.Log("构造摄像头Controller完毕,准备设置播放录像的时间段");
                            maoVideoPlayBackController.PlayByTime(startTime, endTime);
                            //Talent.ClinetLog.SysLog.Log("设置播放录像的时间段完毕");
                        }
                    }
                }
            }
        }
Exemple #3
0
        /// <summary>
        /// 皮重视频播放
        /// </summary>
        private void OpenPiVideo()
        {
            if (this.showType == 0 || this.showType == 1)
            {
                if (weightModel != null && !string.IsNullOrEmpty(weightModel.taretime))
                {
                    if (piVideoPlayBackController != null)
                    {
                        piVideoPlayBackController.PlayStop();
                    }
                    DateTime startTime = dptPZPlayStartTime.Value.Value; // DateTime.Parse(weightModel.JiMaoDate);
                    DateTime endTime   = dptPZPlayEndTime.Value.Value;   //startTime.AddMinutes(5);//
                    if (endTime <= startTime)
                    {
                        return;
                    }
                    var getCamera = piVideoList.SelectedItem as Camera;
                    if (getCamera != null)
                    {
                        if (this.piVideoConfig != null)
                        {
                            VideoConfig gCfg = InfoExchange.Clone <VideoConfig>(this.piVideoConfig);
                            gCfg.CameraList.Clear();
                            getCamera.Position = "1";

                            getCamera.Ip       = piNvrConfig.Ip;
                            getCamera.Port     = piNvrConfig.Port;
                            getCamera.UserName = piNvrConfig.UserName;
                            getCamera.PassWord = piNvrConfig.PassWord;

                            gCfg.CameraList.Add(getCamera);
                            piVideoPlayBackController = new VideoPlayBackController(gCfg, piVideoHis.Handle);
                            piVideoPlayBackController.PlayByTime(startTime, endTime);
                        }
                    }
                }
            }
        }