---
.. this will ultimately be needed for mah's work on jog-while-paused.

This change probably needs to be tweaked or at least tested further before
it's pushed on top of that branch.  However, for those wishing to test the
branch with the AXIS user interface it might be good enough to start with.

 share/axis/tcl/axis.tcl               | 43 ++++++++++++++++++++++++-----------
 src/emc/usr_intf/axis/scripts/axis.py | 16 +++++++++----
 2 files changed, 41 insertions(+), 18 deletions(-)

diff --git a/share/axis/tcl/axis.tcl b/share/axis/tcl/axis.tcl
index d79354f..07c5afa 100644
--- a/share/axis/tcl/axis.tcl
+++ b/share/axis/tcl/axis.tcl
@@ -1880,10 +1880,11 @@ set INTERP_WAITING 4
 set TRAJ_MODE_FREE 1
 set KINEMATICS_IDENTITY 1
 
-set manual [concat [winfo children $_tabs_manual.axes] \
-    $_tabs_manual.jogf.zerohome.home \
+set jog [concat [winfo children $_tabs_manual.axes] \
     $_tabs_manual.jogf.jog.jogminus \
-    $_tabs_manual.jogf.jog.jogplus \
+    $_tabs_manual.jogf.jog.jogplus]
+set manual [list \
+    $_tabs_manual.jogf.zerohome.home \
     $_tabs_manual.spindlef.cw $_tabs_manual.spindlef.ccw \
     $_tabs_manual.spindlef.stop $_tabs_manual.spindlef.brake \
     $_tabs_manual.flood $_tabs_manual.mist $_tabs_mdi.command \
@@ -2003,28 +2004,44 @@ proc update_state {args} {
 
     if {$::task_state == $::STATE_ON} {
        if {$::interp_state == $::INTERP_IDLE} {
+puts a
            if {$::last_interp_state != $::INTERP_IDLE || $::last_task_state != 
$::task_state} {
                set_mode_from_tab
            }
            enable_group $::manual
-       }
-       if {$::queued_mdi_commands < $::max_queued_mdi_commands } {
+           enable_group $::jog
+           set ::enable_jog 1
+       } elseif {$::interp_state == $::INTERP_PAUSED} {
+puts b
+           enable_group $::jog
+           disable_group $::manual
+           set ::enable_jog 1
+       } elseif {$::task_mode == $::TASK_MODE_MDI && $::queued_mdi_commands == 
0} {
+puts c
+           enable_group $::jog
+           enable_group $::manual
+           set ::enable_jog 1
+       } elseif {$::task_mode == $::TASK_MODE_MDI && $::queued_mdi_commands < 
$::max_queued_mdi_commands } {
+puts d
+           disable_group $::jog
            enable_group $::manual
+           set ::enable_jog 0
        } else {
+puts e
+           disable_group $::jog
            disable_group $::manual
+           set ::enable_jog 0
        }
     } else {
+puts f
         disable_group $::manual
+        disable_group $::jog
+       set ::enable_jog 0
     }
 
-    if {$::task_state == $::STATE_ON && $::interp_state == $::INTERP_IDLE &&
-        ($::motion_mode == $::TRAJ_MODE_FREE
-            || $::kinematics_type == $::KINEMATICS_IDENTITY)} {
-        $::_tabs_manual.jogf.jog.jogincr configure -state normal
-    } else {
-        $::_tabs_manual.jogf.jog.jogincr configure -state disabled
-    }
-
+    state {$enable_jog && ($::motion_mode == $::TRAJ_MODE_FREE
+                || $::kinematics_type == $::KINEMATICS_IDENTITY)} \
+       $::_tabs_manual.jogf.jog.jogincr 
     if {$::task_state == $::STATE_ON && $::interp_state == $::INTERP_IDLE &&
         ($::motion_mode != $::TRAJ_MODE_FREE
             || $::kinematics_type == $::KINEMATICS_IDENTITY)} {
diff --git a/src/emc/usr_intf/axis/scripts/axis.py 
b/src/emc/usr_intf/axis/scripts/axis.py
index 49b850e..da74e5f 100755
--- a/src/emc/usr_intf/axis/scripts/axis.py
+++ b/src/emc/usr_intf/axis/scripts/axis.py
@@ -852,6 +852,11 @@ def manual_tab_visible():
     page = root_window.tk.call(widgets.tabs, "raise")
     return page == "manual"
 
+def jog_ok(do_poll=True):
+    if do_poll: s.poll()
+    if s.task_state != linuxcnc.STATE_ON: return False
+    return s.interp_state in (linuxcnc.INTERP_IDLE, linuxcnc.INTERP_PAUSED)
+
 def manual_ok(do_poll=True):
     """warning: deceptive function name.
 
@@ -2574,7 +2579,7 @@ def set_feedrate(n):
 
 def activate_axis_or_set_feedrate(n):
     # XXX: axis_mask does not apply if in joint mode
-    if manual_ok() and s.axis_mask & (1<<n):
+    if jog_ok() and s.axis_mask & (1<<n):
         activate_axis(n)
     else:
         set_feedrate(10*n)
@@ -2686,9 +2691,10 @@ except IOError:
 
 
 def jog(*args):
-    if not manual_ok(): return
+    if not jog_ok(): return
     if not manual_tab_visible(): return
-    ensure_mode(linuxcnc.MODE_MANUAL)
+    if s.interp_state != linuxcnc.INTERP_PAUSED:
+       ensure_mode(linuxcnc.MODE_MANUAL)
     c.jog(*args)
 
 # XXX correct for machines with more than six axes
@@ -2696,7 +2702,7 @@ jog_after = [None] * 9
 jog_cont  = [False] * 9
 jogging   = [0] * 9
 def jog_on(a, b):
-    if not manual_ok(): return
+    if not jog_ok(): return
     if not manual_tab_visible(): return
     if isinstance(a, (str, unicode)):
         a = "xyzabcuvw".index(a)
@@ -2732,7 +2738,7 @@ def jog_off(a):
     jog_after[a] = root_window.after_idle(lambda: jog_off_actual(a))
 
 def jog_off_actual(a):
-    if not manual_ok(): return
+    if not jog_ok(): return
     activate_axis(a)
     jog_after[a] = None
     jogging[a] = 0
-- 
1.8.4.rc3

On Sun, Oct 06, 2013 at 08:34:31PM +0200, Michael Haberler wrote:
> Keyboard jogging during pause now works: http://youtu.be/HNuu_D4X_EM
> 
> The HAL jogging pins are removed since not needed anymore. Hitting resume 
> inserts the return move at the last jog speed.
> 
> Integration is pending some work on the underlying joints_axes3 branch. This 
> is not in enduser-usable shape, also pending changes to UI's to support 
> jog-while-paused.
> 
> I will add wheel jogging once this is supported in teleop mode in 
> joints_axes3; this is currently missing.
> 
> - Michael
> 
> 
> Am 26.09.2013 um 23:20 schrieb Michael Haberler <mai...@mah.priv.at>:
> 
> > Marius, Tom -
> > 
> > Am 26.09.2013 um 21:08 schrieb Marius Liebenberg <mar...@mastercut.co.za>:
> > 
> >> TomP
> >> I second that. I put it on the agenda for the next meeting. I do agree 
> >> that it is very necessary and not just a nice to have. Damn man even 
> >> Mach can do it :)
> >> 
> >> On 2013/09/26 08:10 PM, TJoseph Powderly wrote:
> >>> On 09/26/2013 01:06 PM, TJoseph Powderly wrote:
> >>>> Hello,
> >>>> Would like to discuss adoption of JogWhilePaused at Next meeting.
> >>> ...
> >>>> Thanks
> >>>> TomP ( tjtr33)
> >>> More discussion is linked thru "GladeVCP Toolchange" tag
> >>> 
> >>> http://www.linuxcnc.org/index.php/english/forum/48-gladevcp/24816-gladevcp-toolchange-by-michael-h?start=10
> >>> 
> >>> regards TomP (tjtr33)
> > 
> > We had a very fruitful discussion on irc just finished, starting around 
> > here: http://emc.mah.priv.at/irc/%23linuxcnc-devel/2013-09-26.html#19:13:57
> > 
> > in a nutshell:
> > 
> > - my patch is currently limited in scope, for instance it doesnt integrate 
> > with wheel or command jogs at all at the moment
> > - some ideas in there might be interesting in exploring further in the 
> > future
> > - the upcoming merge of the ja3 branch will touch upon that very area
> > 
> > in the interest of delivering tangible results in the 2.6 timeframe, Chris 
> > and me agreed to proceed like so:
> > 
> > - rebase this branch onto ja3 while keeping it working
> > - integrate with wheel jog so this works during pause (world mode)
> > - provide the command infrastructure so commanded jogs from UI's can be 
> > honored
> > - changing offsets or tool diameter will NOT be part of the release 
> > targeted work - this is just too many moving parts to be realistic to 
> > expect.
> > - changing all UI's to use the new feature may not be realistic to expect 
> > either - only few UI's might be adapted until release time.
> > 
> > 
> > - Michael
> > 
> > 
> > ps: I was away a few days and am still wading the backlog
> > 
> >>> ------------------------------------------------------------------------------
> >>> October Webinars: Code for Performance
> >>> Free Intel webinars can help you accelerate application performance.
> >>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most 
> >>> from
> >>> the latest Intel processors and coprocessors. See abstracts and register >
> >>> http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
> >>> _______________________________________________
> >>> Emc-users mailing list
> >>> Emc-users@lists.sourceforge.net
> >>> https://lists.sourceforge.net/lists/listinfo/emc-users
> >>> 
> >> 
> >> -- 
> >> Regards / Groete
> >> 
> >> Marius D. Liebenberg
> >> MasterCut cc
> >> Cel: +27 82 698 3251
> >> Tel: +27 12 743 6064
> >> Fax: +27 86 551 8029
> >> Skype: marius_d.liebenberg
> >> 
> >> 
> >> 
> >> ---
> >> avast! Antivirus: Outbound message clean.
> >> Virus Database (VPS): 130926-0, 2013/09/26
> >> Tested on: 2013/09/26 09:08:41 PM
> >> avast! - copyright (c) 1988-2013 AVAST Software.
> >> http://www.avast.com
> >> 
> >> 
> >> ------------------------------------------------------------------------------
> >> October Webinars: Code for Performance
> >> Free Intel webinars can help you accelerate application performance.
> >> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most 
> >> from 
> >> the latest Intel processors and coprocessors. See abstracts and register >
> >> http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
> >> _______________________________________________
> >> Emc-users mailing list
> >> Emc-users@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/emc-users
> > 
> > 
> > ------------------------------------------------------------------------------
> > October Webinars: Code for Performance
> > Free Intel webinars can help you accelerate application performance.
> > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most 
> > from 
> > the latest Intel processors and coprocessors. See abstracts and register >
> > http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
> > _______________________________________________
> > Emc-users mailing list
> > Emc-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/emc-users
> 
> 
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
> _______________________________________________
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users
> 

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to