From 3ff04012ff74c91f8fbe849f88a717693fcf6426 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Tue, 20 Jun 2023 09:24:33 +0800 Subject: [PATCH] update --- src/service/a8000_scirpt_processer.cpp | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/service/a8000_scirpt_processer.cpp b/src/service/a8000_scirpt_processer.cpp index 4a922ad..603e2b8 100644 --- a/src/service/a8000_scirpt_processer.cpp +++ b/src/service/a8000_scirpt_processer.cpp @@ -139,6 +139,7 @@ void A8000ScriptProcesser::step_motor_move_by(shared_ptr context, int32_t targetStepMotorId) { A8000ScriptProcesser::CtrlPointConfig cpcfg = getStepMotorConfig(targetStepMotorId, SAMC_REG_ACT_RUN_TO_HOME); writeReg(cpcfg.m_deviceId, cpcfg.m_ctrlPointId, 0, context); @@ -164,6 +165,7 @@ void A8000ScriptProcesser::step_motor_wait_for_idle(shared_ptrinfo("step_motor({}) wait_for_idle:{}", targetStepMotorId, state); } } @@ -205,7 +207,7 @@ void A8000ScriptProcesser::tube_rotate_zero(shared_ptr #define CHECK_CMD_PARAMETER(expectParaNum) \ if (cmdandvar.size() - 1 != expectParaNum) { \ - context->printfInfo = fmt::format("error:do {} error,parameter num error", cmd, cmdandvar.size()); \ + context->printfInfo = fmt::format("error:do {} error,parameter num error,{}", cmd, cmdandvar.size()); \ logger->error("{}", context->printfInfo); \ return; \ } @@ -236,38 +238,33 @@ void A8000ScriptProcesser::docmd(shared_ptr context) { int32_t direction = atoi(context->cmd_and_var[2].c_str()); step_motor_rotate(context, motorId, direction); } else if (cmd == "step_motor_move_to") { - // stepMotorRotate motorId direction CHECK_CMD_PARAMETER(2); step_motor_move_to(context, context->getvarInt(1), context->getvarInt(2)); } else if (cmd == "step_motor_move_by") { - // stepMotorRotate motorId direction CHECK_CMD_PARAMETER(2); step_motor_move_by(context, context->getvarInt(1), context->getvarInt(2)); } else if (cmd == "step_motor_move_to_zero") { - // stepMotorRotate motorId direction CHECK_CMD_PARAMETER(1); step_motor_move_to_zero(context, context->getvarInt(1)); } else if (cmd == "step_motor_read_pos") { - // stepMotorRotate motorId direction - CHECK_CMD_PARAMETER(2); + CHECK_CMD_PARAMETER(1); int32_t retval = 0; step_motor_read_pos(context, context->getvarInt(1), retval); } else if (cmd == "step_motor_read_state") { - // stepMotorRotate motorId direction - CHECK_CMD_PARAMETER(2); + CHECK_CMD_PARAMETER(1); int32_t retval = 0; step_motor_read_state(context, context->getvarInt(1), retval); } else if (cmd == "step_motor_is_idle") { - // stepMotorRotate motorId direction - CHECK_CMD_PARAMETER(2); + CHECK_CMD_PARAMETER(1); int32_t retval = 0; step_motor_is_idle(context, context->getvarInt(1), retval); } else if (cmd == "step_motor_stop") { - // stepMotorRotate motorId direction - CHECK_CMD_PARAMETER(2); + CHECK_CMD_PARAMETER(1); step_motor_stop(context, context->getvarInt(1)); + } else if (cmd == "step_motor_wait_for_idle") { + CHECK_CMD_PARAMETER(1); + step_motor_wait_for_idle(context, context->getvarInt(1)); } - else if (cmd == "duoji_move_to") { CHECK_CMD_PARAMETER(2); duoji_move_to(context, context->getvarInt(1), context->getvarInt(2)); @@ -275,7 +272,7 @@ void A8000ScriptProcesser::docmd(shared_ptr context) { CHECK_CMD_PARAMETER(1); duoji_stop(context, context->getvarInt(1)); } else if (cmd == "duoji_is_idle") { - CHECK_CMD_PARAMETER(2); + CHECK_CMD_PARAMETER(1); int32_t retval = 0; duoji_is_idle(context, context->getvarInt(1), retval); } else if (cmd == "tube_rotate") {