Exemplo n.º 1
0
        private void ReleaseCommandProcess()//释放
        {
            try
            {
                logInLogOutControls.eSDKCodeTextBlock.Text = @"int resultCode = OcxHelper.OCX.IVS_OCX_Cleanup();";
                Application.Current.Dispatcher.BeginInvoke(new Action(() => { OcxHelper.OCX.IVS_OCX_Cleanup(); }), System.Windows.Threading.DispatcherPriority.Background);

                OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("Release") + StringHelper.FindLanguageResource("Success");
                OcxHelper.MainWin.LogInfo.Content       = string.Empty;
            }
            catch (Exception ex)
            {
                LogService.Error(ex.ToString());
                OcxHelper.MainWin.OperationInfo.Content = ex.ToString();
                return;
            }
        }
Exemplo n.º 2
0
        public ReplayUserControls()
        {
            InitializeComponent();

            List <string> list = new List <string>();

            list.Add(StringHelper.FindLanguageResource("PLATRecord"));
            list.Add(StringHelper.FindLanguageResource("PURecord"));
            RecordType.ItemsSource   = list;
            RecordType.SelectedIndex = 0;

            model            = new ReplayViewModel(this);
            this.DataContext = model;

            this.StartTime.Text = System.DateTime.Today.ToString("yyyyMMddHHmmss");
            this.EndTime.Text   = System.DateTime.Today.AddDays(1).ToString("yyyyMMddHHmmss");
        }
Exemplo n.º 3
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;
            }
        }
Exemplo n.º 4
0
        public List <VideoEntity> LoadDeviceInfoByUser()
        {
            List <VideoEntity> deviceList = new List <VideoEntity>();

            try
            {
                string resultXml = OcxHelper.OCX.IVS_OCX_GetDeviceList((uint)IVSDeviceType.DEVICE_TYPE_CAMERA, (uint)1, (uint)PageSize);

                OcxResult ocxResult = XmlHelper.ProcessOcxResponseMsg(resultXml);
                if (ocxResult.ResultCode != "0")
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("GetCameraList") + StringHelper.FindLanguageResource(ocxResult.ResultCode);
                }
                else
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("GetCameraList") + StringHelper.FindLanguageResource("Success");
                    XmlNode     node     = ocxResult.BodyXmlNode;
                    XmlNodeList nodeList = node.SelectNodes("VideoInChanList/VideoInChanInfo");

                    foreach (XmlNode xmlNode in nodeList)
                    {
                        VideoEntity video = new VideoEntity();
                        video.CameraCode = xmlNode.SelectSingleNode("CameraCode").InnerXml.ToString();
                        video.AliasName  = xmlNode.SelectSingleNode("CameraName").InnerXml.ToString();

                        string cameraType = xmlNode.SelectSingleNode("CameraType").InnerXml.ToString();
                        video.CameraType = cameraType.Equals("FIX") ? CameraType.FIX : cameraType.Equals("PTZ") ? CameraType.PTZ : cameraType.Equals("DOME") ?
                                           CameraType.DOME : cameraType.Equals("HALFDOME") ? CameraType.HALFDOME : cameraType.Equals("DOME") ? CameraType.DOME : CameraType.None;

                        video.IsOnline = xmlNode.SelectSingleNode("IsOnline").InnerXml.Equals("ON") ? true : false;
                        deviceList.Add(video);
                    }
                }
            }
            catch (Exception ex)
            {
                LogService.Error(ex.ToString());
                OcxHelper.MainWin.OperationInfo.Content = ex.ToString();
                return(null);
            }
            return(deviceList);
        }
        private void DeletePresetProcess()
        {
            PTZPresetEntity pTZPreset = liveVideoPtzUserControls.PresetList.SelectedItem as PTZPresetEntity;

            if (pTZPreset == null)
            {
                return;
            }
            var resultValue = OcxHelper.OCX.IVS_OCX_DelPTZPreset(pTZPreset.CameraCode, (uint)(pTZPreset.PresetIndex));

            liveVideoPtzUserControls.eSDKCodeTextBlock.Text = @"int resultCode = OcxHelper.IVS_OCX_DelPTZPreset(pTZPreset.CameraCode, (uint)(pTZPreset.PresetIndex));";
            if (resultValue != 0)
            {
                OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource(resultValue.ToString());
            }
            else
            {
                OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("DeletePreset") + StringHelper.FindLanguageResource("Success");
            }
            QueryPresetProcess();
        }
Exemplo n.º 6
0
        public void StartPUDownloadCommandProcess()
        {
            try
            {
                RecordDownloadParam recordDownloadParam = XmlHelper.DeserializeToEntity <RecordDownloadParam>(downloadAndCaptureUserControls.DownLoadPara.Text);
                recordDownloadParam.SavePath = downloadAndCaptureUserControls.SaveFileName.Text.ToString();

                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");

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

                string responseMsg = OcxHelper.OCX.IVS_OCX_StartPUDownload(downloadAndCaptureUserControls.CameraCode.Text.ToString(), startTime, endTime, requestXml);
                downloadAndCaptureUserControls.eSDKCodeTextBlock.Text = @"int resultCode = OcxHelper.OCX.IVS_OCX_StartPUDownload(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("StartPUDownload") + StringHelper.FindLanguageResource("Success");
                    var node = ocxResult.BodyXmlNode.SelectSingleNode("DownloadHandle");
                    downloadAndCaptureUserControls.DownLoadHandle.Text = node.InnerText.ToString();
                }
                downloadAndCaptureUserControls.eSDKCodeTextBlock.Text = @"OcxHelper.OCX.IVS_OCX_StartPUDownload(downloadAndCaptureUserControls.CameraCode.Text.ToString(), downloadAndCaptureUserControls.StartTime.Text.ToString(), downloadAndCaptureUserControls.EndTime.Text.ToString(), requestXml);";
            }
            catch (Exception ex)
            {
                LogService.Error(ex.ToString());
                OcxHelper.MainWin.OperationInfo.Content = ex.ToString();
                return;
            }
        }
        private void QueryPresetProcess()
        {
            try
            {
                VideoEntity camera      = liveVideoPtzUserControls.CameraList.SelectedItem as VideoEntity;
                var         resultValue = OcxHelper.OCX.IVS_OCX_GetPTZPresetList(camera.CameraCode);
                liveVideoPtzUserControls.eSDKCodeTextBlock.Text = @"int resultCode = OcxHelper.IVS_OCX_GetPTZPresetList(CameraCode);";
                OcxResult result = XmlHelper.ProcessOcxResponseMsg(resultValue);
                if (result.ResultCode != "0")
                {
                    throw new Exception(result.ResultCode);
                }

                var returnCameraCode = result.BodyXmlNode.SelectSingleNode("CameraCode").InnerText;
                List <PTZPresetEntity> preSetLocationEntityList = XmlHelper.DeserializeToList <PTZPresetEntity>(result.BodyXmlNode.SelectSingleNode("PresetPTZList"));

                foreach (PTZPresetEntity Preset in preSetLocationEntityList)
                {
                    Preset.CameraCode = camera.CameraCode;
                }
                liveVideoPtzUserControls.PresetList.ItemsSource = preSetLocationEntityList;

                if (result.ResultCode != "0")
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource(result.ResultCode);
                }
                else
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("QueryPreset") + StringHelper.FindLanguageResource("Success");
                }
            }
            catch (Exception ex)
            {
                LogService.Error(ex.ToString());
                OcxHelper.MainWin.OperationInfo.Content = ex.ToString();
                return;
            }
        }
        private void FullScreenProcess()
        {
            try
            {
                int result = OcxHelper.OCX.IVS_OCX_FullScreenDisplay();
                layOutManageUserControls.eSDKCodeTextBlock.Text = @"int resultCode = OcxHelper.OCX.IVS_OCX_FullScreenDisplay();";

                if (result == 0)
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("FullScreen") + StringHelper.FindLanguageResource("Success");
                }
                else
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource(result.ToString());
                }
            }
            catch (Exception ex)
            {
                LogService.Error(ex.ToString());
                OcxHelper.MainWin.OperationInfo.Content = ex.ToString();
                return;
            }
        }
        private void SetDisplayScaleProcess()
        {
            try
            {
                int result = OcxHelper.OCX.IVS_OCX_SetDisplayScale(Convert.ToInt32(layOutManageUserControls.DisplayScale.SelectedIndex + 1));//Source = 1,Full = 2
                layOutManageUserControls.eSDKCodeTextBlock.Text = @"int resultCode = OcxHelper.OCX.IVS_OCX_SetDisplayScale(Convert.ToInt32(layOutManageUserControls.DisplayScale.Text.ToString()));";

                if (result == 0)
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("SetDisplayScale") + StringHelper.FindLanguageResource("Success");
                }
                else
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource(result.ToString());
                }
            }
            catch (Exception ex)
            {
                LogService.Error(ex.ToString());
                OcxHelper.MainWin.OperationInfo.Content = ex.ToString();
                return;
            }
        }
        private void Layout9Process()
        {
            try
            {
                int result = OcxHelper.OCX.IVS_OCX_SetWndLayout((uint)PlayerLayoutType.Layout92);
                layOutManageUserControls.eSDKCodeTextBlock.Text = @"int resultCode = OcxHelper.OCX.IVS_OCX_SetWndLayout((uint)PlayerLayoutType.Layout92);";

                if (result == 0)
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("Layout9") + StringHelper.FindLanguageResource("Success");
                }
                else
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource(result.ToString());
                }
            }
            catch (Exception ex)
            {
                LogService.Error(ex.ToString());
                OcxHelper.MainWin.OperationInfo.Content = ex.ToString();
                return;
            }
        }
