Exemple #1
0
        public string ConvertTo(string number)
        {
            byte        dwStep      = Convert.ToByte(number);
            PTZ_CONTROL ptz_control = PTZ_CONTROL.PTZ_POINT_MOVE_CONTROL;

            return(PtzControlEx(ptz_control, dwStep, false));
        }
Exemple #2
0
 private string PtzControlEx(PTZ_CONTROL ptz_control, byte dwStep, bool stop)
 {
     if (0 != m_nLoginID)
     {
         bool bRet = NETClient.NETPTZControl(m_nLoginID, 0, ptz_control, dwStep, stop);
         if (bRet)
         {
             return("预置位操作成功");
         }
         else
         {
             return("预置位操作失败");
         }
     }
     return("NULL");
 }
Exemple #3
0
 /// <summary>
 /// Extended PTZ control, Enhanced control of the PTZ control  functions
 /// </summary>
 /// <param name="lLoginID">Equipment User LoginID:<seealso cref="CLIENT_Login"/>return value</param>
 /// <param name="nChannelID">Channel number</param>
 /// <param name="dwPTZCommand">PTZ control commands<seealso cref="PTZControlType"/>Command only accepts two parameters</param>
 /// <param name="param1">Parameter1</param>
 /// <param name="param2">Parameter2</param>
 /// <param name="param3">Parameter3</param>
 /// <param name="dwStop">Whether to stop</param>
 /// <returns>true:success;false:failure</returns>
 public static bool NETPTZControl(int lLoginID, int nChannelID, PTZ_CONTROL dwPTZCommand, ushort param1, ushort param2, bool dwStop)
 {
     bool returnValue = false;
     switch (dwPTZCommand)
     {
         case PTZ_CONTROL.PTZ_UP_CONTROL:
         case PTZ_CONTROL.PTZ_LEFT_CONTROL:
         case PTZ_CONTROL.PTZ_DOWN_CONTROL:
         case PTZ_CONTROL.PTZ_RIGHT_CONTROL:
         case PTZ_CONTROL.PTZ_ZOOM_ADD_CONTROL:
         case PTZ_CONTROL.PTZ_ZOOM_DEC_CONTROL:
         case PTZ_CONTROL.PTZ_FOCUS_ADD_CONTROL:
         case PTZ_CONTROL.PTZ_FOCUS_DEC_CONTROL:
         case PTZ_CONTROL.PTZ_APERTURE_ADD_CONTROL:
         case PTZ_CONTROL.PTZ_APERTURE_DEC_CONTROL:
         case PTZ_CONTROL.EXTPTZ_LEFTTOP:
         case PTZ_CONTROL.EXTPTZ_RIGHTTOP:
         case PTZ_CONTROL.EXTPTZ_LEFTDOWN:
         case PTZ_CONTROL.EXTPTZ_RIGHTDOWN:
         case PTZ_CONTROL.EXTPTZ_ADDTOLOOP:
         case PTZ_CONTROL.EXTPTZ_DELFROMLOOP:
         case PTZ_CONTROL.EXTPTZ_AUXIOPEN:
         case PTZ_CONTROL.EXTPTZ_AUXICLOSE:
             returnValue = CLIENT_DHPTZControl(lLoginID, nChannelID, (ushort)dwPTZCommand, param1, param2, 0, dwStop, IntPtr.Zero);
             break;
     }
     return returnValue;
 }
