Hello Guest it is March 28, 2024, 02:34:34 PM

Author Topic: Jogging/Pendant Interface-What is the best way? Ramblings  (Read 39472 times)

0 Members and 1 Guest are viewing this topic.

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #100 on: June 18, 2015, 04:17:40 AM »
sounds good tim when you get it working you may be able to supply pendents to go with your code just a idea

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #101 on: June 18, 2015, 09:44:59 AM »
That sounds awesome Tim! You guys are doing great!  :)

Brett
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #102 on: June 18, 2015, 03:31:39 PM »
thats one good thing about M4 just some switches and a bit of Lua code and you have a mpg or just a signal table

Offline TimGS

*
  •  108 108
    • View Profile
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #103 on: June 18, 2015, 04:51:57 PM »
...Don't forget the bit of work learning Lua if you don't know it already.  ;D

I am working on cleaning up the code; then I will post it.  (I created some bugs when I cleaned up; so I have to do a little troubleshooting later tonight)

There is a signal script,  a Lua Panel script and image files that make it all happen.  I will keep you posted

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #104 on: June 18, 2015, 05:03:13 PM »
get there with learning lua, you are ahead of me to many other things to learn 3D cad. I am testing the tool height probing today hopefully nothing will get broken

Offline TimGS

*
  •  108 108
    • View Profile
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #105 on: June 19, 2015, 12:06:42 PM »
This is the latest version....Sorry, I don't detect the MPG motion yet...nor do I scale images or radio boxes...but neither does Mach4 ;D

You will need to add some switches and ensure that you copy the signal script.

Summary of Software Architecture...
The Screen Load script detects the changes in the switch settings and makes changes to the Mach4 core software settings (MPG Axis, Jog Increment settings)

The MaintTab JogTab Lua Panel Script populates the Lua Panel with the Images and RadioBoxes.  This script is called by a timer event every ~200mSec and calls a panel refresh.  The refresh calls the onPaint function which updates the images based upon what the Mach4 core software settings are.  If you use the RadioBoxes the images will be updated based upon the settings in Mach4 core software.  Note if you modify this script and pieces disappear or are jumbled you did something wrong :D...I did so many times.
The MaintTab JogTab Lua Panel Script gets copied to a Lua Panel script
   --Add a MainTab Tab to the screen
   --Insert and scale a Lua Panel
   --Update the Lua Panel script with the MaintTab JogTab Lua Panel Script

This Software is provided without warranty.  :D  Goodluck

Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #106 on: June 19, 2015, 04:17:48 PM »
That it so cool Tim!  Thanx for sharing! I'm definitely gonna learn something from studying this  :)

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #107 on: June 19, 2015, 05:38:12 PM »
Thanks Tim, that's awesome!  :)

Brett
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #108 on: June 20, 2015, 12:48:25 AM »
This is the latest version....Sorry, I don't detect the MPG motion yet . . .

  . . . This script is called by a timer event every ~200mSec and calls a panel refresh.     --Insert and scale a Lua Panel
   --Update the Lua Panel script with the MaintTab JogTab Lua Panel Script


TimGS,

Sorry I have not had time to follow your progress on this project. I was going to suggest you take a look at a sample 'mouse jogging' setup provided some time ago by Brian Barker and is floating around the forum. This sample uses the MPG functions and also is useful to review the difference in a floating wideget and one in a Lua frame both from the same code.

However, it seems you have had success in figuring this process out for yourself. Bravo! I have read the posts and noted that you are methodical in your approach and eat the elephant a bite at a time. This is a good model for readers to follow.

I have downloaded your code, but have not had time to peruse it. However, based on your description I do have two directions you may want to investigate.

First is to use signals rather than polling. 'Signals' in M4 seem analogous to interrupts and would be a better way to collect data from your hardware. Using this process prevents missed data and also eliminates the tremendous resource hog that polling will induce.

Second, although integrating a widget into an M4 screen is a great exercise in learning both M4 and Lua and wxLua, I don't think this is always the best approach for every application. Consider the advantages of a floating on-demand anytime jog window. For an on-demand anytime process like Jogging, why cripple the utility of it by chaining it to a specific screen or tab whereby other functions are now inaccessible?





Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #109 on: June 20, 2015, 12:55:39 AM »
stick it in the bottom bit then you can use of it from every screen just change yours for the jogging page when you have it at 100%

 >:D :'(
« Last Edit: June 20, 2015, 12:58:31 AM by daniellyall »