Exemplo n.º 11
0
        public void StopFileBroadcastProcess()
        {
            try
            {
                int result = OcxHelper.OCX.IVS_OCX_StopFileBroadcast();
                talkAndBroadcastUserControls.eSDKCodeTextBlock.Text = @"int resultCode = OcxHelper.IVS_OCX_StopFileBroadcast();";

                if (result != 0)
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource(result.ToString());
                }
                else
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("StopFileBroadcast") + StringHelper.FindLanguageResource("Success");
                }
            }
            catch (Exception ex)
            {
                LogService.Error(ex.ToString());
                OcxHelper.MainWin.OperationInfo.Content = ex.ToString();
                return;
            }
        }
 private void RealPlayStopProcess()
 {
     try
     {
         int wndID      = Convert.ToInt32(liveVideoPtzUserControls.PlayPane.Text.ToString());
         int resultCode = OcxHelper.OCX.IVS_OCX_StopRealPlay(wndID);
         liveVideoPtzUserControls.eSDKCodeTextBlock.Text = @"int resultCode = OcxHelper.IVS_OCX_StopRealPlay(wndID);";
         if (resultCode == 0)
         {
             OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("RealPlayStop") + StringHelper.FindLanguageResource("Success");
         }
         else
         {
             OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource(resultCode.ToString());
         }
     }
     catch (Exception ex)
     {
         LogService.Error(ex.ToString());
         OcxHelper.MainWin.OperationInfo.Content = ex.ToString();
         return;
     }
 }
       private void StartPURecordProcess()
       {
           try
           {
               int result = OcxHelper.OCX.IVS_OCX_StartPURecord(recordUserControls.PUCameraCodeTextBox.Text.ToString(), UInt32.Parse(recordUserControls.PURecordTimeTextBox.Text.ToString()));
               recordUserControls.eSDKCodeTextBlock.Text = @"int resultCode = OcxHelper.OCX.IVS_OCX_StartPURecord(recordUserControls.CameraCodeTextBox.Text.ToString(),UInt32.Parse(recordUserControls.RecordTimeTextBox.Text.ToString()));";

               if (result == 0)
               {
                   OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("StartPURecord") + StringHelper.FindLanguageResource("Success");
               }
               else
               {
                   OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource(result.ToString());
               }
           }
           catch (Exception ex)
           {
               LogService.Error(ex.ToString());
               OcxHelper.MainWin.OperationInfo.Content = ex.ToString();
               return;
           }
       }
