12 changed files with 84 additions and 853 deletions
-
103components/motor_laser_code_scanner/motor_laser_code_scanne.cpp
-
38components/motor_laser_code_scanner/motor_laser_code_scanne.hpp
-
282components/pipette_module/pipette_ctrl_module.cpp
-
69components/pipette_module/pipette_ctrl_module.hpp
-
176components/step_motor_ctrl_module/step_motor_ctrl_module.cpp
-
111components/step_motor_ctrl_module/step_motor_ctrl_module.hpp
-
34components/zcancmder_module/zcan_motor_laser_code_scanner_scan_module.cpp
-
22components/zcancmder_module/zcan_motor_laser_code_scanner_scan_module.hpp
-
78components/zcancmder_module/zcan_pipette_module.cpp
-
20components/zcancmder_module/zcan_pipette_module.hpp
-
2components/zprotocols/zcancmder
-
2components/zprotocols/zcancmder_v2
@ -1,103 +0,0 @@ |
|||
#include "motor_laser_code_scanne.hpp"
|
|||
|
|||
#include <stdio.h>
|
|||
#include <string.h>
|
|||
#include <stdlib.h>
|
|||
|
|||
#include "sdk\components\zprotocols\errorcode\errorcode.hpp"
|
|||
using namespace iflytop; |
|||
using namespace std; |
|||
#define TAG "MotorLaserCodeScanner"
|
|||
|
|||
#define DO(infostr, ACTION) \
|
|||
{ \ |
|||
int exec_ret = ACTION; \ |
|||
if (exec_ret != 0) { \ |
|||
ZLOGE(TAG, "do " infostr "(line:%d) fail, ret = %d", __LINE__, exec_ret); \ |
|||
m_lastexecstatus = exec_ret; \ |
|||
if (status_cb) status_cb(exec_ret); \ |
|||
return; \ |
|||
} \ |
|||
} |
|||
|
|||
void MotorLaserCodeScanner::initialize(int id, I_StepMotorCtrlModule* stepM, int max_scan_result_num) { |
|||
m_id = id; |
|||
m_stepM1 = stepM; |
|||
|
|||
m_mallocsize = sizeof(scan_result_t) + 2 * max_scan_result_num; |
|||
m_scan_result = (scan_result_t*)malloc(m_mallocsize); |
|||
ZASSERT(m_scan_result != nullptr); |
|||
memset(m_scan_result, 0, m_mallocsize); |
|||
m_max_scan_result_num = max_scan_result_num; |
|||
|
|||
m_lock.init(); |
|||
m_thread.init(TAG, 1024, osPriorityNormal); |
|||
} |
|||
|
|||
int32_t MotorLaserCodeScanner::start_scan(s32 moveby_distance, //
|
|||
s32 scan_interval_distance, //
|
|||
s32 each_sample_times, //
|
|||
s32 transmitting_tube_amplification, //
|
|||
s32 receiving_tube_amplification, //
|
|||
//
|
|||
action_cb_status_t status_cb) { |
|||
zlock_guard lock(m_lock); |
|||
ZLOGI(TAG, "start_scan %d %d %d %d %d", moveby_distance, scan_interval_distance, each_sample_times, transmitting_tube_amplification, receiving_tube_amplification); |
|||
|
|||
m_thread.stop(); |
|||
memset(m_scan_result, 0, m_mallocsize); |
|||
m_thread.start([this, //
|
|||
moveby_distance, //
|
|||
scan_interval_distance, //
|
|||
each_sample_times, //
|
|||
transmitting_tube_amplification, //
|
|||
receiving_tube_amplification, //
|
|||
status_cb]() { |
|||
int32_t count = moveby_distance / scan_interval_distance; |
|||
int32_t each_move_by_distance = moveby_distance > 0 ? abs(scan_interval_distance) : -abs(scan_interval_distance); |
|||
|
|||
for (int32_t i = 0; i < count; i++) { |
|||
ZLOGI(TAG, "move to %d", each_move_by_distance); |
|||
DO("move_by", m_stepM1->move_by_block(each_move_by_distance)); |
|||
// read adc
|
|||
} |
|||
m_scan_result->each_scan_result_len = 2; |
|||
m_scan_result->scan_reult_nums = count; |
|||
call_action_cb(status_cb, 0); |
|||
}); |
|||
return 0; |
|||
} |
|||
int32_t MotorLaserCodeScanner::stop_scan() { |
|||
zlock_guard lock(m_lock); |
|||
ZLOGI(TAG, "stop_scan"); |
|||
m_thread.stop(); |
|||
return 0; |
|||
}; |
|||
|
|||
int32_t MotorLaserCodeScanner::get_scan_result(u16 sector_index, u16 sector_size, zcancmder_read_ram_ack_t& ack) { |
|||
zlock_guard lock(m_lock); |
|||
if (m_thread.isworking()) return err::kdevice_is_busy; |
|||
uint8_t* src_data = m_scan_result->scan_result + sector_index * sector_size; |
|||
int32_t src_data_len = m_scan_result->each_scan_result_len * m_scan_result->scan_reult_nums; |
|||
|
|||
return assign_scan_result(sector_index, sector_size, src_data, src_data_len, ack); |
|||
} |
|||
int32_t MotorLaserCodeScanner::assign_scan_result(u16 sector_index, u16 sector_size, u8* src_data, s32 src_data_len, zcancmder_read_ram_ack_t& ack) { |
|||
if (sector_size > sizeof(ack.packet)) return err::kbuffer_not_enough; |
|||
|
|||
uint8_t* copy_s = (uint8_t*)src_data + sector_index * sector_size; |
|||
int32_t copy_len = (int32_t)src_data_len - sector_size * sector_index; |
|||
|
|||
if (copy_len > sector_size) copy_len = sector_size; |
|||
if (copy_len < 0) copy_len = 0; |
|||
|
|||
ack.len = copy_len; |
|||
if (ack.len < sector_size) ack.is_end = 1; |
|||
memcpy(ack.packet, copy_s, copy_len); |
|||
return 0; |
|||
} |
|||
|
|||
void MotorLaserCodeScanner::call_action_cb(action_cb_status_t status_cb, int32_t status) { |
|||
m_lastexecstatus = status; |
|||
if (status_cb) status_cb(status); |
|||
} |
@ -1,38 +0,0 @@ |
|||
#pragma once
|
|||
//
|
|||
#include "sdk/os/zos.hpp"
|
|||
#include "sdk\components\zprotocols\zcancmder\api\i_motor_laser_code_scanner.hpp"
|
|||
#include "sdk\components\zprotocols\zcancmder\api\i_step_motor_ctrl_module.hpp"
|
|||
namespace iflytop { |
|||
class MotorLaserCodeScanner : public I_MotorLaserCodeScanner { |
|||
ZThread m_thread; |
|||
int m_id = 0; |
|||
I_StepMotorCtrlModule* m_stepM1 = nullptr; |
|||
zmutex m_lock; |
|||
|
|||
scan_result_t* m_scan_result = nullptr; |
|||
int m_max_scan_result_num = 0; |
|||
int m_mallocsize = 0; |
|||
|
|||
int32_t m_lastexecstatus = 0; |
|||
|
|||
public: |
|||
void initialize(int id, I_StepMotorCtrlModule* stepM, int max_scan_result_num); |
|||
|
|||
virtual int32_t start_scan(s32 moveby_distance, //
|
|||
s32 scan_interval_distance, //
|
|||
s32 each_sample_times, //
|
|||
s32 transmitting_tube_amplification, //
|
|||
s32 receiving_tube_amplification, //
|
|||
//
|
|||
action_cb_status_t status_cb) override; |
|||
//
|
|||
virtual int32_t stop_scan() override; |
|||
//
|
|||
virtual int32_t get_scan_result(u16 sector_index, u16 sector_size, zcancmder_read_ram_ack_t& ack) override; |
|||
|
|||
private: |
|||
void call_action_cb(action_cb_status_t status_cb, int32_t status); |
|||
int32_t assign_scan_result(u16 sector_index, u16 sector_size, u8* src_data, s32 src_data_len, zcancmder_read_ram_ack_t& ack); |
|||
}; |
|||
}; // namespace iflytop
|
@ -1,282 +0,0 @@ |
|||
#include "pipette_ctrl_module.hpp"
|
|||
using namespace iflytop; |
|||
using namespace std; |
|||
#define TAG "PipetteModule"
|
|||
#if 0
|
|||
|
|||
#define DO(infostr, ACTION) \
|
|||
{ \ |
|||
int exec_ret = ACTION; \ |
|||
if (exec_ret != 0) { \ |
|||
ZLOGE(TAG, "do " infostr "(line:%d) fail, ret = %d", __LINE__, exec_ret); \ |
|||
m_lastexecstatus = exec_ret; \ |
|||
if (status_cb) status_cb(exec_ret); \ |
|||
return; \ |
|||
} \ |
|||
ZLOGI(TAG, "do " infostr " complete"); \ |
|||
} |
|||
|
|||
#define DO2(infostr, ACTION) \
|
|||
{ \ |
|||
int exec_ret = ACTION; \ |
|||
if (exec_ret != 0) { \ |
|||
ZLOGE(TAG, "do " infostr "(line:%d) fail, ret = %d", __LINE__, exec_ret); \ |
|||
return exec_ret; \ |
|||
} \ |
|||
} |
|||
|
|||
void PipetteModule::initialize(SMTP2 *smtp2, //
|
|||
StepMotorCtrlModule *stepMotor) { |
|||
m_smtp2 = smtp2; |
|||
m_stepMotor = stepMotor; |
|||
m_thread.init("pipette", 1024); |
|||
} |
|||
|
|||
int32_t PipetteModule::enable(u8 enable) { //
|
|||
m_stepMotor->enable(enable); |
|||
return 0; |
|||
} |
|||
int32_t PipetteModule::stop(u8 stop_type) { |
|||
m_stepMotor->stop(0); |
|||
m_smtp2->stop(); |
|||
return 0; |
|||
} |
|||
|
|||
int32_t PipetteModule::zero_pos_calibrate(action_cb_status_t status_cb) { |
|||
ZLOGI(TAG, "zero_pos_calibrate"); |
|||
if (!m_smtp2->isOnline()) return err::kdevice_offline; |
|||
|
|||
m_thread.stop(); |
|||
m_thread.start([this, status_cb]() { //
|
|||
DO("move_to_zero_with_calibrate_block", m_stepMotor->move_to_zero_with_calibrate_block(0)); |
|||
|
|||
call_status_cb(status_cb, 0); |
|||
return; |
|||
}); |
|||
return 0; |
|||
} |
|||
|
|||
int32_t PipetteModule::zmotor_reset(action_cb_status_t status_cb) { |
|||
ZLOGI(TAG, "reset_device"); |
|||
if (!m_smtp2->isOnline()) return err::kdevice_offline; |
|||
|
|||
m_thread.stop(); |
|||
m_thread.start([this, status_cb]() { |
|||
// Z轴复位
|
|||
DO("move_to_zero_block", m_stepMotor->move_to_zero_block()); |
|||
//
|
|||
|
|||
call_status_cb(status_cb, 0); |
|||
}); |
|||
return 0; |
|||
} |
|||
int32_t PipetteModule::pipette_reset(action_cb_status_t status_cb) { |
|||
ZLOGI(TAG, "reset_device"); |
|||
if (!m_smtp2->isOnline()) return err::kdevice_offline; |
|||
|
|||
m_thread.stop(); |
|||
m_thread.start([this, status_cb]() { |
|||
// 移液枪复位
|
|||
DO("init_device_block", m_smtp2->init_device_block()) |
|||
|
|||
call_status_cb(status_cb, 0); |
|||
}); |
|||
return 0; |
|||
} |
|||
|
|||
int32_t PipetteModule::take_tip(s16 vel, s16 height_mm, s16 tip_hight_mm, action_cb_status_t status_cb) { |
|||
ZLOGI(TAG, "take_tip"); |
|||
if (!m_smtp2->isOnline()) return err::kdevice_offline; |
|||
|
|||
bool hastip = false; |
|||
DO2("m_smtp2->read_tip_state(hastip)", m_smtp2->read_tip_state(hastip)); |
|||
if (hastip) { |
|||
ZLOGI(TAG, "pipette gun has tip"); |
|||
return err::kSMTP2_TipAlreadyLoad; |
|||
} |
|||
|
|||
// m_tip_hight_mm = tip_hight_mm;
|
|||
m_thread.stop(); |
|||
m_thread.start([this, vel, height_mm, tip_hight_mm, status_cb]() { |
|||
// 移动移液枪到取Tip位置
|
|||
ZLOGI(TAG, "move to take_tip_height_mm %d", height_mm); |
|||
DO("move_to", m_stepMotor->move_to_block(hight_trans(height_mm), vel)); |
|||
// 取tip头
|
|||
ZLOGI(TAG, "take tip"); |
|||
osDelay(1000); |
|||
// 移液枪返回零点
|
|||
ZLOGI(TAG, "move to transfer_height_mm %d", m_transfer_height_mm); |
|||
DO("move_to_block", m_stepMotor->move_to_block(hight_trans(m_transfer_height_mm), vel)); |
|||
|
|||
bool hastip = false; |
|||
DO("m_smtp2->read_tip_state(hastip)", m_smtp2->read_tip_state(hastip)); |
|||
if (!hastip) { |
|||
ZLOGE(TAG, "pipette gun take tip fail,no tip detected"); |
|||
|
|||
call_status_cb(status_cb, err::kSMTP2_TipLoadFail); |
|||
return; |
|||
} |
|||
|
|||
call_status_cb(status_cb, 0); |
|||
}); |
|||
return 0; |
|||
} |
|||
|
|||
int32_t PipetteModule::remove_tip(s16 vel, s16 height_mm, action_cb_status_t status_cb) { |
|||
ZLOGI(TAG, "rmove_tip "); |
|||
if (!m_smtp2->isOnline()) return err::kdevice_offline; |
|||
|
|||
m_thread.stop(); |
|||
m_thread.start([this, vel, height_mm, status_cb]() { |
|||
// 移动移液枪到丢Tip位置
|
|||
ZLOGI(TAG, "move to remove_tip_height_mm %d", height_mm); |
|||
DO("move_to_block", m_stepMotor->move_to_block(hight_trans(height_mm), vel)); |
|||
|
|||
// 丢弃tip头
|
|||
ZLOGI(TAG, "put_tip"); |
|||
DO("put_tip_block", m_smtp2->put_tip_block()); |
|||
|
|||
// 移液枪返回零点
|
|||
ZLOGI(TAG, "move to transfer_height_mm %d", m_transfer_height_mm); |
|||
DO("move_to_block", m_stepMotor->move_to_block(hight_trans(m_transfer_height_mm), vel)); |
|||
|
|||
call_status_cb(status_cb, 0); |
|||
}); |
|||
return 0; |
|||
} |
|||
|
|||
int32_t PipetteModule::move_to(s16 vel, s16 height_mm, action_cb_status_t status_cb) { |
|||
ZLOGI(TAG, "move_to %d %d", vel, height_mm); |
|||
m_thread.stop(); |
|||
m_thread.start([this, vel, height_mm, status_cb]() { |
|||
ZLOGI(TAG, "move to transfer_height_mm %d", height_mm); |
|||
DO("m_stepMotor->move_to_block(targethith)", m_stepMotor->move_to_block(hight_trans(height_mm), vel)); |
|||
|
|||
call_status_cb(status_cb, 0); |
|||
}); |
|||
return 0; |
|||
} |
|||
int32_t PipetteModule::exec_move_to_with_lld(s16 vel, s16 lld_cap_thr, s16 lld_max_hight_mm) { |
|||
return m_stepMotor->do_motor_action_block_2( |
|||
// action function
|
|||
[this, vel, lld_cap_thr, lld_max_hight_mm]() { //
|
|||
return m_stepMotor->move_to(vel, hight_trans(lld_max_hight_mm), nullptr); |
|||
}, |
|||
// check function
|
|||
[this, lld_cap_thr](bool &reachtarget, int periodcount) { |
|||
int32_t capacitance = 0; |
|||
int32_t ret = m_smtp2->read_capacitance_val(capacitance); |
|||
if (ret != 0) { |
|||
ZLOGE(TAG, "read_capacitance_val fail, ret = %d", ret); |
|||
return ret; |
|||
} |
|||
|
|||
if (capacitance > lld_cap_thr) { |
|||
ZLOGI(TAG, "capacitance %d reach threshold %d", capacitance, lld_cap_thr); |
|||
reachtarget = true; |
|||
} |
|||
if (periodcount % 100 == 0) { |
|||
ZLOGI(TAG, "capacitance %d", capacitance); |
|||
} |
|||
return int32_t(0); |
|||
}); |
|||
} |
|||
|
|||
int32_t PipetteModule::move_to_with_lld( //
|
|||
s16 vel, s16 lld_cap_thr, s16 lld_max_hight_mm, s16 lld_rela_hight_mm, action_cb_status_t status_cb) { |
|||
ZLOGI(TAG, "move_to_with_lld %d %d %d %d", vel, lld_cap_thr, lld_max_hight_mm, lld_rela_hight_mm); |
|||
|
|||
m_thread.stop(); |
|||
m_thread.start([this, vel, lld_cap_thr, lld_max_hight_mm, lld_rela_hight_mm, status_cb]() { |
|||
DO("m_stepMotor->move_to(lld_max_hight_mm)", exec_move_to_with_lld(vel, lld_cap_thr, lld_max_hight_mm)); |
|||
|
|||
int32_t nowpos; |
|||
DO("readpos", m_stepMotor->read_pos(nowpos)); |
|||
int32_t targethith = nowpos + lld_rela_hight_mm; |
|||
if (targethith > lld_max_hight_mm) { |
|||
targethith = lld_max_hight_mm; |
|||
} |
|||
DO("m_stepMotor->move_to_block(targethith)", m_stepMotor->move_to_block(hight_trans(targethith), vel)); |
|||
|
|||
call_status_cb(status_cb, 0); |
|||
}); |
|||
return 0; |
|||
} |
|||
int32_t PipetteModule::shake(s16 shake_times, s16 shake_volume, action_cb_status_t status_cb) { |
|||
ZLOGI(TAG, "shake_volume %d %d", shake_times, shake_volume); |
|||
m_thread.stop(); |
|||
m_thread.start([this, shake_times, shake_volume, status_cb]() { |
|||
for (size_t i = 0; i < shake_times; i++) { |
|||
DO("m_smtp2->move_to_ul(0)", m_smtp2->move_to_ul(0)); |
|||
DO("m_smtp2->move_to_ul(shake_volume)", m_smtp2->move_to_ul(shake_volume)); |
|||
} |
|||
DO("m_smtp2->move_to_ul(0)", m_smtp2->move_to_ul(0)); |
|||
|
|||
call_status_cb(status_cb, 0); |
|||
}); |
|||
return 0; |
|||
} |
|||
int32_t PipetteModule::pipette_move_to_ul(s16 take_volume_mm, action_cb_status_t status_cb) { |
|||
ZLOGI(TAG, "pipette_move_to_ul %d", take_volume_mm); |
|||
m_thread.stop(); |
|||
m_thread.start([this, take_volume_mm, status_cb]() { |
|||
DO("m_stepMotor->move_to_block(nowpos)", m_smtp2->move_to_ul(take_volume_mm)); |
|||
|
|||
call_status_cb(status_cb, 0); |
|||
}); |
|||
return 0; |
|||
} |
|||
|
|||
int32_t PipetteModule::hight_trans(s16 targethith, s16 &motormovehight) { |
|||
motormovehight = targethith; |
|||
return 0; |
|||
#if 0
|
|||
bool hastip = false; |
|||
int32_t err = m_smtp2->read_tip_state(hastip); |
|||
if (err != 0) { |
|||
ZLOGE(TAG, "pipette gun lost connection"); |
|||
motormovehight = 0; |
|||
return err; |
|||
} |
|||
|
|||
if (hastip) { |
|||
motormovehight = targethith - m_tip_hight_mm; |
|||
} else { |
|||
motormovehight = targethith; |
|||
} |
|||
|
|||
if (motormovehight < 0) { |
|||
motormovehight = 0; |
|||
} |
|||
return 0; |
|||
#endif
|
|||
} |
|||
|
|||
int32_t PipetteModule::get_status(status_t &status) { |
|||
#if 0
|
|||
uint8_t status; // 设备状态
|
|||
uint8_t io_state; // IO0:z_zero_io/IO1:hastip/
|
|||
int16_t zpos_mm; // z轴位置,如果有tip,则自动加上tip高度
|
|||
int16_t pipette_ul; // 移液枪液量
|
|||
#endif
|
|||
status.status = m_thread.isworking() ? 1 : 0; |
|||
status.pipette_gun_status = m_smtp2->getState(); |
|||
status.io_state = m_stepMotor->read_zero_io_state() ? 1 : 0; |
|||
status.has_tip = m_smtp2->read_tip_state(); |
|||
status.zpos_mm = m_stepMotor->read_pos(); |
|||
status.pipette_ul = m_smtp2->read_pos_ul(); |
|||
return 0; |
|||
} |
|||
|
|||
s16 PipetteModule::hight_trans(s16 targethith) { |
|||
s16 realhight = 0; |
|||
int32_t err = hight_trans(targethith, realhight); |
|||
if (err != 0) { |
|||
ZLOGE(TAG, "pipette gun lost connection"); |
|||
return 0; |
|||
} |
|||
return realhight; |
|||
} |
|||
|
|||
void PipetteModule::call_status_cb(action_cb_status_t status_cb, int32_t status) { call_status_cb(status_cb, status); } |
|||
#endif
|
@ -1,69 +0,0 @@ |
|||
#pragma once
|
|||
//
|
|||
#include "sdk/os/zos.hpp"
|
|||
#include "sdk\components\sensors\smtp2\smtp2.hpp"
|
|||
#include "sdk\components\tmc\basic\tmc_ic_interface.hpp"
|
|||
#include "sdk\components\zprotocols\zcancmder\api\i_pipette_module.hpp"
|
|||
#include "sdk\components\zprotocols\zcancmder\api\i_step_motor_ctrl_module.hpp"
|
|||
#include "sdk\components\step_motor_ctrl_module\step_motor_ctrl_module.hpp"
|
|||
// #include "StepMotorCtrlModule"
|
|||
|
|||
namespace iflytop { |
|||
|
|||
class PipetteModule : public I_PipetteModule { |
|||
public: |
|||
private: |
|||
bool m_module_enable = false; |
|||
SMTP2 *m_smtp2; |
|||
StepMotorCtrlModule *m_stepMotor; |
|||
|
|||
ZThread m_thread; |
|||
int32_t m_lastexecstatus = 0; |
|||
bool m_has_tip = false; |
|||
|
|||
base_param_t m_base_param; |
|||
int16_t m_transfer_height_mm = 0; |
|||
|
|||
public: |
|||
void initialize(SMTP2 *smtp2, StepMotorCtrlModule *stepMotor); |
|||
|
|||
/*******************************************************************************
|
|||
* ACTION * |
|||
*******************************************************************************/ |
|||
virtual int32_t enable(u8 enable) override; |
|||
virtual int32_t stop(u8 stop_type) override; |
|||
|
|||
virtual int32_t zero_pos_calibrate(action_cb_status_t status_cb) override; |
|||
|
|||
virtual int32_t zmotor_reset(action_cb_status_t status_cb) override; |
|||
virtual int32_t pipette_reset(action_cb_status_t status_cb) override; |
|||
|
|||
virtual int32_t take_tip(s16 vel, s16 height_mm, s16 tip_hight_mm, action_cb_status_t status_cb) override; |
|||
virtual int32_t remove_tip(s16 vel, s16 height_mm, action_cb_status_t status_cb) override; |
|||
|
|||
virtual int32_t move_to(s16 vel, s16 height_mm, action_cb_status_t status_cb) override; |
|||
virtual int32_t move_to_with_lld(s16 vel, s16 lld_cap_thr, s16 lld_max_hight_mm, s16 lld_rela_hight_mm, action_cb_status_t status_cb) override; |
|||
virtual int32_t shake(s16 shake_times, s16 shake_volume, action_cb_status_t status_cb) override; |
|||
virtual int32_t pipette_move_to_ul(s16 take_volume_mm, action_cb_status_t status_cb) override; |
|||
|
|||
/*******************************************************************************
|
|||
* ReadStatus * |
|||
*******************************************************************************/ |
|||
virtual int32_t get_status(status_t &status) override; |
|||
|
|||
/*******************************************************************************
|
|||
* SETTING * |
|||
*******************************************************************************/ |
|||
virtual int32_t set_z_motor_para(const I_StepMotorCtrlModule::base_param_t &z_motor_param) override; |
|||
virtual int32_t get_z_motor_para(I_StepMotorCtrlModule::base_param_t &z_motor_param) override; |
|||
virtual int32_t set_base_param(const base_param_t &base_param) override; |
|||
virtual int32_t get_base_param(base_param_t &base_param) override; |
|||
|
|||
public: |
|||
int32_t exec_move_to_with_lld(s16 vel, s16 lld_cap_thr, s16 lld_max_hight_mm); |
|||
|
|||
int32_t hight_trans(s16 targethith, s16 &motormovehight); |
|||
s16 hight_trans(s16 targethith); |
|||
void call_status_cb(action_cb_status_t status_cb, int32_t status); |
|||
}; |
|||
} // namespace iflytop
|
@ -1,34 +0,0 @@ |
|||
#include "zcan_motor_laser_code_scanner_scan_module.hpp"
|
|||
|
|||
#include "string.h"
|
|||
using namespace iflytop; |
|||
|
|||
#define TAG "ZcanMotorLaserCodeScannerScanModule"
|
|||
#if 0
|
|||
void ZcanMotorLaserCodeScannerScanModule::initialize(ZCanCmder* cancmder, int id, I_MotorLaserCodeScanner* module) { |
|||
m_cancmder = cancmder; |
|||
m_id = id; |
|||
m_module = module; |
|||
m_lock.init(); |
|||
cancmder->registerListener(this); |
|||
} |
|||
void ZcanMotorLaserCodeScannerScanModule::onRceivePacket(CanPacketRxBuffer* rxcmd) { |
|||
|
|||
PROCESS_PACKET(kcmd_motor_laser_code_scanner_scan, m_id) { |
|||
errorcode = m_module->start_scan( //
|
|||
cmd->moveby_distance, //
|
|||
cmd->scan_interval_distance, //
|
|||
cmd->each_sample_times, //
|
|||
cmd->transmitting_tube_amplification, //
|
|||
cmd->receiving_tube_amplification, //
|
|||
[this, cmdheader](int32_t status) { PROCESS_REPORT(kcmd_motor_laser_code_scanner_scan); }); |
|||
} |
|||
END_PP(); |
|||
|
|||
PROCESS_PACKET(kcmd_motor_laser_code_scanner_stop_scan, m_id) { errorcode = m_module->stop_scan(); } |
|||
END_PP(); |
|||
|
|||
PROCESS_PACKET(kcmd_motor_laser_code_scanner_get_scan_result, m_id) { errorcode = m_module->get_scan_result(cmd->sector_index, cmd->sector_size, ack->ack); } |
|||
END_PP(); |
|||
} |
|||
#endif
|
@ -1,22 +0,0 @@ |
|||
#pragma once
|
|||
// #include "sdk/components/zprotocols/zcancmder/api/i_step_motor_ctrl_module.hpp"
|
|||
// #include "sdk/components/zprotocols/zcancmder/api/i_pipette_module.hpp"
|
|||
#include "sdk/components/zprotocols/zcancmder/api/i_motor_laser_code_scanner.hpp"
|
|||
#include "sdk\components\zcancmder\zcanreceiver.hpp"
|
|||
#include "sdk\os\zos.hpp"
|
|||
namespace iflytop { |
|||
#if 0
|
|||
class ZcanMotorLaserCodeScannerScanModule : public ZCanCmderListener { |
|||
ZCanCmder* m_cancmder = nullptr; |
|||
int m_id = 0; |
|||
I_MotorLaserCodeScanner* m_module; |
|||
|
|||
uint8_t m_txbuf[512] = {0}; |
|||
zmutex m_lock; |
|||
|
|||
public: |
|||
void initialize(ZCanCmder* cancmder, int id, I_MotorLaserCodeScanner* module); |
|||
virtual void onRceivePacket(CanPacketRxBuffer* rxcmd); |
|||
}; |
|||
#endif
|
|||
} // namespace iflytop
|
@ -1,78 +0,0 @@ |
|||
#include "zcan_pipette_module.hpp"
|
|||
using namespace iflytop; |
|||
|
|||
#define TAG "ZcanPipetteModule"
|
|||
#if 0
|
|||
void ZcanPipetteModule::initialize(ZCanCmder* cancmder, int id, I_PipetteModule* module) { |
|||
m_cancmder = cancmder; |
|||
m_id = id; |
|||
m_module = module; |
|||
m_lock.init(); |
|||
cancmder->registerListener(this); |
|||
} |
|||
void ZcanPipetteModule::onRceivePacket(CanPacketRxBuffer* rxcmd) { |
|||
|
|||
PROCESS_PACKET(kcmd_pipette_module_enable, m_id) { errorcode = m_module->enable(cmd->enable); } |
|||
END_PP(); |
|||
PROCESS_PACKET(kcmd_pipette_module_stop, m_id) { errorcode = m_module->stop(cmd->stop_type); } |
|||
END_PP(); |
|||
PROCESS_PACKET(kcmd_pipette_module_zero_pos_calibrate, m_id) { |
|||
errorcode = m_module->zero_pos_calibrate([this, cmdheader](int32_t status) { PROCESS_REPORT(kcmd_pipette_module_zero_pos_calibrate); }); |
|||
} |
|||
END_PP(); |
|||
PROCESS_PACKET(kcmd_pipeete_module_zmotor_reset, m_id) { |
|||
errorcode = m_module->zmotor_reset([this, cmdheader](int32_t status) { PROCESS_REPORT(kcmd_pipeete_module_zmotor_reset); }); |
|||
} |
|||
END_PP(); |
|||
|
|||
PROCESS_PACKET(kcmd_pipeete_module_pipette_reset, m_id) { |
|||
errorcode = m_module->pipette_reset([this, cmdheader](int32_t status) { PROCESS_REPORT(kcmd_pipeete_module_pipette_reset); }); |
|||
} |
|||
END_PP(); |
|||
|
|||
PROCESS_PACKET(kcmd_pipette_module_take_tip, m_id) { |
|||
errorcode = m_module->take_tip(cmd->vel, cmd->height_mm, cmd->tip_hight_mm, [this, cmdheader](int32_t status) { PROCESS_REPORT(kcmd_pipette_module_take_tip); }); |
|||
} |
|||
END_PP(); |
|||
|
|||
PROCESS_PACKET(kcmd_pipette_module_remove_tip, m_id) { |
|||
errorcode = m_module->remove_tip(cmd->vel, cmd->height_mm, [this, cmdheader](int32_t status) { PROCESS_REPORT(kcmd_pipette_module_remove_tip); }); |
|||
} |
|||
END_PP(); |
|||
|
|||
PROCESS_PACKET(kcmd_pipette_module_move_to, m_id) { |
|||
errorcode = m_module->move_to(cmd->vel, cmd->height_mm, [this, cmdheader](int32_t status) { PROCESS_REPORT(kcmd_pipette_module_move_to); }); |
|||
} |
|||
END_PP(); |
|||
|
|||
PROCESS_PACKET(kcmd_pipette_module_move_to_with_lld, m_id) { |
|||
errorcode = m_module->move_to_with_lld(cmd->vel, cmd->lld_cap_thr, cmd->lld_max_hight_mm, cmd->lld_rela_hight_mm, [this, cmdheader](int32_t status) { PROCESS_REPORT(kcmd_pipette_module_move_to_with_lld); }); |
|||
} |
|||
END_PP(); |
|||
|
|||
PROCESS_PACKET(kcmd_pipette_module_shake, m_id) { |
|||
errorcode = m_module->shake(cmd->shake_times, cmd->shake_volume, [this, cmdheader](int32_t status) { PROCESS_REPORT(kcmd_pipette_module_shake); }); |
|||
} |
|||
END_PP(); |
|||
|
|||
PROCESS_PACKET(kcmd_pipette_module_pipette_move_to_ul, m_id) { |
|||
errorcode = m_module->pipette_move_to_ul(cmd->take_volume_mm, [this, cmdheader](int32_t status) { PROCESS_REPORT(kcmd_pipette_module_pipette_move_to_ul); }); |
|||
} |
|||
END_PP(); |
|||
|
|||
PROCESS_PACKET(kcmd_pipette_module_get_status, m_id) { errorcode = m_module->get_status(ack->ack); } |
|||
END_PP(); |
|||
|
|||
PROCESS_PACKET(kcmd_pipette_module_set_z_motor_para, m_id) { errorcode = m_module->set_z_motor_para(cmd->param); } |
|||
END_PP(); |
|||
|
|||
PROCESS_PACKET(kcmd_pipette_module_get_z_motor_para, m_id) { errorcode = m_module->get_z_motor_para(ack->ack); } |
|||
END_PP(); |
|||
|
|||
PROCESS_PACKET(kcmd_pipette_module_set_base_param, m_id) { errorcode = m_module->set_base_param(cmd->param); } |
|||
END_PP(); |
|||
|
|||
PROCESS_PACKET(kcmd_pipette_module_get_base_param, m_id) { errorcode = m_module->get_base_param(ack->ack); } |
|||
END_PP(); |
|||
} |
|||
#endif
|
@ -1,20 +0,0 @@ |
|||
#pragma once
|
|||
// #include "sdk/components/zprotocols/zcancmder/api/i_step_motor_ctrl_module.hpp"
|
|||
#include "sdk/components/zprotocols/zcancmder/api/i_pipette_module.hpp"
|
|||
#include "sdk\components\zcancmder\zcanreceiver.hpp"
|
|||
namespace iflytop { |
|||
#if 0
|
|||
class ZcanPipetteModule : public ZCanCmderListener { |
|||
ZCanCmder* m_cancmder = nullptr; |
|||
int m_id = 0; |
|||
I_PipetteModule* m_module; |
|||
|
|||
uint8_t m_txbuf[128] = {0}; |
|||
zmutex m_lock; |
|||
|
|||
public: |
|||
void initialize(ZCanCmder* cancmder, int id, I_PipetteModule* module); |
|||
virtual void onRceivePacket(CanPacketRxBuffer* rxcmd); |
|||
}; |
|||
#endif
|
|||
} // namespace iflytop
|
@ -1 +1 @@ |
|||
Subproject commit 35ead127ccd9676336f14a982d1dd3d6b95fe2ad |
|||
Subproject commit b03e0a12e3ae450cbcdf5fd0f0218b258071f2eb |
@ -1 +1 @@ |
|||
Subproject commit b07e34e08cd6954295d3a6c2104fd0457bc4dab4 |
|||
Subproject commit 006b7d8844cea0f95bc64f672cb3e7b82108e9ed |
Write
Preview
Loading…
Cancel
Save
Reference in new issue