From: Chris M. <gi...@gi...> - 2013-03-31 06:22:59
|
gscreen -add a touchoff method to MDI command file http://git.linuxcnc.org/?p=linuxcnc.git;a=commitdiff;h=95bcb25 --- src/emc/usr_intf/gscreen/mdi.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/emc/usr_intf/gscreen/mdi.py b/src/emc/usr_intf/gscreen/mdi.py index 081b1dc..19afd1c 100644 --- a/src/emc/usr_intf/gscreen/mdi.py +++ b/src/emc/usr_intf/gscreen/mdi.py @@ -148,6 +148,16 @@ class mdi: self.emccommand.wait_complete() self.emccommand.mdi(m) + def set_tool_touchoff(self,tool,axis,value): + m = "G10 L10 P%d %s%f"%(tool,axis,value) + self.emcstat.poll() + if self.emcstat.task_mode != self.emc.MODE_MDI: + self.emccommand.mode(self.emc.MODE_MDI) + self.emccommand.wait_complete() + self.emccommand.mdi(m) + self.emccommand.wait_complete() + self.emccommand.mdi("g43") + def set_axis_origin(self,axis,value): m = "G10 L20 P0 %s%f"%(axis,value) self.emcstat.poll() @@ -229,6 +239,12 @@ class mdi_control: self.mdi.emccommand.mode(premode) self.mdi.emccommand.wait_complete() + def touchoff(self,tool,axis,value): + premode = self.mdi.emcstat.task_mode + self.mdi.set_tool_touchoff(tool,axis,value) + self.mdi.emccommand.mode(premode) + self.mdi.emccommand.wait_complete() + def set_spindle_speed(self,value): self.mdi.set_spindle_speed(value) |