Exemplo n.º 14
0
        public TalkAndBroadcastUserControls()
        {
            InitializeComponent();

            List <string> listCycle = new List <string>();

            listCycle.Add(StringHelper.FindLanguageResource("CycleFalse"));
            listCycle.Add(StringHelper.FindLanguageResource("CycleTrue"));

            CycleType.ItemsSource   = listCycle;
            CycleType.SelectedIndex = 0;

            model            = new TalkAndBroadcastViewModel(this);
            this.DataContext = model;

            List <string> listProtocol = new List <string>();

            listProtocol.Add("UDP");
            listProtocol.Add("TCP");

            ProtocolType.ItemsSource   = listProtocol;
            ProtocolType.SelectedIndex = 0;
        }
Exemplo n.º 15
0
 private void FileName_GotMouseCapture(object sender, System.Windows.Input.MouseEventArgs e)
 {
     try
     {
         System.Windows.Application.Current.Dispatcher.BeginInvoke(new Action(() =>
         {
             OpenFileDialog openFileDialog   = new OpenFileDialog();
             openFileDialog.Title            = StringHelper.FindLanguageResource("SelectFile");
             openFileDialog.FileName         = string.Empty;
             openFileDialog.FilterIndex      = 1;
             openFileDialog.RestoreDirectory = true;
             DialogResult result             = openFileDialog.ShowDialog();
             if (result == System.Windows.Forms.DialogResult.Cancel)
             {
                 return;
             }
             this.FileName.Text = openFileDialog.FileName;
         }));
     }
     catch (Exception ex)
     {
         LogService.Error(ex.ToString());
     }
 }
Exemplo n.º 16
0
        private void PlayBackTimeProcess()
        {
            try
            {
                int result = 0;
                result = OcxHelper.OCX.IVS_OCX_SetPlayBackTime((int)OcxHelper.OCX.IVS_OCX_GetSelectWnd(), UInt32.Parse(replayUserControls.Speed.Text));
                if (result == 0)
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("PlayBackTime") + StringHelper.FindLanguageResource("Success");
                }
                else
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource(result.ToString());
                }
                replayUserControls.eSDKCodeTextBlock.Text = @"var result = OcxHelper.OCX.IVS_OCX_SetPlayBackTime((int)OcxHelper.OCX.IVS_OCX_GetSelectWnd(), UInt32.Parse(replayUserControls.Speed.Text));";
            }

            catch (Exception ex)
            {
                LogService.Error(ex.ToString());
                OcxHelper.MainWin.OperationInfo.Content = ex.ToString();
                return;
            }
        }
Exemplo n.º 17
0
        public void LocalSnapshotCommandProcess()
        {
            try
            {
                CaptureConfigEntity reqEntity = new CaptureConfigEntity();
                reqEntity.CaptureDownloadPath = downloadAndCaptureUserControls.SnapshotFielName.Text.ToString();
                reqEntity.CapturePath         = downloadAndCaptureUserControls.SnapshotFielName.Text.ToString();
                reqEntity.NameRule            = NameRuleType.NameRule1;
                reqEntity.SnapshotCount       = 1;
                reqEntity.SnapshotFormat      = downloadAndCaptureUserControls.PicType.SelectedIndex == 0 ? SnapshotFormat.Jpg : SnapshotFormat.Bmp;
                reqEntity.SnapshotInterval    = 1;
                reqEntity.SnapshotMode        = "0";

                string msgReq = XmlHelper.SerializeToXml(reqEntity);
                //OcxHelper.OCX.IVS_OCX_SetLocalCaptureConfig(msgReq);
                int wndID      = Convert.ToInt32(downloadAndCaptureUserControls.WndID.Text.ToString());
                int resultCode = OcxHelper.OCX.IVS_OCX_LocalSnapshot(wndID);
                downloadAndCaptureUserControls.eSDKCodeTextBlock.Text = @"int resultCode = OcxHelper.IVS_OCX_LocalSnapshot(wndID);";

                if (resultCode == 0)
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("LocalSnapshot") + StringHelper.FindLanguageResource("Success");
                }
                else
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource(resultCode.ToString());
                }
                downloadAndCaptureUserControls.eSDKCodeTextBlock.Text = @" OcxHelper.OCX.IVS_OCX_SetLocalCaptureConfig(msgReq);OcxHelper.OCX.IVS_OCX_LocalSnapshot(wndID);";
            }
            catch (Exception ex)
            {
                LogService.Error(ex.ToString());
                OcxHelper.MainWin.OperationInfo.Content = ex.ToString();
                return;
            }
        }