Exemple #4
0
 /// <summary>
 /// Extended PTZ control, Enhanced control of the PTZ control function functions
 /// </summary>
 /// <param name="lLoginID">Equipment User LoginID:<seealso cref="CLIENT_Login"/>return value</param>
 /// <param name="nChannelID">channel number</param>
 /// <param name="dwPTZCommand">PTZ control commands<seealso cref="PTZControlType"/>See the documentation accept parameters format</param>
 /// <param name="param1">Parameter1</param>
 /// <param name="param2">Parameter2</param>
 /// <param name="param3">Parameter3</param>
 /// <param name="dwStop">Whether to stop</param>
 /// <returns>true:suceess;false:failure</returns>
 public static bool NETPTZControl(int lLoginID, int nChannelID, PTZ_CONTROL dwPTZCommand, ushort param1, ushort param2, ushort param3, bool dwStop)
 {
     bool returnValue = false;
     switch (dwPTZCommand)
     {
         case PTZ_CONTROL.PTZ_APERTURE_ADD_CONTROL:
         case PTZ_CONTROL.PTZ_APERTURE_DEC_CONTROL:
         case PTZ_CONTROL.PTZ_DOWN_CONTROL:
         case PTZ_CONTROL.PTZ_FOCUS_ADD_CONTROL:
         case PTZ_CONTROL.PTZ_FOCUS_DEC_CONTROL:
         case PTZ_CONTROL.PTZ_LAMP_CONTROL:
         case PTZ_CONTROL.PTZ_LEFT_CONTROL:
         case PTZ_CONTROL.PTZ_POINT_DEL_CONTROL:
         case PTZ_CONTROL.PTZ_POINT_MOVE_CONTROL:
         case PTZ_CONTROL.PTZ_POINT_SET_CONTROL:
         case PTZ_CONTROL.PTZ_RIGHT_CONTROL:
         case PTZ_CONTROL.PTZ_UP_CONTROL:
         case PTZ_CONTROL.PTZ_ZOOM_ADD_CONTROL:
         case PTZ_CONTROL.PTZ_ZOOM_DEC_CONTROL:
             returnValue = CLIENT_DHPTZControlEx(lLoginID, nChannelID, (ushort)dwPTZCommand, 0, param2, 0, dwStop);
             break;
         case PTZ_CONTROL.PTZ_POINT_LOOP_CONTROL:
             returnValue = CLIENT_DHPTZControlEx(lLoginID, nChannelID, (ushort)dwPTZCommand, 0, 0, param3, dwStop);
             break;
         case PTZ_CONTROL.EXTPTZ_LEFTTOP:
         case PTZ_CONTROL.EXTPTZ_RIGHTTOP:
         case PTZ_CONTROL.EXTPTZ_LEFTDOWN:
         case PTZ_CONTROL.EXTPTZ_RIGHTDOWN:
         case PTZ_CONTROL.EXTPTZ_ADDTOLOOP:
         case PTZ_CONTROL.EXTPTZ_DELFROMLOOP:
         case PTZ_CONTROL.EXTPTZ_AUXIOPEN:
         case PTZ_CONTROL.EXTPTZ_AUXICLOSE:
             returnValue = CLIENT_DHPTZControlEx(lLoginID, nChannelID, (ushort)dwPTZCommand, param1, param2, 0, dwStop);
             break;
         case PTZ_CONTROL.EXTPTZ_SETMODESTART:
         case PTZ_CONTROL.EXTPTZ_SETMODESTOP:
         case PTZ_CONTROL.EXTPTZ_RUNMODE:
         case PTZ_CONTROL.EXTPTZ_STOPMODE:
         case PTZ_CONTROL.EXTPTZ_DELETEMODE:
             returnValue = CLIENT_DHPTZControlEx(lLoginID, nChannelID, (ushort)dwPTZCommand, param1, 0, 0, dwStop);
             break;
         //case PTZ_CONTROL.EXTPTZ_FASTGOTO:
         //    returnValue = CLIENT_DHPTZControl(lLoginID, nChannelID, (ushort)dwPTZCommand, param1, param2, param3, dwStop);
         //    break;
     }
     return returnValue;
 }
