Пример #1
0
        public void StartVoiceTalkbackProcess()
        {
            try
            {
                TalkbackParam para = new TalkbackParam();
                para.ProtocolType = (talkAndBroadcastUserControls.ProtocolType.SelectedIndex + 1).ToString();
                para.DirectFirst  = (bool)talkAndBroadcastUserControls.DirectFirst.IsChecked ? "1" :"0";

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

                string responseMsg = OcxHelper.OCX.IVS_OCX_StartVoiceTalkback(requestXml, talkAndBroadcastUserControls.TalkCameraCode.Text.ToString());
                talkAndBroadcastUserControls.eSDKCodeTextBlock.Text = @"int resultCode = OcxHelper.IVS_OCX_StartVoiceTalkback(requestXml, talkAndBroadcastUserControls.TalkCameraCode.Text.ToString());";

                var ocxResult = XmlHelper.ProcessOcxResponseMsg(responseMsg);

                if (ocxResult.ResultCode != "0")
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource(ocxResult.ResultCode.ToString());
                }
                else
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("StartVoiceTalkback") + StringHelper.FindLanguageResource("Success");
                    var node = ocxResult.BodyXmlNode.SelectSingleNode("TalkbackHandle");
                    talkAndBroadcastUserControls.TalkbackHandle.Text = node.InnerText.ToString();
                }
            }
            catch (Exception ex)
            {
                LogService.Error(ex.ToString());
                OcxHelper.MainWin.OperationInfo.Content = ex.ToString();
                return;
            }
        }
Пример #2
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;
            }
        }
Пример #3
0
        public void StartPlatformDownloadCommandProcess()
        {
            try
            {
                RecordDownloadParam recordDownloadParam = XmlHelper.DeserializeToEntity <RecordDownloadParam>(downloadAndCaptureUserControls.DownLoadPara.Text);
                recordDownloadParam.SavePath = downloadAndCaptureUserControls.SaveFileName.Text.ToString();
                if (!downloadAndCaptureUserControls.CameraCode.Text.Contains("#"))
                {
                    return;
                }

                recordDownloadParam.NVRCode = downloadAndCaptureUserControls.CameraCode.Text.Split('#')[1];



                var requestXml = XmlHelper.SerializeToXml(recordDownloadParam);
                requestXml = "<?xml version='1.0' encoding='utf-8'?>" + XmlHelper.GetContentXml(requestXml);

                DateTime realStartTime = DateTime.ParseExact(downloadAndCaptureUserControls.StartTime.Text.ToString(), "yyyyMMddHHmmss", Thread.CurrentThread.CurrentCulture);
                string   startTime     = realStartTime.ToUniversalTime().ToString("yyyyMMddHHmmss");

                DateTime realEndTime = DateTime.ParseExact(downloadAndCaptureUserControls.EndTime.Text.ToString(), "yyyyMMddHHmmss", Thread.CurrentThread.CurrentCulture);
                string   endTime     = realEndTime.ToUniversalTime().ToString("yyyyMMddHHmmss");

                string responseMsg = OcxHelper.OCX.IVS_OCX_StartPlatformDownload(downloadAndCaptureUserControls.CameraCode.Text.ToString(), startTime, endTime, requestXml);
                downloadAndCaptureUserControls.eSDKCodeTextBlock.Text = @"int resultCode = OcxHelper.OCX.IVS_OCX_StartPlatformDownload(downloadAndCaptureUserControls.CameraCode.Text.ToString(), downloadAndCaptureUserControls.StartTime.Text.ToString(), downloadAndCaptureUserControls.EndTime.Text.ToString(), requestXml);";

                var ocxResult = XmlHelper.ProcessOcxResponseMsg(responseMsg);
                if (ocxResult.ResultCode != "0")
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource(ocxResult.ResultCode.ToString());
                }
                else
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("StartPlatformDownload") + StringHelper.FindLanguageResource("Success");
                    var node = ocxResult.BodyXmlNode.SelectSingleNode("DownloadHandle");
                    downloadAndCaptureUserControls.DownLoadHandle.Text = node.InnerText.ToString();
                }
                downloadAndCaptureUserControls.eSDKCodeTextBlock.Text = @"OcxHelper.OCX.IVS_OCX_StartPlatformDownload(downloadAndCaptureUserControls.CameraCode.Text.ToString(), startTime, endTime, requestXml);";
            }
            catch (Exception ex)
            {
                LogService.Error(ex.ToString());
                OcxHelper.MainWin.OperationInfo.Content = ex.ToString();
                return;
            }
        }