Exemplo n.º 18
0
        private void LogOutCommandProcess()//签出
        {
            try
            {
                int resultCode = OcxHelper.OCX.IVS_OCX_Logout();

                logInLogOutControls.eSDKCodeTextBlock.Text = @"int resultCode = OcxHelper.OCX.IVS_OCX_Logout();";
                if (resultCode == 0)
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("LogOut") + StringHelper.FindLanguageResource("Success");
                    OcxHelper.MainWin.LogInfo.Content       = string.Empty;
                }
                else
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource(resultCode.ToString());
                }
            }
            catch (Exception ex)
            {
                LogService.Error(ex.ToString());
                OcxHelper.MainWin.OperationInfo.Content = ex.ToString();
                return;
            }
        }
Exemplo n.º 19
0
        private void FrameReplayProcess()
        {
            try
            {
                int result = 0;
                result = OcxHelper.OCX.IVS_OCX_PlaybackFrameStepForward((int)OcxHelper.OCX.IVS_OCX_GetSelectWnd());
                if (result == 0)
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("FrameReplay") + StringHelper.FindLanguageResource("Success");
                }
                else
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource(result.ToString());
                }
                replayUserControls.eSDKCodeTextBlock.Text = @"var result = OcxHelper.OCX.IVS_OCX_PlaybackFrameStepForward((int)OcxHelper.OCX.IVS_OCX_GetSelectWnd());";
            }

            catch (Exception ex)
            {
                LogService.Error(ex.ToString());
                OcxHelper.MainWin.OperationInfo.Content = ex.ToString();
                return;
            }
        }
Exemplo n.º 20
0
 private void ModifyPasswordCommandProcess()//修改密码
 {
     try
     {
         if (logInLogOutControls.ConfirmNewPassword.Password != logInLogOutControls.NewPassword.Password)
         {
             OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("PassWordError");
             return;
         }
         int resultCode = OcxHelper.OCX.IVS_OCX_ChangePWD(logInLogOutControls.OldPassword.Password.ToString(), logInLogOutControls.NewPassword.Password.ToString());
         logInLogOutControls.eSDKCodeTextBlock.Text = @"int resultCode = OcxHelper.OCX.IVS_OCX_ChangePWD(pOldPWD, pNewPWD);";
         if (resultCode == 0)
         {
             OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("ModifyPassword") + StringHelper.FindLanguageResource("Success");
         }
         else
         {
             OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource(resultCode.ToString());
         }
     }
     catch (Exception ex)
     {
         LogService.Error(ex.ToString());
         OcxHelper.MainWin.OperationInfo.Content = ex.ToString();
         return;
     }
 }
