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;
     }
 }
Exemplo n.º 2
0
        public int SendPtz(PtzOperationType operation, int param1, int param2, string code)
        {
            string strCameracode = code;

            if (string.IsNullOrEmpty(strCameracode))
            {
                strCameracode = string.Empty;
                LogService.Info("Search request info:==>>CameraCode is null.");
                return(-1);
            }
            LogService.Info("Search request info:==>>CameraCode:" + strCameracode + ",PtzOperationType:" + operation.ToString() + ",Param1:" + param1.ToString() + ",Param2:" + param2.ToString());
            var resultValue = OcxHelper.OCX.IVS_OCX_PtzControl(strCameracode, (int)operation, param1.ToString(), param2.ToString());

            OcxResult result     = XmlHelper.ProcessOcxResponseMsg(resultValue);
            var       lockStatus = string.Empty;

            if (result.BodyXmlNode.SelectSingleNode("LockStatus") != null)
            {
                lockStatus = result.BodyXmlNode.SelectSingleNode("LockStatus").InnerText;
            }
            if (result.ResultCode != "0")
            {
                throw new Exception(result.ResultCode + "," + lockStatus);
            }
            LogService.Info("IVS_OCX_PtzControl response info:==>>" + resultValue);

            return(int.Parse(lockStatus.ToString()));
        }
 public int SendPtz(PtzOperationType operation, int param1, int param2, string code)
 {
     return(ptzService.SendPtz(operation, param1, param2, code));
 }