Playing around with Pathpilot GUI

17 Jan 2017 04:19 #85890 by smgvbest
Spent some time learning how the gui works and I am getting a better idea so I made some minor changes to it

I changed the led for the Door, I'm color blind and can not tell the difference between the yellow and green led so I made it green and black, That was first change.
I added a second colum for Flood, Mist, Collet, estop and external lighting. (flood is working)
I also change the label on the HOME to indicate when it is homing and added individual leds for X+/- and z+/- also working
so when HOMING the HOME LED comes on, then when it trips the limit switching the one that is hit is lit up.
Finally changed USBIO labels to 7i76 since thats my source of I/Os
oh, and made the version number a bit larger and i'm doing this to the V1.9.8 Version
I have more work to do but it's fun learning the gui and python

I want to add a Lighting Button on the main page but there really isn't room for one. I could add it to the Settings page but that makes no sense really.

Anyway, thought I would share my adventure in GUI editing.

Oh, since technically pathpilot is opensource, I should be able to share when done, I'm leaving comments in the code so mark what i've changed

also, i had to move the limit switch stuff to the postgui because I couldn't figure out how to use a signal inside the GUI. does anyone know if you can use a signal inside the gui or are you limited to HAL PINS?
17 Jan 2017 08:39 #85896 by racedirector
Nice, well done! I have been dying to make the offset number more visible, switching from G54 to G55 etc has caught me out a few too many times.

Might be time to get this onto my other machine and have a play with the gui and code.....
17 Jan 2017 20:22 #85994 by Jedi
Nice! :)
19 Jan 2017 23:18 - 19 Jan 2017 23:23 #86209 by smgvbest
is this that you mean for the G54?
Last Edit: 19 Jan 2017 23:23 by smgvbest.
20 Jan 2017 08:56 #86230 by racedirector
Sort of, I was thinking more of having a seperate line for the current offset. Probable easier said than done but I haven't had a chance to play with it. Your solution is better than the original though. Space on the lower screen is an issue when you have a router using X,Y,Z and A though
21 Jan 2017 16:25 #86370 by smgvbest
Yeh, space is a bit constrained there
I tried like putting a OFFET just above Status, it worked but I needed to figure out how to remove the current offset from the Status line otherwise it really looks redundant

Here's some of my latest playing around
Modified the Gaurd/Door Label to turn RED when it is Open, Makes the unsafe condition clearer
Modified the Home Switch to Say Homing while it's Homing with a Yellow LED, When Both X/Y are Homed the LED is Green and the Label Says HOMED.
Modified MACHINE OK to also Go RED and Say MACHINE NOT OK when the Machine Check is in error
Added a [CUSTOM] to the INI
with a way to change the Labels for the Machine Name and USBIO Label
MACHINE_LABEL=Grizzly G0602 Lathe

you can see both on the screen shots, if they are not in the INI it will use the defaults in pathpilot
Shifted things around a bit to put labels above the IO LED for P1-P4 just so there's no confusion with the X+/- and Y+/- labels
Flood and Collet LEDS working
Not sure yet how to hook up the Mist LED
Need to tie into the ESTOP logic
Need to Add a Lighting Button Somewhere which would turn on/off the lighting inside the enclosure (or any lighting you hooked up)

This is mostly a learning experience for me on Glade, Python and Pathpilots UI
Really does help understand it.

One thing I would like to work out is having a Spindle Orientation DRO show 0 - 360 degrees of rotation,
Curious of anyone else thinks that would be useful?
The following user(s) said Thank You: racedirector
25 Jan 2017 03:14 #86589 by smgvbest
I decided to bite the bullet on selecting between Flood or Mist Coolant. So I did up new buttons for Flood and Mist, added the code to support mist (for flood just changed the images).

Here's the latest version of of the lathe control screen

you can see a few other cosmetic changes.

Next to figure out where to add a Light Button so you can control any light source such as the one inside the lathes enclosure (maybe use the Y Axis Ref button for that and I don't need rapid turn features)
Also I'm thinking I might use the Y axis for a Spindle Orientation DRO. this is normally used for rapid turn also
The following user(s) said Thank You: Contract_Pilot
26 Jan 2017 18:58 - 26 Jan 2017 18:59 #86731 by smgvbest
Lesson Learned
Had a setback in working on this. it was working last night, went to fire up pathpilot and get
Traceback (most recent call last):
  File "/home/operator/tmc/python/", line 7340, in <module>
    UI = lathe()
  File "/home/operator/tmc/python/", line 894, in __init__
  File "/home/operator/v1.9.8/python/", line 738, in setup_gcode_marks
AttributeError: 'NoneType' object has no attribute 'set_buffer'
Shutting down and cleaning up LinuxCNC...

I did a diff on to the original 1.9.8 version and they match, I also compared all *.py in ~/python to the original and only the changes I made where there. took a look at the glade source. after searching I found the problem.

looking at
self.sourceview = self.builder.get_object("gcode_sourceview")
        self.gcodelisting_buffer = gtksourceview2.Buffer()

Well there are no reference to gcode_sourceview in the glade file.
checking as to why I found I had restarted glade after starting a new session. I had lost the rip_environment and when I saved the glade file it removed that entire section when it saved. Oye!

So I restored that section and the gui is back up and running.

I wanted to add Spindle Orientation to the gui and I've decided what I'll do is use the Y-DRO for that. I've added a "Use Y Axis for C Axis" to the settings tab. if checked I'll change the Label on Y to C1 and unhide the Label, DRO and LED. then the Y-DRO will display the current angle of the C Axis (Spindle). Of course you'll need an encoder on the spindle to work. and it will be orientate to the Index Pulse. so that it resets after 360. on mine I have a 1440 PPR encoder (that is the 4x count) which is about .25 deg per count. So I'll display something like 123.50 in the DRO. this will be the biggest GUI change yet and may take a bit. especially sicne I'm putting a Rostock MAX 3d printer together also. :)
Last Edit: 26 Jan 2017 18:59 by smgvbest. Reason: I guess you can't embed things like bold withing a code block.
Moderators: cncbasher
Time to create page: 0.166 seconds
Powered by Kunena Forum