|
|
@ -52,6 +52,8 @@ void PipetteModule::initialize(int32_t id, hardward_config_t *hardwaredcfg) { / |
|
|
|
test_connectivity(); |
|
|
|
parameter_init(); |
|
|
|
zm_sync_base_cfg(); |
|
|
|
|
|
|
|
get_platinfo_smart(m_state.platinfo_cpyid, &m_now_platinfo); |
|
|
|
} |
|
|
|
|
|
|
|
void PipetteModule::test_connectivity() { |
|
|
@ -698,10 +700,13 @@ int32_t PipetteModule::pipette_pump_init_device(int32_t platinfo_cpyid) { |
|
|
|
thread_start_work(__FUNCTION__, [this, platinfo_cpyid]() { |
|
|
|
ZLOGI(TAG, "pipette_pump_init_device platinfo_cpyid: %d", platinfo_cpyid); |
|
|
|
check_platinfo_cpyid(platinfo_cpyid); |
|
|
|
|
|
|
|
pump_apply_vcfg(kpm_v_max); // 默认配置
|
|
|
|
DO_IN_THREAD(m_smtp2.pump_init()); |
|
|
|
pump_waitfor_stop(); |
|
|
|
|
|
|
|
m_state.platinfo_cpyid = platinfo_cpyid; |
|
|
|
platinfo_t *platform_info = get_platinfo_smart(m_state.platinfo_cpyid, &m_now_platinfo); |
|
|
|
}); |
|
|
|
return 0; |
|
|
|
} |
|
|
@ -710,32 +715,91 @@ int32_t PipetteModule::pipette_pump_take_tip() { |
|
|
|
/**
|
|
|
|
* @brief |
|
|
|
* |
|
|
|
* -> 默认速度移动到取头位置 |
|
|
|
* -> |
|
|
|
* |
|
|
|
* |
|
|
|
* -> 默认速度移动到取tip开始位 |
|
|
|
* -> 缓慢移动取tip |
|
|
|
* -> 直到tip状态被触发停止移动 |
|
|
|
*/ |
|
|
|
|
|
|
|
platinfo_t *platform_info = &m_now_platinfo; |
|
|
|
zm_move_to_block(platform_info->tip_picking_pos, kzm_v_default, 0); |
|
|
|
zm_move_by(platform_info->tip_picking_search_range, kzm_v_picking_tip, 0); |
|
|
|
bool takeTip = false; |
|
|
|
while (true) { |
|
|
|
int32_t tipstate = 0; |
|
|
|
DO_IN_THREAD(m_smtp2.pump_get_tip_state(&tipstate)); |
|
|
|
if (tipstate == 1) { |
|
|
|
takeTip = true; |
|
|
|
zm_stop(); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (m_zm->isStoped()) break; |
|
|
|
thread_delay(1); |
|
|
|
} |
|
|
|
if (takeTip && platform_info->tip_picking_append_distance > 0) //
|
|
|
|
zm_move_by_block(platform_info->tip_picking_append_distance, kzm_v_picking_tip, 0); |
|
|
|
|
|
|
|
zm_move_to_block(platform_info->transform_pos, kzm_v_default, 0); |
|
|
|
ZLOGI(TAG, "pipette_pump_take_tip takeTip %s", takeTip ? "suc" : "fail"); |
|
|
|
}); |
|
|
|
return 0; |
|
|
|
} |
|
|
|
int32_t PipetteModule::pipette_pump_putbak_tip() { |
|
|
|
thread_start_work(__FUNCTION__, [this]() { |
|
|
|
/**
|
|
|
|
* @brief |
|
|
|
* |
|
|
|
* -> 移动到tip_picking_pos上面10mm的位置 |
|
|
|
* -> 丢tip |
|
|
|
*/ |
|
|
|
|
|
|
|
platinfo_t *platform_info = &m_now_platinfo; |
|
|
|
int32_t putbakpos = platform_info->tip_picking_pos - 100; |
|
|
|
if (putbakpos < 0) putbakpos = 0; |
|
|
|
zm_move_to_block(putbakpos, kzm_v_default, 0); |
|
|
|
|
|
|
|
// pump初始化(约等于丢tip,且保证百分百丢弃tip)
|
|
|
|
pump_apply_vcfg(kpm_v_max); //
|
|
|
|
DO_IN_THREAD(m_smtp2.pump_init()); |
|
|
|
pump_waitfor_stop(); |
|
|
|
|
|
|
|
zm_move_to_block(platform_info->transform_pos, kzm_v_default, 0); |
|
|
|
}); |
|
|
|
|
|
|
|
return 0; |
|
|
|
} |
|
|
|
int32_t PipetteModule::pipette_pump_putbak_tip() { return 0; } |
|
|
|
|
|
|
|
int32_t PipetteModule::pipette_pump_deposit_tip() { |
|
|
|
thread_start_work(__FUNCTION__, [this]() { |
|
|
|
pump_apply_vcfg(kpm_v_max); // 默认配置
|
|
|
|
DO_IN_THREAD(m_smtp2.pump_put_tip()); |
|
|
|
/**
|
|
|
|
* @brief |
|
|
|
* |
|
|
|
* -> 移动到tip_deposit_pos |
|
|
|
* -> 丢tip |
|
|
|
*/ |
|
|
|
|
|
|
|
platinfo_t *platform_info = &m_now_platinfo; |
|
|
|
zm_move_to_block(platform_info->tip_deposit_pos, kzm_v_default, 0); |
|
|
|
|
|
|
|
pump_apply_vcfg(kpm_v_max); //
|
|
|
|
// DO_IN_THREAD(m_smtp2.pump_put_tip());
|
|
|
|
DO_IN_THREAD(m_smtp2.pump_init()); |
|
|
|
pump_waitfor_stop(); |
|
|
|
|
|
|
|
zm_move_to_block(platform_info->transform_pos, kzm_v_default, 0); |
|
|
|
}); |
|
|
|
|
|
|
|
return 0; |
|
|
|
} |
|
|
|
int32_t PipetteModule::pipette_pump_pierce_through() { |
|
|
|
thread_start_work(__FUNCTION__, [this]() { |
|
|
|
pump_apply_vcfg(kpm_v_max); // 默认配置
|
|
|
|
DO_IN_THREAD(m_smtp2.pump_put_tip()); |
|
|
|
pump_waitfor_stop(); |
|
|
|
int32_t PipetteModule::pipette_pump_pierce_through(int32_t container_info_index, int32_t container_pos) { |
|
|
|
thread_start_work(__FUNCTION__, [this, container_info_index, container_pos]() { |
|
|
|
// check param
|
|
|
|
check_container_info_cpyid(container_info_index); |
|
|
|
|
|
|
|
platinfo_t *platform_info = &m_now_platinfo; |
|
|
|
container_info_t *container_info = get_container_info_smart(container_info_index, &m_now_container_info); |
|
|
|
|
|
|
|
zm_move_to_block(container_info->pierce_depth + container_pos, kzm_v_default, 0); |
|
|
|
zm_move_to_block(platform_info->transform_pos, kzm_v_default, 0); |
|
|
|
}); |
|
|
|
return 0; |
|
|
|
} |
|
|
@ -829,7 +893,7 @@ int32_t PipetteModule::pipette_pump_aspirate() { |
|
|
|
ZLOGI(TAG, "-"); |
|
|
|
|
|
|
|
// aspirate_run_cxt
|
|
|
|
platinfo_t *platform_info = get_platinfo_smart(m_state.platinfo_cpyid, &aspirate_run_cxt.platinfo); |
|
|
|
platinfo_t *platform_info = &m_now_platinfo; |
|
|
|
liquid_info_t *liquidinfo = get_liquid_info_smart(acfg->liquid_cfg_index, &aspirate_run_cxt.liquid_info); |
|
|
|
container_info_t *container_cfg = get_container_info_smart(acfg->container_info_index, &aspirate_run_cxt.container_info); |
|
|
|
/***********************************************************************************************************************
|
|
|
@ -1089,6 +1153,10 @@ void PipetteModule::zm_move_by(int32_t dx, int32_t vindex, int32_t vel) { |
|
|
|
zm_apply_vcfg(vindex, vel); |
|
|
|
m_zm->moveBy(dx); |
|
|
|
} |
|
|
|
void PipetteModule::zm_move_by_block(int32_t dx, int32_t vindex, int32_t vel) { |
|
|
|
zm_move_by(dx, vindex, vel); |
|
|
|
zm_waitfor_stop(); |
|
|
|
} |
|
|
|
|
|
|
|
void PipetteModule::zm_move_to_end(int32_t direction, int32_t vindex) { |
|
|
|
if (zmbcfg.enable_enc != 0) { |
|
|
@ -1548,6 +1616,7 @@ void PipetteModule::parameter_init() { |
|
|
|
* pm_base_cfg * |
|
|
|
***********************************************************************************************************************/ |
|
|
|
pm_base_cfg.pad = 0; |
|
|
|
pm_base_cfg.mark = 9973; |
|
|
|
|
|
|
|
/***********************************************************************************************************************
|
|
|
|
* m_platinfo * |
|
|
|