Пример #4
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;
            }
        }
Пример #5
0
        private void QueryProcess()
        {
            try
            {
                var result = new RecordQueryResultEntity();

                PageInfo pageInfo = new PageInfo();
                pageInfo.FromIndex      = 1;
                pageInfo.PageSize       = 200;
                pageInfo.ToIndex        = 200;
                pageInfo.QueryCondition = new QueryCondition();

                QueryField startTime = new QueryField();//开始时间
                startTime.Field     = "FromTime";
                startTime.QueryType = QueryType.Exact;

                DateTime realFromTime = DateTime.ParseExact(replayUserControls.StartTime.Text.ToString(), "yyyyMMddHHmmss", Thread.CurrentThread.CurrentCulture);
                startTime.Value = DateTimeExtensions.ToDstUtcTime(realFromTime, true).ToString("yyyyMMddHHmmss");
                pageInfo.QueryCondition.QueryFieldList.Add(startTime);

                QueryField endTime = new QueryField();//结束时间
                endTime.Field     = "ToTime";
                endTime.QueryType = QueryType.Exact;

                DateTime realEndTime = DateTime.ParseExact(replayUserControls.EndTime.Text.ToString(), "yyyyMMddHHmmss", Thread.CurrentThread.CurrentCulture);
                endTime.Value = DateTimeExtensions.ToDstUtcTime(realEndTime, false).ToString("yyyyMMddHHmmss");
                pageInfo.QueryCondition.QueryFieldList.Add(endTime);

                QueryField cameraCode = new QueryField();//摄像机编号
                cameraCode.Field     = "CameraCode";
                cameraCode.QueryType = QueryType.Exact;
                cameraCode.Value     = replayUserControls.CameraCode.Text.ToString();
                pageInfo.QueryCondition.QueryFieldList.Add(cameraCode);

                QueryField recordMethod = new QueryField();//录像方式
                recordMethod.Field     = "RecordMethod";
                recordMethod.QueryType = QueryType.Exact;
                recordMethod.Value     = replayUserControls.RecordType.SelectedIndex.ToString();
                pageInfo.QueryCondition.QueryFieldList.Add(recordMethod);

                QueryField recordType = new QueryField();//录像类型
                recordType.Field     = "RecordType";
                recordType.QueryType = QueryType.Exact;
                recordType.Value     = "111";
                pageInfo.QueryCondition.QueryFieldList.Add(recordType);

                QueryField queryType = new QueryField();//查询方式
                queryType.Field     = "QueryType";
                queryType.QueryType = QueryType.Exact;
                queryType.Value     = "0";
                pageInfo.QueryCondition.QueryFieldList.Add(queryType);

                QueryField alarmTypeList = new QueryField();//告警类型列表
                alarmTypeList.Field     = "AlarmTypeList";
                alarmTypeList.QueryType = QueryType.Exact;
                alarmTypeList.Value     = "ALARM_TYPE_DI,ALARM_NO_SIGNAL,ALARM_SHIELD,ALARM_TYPE_MOVE_DECTION,ALARM_VIDEO_G,ALARM_REVERSE_DETECTION,ALARM_INTRUSION,ALARM_TRIP_LINE,ALARM_OBJECT_ABANDONED,ALARM_OBJECT_REMOVAL,ALARM_PRESENCE,ALARM_PATH,ALARM_DIRECTION_MOVE,ALARM_SPEED,ALARM_SPEED_MONITOR,ALARM_OBJECT_WANDER,ALARM_DENSITY_MONITOR,ALARM_FACE_RECOGNITION_WARNING,ALARM_FACE_RECOGNITION,ALARM_FACE_CAPTURE,ALARM_MAU_VQD_BRIGHTNESS,ALARM_MAU_VQD_DARKNESS,ALARM_MAU_VQD_BLUR,ALARM_MAU_VQD_SNOWNOISE,ALARM_MAU_VQD_COLORCAST,ALARM_MAU_VQD_STRIPENOISE,ALARM_MAU_VQD_FRAMEFROZEN,ALARM_MAU_VQD_SHAKE,ALARM_MAU_VQD_CAMERACOVERD,ALARM_MAU_VIDEO_LOST,EXSYS_ALARM_EMERGENCY_ON,EXSYS_ALARM_FIRE_ALERT_ON,EXSYS_ALARM_ROBBERY_ON,EXSYS_ALARM_STEAL_ON,EXSYS_ALARM_ALERT_ON,EXSYS_ALARM_MONITOR_ON,EXSYS_ALARM_FAILURE_ON,EXSYS_ALARM_DEFENCE_ON,EXSYS_ALARM_REMOTE_CONTROL_ON,EXSYS_ALARM_ENTER_EXIT_ON,EXSYS_ALARM_STATUS_ON,EXSYS_ALARM_SHUTDOWN_ON,EXSYS_ALARM_BYPASS_ON,EXSYS_ALARM_TEST_ON,EXSYS_ALARM_USER_OPERATION_ON,EXSYS_ALARM_ERROR_ON,SCADA_ALARM";
                pageInfo.QueryCondition.QueryFieldList.Add(alarmTypeList);

                QueryField operatorID = new QueryField();//执行查询操作的用户ID
                operatorID.Field     = "OperatorID";
                operatorID.QueryType = QueryType.Exact;
                operatorID.Value     = LoginInfo.CurrentLoginInfo.UserId;
                pageInfo.QueryCondition.QueryFieldList.Add(operatorID);

                QueryField operatorDomain = new QueryField();//
                operatorDomain.Field     = "OperatorDomain";
                operatorDomain.QueryType = QueryType.Exact;
                operatorDomain.Value     = LoginInfo.CurrentLoginInfo.OperatorDomain;
                pageInfo.QueryCondition.QueryFieldList.Add(operatorDomain);

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

                var responseMsg = OcxHelper.OCX.IVS_OCX_QueryRecordList(requestXml);

                var ocxResult = XmlHelper.ProcessOcxResponseMsg(responseMsg);

                if (ocxResult.ResultCode != "0")
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource(ocxResult.ResultCode.ToString());
                }
                else
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("Query") + StringHelper.FindLanguageResource("Success");
                }

                var node = ocxResult.BodyXmlNode.SelectSingleNode("PageInfo");

                if (node != null)
                {
                    var tempNode = XmlHelper.DeserializeToEntity <PageInfo>(node);
                    result.PageInfo = tempNode;
                }

                node = ocxResult.BodyXmlNode.SelectSingleNode("RecordDataList");

                if (node != null)
                {
                    var tempNode = XmlHelper.DeserializeToList <RecordDataInfoEntity>(node);

                    foreach (RecordDataInfoEntity info in tempNode)
                    {
                        info.CameraCode = replayUserControls.CameraCode.Text.ToString();

                        info.LocalStartTime = DateTime.ParseExact(info.StartTime, "yyyyMMddHHmmss", Thread.CurrentThread.CurrentCulture).ToLocalTime().ToString();
                        info.LocalEndTime   = DateTime.ParseExact(info.EndTime, "yyyyMMddHHmmss", Thread.CurrentThread.CurrentCulture).ToLocalTime().ToString();
                    }
                    replayUserControls.RecordList.ItemsSource = tempNode;
                }
                else
                {
                    replayUserControls.RecordList.ItemsSource = null;
                }
                replayUserControls.eSDKCodeTextBlock.Text = @"var responseMsg = OcxHelper.OCX.IVS_OCX_QueryRecordList(requestXml);";
            }
            catch (Exception ex)
            {
                LogService.Error("Server Record Search Error Code:" + ex.ToString());
            }
        }