コード例 #1
0
        private void StartLocalReplayProcess()
        {
            try
            {
                OcxHelper.InitOcxPaneState(int.Parse(replayUserControls.WndID.Text.ToString()));
                PlaybackParam para = new PlaybackParam();
                para.StartTime    = "";
                para.EndTime      = "";
                para.ProtocolType = "2";
                para.Speed        = "1";
                para.pPWD         = "";
                var requestXml = XmlHelper.SerializeToXml(para);
                requestXml = XmlHelper.GetContentXml(requestXml);

                int result = 0;
                result = OcxHelper.OCX.IVS_OCX_StartLocalPlayBack(int.Parse(replayUserControls.WndID.Text.ToString()), replayUserControls.LocalFileName.Text.ToString(), requestXml);
                if (result == 0)
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("StartLocalReplay") + StringHelper.FindLanguageResource("Success");
                }
                else
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource(result.ToString());
                }
                replayUserControls.eSDKCodeTextBlock.Text = @"var result = OcxHelper.OCX.IVS_OCX_StartLocalPlayBack(int.Parse(replayUserControls.WndID.Text.ToString()), replayUserControls.LocalFileName.Text.ToString(), requestXml);";
            }
            catch (Exception ex)
            {
                LogService.Error(ex.ToString());
                OcxHelper.MainWin.OperationInfo.Content = ex.ToString();
                return;
            }
        }
コード例 #2
0
        public void StartReplayProcess()
        {
            try
            {
                RecordDataInfoEntity record = replayUserControls.RecordList.SelectedItem as RecordDataInfoEntity;
                replayUserControls.RecordList.CommitEdit();//刷新数据的编辑
                OcxHelper.InitOcxPaneState(Convert.ToInt32(record.WndID));

                PlaybackParam para = new PlaybackParam();
                para.StartTime    = record.StartTime;
                para.EndTime      = record.EndTime;
                para.NVRCode      = record.NvrCode;
                para.ProtocolType = "2";
                para.Speed        = "1";

                var requestXml = XmlHelper.SerializeToXml(para);
                requestXml = XmlHelper.GetContentXml(requestXml);

                int result = 0;
                if (replayUserControls.RecordType.SelectedIndex == 0)
                {
                    result = OcxHelper.OCX.IVS_OCX_StartPlatformPlayBack(record.CameraCode, requestXml, Convert.ToInt32(record.WndID));
                }
                else
                {
                    result = OcxHelper.OCX.IVS_OCX_StartPUPlayBack(record.CameraCode, requestXml, Convert.ToInt32(record.WndID));
                }
                if (result == 0)
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("StartReplay") + StringHelper.FindLanguageResource("Success");
                }
                else
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource(result.ToString());
                }
                replayUserControls.eSDKCodeTextBlock.Text = @"var result = OcxHelper.OCX.IVS_OCX_StartPlatformPlayBack(inrecord.CameraCode, requestXml, Convert.ToInt32(record.WndID));";
            }
            catch (Exception ex)
            {
                LogService.Error(ex.ToString());
                OcxHelper.MainWin.OperationInfo.Content = ex.ToString();
                return;
            }
        }