Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From bda04772753a6410a8c6c2832fb8ade483460ea0 Mon Sep 17 00:00:00 2001
- From: Jason Penn <jpenn@tormach.com>
- Date: Wed, 22 Oct 2014 17:14:13 -0500
- Subject: [PATCH] Added missing hooks for unloading gcode NML call.
- ---
- src/emc/task/emctaskmain.cc | 15 +++++++++++++++
- src/emc/usr_intf/axis/extensions/emcmodule.cc | 15 +++++++++++++++
- 2 files changed, 30 insertions(+)
- diff --git a/src/emc/task/emctaskmain.cc b/src/emc/task/emctaskmain.cc
- index b880c35..ff5efe2 100644
- --- a/src/emc/task/emctaskmain.cc
- +++ b/src/emc/task/emctaskmain.cc
- @@ -857,6 +857,7 @@ static int emcTaskPlan(void)
- case EMC_TASK_SET_STATE_TYPE:
- case EMC_TASK_PLAN_INIT_TYPE:
- case EMC_TASK_PLAN_OPEN_TYPE:
- + case EMC_TASK_PLAN_CLOSE_TYPE:
- case EMC_TASK_PLAN_SET_OPTIONAL_STOP_TYPE:
- case EMC_TASK_PLAN_SET_BLOCK_DELETE_TYPE:
- case EMC_TASK_ABORT_TYPE:
- @@ -1076,6 +1077,7 @@ static int emcTaskPlan(void)
- case EMC_TASK_ABORT_TYPE:
- case EMC_TASK_PLAN_INIT_TYPE:
- case EMC_TASK_PLAN_OPEN_TYPE:
- + case EMC_TASK_PLAN_CLOSE_TYPE:
- case EMC_TASK_PLAN_RUN_TYPE:
- case EMC_TASK_PLAN_EXECUTE_TYPE:
- case EMC_TASK_PLAN_PAUSE_TYPE:
- @@ -1407,6 +1409,7 @@ static int emcTaskPlan(void)
- case EMC_TASK_SET_STATE_TYPE:
- case EMC_TASK_PLAN_INIT_TYPE:
- case EMC_TASK_PLAN_OPEN_TYPE:
- + case EMC_TASK_PLAN_CLOSE_TYPE:
- case EMC_TASK_PLAN_PAUSE_TYPE:
- case EMC_TASK_PLAN_SET_OPTIONAL_STOP_TYPE:
- case EMC_TASK_PLAN_SET_BLOCK_DELETE_TYPE:
- @@ -2194,6 +2197,18 @@ static int emcTaskIssueCommand(NMLmsg * cmd)
- }
- break;
- + case EMC_TASK_PLAN_CLOSE_TYPE:
- + //close_msg = (EMC_TASK_PLAN_CLOSE *) cmd;
- + retval = emcTaskPlanClose();
- + if (retval > INTERP_MIN_ERROR) {
- + retval = -1;
- + }
- + retval = emcTaskPlanInit();
- + if (retval > INTERP_MIN_ERROR) {
- + retval = -1;
- + }
- + break;
- +
- case EMC_TASK_PLAN_EXECUTE_TYPE:
- stepping = 0;
- steppingWait = 0;
- diff --git a/src/emc/usr_intf/axis/extensions/emcmodule.cc b/src/emc/usr_intf/axis/extensions/emcmodule.cc
- index b42f78a..8a62769 100644
- --- a/src/emc/usr_intf/axis/extensions/emcmodule.cc
- +++ b/src/emc/usr_intf/axis/extensions/emcmodule.cc
- @@ -1172,6 +1172,20 @@ static PyObject *program_open(pyCommandChannel *s, PyObject *o) {
- return Py_None;
- }
- +static PyObject *program_close(pyCommandChannel *s, PyObject *o) {
- + EMC_TASK_PLAN_CLOSE m;
- + char *file;
- + int len;
- +
- + //if(!PyArg_ParseTuple(o, "s#", &file, &len)) return NULL;
- + m.serial_number = next_serial(s);
- + //strcpy(m.file, file);
- + s->c->write(m);
- + emcWaitCommandReceived(s->serial, s->s);
- + Py_INCREF(Py_None);
- + return Py_None;
- +}
- +
- static PyObject *emcauto(pyCommandChannel *s, PyObject *o) {
- int fn;
- EMC_TASK_PLAN_RUN run;
- @@ -1449,6 +1463,7 @@ static PyMethodDef Command_methods[] = {
- {"set_analog_output", (PyCFunction)set_analog_output, METH_VARARGS},
- {"set_homing_params", (PyCFunction)set_homing_params, METH_VARARGS},
- {"set_axis_max_velocity", (PyCFunction)set_axis_max_velocity, METH_VARARGS},
- + {"program_close", (PyCFunction)program_close, METH_NOARGS},
- {NULL}
- };
- --
- 1.9.2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement