>Quoth [email protected] (Russell Brown) > >Can anyone point me in the right direction to adding a current mode (mdi >or manual) output pin to axis? I can't see anywhere in the code where a >pin could be set to reflect the current mode.
OK I figured out the convoluted Python/Tk syntax and got it working. Here's a patch to create an axisui.manual.mode pin that can be used as an input to toggle2nist BTW is this the best way of sending such things for consideration ? and who decides if it's going to get included? >From bb3641919bcf39cacc0a7a2ea3b7dc3a6b15fdf3 Mon Sep 17 00:00:00 2001 From: RussellBrown <[email protected]> Date: Tue, 26 Nov 2013 10:29:05 +0000 Subject: [PATCH 2/2] Added a new pin axisui.manual.mode to reflect the current tab in axis. This was added to allow the use of toggle2nist logic (which requires a current status pin) to provide a toggle button on my pendant to toggle axis between manual and MDI mode when jogging and calling a mdi based z-axis touchoff routine. --- src/emc/usr_intf/axis/scripts/axis.py | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/src/emc/usr_intf/axis/scripts/axis.py b/src/emc/usr_intf/axis/scripts/axis.py index 8403c28..82457aa 100755 --- a/src/emc/usr_intf/axis/scripts/axis.py +++ b/src/emc/usr_intf/axis/scripts/axis.py @@ -2855,6 +2855,13 @@ else: root_window.tk.eval(u"${pane_top}.ajogspeed.l1 configure -text deg/min") homing_order_defined = inifile.find("AXIS_0", "HOME_SEQUENCE") is not None +def set_mode_hal_pin(val): + comp['manual.mode'] = val + +if hal_present == 1 : + widgets.tabs.itemconfigure("mdi",raisecmd=lambda: set_mode_hal_pin(False)) + widgets.tabs.itemconfigure("manual",raisecmd=lambda: set_mode_hal_pin(True)) + if homing_order_defined: widgets.homebutton.configure(text=_("Home All"), command="home_all_axes") root_window.tk.call("DynamicHelp::add", widgets.homebutton, @@ -3101,6 +3108,7 @@ if hal_present == 1 : comp.newpin("jog.increment", hal.HAL_FLOAT, hal.HAL_OUT) comp.newpin("set-manual-mode",hal.HAL_BIT,hal.HAL_IN) comp.newpin("set-mdi-mode",hal.HAL_BIT,hal.HAL_IN) + comp.newpin("manual.mode",hal.HAL_BIT,hal.HAL_OUT) 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) -- 1.7.0.4 -- Regards, Russell -------------------------------------------------------------------- | Russell Brown | MAIL: [email protected] PHONE: 01780 471800 | | Lady Lodge Systems | WWW Work: http://www.lls.com | | Peterborough, England | WWW Play: http://www.ruffle.me.uk | -------------------------------------------------------------------- ------------------------------------------------------------------------------ Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk _______________________________________________ Emc-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-developers
