|
@ -25,6 +25,7 @@ using namespace iflytop; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#define PIPETTE_PREPARE_POS 800
|
|
|
#define PIPETTE_PREPARE_POS 800
|
|
|
|
|
|
#define LLF_DPOS 1000
|
|
|
|
|
|
|
|
|
void PipetteModule::initialize(int32_t id, config_t *config, StepMotorCtrlModule *zmotor, hardward_config_t *hardwaredcfg) { //
|
|
|
void PipetteModule::initialize(int32_t id, config_t *config, StepMotorCtrlModule *zmotor, hardward_config_t *hardwaredcfg) { //
|
|
|
ZASSERT(config != nullptr); |
|
|
ZASSERT(config != nullptr); |
|
@ -146,12 +147,12 @@ int32_t PipetteModule::pipette_mlld(int32_t zdpos, int32_t c_threshold, int32_t |
|
|
int32_t PipetteModule::pipette_aspirate(int32_t ul) { |
|
|
int32_t PipetteModule::pipette_aspirate(int32_t ul) { |
|
|
ZLOGI(TAG, "pipette_aspirate %d", ul); |
|
|
ZLOGI(TAG, "pipette_aspirate %d", ul); |
|
|
if (creg.module_status == 1) return err::kdevice_is_busy; |
|
|
if (creg.module_status == 1) return err::kdevice_is_busy; |
|
|
return do_pipette_aspirate(ul, 0, 0); |
|
|
|
|
|
|
|
|
return do_pipette_aspirate(ul, 0); |
|
|
}; |
|
|
}; |
|
|
int32_t PipetteModule::pipette_distribut(int32_t ul) { |
|
|
int32_t PipetteModule::pipette_distribut(int32_t ul) { |
|
|
ZLOGI(TAG, "pipette_distribut %d", ul); |
|
|
ZLOGI(TAG, "pipette_distribut %d", ul); |
|
|
if (creg.module_status == 1) return err::kdevice_is_busy; |
|
|
if (creg.module_status == 1) return err::kdevice_is_busy; |
|
|
return do_pipette_distribut(ul, 0, 0); |
|
|
|
|
|
|
|
|
return do_pipette_distribut(ul, 0); |
|
|
}; |
|
|
}; |
|
|
int32_t PipetteModule::pipette_shake_up(int32_t ul, int32_t times) { |
|
|
int32_t PipetteModule::pipette_shake_up(int32_t ul, int32_t times) { |
|
|
ZLOGI(TAG, "pipette_shake_up %d %d", ul, times); |
|
|
ZLOGI(TAG, "pipette_shake_up %d %d", ul, times); |
|
@ -164,18 +165,18 @@ int32_t PipetteModule::pipette_lld_is_detect_liquid(int32_t *detect_liquid) { / |
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
int32_t PipetteModule::pipette_aspirate_llf(int32_t ul, int32_t dpos, int32_t zmotor_v) { //
|
|
|
|
|
|
ZLOGI(TAG, "pipette_aspirate_llf %d %d %d", ul, dpos, zmotor_v); |
|
|
|
|
|
|
|
|
int32_t PipetteModule::pipette_aspirate_llf(int32_t ul, int32_t zmotor_v) { //
|
|
|
|
|
|
ZLOGI(TAG, "pipette_aspirate_llf %d %d %d", ul, zmotor_v); |
|
|
if (creg.module_status == 1) return err::kdevice_is_busy; |
|
|
if (creg.module_status == 1) return err::kdevice_is_busy; |
|
|
return do_pipette_aspirate(ul, dpos, zmotor_v); |
|
|
|
|
|
|
|
|
return do_pipette_aspirate(ul, zmotor_v); |
|
|
} |
|
|
} |
|
|
int32_t PipetteModule::pipette_distribut_llf(int32_t ul, int32_t dpos, int32_t zmotor_v) { //
|
|
|
|
|
|
ZLOGI(TAG, "pipette_distribut_llf %d %d %d", ul, dpos, zmotor_v); |
|
|
|
|
|
|
|
|
int32_t PipetteModule::pipette_distribut_llf(int32_t ul, int32_t zmotor_v) { //
|
|
|
|
|
|
ZLOGI(TAG, "pipette_distribut_llf %d %d %d", ul, zmotor_v); |
|
|
if (creg.module_status == 1) return err::kdevice_is_busy; |
|
|
if (creg.module_status == 1) return err::kdevice_is_busy; |
|
|
return do_pipette_distribut(ul, dpos, zmotor_v); |
|
|
|
|
|
|
|
|
return do_pipette_distribut(ul, zmotor_v); |
|
|
} |
|
|
} |
|
|
int32_t PipetteModule::pipette_shake_up_llf(int32_t ul, int32_t dpos, int32_t zmotor_v, int32_t times) { //
|
|
|
|
|
|
ZLOGI(TAG, "pipette_shake_up_llf %d %d %d %d", ul, dpos, zmotor_v, times); |
|
|
|
|
|
|
|
|
int32_t PipetteModule::pipette_shake_up_llf(int32_t ul, int32_t zmotor_v, int32_t times) { //
|
|
|
|
|
|
ZLOGI(TAG, "pipette_shake_up_llf %d %d %d %d", ul, zmotor_v, times); |
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -482,7 +483,7 @@ int32_t PipetteModule::do_pipette_lld(lld_mode_t mode, int32_t zdpos, int32_t c_ |
|
|
); |
|
|
); |
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
int32_t PipetteModule::do_pipette_aspirate(int32_t ul, int32_t dpos, int32_t zmotor_v) { |
|
|
|
|
|
|
|
|
int32_t PipetteModule::do_pipette_aspirate(int32_t ul, int32_t zmotor_v) { |
|
|
/**
|
|
|
/**
|
|
|
* @brief |
|
|
* @brief |
|
|
*/ |
|
|
*/ |
|
@ -496,12 +497,12 @@ int32_t PipetteModule::do_pipette_aspirate(int32_t ul, int32_t dpos, int32_t zmo |
|
|
m_thread.stop(); |
|
|
m_thread.stop(); |
|
|
creg.module_status = 1; |
|
|
creg.module_status = 1; |
|
|
m_thread.start( |
|
|
m_thread.start( |
|
|
[this, ul, dpos, zmotor_v]() { //
|
|
|
|
|
|
|
|
|
[this, ul, zmotor_v]() { //
|
|
|
auto submotor = m_zmotor->getMotor(); |
|
|
auto submotor = m_zmotor->getMotor(); |
|
|
|
|
|
|
|
|
DO_IN_THREAD(befor_run()); |
|
|
DO_IN_THREAD(befor_run()); |
|
|
if (dpos != 0) { |
|
|
|
|
|
submotor->moveBy(dpos, zmotor_v); |
|
|
|
|
|
|
|
|
if (zmotor_v != 0) { |
|
|
|
|
|
submotor->moveBy(LLF_DPOS, zmotor_v); |
|
|
} |
|
|
} |
|
|
DO_IN_THREAD(m_smtp2.pump_aspirate(m_config.aspirate_distribut_pump_vel, ul)); |
|
|
DO_IN_THREAD(m_smtp2.pump_aspirate(m_config.aspirate_distribut_pump_vel, ul)); |
|
|
while (true) { |
|
|
while (true) { |
|
@ -530,7 +531,7 @@ int32_t PipetteModule::do_pipette_aspirate(int32_t ul, int32_t dpos, int32_t zmo |
|
|
); |
|
|
); |
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
int32_t PipetteModule::do_pipette_distribut(int32_t ul, int32_t dpos, int32_t zmotor_v) { |
|
|
|
|
|
|
|
|
int32_t PipetteModule::do_pipette_distribut(int32_t ul, int32_t zmotor_v) { |
|
|
/**
|
|
|
/**
|
|
|
* @brief |
|
|
* @brief |
|
|
*/ |
|
|
*/ |
|
@ -540,12 +541,13 @@ int32_t PipetteModule::do_pipette_distribut(int32_t ul, int32_t dpos, int32_t zm |
|
|
m_thread.stop(); |
|
|
m_thread.stop(); |
|
|
creg.module_status = 1; |
|
|
creg.module_status = 1; |
|
|
m_thread.start( |
|
|
m_thread.start( |
|
|
[this, ul, dpos, zmotor_v]() { //
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[this, ul, zmotor_v]() { //
|
|
|
auto submotor = m_zmotor->getMotor(); |
|
|
auto submotor = m_zmotor->getMotor(); |
|
|
DO_IN_THREAD(befor_run()); |
|
|
DO_IN_THREAD(befor_run()); |
|
|
DO_IN_THREAD(m_smtp2.pump_distribut(m_config.aspirate_distribut_pump_vel, ul)); |
|
|
DO_IN_THREAD(m_smtp2.pump_distribut(m_config.aspirate_distribut_pump_vel, ul)); |
|
|
if (dpos != 0) { |
|
|
|
|
|
submotor->moveBy(-dpos, zmotor_v); |
|
|
|
|
|
|
|
|
if (zmotor_v != 0) { |
|
|
|
|
|
submotor->moveBy(-LLF_DPOS, zmotor_v); |
|
|
} |
|
|
} |
|
|
while (true) { |
|
|
while (true) { |
|
|
if (!check_when_run()) break; |
|
|
if (!check_when_run()) break; |
|
|