diff --git a/api/i_motor_laser_code_scanner.hpp b/api/i_motor_laser_code_scanner.hpp new file mode 100644 index 0000000..7bc6b60 --- /dev/null +++ b/api/i_motor_laser_code_scanner.hpp @@ -0,0 +1,17 @@ +#pragma once +#include "basic_type.hpp" +namespace iflytop { +using namespace std; + +class I_MotorLaserCodeScanner { + public: + // virtual void + + /** + * push one clamp + */ + virtual void push_clamp(int32_t clamp_id, int32_t clamp_type, int32_t clamp_status, int32_t clamp_error_code) = 0; + +}; + +} // namespace iflytop \ No newline at end of file diff --git a/zcancmder_protocol.hpp b/zcancmder_protocol.hpp index 1961949..fd73ff6 100644 --- a/zcancmder_protocol.hpp +++ b/zcancmder_protocol.hpp @@ -3,9 +3,9 @@ #include "api/basic_type.hpp" #include "api/i_mini_servo_module.hpp" +#include "api/i_pipette_module.hpp" #include "api/i_step_motor_ctrl_module.hpp" #include "api/i_xyrobot_ctrl_module.hpp" -#include "api/i_pipette_module.hpp" #include "zcancmder_protocol_basic.hpp" namespace iflytop { namespace zcr { @@ -102,62 +102,43 @@ typedef enum { *******************************************************************************/ // 设置目标温度 kcmd_heater_ctrl_module_start_ctrl_temperature = CMDID(1011, 0), // 设置目标温度 - kcmd_heater_ctrl_module_read_stop_temperature = CMDID(1011, 1), // 读取停止温度 + kcmd_heater_ctrl_module_stop_temperature = CMDID(1011, 1), // 读取停止温度 - kcmd_heater_ctrl_module_read_version = CMDID(1011, 50), // 读取模块型号版本信息 - kcmd_heater_ctrl_module_read_status = CMDID(1011, 51), // 读取模块精简状态信息 - kcmd_heater_ctrl_module_read_detailed_status = CMDID(1011, 52), // 读取模块详细状态信息 + kcmd_heater_ctrl_module_read_status = CMDID(1011, 50), // 读取模块精简状态信息 + kcmd_heater_ctrl_module_read_detail_status = CMDID(1011, 50), // 读取模块精简状态信息 - kcmd_heater_ctrl_module_set_run_param = CMDID(1011, 100), // 设置运行参数 - kcmd_heater_ctrl_module_set_warning_limit_param = CMDID(1011, 101), // 设置限制参数 + kcmd_heater_ctrl_module_set_base_param = CMDID(1011, 100), // 设置运行参数 + kcmd_heater_ctrl_module_get_base_param = CMDID(1011, 101), // 设置限制参数 /******************************************************************************* * |Module_1012:光学模组扫码器 * *******************************************************************************/ - kcmd_optical_barcode_reader_start_scan = CMDID(1012, 0), // 开始扫码 - kcmd_optical_barcode_reader_stop_scan = CMDID(1012, 1), // 停止扫码 - kcmd_optical_barcode_reader_motor_move_to = CMDID(1012, 4), // 水平电机移动到 - kcmd_optical_barcode_reader_motor_move_to_zero = CMDID(1012, 6), // 电机校准 - kcmd_optical_barcode_reader_motor_move_to_zero_with_calibrate = CMDID(1012, 7), // 电机校准 - kcmd_optical_barcode_reader_motor_stop = CMDID(1012, 8), // 电机停止 - kcmd_optical_barcode_reader_motor_enable = CMDID(1012, 9), // 电机使能 - - kcmd_optical_barcode_reader_read_version = CMDID(1012, 50), // 读取模块型号版本信息 - kcmd_optical_barcode_reader_read_status = CMDID(1012, 51), // 读取模块精简状态信息 - kcmd_optical_barcode_reader_read_detailed_status = CMDID(1012, 52), // 读取模块详细状态信息 - - kcmd_optical_barcode_reader_set_run_param = CMDID(1012, 100), // 设置运行参数 - kcmd_optical_barcode_reader_set_warning_limit_param = CMDID(1012, 101), // 设置限制参数 - kcmd_optical_barcode_reader_set_run_to_zero_param = CMDID(1012, 102), // 设置归零参数 + kcmd_optical_barcode_reader_reset_pos = CMDID(1012, 0), // 复位 + kcmd_optical_barcode_reader_start_scan = CMDID(1012, 1), // 开始扫码 + kcmd_optical_barcode_reader_stop_scan = CMDID(1012, 2), // 停止扫码 + kcmd_optical_barcode_reader_drop_reaction_plate = CMDID(1012, 3), // 丢弃夹具 + + kcmd_optical_barcode_reader_read_status = CMDID(1012, 50), // 读取模块状态信息 + + kcmd_optical_barcode_reader_set_base_param = CMDID(1012, 100), // 设置运行参数 + kcmd_optical_barcode_reader_get_base_param = CMDID(1012, 101), // 读取运行参数 /******************************************************************************* * |Module_1013:板夹仓 * *******************************************************************************/ + kcmd_reaction_plate_module_reset = CMDID(1013, 0), // 复位 + kcmd_reaction_plate_module_push_plate_and_scan = CMDID(1013, 1), // 推板 - kcmd_board_clamp_module_push_and_scan = CMDID(1013, 0), // 推出反应板并扫码 - kcmd_board_clamp_module_moter_move_to = CMDID(1013, 1), // 电机移动到 - kcmd_board_clamp_module_moter_move_by = CMDID(1013, 2), // 电机移动到 - kcmd_board_clamp_module_moter_move_to_zero = CMDID(1013, 3), // 电机归零 - kcmd_board_clamp_module_moter_move_to_zero_with_calibrate = CMDID(1013, 4), // 电机归零并校准 - kcmd_board_clamp_module_moter_stop = CMDID(1013, 5), // 电机停止 - kcmd_board_clamp_module_moter_enable = CMDID(1013, 6), // 电机使能 - - kcmd_board_clamp_module_read_version = CMDID(1013, 50), // 读取模块型号版本信息 - kcmd_board_clamp_module_read_status = CMDID(1013, 51), // 读取模块精简状态信息 - kcmd_board_clamp_module_read_detailed_status = CMDID(1013, 52), // 读取模块详细状态信息 - - kcmd_board_clamp_module_set_run_param = CMDID(1013, 100), // 设置运行参数 - kcmd_board_clamp_module_set_warning_limit_param = CMDID(1013, 101), // 设置限制参数 - kcmd_board_clamp_module_set_run_to_zero_param = CMDID(1013, 102), // 设置归零参数 - + kcmd_reaction_plate_module_read_status = CMDID(1013, 50), // 读取模块状态信息 + kcmd_reaction_plate_module_set_base_param = CMDID(1013, 100), // 设置运行参数 + kcmd_reaction_plate_module_get_base_param = CMDID(1013, 101), // 读取运行参数 // 风扇 /******************************************************************************* * |Module_1014:风扇 * *******************************************************************************/ - kcmd_fan_module_fan_ctrl = CMDID(1014, 0), // 风扇控制 - kcmd_fan_module_fan_read_status = CMDID(1014, 50), // 读取模块精简状态信息 - kcmd_fan_module_fan_read_detailed_status = CMDID(1014, 51), // 读取模块详细状态信息 - + kcmd_fan_module_fan_ctrl = CMDID(1014, 0), // 风扇控制 + kcmd_fan_module_fan_read_status = CMDID(1014, 50), // 读取模块精简状态信息 +#if 0 // 串口透传 /******************************************************************************* * |Module_1015:串口透传 * @@ -167,6 +148,7 @@ typedef enum { kcmd_serial_module_start_stop_data = CMDID(1015, 2), // 串口透传停止读取数据 kcmd_serial_module_read_status = CMDID(1015, 50), // 读取模块状态信息 kcmd_serial_module_set_cfg = CMDID(1015, 100), // 串口透传设置配置 +#endif // 移液枪控制 /******************************************************************************* @@ -305,133 +287,18 @@ ZPACKET_CMD_ACK(kcmd_barcode_reader_stop_scan, /******************************************************************************* * |Module_1011:帕尔贴-水泵-风扇控温系统 * *******************************************************************************/ -ZPACKET_CMD_ACK(kcmd_heater_ctrl_module_start_ctrl_temperature, - CMD(u8 id; s32 target_temperature;), // - ACK(u8 id;)); -ZPACKET_CMD_ACK(kcmd_heater_ctrl_module_read_stop_temperature, - CMD(u8 id;), // - ACK(u8 id;)); -ZPACKET_CMD_ACK(kcmd_heater_ctrl_module_read_version, - CMD(u8 id;), // - ACK(u8 id; uint32_t version;)); -ZPACKET_CMD_ACK(kcmd_heater_ctrl_module_read_status, - CMD(u8 id;), // - ACK(u8 id; u8 status; s32 temperature;)); -ZPACKET_CMD_ACK(kcmd_heater_ctrl_module_read_detailed_status, - CMD(u8 id;), // - ACK(u8 id; u8 status; s32 temperature;)); -ZPACKET_CMD_ACK(kcmd_heater_ctrl_module_set_run_param, - CMD(u8 id; u8 opt_type; s32 kp; s32 ki; s32 kd; s32 max_pwm; s32 min_temperature; s32 max_temperature;), // - ACK(u8 id; u8 opt_type; s32 kp; s32 ki; s32 kd; s32 max_pwm; s32 min_temperature; s32 max_temperature;)); -ZPACKET_CMD_ACK(kcmd_heater_ctrl_module_set_warning_limit_param, - CMD(u8 id; u8 opt_type;), // - ACK(u8 id; u8 opt_type;)); /******************************************************************************* * |Module_1012:光学模组扫码器 * *******************************************************************************/ -ZPACKET_CMD_ACK_AND_REPORT(kcmd_optical_barcode_reader_start_scan, - CMD(u8 id;), // - ACK(u8 id;), // - REPORT(u8 id; u8 status; u16 codelen; u16 code[0];)); -ZPACKET_CMD_ACK(kcmd_optical_barcode_reader_stop_scan, - CMD(u8 id;), // - ACK(u8 id;)); - -ZPACKET_CMD_ACK_AND_REPORT(kcmd_optical_barcode_reader_motor_move_to, - CMD(u8 id; u8 motor_id; s32 pos; s32 speed;), // - ACK(u8 id;), // - REPORT(u8 id; u8 status; s32 pos;)); -ZPACKET_CMD_ACK_AND_REPORT(kcmd_optical_barcode_reader_motor_move_to_zero, - CMD(u8 id; u8 motor_id;), // - ACK(u8 id;), // - REPORT(u8 id; u8 status;)); -ZPACKET_CMD_ACK_AND_REPORT(kcmd_optical_barcode_reader_motor_move_to_zero_with_calibrate, - CMD(u8 id; u8 motor_id; s32 now_pos;), // - ACK(u8 id;), // - REPORT(u8 id; u8 status; s32 zero_shift;)); -ZPACKET_CMD_ACK(kcmd_optical_barcode_reader_motor_stop, - CMD(u8 id; u8 motor_id;), // - ACK(u8 id;)); -ZPACKET_CMD_ACK(kcmd_optical_barcode_reader_read_version, - CMD(u8 id;), // - ACK(u8 id;)); -ZPACKET_CMD_ACK(kcmd_optical_barcode_reader_read_status, - CMD(u8 id;), // - ACK(u8 id; u8 status; u8 hasmove2zero[2]; s32 pos[2];)); -ZPACKET_CMD_ACK(kcmd_optical_barcode_reader_read_detailed_status, - CMD(u8 id;), // - ACK(u8 id; u8 status; u8 hasmove2zero[2]; s32 pos[2]; s32 acc[2]; s32 speed[2];)); -ZPACKET_CMD_ACK(kcmd_optical_barcode_reader_set_run_param, // - CMD(u8 id; u8 opt_type; s32 acc[2]; s32 dec[2]; s32 max_speed[2]; s32 min_pos[2]; s32 max_pos[2];), // - ACK(u8 id; u8 opt_type; s32 acc[2]; s32 dec[2]; s32 max_speed[2]; s32 min_pos[2]; s32 max_pos[2];)); -ZPACKET_CMD_ACK(kcmd_optical_barcode_reader_set_warning_limit_param, - CMD(u8 id; u8 opt_type; s32 pad;), // - ACK(u8 id; u8 opt_type; s32 pad;)); -ZPACKET_CMD_ACK(kcmd_optical_barcode_reader_set_run_to_zero_param, - CMD(u8 id; u8 opt_type; s32 move_to_zero_max_d[2]; s32 leave_from_zero_max_d[2]; s32 speed[2]; s32 dec[2];), // - ACK(u8 id; u8 opt_type; s32 move_to_zero_max_d[2]; s32 leave_from_zero_max_d[2]; s32 speed[2]; s32 dec[2];)); /******************************************************************************* * Module_1013:板夹仓 * *******************************************************************************/ -ZPACKET_CMD_ACK_AND_REPORT(kcmd_board_clamp_module_push_and_scan, - CMD(u8 id;), // - ACK(u8 id;), // - REPORT(u8 id; u8 status; u16 barcodelen; u8 barcode[0];)); - -ZPACKET_CMD_ACK_AND_REPORT(kcmd_board_clamp_module_moter_move_to, - CMD(u8 id; u8 motor_id; s32 pos; s32 speed;), // - ACK(u8 id;), // - REPORT(u8 id; u8 status; s32 pos;)); - -ZPACKET_CMD_ACK_AND_REPORT(kcmd_board_clamp_module_moter_move_by, - CMD(u8 id; u8 motor_id; s32 pos; s32 speed;), // - ACK(u8 id;), // - REPORT(u8 id; u8 status; s32 pos;)); -ZPACKET_CMD_ACK_AND_REPORT(kcmd_board_clamp_module_moter_move_to_zero, - CMD(u8 id; u8 motor_id;), // - ACK(u8 id;), // - REPORT(u8 id; u8 status;)); -ZPACKET_CMD_ACK_AND_REPORT(kcmd_board_clamp_module_moter_move_to_zero_with_calibrate, - CMD(u8 id; u8 motor_id; s32 now_pos;), // - ACK(u8 id;), // - REPORT(u8 id; u8 status; s32 zero_shift;)); -ZPACKET_CMD_ACK(kcmd_board_clamp_module_moter_stop, - CMD(u8 id; u8 motor_id;), // - ACK(u8 id;)); -ZPACKET_CMD_ACK(kcmd_board_clamp_module_read_version, - CMD(u8 id;), // - ACK(u8 id;)); -ZPACKET_CMD_ACK(kcmd_board_clamp_module_read_status, - CMD(u8 id;), // - ACK(u8 id; u8 status; u8 hasmove2zero[2]; s32 pos[2];)); -ZPACKET_CMD_ACK(kcmd_board_clamp_module_read_detailed_status, - CMD(u8 id;), // - ACK(u8 id; u8 status; u8 hasmove2zero[2]; s32 pos[2]; s32 acc[2]; s32 speed[2];)); -ZPACKET_CMD_ACK(kcmd_board_clamp_module_set_run_param, // - CMD(u8 id; u8 opt_type; s32 acc[2]; s32 dec[2]; s32 max_speed[2]; s32 min_pos[2]; s32 max_pos[2];), // - ACK(u8 id; u8 opt_type; s32 acc[2]; s32 dec[2]; s32 max_speed[2]; s32 min_pos[2]; s32 max_pos[2];)); -ZPACKET_CMD_ACK(kcmd_board_clamp_module_set_warning_limit_param, - CMD(u8 id; u8 opt_type; s32 pad;), // - ACK(u8 id; u8 opt_type; s32 pad;)); -ZPACKET_CMD_ACK(kcmd_board_clamp_module_set_run_to_zero_param, - CMD(u8 id; u8 opt_type; s32 move_to_zero_max_d[2]; s32 leave_from_zero_max_d[2]; s32 speed[2]; s32 dec[2];), // - ACK(u8 id; u8 opt_type; s32 move_to_zero_max_d[2]; s32 leave_from_zero_max_d[2]; s32 speed[2]; s32 dec[2];)); /******************************************************************************* * |Module_1014:风扇 * *******************************************************************************/ -ZPACKET_CMD_ACK(kcmd_fan_module_fan_ctrl, - CMD(u8 id; u8 level;), // - ACK(u8 id;)); -ZPACKET_CMD_ACK(kcmd_fan_module_fan_read_status, - CMD(u8 id;), // - ACK(u8 id; u8 status; u8 level;)); -ZPACKET_CMD_ACK(kcmd_fan_module_fan_read_detailed_status, - CMD(u8 id;), // - ACK(u8 id; u8 status; u8 level; int16_t fbcount;)); - /******************************************************************************* * |Module_1016:移液枪控制 * *******************************************************************************/