CameraStatus.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. #ifndef __CAMERA_STATUS_DEF__
  2. #define __CAMERA_STATUS_DEF__
  3. /// @ingroup MV_TYPEDEF
  4. /// \~chinese SDK错误码
  5. /// \~english SDK error code
  6. typedef int CameraSdkStatus;
  7. /*常用的宏*/
  8. #define SDK_SUCCESS(_FUC_) (_FUC_ == CAMERA_STATUS_SUCCESS)
  9. #define SDK_UNSUCCESS(_FUC_) (_FUC_ != CAMERA_STATUS_SUCCESS)
  10. #define SDK_UNSUCCESS_RETURN(_FUC_,RET) if((RET = _FUC_) != CAMERA_STATUS_SUCCESS)\
  11. {\
  12. return RET;\
  13. }
  14. #define SDK_UNSUCCESS_BREAK(_FUC_) if(_FUC_ != CAMERA_STATUS_SUCCESS)\
  15. {\
  16. break;\
  17. }
  18. /// @ingroup MV_MACRO_TYPE
  19. /// @{
  20. /* 常用错误 */
  21. #define CAMERA_STATUS_SUCCESS 0 ///< \~chinese 操作成功 \~english Successful
  22. #define CAMERA_STATUS_FAILED -1 ///< \~chinese 操作失败 \~english operation failed
  23. #define CAMERA_STATUS_INTERNAL_ERROR -2 ///< \~chinese 内部错误 \~english internal error
  24. #define CAMERA_STATUS_UNKNOW -3 ///< \~chinese 未知错误 \~english unknown error
  25. #define CAMERA_STATUS_NOT_SUPPORTED -4 ///< \~chinese 不支持该功能 \~english Does not support this feature
  26. #define CAMERA_STATUS_NOT_INITIALIZED -5 ///< \~chinese 初始化未完成 \~english Incomplete initialization
  27. #define CAMERA_STATUS_PARAMETER_INVALID -6 ///< \~chinese 参数无效 \~english Invalid argument
  28. #define CAMERA_STATUS_PARAMETER_OUT_OF_BOUND -7 ///< \~chinese 参数越界 \~english Out of bounds of parameters
  29. #define CAMERA_STATUS_UNENABLED -8 ///< \~chinese 未使能 \~english Not enabled
  30. #define CAMERA_STATUS_USER_CANCEL -9 ///< \~chinese 用户手动取消了,比如roi面板点击取消,返回 \~english The user manually canceled, such as roi panel click cancel, return
  31. #define CAMERA_STATUS_PATH_NOT_FOUND -10 ///< \~chinese 注册表中没有找到对应的路径 \~english The corresponding path was not found in the registry
  32. #define CAMERA_STATUS_SIZE_DISMATCH -11 ///< \~chinese 获得图像数据长度和定义的尺寸不匹配 \~english The length of the obtained image data does not match the defined size
  33. #define CAMERA_STATUS_TIME_OUT -12 ///< \~chinese 超时错误 \~english Timeout error
  34. #define CAMERA_STATUS_IO_ERROR -13 ///< \~chinese 硬件IO错误 \~english Hardware IO error
  35. #define CAMERA_STATUS_COMM_ERROR -14 ///< \~chinese 通讯错误 \~english Communication error
  36. #define CAMERA_STATUS_BUS_ERROR -15 ///< \~chinese 总线错误 \~english Bus error
  37. #define CAMERA_STATUS_NO_DEVICE_FOUND -16 ///< \~chinese 没有发现设备 \~english No device found
  38. #define CAMERA_STATUS_NO_LOGIC_DEVICE_FOUND -17 ///< \~chinese 未找到逻辑设备 \~english Logical device not found
  39. #define CAMERA_STATUS_DEVICE_IS_OPENED -18 ///< \~chinese 设备已经打开 \~english The device is already open
  40. #define CAMERA_STATUS_DEVICE_IS_CLOSED -19 ///< \~chinese 设备已经关闭 \~english Device is off
  41. #define CAMERA_STATUS_DEVICE_VEDIO_CLOSED -20 ///< \~chinese 没有打开设备视频,调用录像相关的函数时,如果相机视频没有打开,则回返回该错误。 \~english Without opening the device video, when the video-related function is called, if the camera video is not open, the error is returned back.
  42. #define CAMERA_STATUS_NO_MEMORY -21 ///< \~chinese 没有足够系统内存 \~english Not enough system memory
  43. #define CAMERA_STATUS_FILE_CREATE_FAILED -22 ///< \~chinese 创建文件失败 \~english Failed to create file
  44. #define CAMERA_STATUS_FILE_INVALID -23 ///< \~chinese 文件格式无效 \~english Invalid file format
  45. #define CAMERA_STATUS_WRITE_PROTECTED -24 ///< \~chinese 写保护,不可写 \~english Write protection, not write
  46. #define CAMERA_STATUS_GRAB_FAILED -25 ///< \~chinese 数据采集失败 \~english Data collection failed
  47. #define CAMERA_STATUS_LOST_DATA -26 ///< \~chinese 数据丢失,不完整 \~english Loss of data, incomplete
  48. #define CAMERA_STATUS_EOF_ERROR -27 ///< \~chinese 未接收到帧结束符 \~english No frame terminator received
  49. #define CAMERA_STATUS_BUSY -28 ///< \~chinese 正忙(上一次操作还在进行中),此次操作不能进行 \~english Busy (last operation is still in progress), this operation cannot be performed
  50. #define CAMERA_STATUS_WAIT -29 ///< \~chinese 需要等待(进行操作的条件不成立),可以再次尝试 \~english Need to wait (condition of operation is not established), can try again
  51. #define CAMERA_STATUS_IN_PROCESS -30 ///< \~chinese 正在进行,已经被操作过 \~english Ongoing, has been operated
  52. #define CAMERA_STATUS_IIC_ERROR -31 ///< \~chinese IIC传输错误 \~english IIC transmission error
  53. #define CAMERA_STATUS_SPI_ERROR -32 ///< \~chinese SPI传输错误 \~english SPI transmission error
  54. #define CAMERA_STATUS_USB_CONTROL_ERROR -33 ///< \~chinese USB控制传输错误 \~english USB control transmission error
  55. #define CAMERA_STATUS_USB_BULK_ERROR -34 ///< \~chinese USB BULK传输错误 \~english USB BULK transmission error
  56. #define CAMERA_STATUS_SOCKET_INIT_ERROR -35 ///< \~chinese 网络传输套件初始化失败 \~english Network Transport Suite Initialization Failed
  57. #define CAMERA_STATUS_GIGE_FILTER_INIT_ERROR -36 ///< \~chinese 网络相机内核过滤驱动初始化失败,请检查是否正确安装了驱动,或者重新安装。 \~english The webcam kernel filter driver failed to initialize. Please check if the driver is installed correctly or reinstall it.
  58. #define CAMERA_STATUS_NET_SEND_ERROR -37 ///< \~chinese 网络数据发送错误 \~english Network data sending error
  59. #define CAMERA_STATUS_DEVICE_LOST -38 ///< \~chinese 与网络相机失去连接,心跳检测超时 \~english Lost connection with webcam, heartbeat timeout
  60. #define CAMERA_STATUS_DATA_RECV_LESS -39 ///< \~chinese 接收到的字节数比请求的少 \~english Received fewer bytes than requested
  61. #define CAMERA_STATUS_FUNCTION_LOAD_FAILED -40 ///< \~chinese 从文件中加载程序失败 \~english Failed to load program from file
  62. #define CAMERA_STATUS_CRITICAL_FILE_LOST -41 ///< \~chinese 程序运行所必须的文件丢失。 \~english The file necessary to run the program is missing.
  63. #define CAMERA_STATUS_SENSOR_ID_DISMATCH -42 ///< \~chinese 固件和程序不匹配,原因是下载了错误的固件。 \~english The firmware and program do not match because the wrong firmware was downloaded.
  64. #define CAMERA_STATUS_OUT_OF_RANGE -43 ///< \~chinese 参数超出有效范围。 \~english The parameter is out of valid range.
  65. #define CAMERA_STATUS_REGISTRY_ERROR -44 ///< \~chinese 安装程序注册错误。请重新安装程序,或者运行安装目录Setup/Installer.exe \~english Setup registration error. Please reinstall the program, or run the installation directory Setup/Installer.exe
  66. #define CAMERA_STATUS_ACCESS_DENY -45 ///< \~chinese 禁止访问。指定相机已经被其他程序占用时,再申请访问该相机,会返回该状态。(一个相机不能被多个程序同时访问) \~english No Access. When the specified camera has been occupied by another program, it will return to this state if you request to access the camera. (A camera cannot be accessed simultaneously by multiple programs)
  67. #define CAMERA_STATUS_CAMERA_NEED_RESET -46 ///< \~chinese 表示相机需要复位后才能正常使用,此时请让相机断电重启,或者重启操作系统后,便可正常使用。 \~english It means that the camera needs to be reset before it can be used normally. At this time, please make the camera power off and restart, or restart the operating system, then it can be used normally.
  68. #define CAMERA_STATUS_ISP_MOUDLE_NOT_INITIALIZED -47 ///< \~chinese ISP模块未初始化 \~english ISP module is not initialized
  69. #define CAMERA_STATUS_ISP_DATA_CRC_ERROR -48 ///< \~chinese 数据校验错误 \~english Data check error
  70. #define CAMERA_STATUS_MV_TEST_FAILED -49 ///< \~chinese 数据测试失败 \~english Data test failed
  71. #define CAMERA_STATUS_INTERNAL_ERR1 -50 ///< \~chinese 内部错误1 \~english Internal error 1
  72. #define CAMERA_STATUS_U3V_NO_CONTROL_EP -51 ///< \~chinese U3V控制端点未找到 \~english U3V control endpoint not found
  73. #define CAMERA_STATUS_U3V_CONTROL_ERROR -52 ///< \~chinese U3V控制通讯错误 \~english U3V control communication error
  74. #define CAMERA_STATUS_INVALID_FRIENDLY_NAME -53 ///< \~chinese 无效的设备名,名字里不能包含以下字符(\/:*?"<>|") \~english Invalid device name, the name cannot contain the following characters (\/:*?"<>|")
  75. #define CAMERA_STATUS_FORMAT_ERROR -54 ///< \~chinese 格式错误 \~english Format error
  76. #define CAMERA_STATUS_PCIE_OPEN_ERROR -55 ///< \~chinese PCIE设备打开失败 \~english PCIE device open failed
  77. #define CAMERA_STATUS_PCIE_COMM_ERROR -56 ///< \~chinese PCIE设备通讯失败 \~english PCIE device communication failed
  78. #define CAMERA_STATUS_PCIE_DDR_ERROR -57 ///< \~chinese PCIE DDR错误 \~english PCIE DDR error
  79. //和AIA制定的标准相同
  80. /*#define CAMERA_AIA_SUCCESS 0x0000 */
  81. #define CAMERA_AIA_PACKET_RESEND 0x0100 ///< \~chinese 该帧需要重传 \~english The frame needs to be retransmitted
  82. #define CAMERA_AIA_NOT_IMPLEMENTED 0x8001 ///< \~chinese 设备不支持的命令 \~english Device does not support commands
  83. #define CAMERA_AIA_INVALID_PARAMETER 0x8002 ///< \~chinese 命令参数非法 \~english Illegal command parameters
  84. #define CAMERA_AIA_INVALID_ADDRESS 0x8003 ///< \~chinese 不可访问的地址 \~english Inaccessible address
  85. #define CAMERA_AIA_WRITE_PROTECT 0x8004 ///< \~chinese 访问的对象不可写 \~english The accessed object cannot be written
  86. #define CAMERA_AIA_BAD_ALIGNMENT 0x8005 ///< \~chinese 访问的地址没有按照要求对齐 \~english Visited address is not aligned as required
  87. #define CAMERA_AIA_ACCESS_DENIED 0x8006 ///< \~chinese 没有访问权限 \~english No access
  88. #define CAMERA_AIA_BUSY 0x8007 ///< \~chinese 命令正在处理中 \~english Command is processing
  89. #define CAMERA_AIA_DEPRECATED 0x8008 ///< \~chinese 0x8008-0x0800B 0x800F 该指令已经废弃 \~english 0x8008-0x0800B 0x800F This instruction has been deprecated
  90. #define CAMERA_AIA_PACKET_UNAVAILABLE 0x800C ///< \~chinese 包无效 \~english Invalid package
  91. #define CAMERA_AIA_DATA_OVERRUN 0x800D ///< \~chinese 数据溢出,通常是收到的数据比需要的多 \~english Data overflow, usually more data than needed
  92. #define CAMERA_AIA_INVALID_HEADER 0x800E ///< \~chinese 数据包头部中某些区域与协议不匹配 \~english Some areas in the packet header do not match the protocol
  93. #define CAMERA_AIA_PACKET_NOT_YET_AVAILABLE 0x8010 ///< \~chinese 图像分包数据还未准备好,多用于触发模式,应用程序访问超时 \~english Image packet data is not ready yet. It is mostly used in trigger mode. Application access timeout
  94. #define CAMERA_AIA_PACKET_AND_PREV_REMOVED_FROM_MEMORY 0x8011 ///< \~chinese 需要访问的分包已经不存在。多用于重传时数据已经不在缓冲区中 \~english Subcontracts that require access no longer exist. Mostly used for data retransmission is not in the buffer
  95. #define CAMERA_AIA_PACKET_REMOVED_FROM_MEMORY 0x8012 ///< \~chinese CAMERA_AIA_PACKET_AND_PREV_REMOVED_FROM_MEMORY \~english CAMERA_AIA_PACKET_AND_PREV_REMOVED_FROM_MEMORY
  96. #define CAMERA_AIA_NO_REF_TIME 0x0813 ///< \~chinese 没有参考时钟源。多用于时间同步的命令执行时 \~english There is no reference clock source. When used for time synchronization commands
  97. #define CAMERA_AIA_PACKET_TEMPORARILY_UNAVAILABLE 0x0814 ///< \~chinese 由于信道带宽问题,当前分包暂时不可用,需稍后进行访问 \~english Due to channel bandwidth issues, the current subcontracting is temporarily unavailable and needs to be accessed later
  98. #define CAMERA_AIA_OVERFLOW 0x0815 ///< \~chinese 设备端数据溢出,通常是队列已满 \~english Data overflow on the device, usually the queue is full
  99. #define CAMERA_AIA_ACTION_LATE 0x0816 ///< \~chinese 命令执行已经超过有效的指定时间 \~english Command execution has exceeded valid specified time
  100. #define CAMERA_AIA_ERROR 0x8FFF ///< \~chinese 错误 \~english error
  101. /// @} end of MV_MACRO_TYPE
  102. #endif