Skip to content

Commit

Permalink
halui: switch to Manual when the user requests jog
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
SebKuzminsky committed Nov 29, 2013
1 parent b22f83b commit 46557dc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/emc/usr_intf/halui.cc
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 46557dc

Please sign in to comment.