Exemplo n.º 21
0
        public void StopVoiceTalkbackProcess()
        {
            try
            {
                int result = 0;
                result = OcxHelper.OCX.IVS_OCX_StopVoiceTalkback(uint.Parse(talkAndBroadcastUserControls.TalkbackHandle.Text.ToString()));

                if (result == 0)
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("StopVoiceTalkback") + StringHelper.FindLanguageResource("Success");
                }
                else
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource(result.ToString());
                }
                talkAndBroadcastUserControls.eSDKCodeTextBlock.Text = @"var result = OcxHelper.OCX.IVS_OCX_StopVoiceTalkback(uint.Parse(talkAndBroadcastUserControls.TalkbackHandle.Text.ToString()));";
            }

            catch (Exception ex)
            {
                LogService.Error(ex.ToString());
                OcxHelper.MainWin.OperationInfo.Content = ex.ToString();
                return;
            }
        }
 public void PtzProcess(PtzOperationType operaction)
 {
     try
     {
         int resultCode = business.SendPtz(operaction, 2, 5, OcxHelper.OCX.IVS_OCX_GetCameraByWnd(Convert.ToUInt32(liveVideoPtzUserControls.PlayPane.Text.ToString())));
         liveVideoPtzUserControls.eSDKCodeTextBlock.Text = @"int resultCode = OcxHelper.IVS_OCX_PtzControl(strCameracode, (int)operation, param1.ToString(), param2.ToString())";
         if (operaction == PtzOperationType.PTZ_STOP)
         {
             return;
         }
         if (resultCode == 0)
         {
             OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("PtzOp") + StringHelper.FindLanguageResource("Success");
         }
         else if (resultCode == 1)
         {
             OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("PtzLocked");
         }
         else
         {
             OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource(resultCode.ToString());
         }
     }
     catch (Exception ex)
     {
         LogService.Error(ex.ToString());
         OcxHelper.MainWin.OperationInfo.Content = ex.ToString();
         return;
     }
 }
        private void InvokePresetProcess()
        {
            PTZPresetEntity pTZPreset = liveVideoPtzUserControls.PresetList.SelectedItem as PTZPresetEntity;

            var resultValue = business.SendPtz(PtzOperationType.PTZ_PREFAB_BIT_RUN, pTZPreset.PresetIndex, 5, pTZPreset.CameraCode);

            liveVideoPtzUserControls.eSDKCodeTextBlock.Text = @"int resultCode = OcxHelper.IVS_OCX_PtzControl(strCameracode, (int)operation, param1.ToString(), param2.ToString())";
            if (resultValue != 0)
            {
                OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource(resultValue.ToString());
            }
            else
            {
                OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("InvokePreset") + StringHelper.FindLanguageResource("Success");
            }
        }
 private void AddPresetProcess()
 {
     try
     {
         if (string.IsNullOrEmpty(liveVideoPtzUserControls.PresetName.Text.ToString()))
         {
             return;
         }
         VideoEntity camera      = liveVideoPtzUserControls.CameraList.SelectedItem as VideoEntity;
         string      resultValue = OcxHelper.OCX.IVS_OCX_AddPTZPreset(camera.CameraCode, liveVideoPtzUserControls.PresetName.Text.ToString());
         liveVideoPtzUserControls.eSDKCodeTextBlock.Text = @"int resultCode = OcxHelper.IVS_OCX_AddPTZPreset(camera.CameraCode, liveVideoPtzUserControls.PresetName.Text.ToString());";
         OcxResult result = XmlHelper.ProcessOcxResponseMsg(resultValue);
         if (result.ResultCode != "0")
         {
             OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource(result.ResultCode);
         }
         else
         {
             OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("AddPreset") + StringHelper.FindLanguageResource("Success");
         }
     }
     catch (Exception ex)
     {
         LogService.Error(ex.ToString());
         OcxHelper.MainWin.OperationInfo.Content = ex.ToString();
         return;
     }
 }
Exemplo n.º 25
0
        public void DeleteBroadcastDeviceProcess()
        {
            try
            {
                int result = 0;
                result = OcxHelper.OCX.IVS_OCX_DeleteBroadcastDevice(talkAndBroadcastUserControls.BroadcastDeviceCode.Text.ToString());

                if (result == 0)
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("DeleteBroadcastDevice") + StringHelper.FindLanguageResource("Success");
                }
                else
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource(result.ToString());
                }
                GetBroadcastDeviceList();

                talkAndBroadcastUserControls.eSDKCodeTextBlock.Text = @"var result = OcxHelper.OCX.IVS_OCX_DeleteBroadcastDevice(talkAndBroadcastUserControls.TalkCameraCode.Text.ToString());";
            }

            catch (Exception ex)
            {
                LogService.Error(ex.ToString());
                OcxHelper.MainWin.OperationInfo.Content = ex.ToString();
                return;
            }
        }
