From 46557dc6245fd685a6d44d37d21f8b1458ff28d0 Mon Sep 17 00:00:00 2001 From: Sebastian Kuzminsky Date: Tue, 26 Nov 2013 12:02:43 -0700 Subject: [PATCH] halui: switch to Manual when the user requests jog halui used to just disallow jogging when the controller was not in Manual mode. Now it switches to Manual mode just in time, as needed. --- src/emc/usr_intf/halui.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/emc/usr_intf/halui.cc b/src/emc/usr_intf/halui.cc index a598a76d987..d0272e54d89 100644 --- a/src/emc/usr_intf/halui.cc +++ b/src/emc/usr_intf/halui.cc @@ -1386,13 +1386,16 @@ static int sendJogCont(int axis, double speed) EMC_AXIS_JOG emc_axis_jog_msg; EMC_TRAJ_SET_TELEOP_VECTOR emc_set_teleop_vector; - if ((emcStatus->task.state != EMC_TASK_STATE_ON) || (emcStatus->task.mode != EMC_TASK_MODE_MANUAL)) + if (emcStatus->task.state != EMC_TASK_STATE_ON) { return -1; + } if (axis < 0 || axis >= EMC_AXIS_MAX) { return -1; } + sendManual(); + if (emcStatus->motion.traj.mode != EMC_TRAJ_MODE_TELEOP) { emc_axis_jog_msg.serial_number = ++emcCommandSerialNumber; emc_axis_jog_msg.axis = axis; @@ -1433,12 +1436,15 @@ static int sendJogInc(int axis, double speed, double inc) { EMC_AXIS_INCR_JOG emc_axis_jog_msg; - if ((emcStatus->task.state != EMC_TASK_STATE_ON) || (emcStatus->task.mode != EMC_TASK_MODE_MANUAL)) + if (emcStatus->task.state != EMC_TASK_STATE_ON) { return -1; + } if (axis < 0 || axis >= EMC_AXIS_MAX) return -1; + sendManual(); + if (emcStatus->motion.traj.mode == EMC_TRAJ_MODE_TELEOP) return -1;