You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

121 lines
8.0 KiB

2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
  1. #pragma once
  2. #include <stdint.h>
  3. namespace iflytop {
  4. namespace err {
  5. using namespace std;
  6. #define ERROR_CODE(errortype, suberrorcode) (errortype + suberrorcode)
  7. typedef enum {
  8. ksucc = ERROR_CODE(0, 0),
  9. kfail = ERROR_CODE(0, 1),
  10. /***********************************************************************************************************************
  11. * *
  12. ***********************************************************************************************************************/
  13. kparam_out_of_range = ERROR_CODE(100, 2), // 参数超出范围
  14. kcmd_not_support = ERROR_CODE(100, 3), // 操作不支持
  15. kdevice_is_busy = ERROR_CODE(100, 4), // 设备忙
  16. kdevice_is_offline = ERROR_CODE(100, 5), // 设备离线
  17. kovertime = ERROR_CODE(100, 6),
  18. knoack = ERROR_CODE(100, 7),
  19. kerrorack = ERROR_CODE(100, 8),
  20. kdevice_offline = ERROR_CODE(100, 9),
  21. ksubdevice_overtime = ERROR_CODE(100, 11),
  22. kbuffer_not_enough = ERROR_CODE(100, 12),
  23. kcmd_param_num_error = ERROR_CODE(100, 14),
  24. kcheckcode_is_error = ERROR_CODE(100, 15),
  25. killegal_operation = ERROR_CODE(100, 16),
  26. kaction_overtime = ERROR_CODE(100, 17),
  27. /***********************************************************************************************************************
  28. * *
  29. ***********************************************************************************************************************/
  30. kmodule_opeation_break_by_user = ERROR_CODE(200, 2), // 用户中断
  31. kmodule_not_find_reg = ERROR_CODE(200, 7), // 未找到配置索引
  32. /***********************************************************************************************************************
  33. * XY电机驱动错误码 *
  34. ***********************************************************************************************************************/
  35. kxymotor_x_find_zero_edge_fail = ERROR_CODE(300, 6), // 离开零点失败
  36. kxymotor_y_find_zero_edge_fail = ERROR_CODE(300, 7), // 离开零点失败
  37. kxymotor_not_enable = ERROR_CODE(300, 8),
  38. kxymotor_target_pos_outof_range = ERROR_CODE(300, 9),
  39. /***********************************************************************************************************************
  40. * *
  41. ***********************************************************************************************************************/
  42. kpipette_error_NoError = ERROR_CODE(400, 0), // 无错误
  43. kpipette_error_InitFail = ERROR_CODE(400, 1), // 初始化失败
  44. kpipette_error_InvalidCmd = ERROR_CODE(400, 2), // 无效命令
  45. kpipette_error_InvalidArg = ERROR_CODE(400, 3), // 无效参数
  46. kpipette_error_PressureSensorError = ERROR_CODE(400, 4), // 压力传感器故障
  47. kpipette_error_OverPressure = ERROR_CODE(400, 5), // 超过压力
  48. kpipette_error_LLDError = ERROR_CODE(400, 6), // LLD 错误
  49. kpipette_error_DeviceNotInit = ERROR_CODE(400, 7), // 设备未初始化
  50. kpipette_error_TipPopError = ERROR_CODE(400, 8), // Tip 弹出错误
  51. kpipette_error_PumpOverload = ERROR_CODE(400, 9), // 泵过载
  52. kpipette_error_TipDrop = ERROR_CODE(400, 10), // Tip 脱落
  53. kpipette_error_CanBusError = ERROR_CODE(400, 11), // CAN 总线故障
  54. kpipette_error_InvalidChecksum = ERROR_CODE(400, 12), // 无效校验和
  55. kpipette_error_EEPROMError = ERROR_CODE(400, 13), // EEPROM 故障
  56. kpipette_error_CmdBufferEmpty = ERROR_CODE(400, 14), // 命令缓冲区为空
  57. kpipette_error_CmdBufferOverflow = ERROR_CODE(400, 15), // 命令溢出
  58. kpipette_error_TipBlock = ERROR_CODE(400, 16), // Tip 堵塞
  59. kpipette_error_AirSuction = ERROR_CODE(400, 17), // 吸入空气
  60. kpipette_error_Bubble = ERROR_CODE(400, 18), // 液体中有气泡/泡沫
  61. kpipette_error_VolumeError = ERROR_CODE(400, 19), // 吸取/分配量不准确
  62. kpipette_error_TipAlreadyLoad = ERROR_CODE(400, 20), // Tip已经装载
  63. kpipette_error_TipLoadFail = ERROR_CODE(400, 21),
  64. kpipette_error_tipisload_when_lld_prepare = ERROR_CODE(500, 0), // 未卸载Tip就进行LLD准备
  65. kpipette_error_uninited = ERROR_CODE(500, 1), // 泵机未初始化
  66. kpipette_error_not_lld_prepare = ERROR_CODE(500, 2), // 为执行lld_prepare
  67. kpipette_error_pump_load_val_is_not_empty = ERROR_CODE(500, 3), // 为执行lld_prepare
  68. /***********************************************************************************************************************
  69. * *
  70. ***********************************************************************************************************************/
  71. kstep_motor_not_found_zero_point = ERROR_CODE(600, 0), // 未找到零点
  72. kstep_motor_not_go_zero = ERROR_CODE(600, 1), // 设备未归零
  73. kstep_motor_over_temperature = ERROR_CODE(600, 2), // 过温
  74. kstep_motor_over_voltage = ERROR_CODE(600, 3), // 过压
  75. kstep_motor_run_overtime = ERROR_CODE(600, 4), // 运行超时
  76. kstep_motor_not_enable = ERROR_CODE(600, 5), // 电机未使能
  77. kstep_motor_ioindex_out_of_range = ERROR_CODE(600, 6), // IO超出范围
  78. kstep_motor_subic_reset = ERROR_CODE(600, 7), // 子IC复位
  79. kstep_motor_drv_err = ERROR_CODE(600, 8), // 驱动器异常
  80. kstep_motor_uv_cp = ERROR_CODE(600, 9), // 驱动器异常
  81. kstep_motor_not_found_point_edge = ERROR_CODE(600, 10), // 未找到零点
  82. kstep_motor_lost_step = ERROR_CODE(600, 11), // 未找到零点
  83. /***********************************************************************************************************************
  84. * *
  85. ***********************************************************************************************************************/
  86. kmini_servo_not_enable = ERROR_CODE(700, 0), //
  87. kmini_servo_mode_not_support = ERROR_CODE(700, 1), //
  88. /***********************************************************************************************************************
  89. * *
  90. ***********************************************************************************************************************/
  91. kfan_hardware_fault = ERROR_CODE(800, 0), //
  92. /***********************************************************************************************************************
  93. * *
  94. ***********************************************************************************************************************/
  95. kwater_cooling_fan_error = ERROR_CODE(900, 0), //
  96. kwater_cooling_temperature_sensor_error = ERROR_CODE(900, 2), //
  97. kwater_cooling_pump_is_error = ERROR_CODE(900, 3), //
  98. kwater_cooling_pelter_is_error = ERROR_CODE(900, 4), //
  99. } error_t;
  100. typedef struct {
  101. int index;
  102. const char* info;
  103. } ecode_table_item_t;
  104. const char* error2str(int32_t code);
  105. ecode_table_item_t* error_get_table();
  106. int error_get_table_size();
  107. } // namespace err
  108. } // namespace iflytop