Exemple #5
0
        /// <summary>
        /// PTZ control
        /// </summary>
        /// <param name="lLoginID">Equipment User LoginID:<seealso cref="CLIENT_Login"/>return value</param>
        /// <param name="nChannelID">Channel number</param>
        /// <param name="dwPTZCommand">PTZ control commands<seealso cref="PTZControlType"/>[PTZ_****commod]</param>
        /// <param name="dwStep">Stepping/Speed</param>
        /// <param name="dwStop">Whether to stop</param>
        /// <returns>true:success;false:failure</returns>
        public static bool NETPTZControl(int lLoginID, int nChannelID, PTZ_CONTROL dwPTZCommand, ushort dwStep, bool dwStop)
        {
            bool returnValue = false;
            switch (dwPTZCommand)
            {
                case PTZ_CONTROL.PTZ_APERTURE_ADD_CONTROL:
                case PTZ_CONTROL.PTZ_APERTURE_DEC_CONTROL:
                case PTZ_CONTROL.PTZ_DOWN_CONTROL:
                case PTZ_CONTROL.PTZ_FOCUS_ADD_CONTROL:
                case PTZ_CONTROL.PTZ_FOCUS_DEC_CONTROL:
                //case PTZ_CONTROL.PTZ_LAMP_CONTROL:
                case PTZ_CONTROL.PTZ_LEFT_CONTROL:
                //case PTZ_CONTROL.PTZ_POINT_DEL_CONTROL:
                case PTZ_CONTROL.PTZ_POINT_LOOP_CONTROL:
                //case PTZ_CONTROL.PTZ_POINT_MOVE_CONTROL:
                //case PTZ_CONTROL.PTZ_POINT_SET_CONTROL:
                case PTZ_CONTROL.PTZ_RIGHT_CONTROL:
                case PTZ_CONTROL.PTZ_UP_CONTROL:
                case PTZ_CONTROL.PTZ_ZOOM_ADD_CONTROL:
                case PTZ_CONTROL.PTZ_ZOOM_DEC_CONTROL:
                    returnValue = CLIENT_PTZControl(lLoginID, nChannelID, (ushort)dwPTZCommand, dwStep, dwStop);
                    break;
                case PTZ_CONTROL.PTZ_LAMP_CONTROL:
                    returnValue = CLIENT_DHPTZControlEx(lLoginID, nChannelID, (ushort)dwPTZCommand, dwStep, 0, 0, dwStop);
                    break;
                case PTZ_CONTROL.PTZ_POINT_DEL_CONTROL:
                case PTZ_CONTROL.PTZ_POINT_MOVE_CONTROL:
                case PTZ_CONTROL.PTZ_POINT_SET_CONTROL:
                    returnValue = CLIENT_DHPTZControlEx(lLoginID, nChannelID, (ushort)dwPTZCommand, 0, dwStep, 0, dwStop);
                    break;

                //case PTZControlType.PTZ_POINT_LOOP_CONTROL:
                //    returnValue = CLIENT_DHPTZControl(lLoginID, nChannelID, (ushort)dwPTZCommand, "", "", dwStep, dwStop);
                //    break;
                case PTZ_CONTROL.EXTPTZ_SETMODESTART:
                case PTZ_CONTROL.EXTPTZ_SETMODESTOP:
                case PTZ_CONTROL.EXTPTZ_RUNMODE:
                case PTZ_CONTROL.EXTPTZ_STOPMODE:
                case PTZ_CONTROL.EXTPTZ_DELETEMODE:
                    returnValue = CLIENT_DHPTZControlEx(lLoginID, nChannelID, (ushort)dwPTZCommand, dwStep, 0, 0, dwStop);
                    break;
                case PTZ_CONTROL.EXTPTZ_STARTPANCRUISE:
                case PTZ_CONTROL.EXTPTZ_STOPPANCRUISE:
                case PTZ_CONTROL.EXTPTZ_SETLEFTBORDER:
                case PTZ_CONTROL.EXTPTZ_RIGHTBORDER:
                case PTZ_CONTROL.EXTPTZ_STARTLINESCAN:
                case PTZ_CONTROL.EXTPTZ_CLOSELINESCAN:
                case PTZ_CONTROL.EXTPTZ_REVERSECOMM:
                case PTZ_CONTROL.EXTPTZ_OPENMENU:
                case PTZ_CONTROL.EXTPTZ_CLOSEMENU:
                case PTZ_CONTROL.EXTPTZ_MENUOK:
                case PTZ_CONTROL.EXTPTZ_MENUCANCEL:
                case PTZ_CONTROL.EXTPTZ_MENUUP:
                case PTZ_CONTROL.EXTPTZ_MENUDOWN:
                case PTZ_CONTROL.EXTPTZ_MENULEFT:
                case PTZ_CONTROL.EXTPTZ_MENURIGHT:
                case PTZ_CONTROL.EXTPTZ_TOTAL:
                    returnValue = CLIENT_DHPTZControlEx(lLoginID, nChannelID, (ushort)dwPTZCommand, 0, 0, 0, dwStop);
                    break;
            }

            return returnValue;
        }
Exemple #6
0
 /// <summary>
 /// 扩展云台控制, 对云台控制函数功能的增强控制
 /// </summary>
 /// <param name="lLoginID">设备用户登录ID:<seealso cref="CLIENT_Login"/>的返回值</param>
 /// <param name="nChannelID">通道号</param>
 /// <param name="dwPTZCommand">云台控制命令<seealso cref="PTZControlType"/>接受只有两个参数的命令</param>
 /// <param name="param1">参数1</param>
 /// <param name="param2">参数2</param>
 /// <param name="param3">参数3</param>
 /// <param name="dwStop">是否停止</param>
 /// <returns>true:成功;false:失败</returns>
 public static bool DHPTZControl(int lLoginID, int nChannelID, PTZ_CONTROL dwPTZCommand, ushort param1, ushort param2, bool dwStop)
 {
     bool returnValue = false;
     switch (dwPTZCommand)
     {
         case PTZ_CONTROL.EXTPTZ_LEFTTOP:
         case PTZ_CONTROL.EXTPTZ_RIGHTTOP:
         case PTZ_CONTROL.EXTPTZ_LEFTDOWN:
         case PTZ_CONTROL.EXTPTZ_RIGHTDOWN:
         case PTZ_CONTROL.EXTPTZ_ADDTOLOOP:
         case PTZ_CONTROL.EXTPTZ_DELFROMLOOP:
         case PTZ_CONTROL.EXTPTZ_AUXIOPEN:
         case PTZ_CONTROL.EXTPTZ_AUXICLOSE:
             returnValue = CLIENT_DHPTZControl(lLoginID, nChannelID, (ushort)dwPTZCommand, param1, param2, 0, dwStop);
             break;
     }
     return returnValue;
 }