On 06/19/2012 02:00 PM, andy pugh wrote:
> Someone on the forum is in the habit of editing the G-code file on a
> separate PC, then moving back to the machine. He wanted a way to press
> a hardware button to reload the file.
> I made the following changes to Axis. Does this seem reasonable, or
> should it be done somewhere less Axis-specific?
> I know next-to-nothing about Python, so didn't want to push this
> without discussion.
>
> 0001-Add-a-file-reload-pin-to-Axis.patch
> andypugh@DN2800:~/linuxcnc-dev/src$ cat
> 0001-Add-a-file-reload-pin-to-Axis.patch
> > From 09ed716a4ed60ba97b3bf3d9fe6eb8f3acb72e72 Mon Sep 17 00:00:00 2001
> From: Andy Pugh<[email protected]>
> Date: Tue, 19 Jun 2012 21:29:52 +0100
> Subject: [PATCH] Add a file-reload pin to Axis
>
> Signed-off-by: Andy Pugh<[email protected]>
> ---
>   src/emc/usr_intf/axis/scripts/axis.py |    7 +++++++
>   1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/src/emc/usr_intf/axis/scripts/axis.py
> b/src/emc/usr_intf/axis/scripts/axis.py
> index 10aa086..e011a7f 100755
> --- a/src/emc/usr_intf/axis/scripts/axis.py
> +++ b/src/emc/usr_intf/axis/scripts/axis.py
> @@ -671,6 +671,7 @@ class LivePlotter:
>           self.notifications_clear = False
>           self.notifications_clear_info = False
>           self.notifications_clear_error = False
> +        self.reload_pin = False
>
>       def start(self):
>           if self.running.get(): return
> @@ -793,6 +794,11 @@ class LivePlotter:
>                    self.notifications_clear_error = notifications_clear_error
>                    if self.notifications_clear_error:
>                        notifications.clear("error")
> +            reload_pin = comp["reload"]
> +            if self.reload_pin != reload_pin:
> +                 self.reload_pin = reload_pin
> +                 if self.reload_pin:
> +                     commands.reload_file()
>           vupdate(vars.task_mode, self.stat.task_mode)
>           vupdate(vars.task_state, self.stat.task_state)
>           vupdate(vars.task_paused, self.stat.task_paused)
> @@ -3067,6 +3073,7 @@ if hal_present == 1 :
>       comp.newpin("notifications-clear",hal.HAL_BIT,hal.HAL_IN)
>       comp.newpin("notifications-clear-info",hal.HAL_BIT,hal.HAL_IN)
>       comp.newpin("notifications-clear-error",hal.HAL_BIT,hal.HAL_IN)
> +    comp.newpin("reload",hal.HAL_BIT,hal.HAL_IN)
>       vars.has_ladder.set(hal.component_exists('classicladder_rt'))
>
>       if vcp:
IIRC on TkEmc there is a reset button that does just that. 
Unfortunately, I'm on my 2.5 machine where most of the sim stuff is 
broken. :-(
So can't verify my memory.

Dave


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to