Merge 2.8 to master (inhibit task mode set if jogging)

This commit is contained in:
Dewey Garrett 2022-05-27 20:13:19 -07:00
commit 0b5f57d6fa
7 changed files with 26 additions and 1 deletions

View file

@ -275,6 +275,16 @@ void emcmotController(void *arg, long period)
prototypes"
*/
static bool joint_jog_is_active(void) {
int jno;
for (jno = 0; jno < EMCMOT_MAX_AXIS; jno++) {
if ( (&joints[jno])->kb_jjog_active || (&joints[jno])->wheel_jjog_active) {
return 1;
}
}
return 0;
}
static void handle_kinematicsSwitch(void) {
int joint_num;
int hal_switchkins_type = 0;
@ -2114,6 +2124,8 @@ static void update_status(void)
emcmotStatus->motionType = tpGetMotionType(&emcmotInternal->coord_tp);
emcmotStatus->queueFull = tcqFull(&emcmotInternal->coord_tp.queue);
emcmotStatus->jogging_active = axis_jog_is_active()
|| joint_jog_is_active();
/* check to see if we should pause in order to implement
single emcmotStatus->stepping */

View file

@ -656,6 +656,7 @@ Suggestion: Split this in to an Error and a Status flag register..
EmcPose eoffset_pose;
int numExtraJoints;
int stepping;
bool jogging_active;
} emcmot_status_t;
/*********************************

View file

@ -1232,6 +1232,7 @@ class EMC_MOTION_STAT:public EMC_MOTION_STAT_MSG {
int external_offsets_applied;
EmcPose eoffset_pose;
int numExtraJoints;
bool jogging_active;
};
// declarations for EMC_TASK classes

View file

@ -269,6 +269,11 @@ int emcTaskSetMode(int mode)
{
int retval = 0;
if (jogging_is_active()) {
emcOperatorError(0, "Ignoring task mode change while jogging");
return 0;
}
switch (mode) {
case EMC_TASK_MODE_MANUAL:
// go to manual mode

View file

@ -152,6 +152,10 @@ int all_homed(void) {
return 1;
}
bool jogging_is_active(void) {
return emcStatus->motion.jogging_active;
}
void emctask_quit(int sig)
{
// set main's done flag

View file

@ -27,6 +27,7 @@ extern int emcRunHalFiles(const char *filename);
// Returns 0 if all joints are homed, 1 if any joints are un-homed.
int all_homed(void);
bool jogging_is_active(void);
int emcTaskInit();
int emcTaskHalt();

View file

@ -2060,7 +2060,8 @@ int emcMotionUpdate(EMC_MOTION_STAT * stat)
stat->misc_error[num_error] = emcmotStatus.misc_error[num_error];
}
stat->numExtraJoints=emcmotStatus.numExtraJoints;
stat->jogging_active = emcmotStatus.jogging_active;
stat->numExtraJoints = emcmotStatus.numExtraJoints;
// set the status flag
error = 0;