Exemplo n.º 26
0
        private void InitCommandProcess()//初始化
        {
            try
            {
                OcxHelper.MainWin.PlayOcx.Visibility = System.Windows.Visibility.Visible;
                int resultCode = OcxHelper.OCX.IVS_OCX_Cleanup();//释放
                resultCode = OcxHelper.OCX.IVS_OCX_Init();
                resultCode = OcxHelper.OCX.IVS_OCX_SetLanguage(CultureInfo.CurrentCulture.Name);
                resultCode = OcxHelper.OCX.IVS_OCX_ShowTitlebar(true);
                resultCode = OcxHelper.OCX.IVS_OCX_ShowToolbar(true);

                logInLogOutControls.eSDKCodeTextBlock.Text = @"int resultCode = OcxHelper.OCX.IVS_OCX_Init();";

                if (resultCode == 0)
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("Init") + StringHelper.FindLanguageResource("Success");
                }
                else
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource(resultCode.ToString());
                }
            }
            catch (Exception ex)
            {
                LogService.Error(ex.ToString());
                OcxHelper.MainWin.OperationInfo.Content = ex.ToString();
                return;
            }
        }
Exemplo n.º 27
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());
            }
        }
Exemplo n.º 28
0
        private void LogInCommandProcess()//登录
        {
            try
            {
                int resultCode = OcxHelper.OCX.IVS_OCX_Login(logInLogOutControls.UserList.Text.ToString(), logInLogOutControls.PasswordTextBox.Password.ToString(),
                                                             logInLogOutControls.ServeTextBox.Text.ToString(), logInLogOutControls.PortTextBox.Text.ToString(), 0);
                logInLogOutControls.eSDKCodeTextBlock.Text = @"int resultCode = OcxHelper.OCX.IVS_OCX_Login(pUserName, pPWD, pServerIP, pPort, ulClientType);";
                OcxHelper.OCX.IVS_OCX_SetLanguage(CultureInfo.CurrentCulture.Name);
                if (resultCode == 0)
                {
                    OcxHelper.MainWin.OperationInfo.Content = logInLogOutControls.UserList.Text.ToString() + (CultureInfo.CurrentCulture.Name == "en-US"? " ":"") + StringHelper.FindLanguageResource("LogSuccess");
                    OcxHelper.MainWin.LogInfo.Content       = logInLogOutControls.UserList.Text.ToString() + StringHelper.FindLanguageResource("LogIn");

                    UserEntity user = new UserEntity();
                    user.username     = logInLogOutControls.UserList.Text.ToString();
                    user.userpassword = logInLogOutControls.PasswordTextBox.Password.ToString();
                    user.port         = logInLogOutControls.PortTextBox.Text.ToString();
                    user.ip           = logInLogOutControls.ServeTextBox.Text.ToString();

                    XmlHelper.AddUser(user);
                }
                else
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource(resultCode.ToString());
                }
            }
            catch (Exception ex)
            {
                LogService.Error(ex.ToString());
                OcxHelper.MainWin.OperationInfo.Content = ex.ToString();
                return;
            }
        }
Exemplo n.º 29
0
        public void StopReplayProcess()
        {
            try
            {
                int result = 0;
                RecordDataInfoEntity record = replayUserControls.RecordList.SelectedItem as RecordDataInfoEntity;
                replayUserControls.RecordList.CommitEdit();//刷新数据的编辑

                if (replayUserControls.RecordType.SelectedIndex == 0)
                {
                    result = OcxHelper.OCX.IVS_OCX_StopPlatformPlayBack(Convert.ToInt32(record.WndID));
                }
                else
                {
                    result = OcxHelper.OCX.IVS_OCX_StopPUPlayBack(Convert.ToInt32(record.WndID));
                }
                if (result == 0)
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource("StopReplay") + StringHelper.FindLanguageResource("Success");
                }
                else
                {
                    OcxHelper.MainWin.OperationInfo.Content = StringHelper.FindLanguageResource(result.ToString());
                }
                replayUserControls.eSDKCodeTextBlock.Text = @"var result = OcxHelper.OCX.IVS_OCX_StopBackupPlayBack(Convert.ToInt32(record.WndID));";
            }

            catch (Exception ex)
            {
                LogService.Error(ex.ToString());
                OcxHelper.MainWin.OperationInfo.Content = ex.ToString();
                return;
            }
        }
Exemplo n.º 30
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;
            }
        }