|
@ -495,6 +495,7 @@ int32_t StepMotorCtrlModule::step_motor_easy_reciprocating_motion(int32_t startp |
|
|
if (m_cfg.min_d != 0 && x_endpos < m_cfg.min_d) x_endpos = m_cfg.min_d; |
|
|
if (m_cfg.min_d != 0 && x_endpos < m_cfg.min_d) x_endpos = m_cfg.min_d; |
|
|
if (m_cfg.max_d != 0 && x_endpos > m_cfg.max_d) x_endpos = m_cfg.max_d; |
|
|
if (m_cfg.max_d != 0 && x_endpos > m_cfg.max_d) x_endpos = m_cfg.max_d; |
|
|
m_thread.stop(); |
|
|
m_thread.stop(); |
|
|
|
|
|
creg.module_status = 1; |
|
|
m_thread.start( |
|
|
m_thread.start( |
|
|
[this, x_startpos, x_endpos, x_beginpos, times]() { |
|
|
[this, x_startpos, x_endpos, x_beginpos, times]() { |
|
|
befor_motor_move(); |
|
|
befor_motor_move(); |
|
@ -537,6 +538,7 @@ int32_t StepMotorCtrlModule::step_motor_easy_reciprocating_motion(int32_t startp |
|
|
|
|
|
|
|
|
int32_t StepMotorCtrlModule::do_step_motor_easy_rotate(int32_t direction) { |
|
|
int32_t StepMotorCtrlModule::do_step_motor_easy_rotate(int32_t direction) { |
|
|
m_thread.stop(); |
|
|
m_thread.stop(); |
|
|
|
|
|
creg.module_status = 1; |
|
|
m_thread.start( |
|
|
m_thread.start( |
|
|
[this, direction]() { |
|
|
[this, direction]() { |
|
|
befor_motor_move(); |
|
|
befor_motor_move(); |
|
@ -559,6 +561,7 @@ int32_t StepMotorCtrlModule::do_step_motor_easy_move_to(int32_t tox) { |
|
|
if (m_cfg.min_d != 0 && tox < m_cfg.min_d) tox = m_cfg.min_d; |
|
|
if (m_cfg.min_d != 0 && tox < m_cfg.min_d) tox = m_cfg.min_d; |
|
|
if (m_cfg.max_d != 0 && tox > m_cfg.max_d) tox = m_cfg.max_d; |
|
|
if (m_cfg.max_d != 0 && tox > m_cfg.max_d) tox = m_cfg.max_d; |
|
|
m_thread.stop(); |
|
|
m_thread.stop(); |
|
|
|
|
|
creg.module_status = 1; |
|
|
m_thread.start( |
|
|
m_thread.start( |
|
|
[this, tox]() { |
|
|
[this, tox]() { |
|
|
befor_motor_move(); |
|
|
befor_motor_move(); |
|
@ -589,6 +592,7 @@ int32_t StepMotorCtrlModule::do_step_motor_easy_move_by(int32_t distance) { |
|
|
|
|
|
|
|
|
int32_t StepMotorCtrlModule::do_step_motor_easy_move_to_zero() { |
|
|
int32_t StepMotorCtrlModule::do_step_motor_easy_move_to_zero() { |
|
|
m_thread.stop(); |
|
|
m_thread.stop(); |
|
|
|
|
|
creg.module_status = 1; |
|
|
m_thread.start( |
|
|
m_thread.start( |
|
|
[this]() { |
|
|
[this]() { |
|
|
befor_motor_move(); |
|
|
befor_motor_move(); |
|
@ -609,6 +613,7 @@ int32_t StepMotorCtrlModule::do_step_motor_easy_move_to_io(int32_t ioindex, int3 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
m_thread.stop(); |
|
|
m_thread.stop(); |
|
|
|
|
|
creg.module_status = 1; |
|
|
m_thread.start( |
|
|
m_thread.start( |
|
|
[this, ioindex, direction]() { |
|
|
[this, ioindex, direction]() { |
|
|
befor_motor_move(); |
|
|
befor_motor_move(); |
|
|