- Posts: 70
- Thank you received: 0
Gui Coding
- jcdammeyer
- Topic Author
- Offline
- Senior Member
-
Less
More
3 years 2 months ago #277122
by jcdammeyer
Screen shots of gui designs was created by jcdammeyer
With reference to your posting from 2013,
forum.linuxcnc.org/41-guis/26174-screen-...of-gui-designs#30125
Your screen done with free pascal looks interesting. Are you still using it? I'm interested in the files.
Your screen done with free pascal looks interesting. Are you still using it? I'm interested in the files.
Please Log in to join the conversation.
3 years 2 months ago #277327
by andypugh
Gmoccapy is not written in Pascal, but is based on "Mocca GUI" which was.
It seems to be here: code.google.com/archive/p/moccagui/
Replied by andypugh on topic Screen shots of gui designs
Your screen done with free pascal looks interesting. Are you still using it? I'm interested in the files.
Gmoccapy is not written in Pascal, but is based on "Mocca GUI" which was.
It seems to be here: code.google.com/archive/p/moccagui/
Please Log in to join the conversation.
- jcdammeyer
- Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 70
- Thank you received: 0
3 years 2 months ago #277336
by jcdammeyer
Replied by jcdammeyer on topic Screen shots of gui designs
Thanks. Just trying to figure out how to add code to a tab in AXIS actually. Thought that might give me a hint.
Please Log in to join the conversation.
3 years 2 months ago #277432
by andypugh
To do that you will need to use GladeVCP or QTVCP.
There is an example here: wiki.linuxcnc.org/cgi-bin/wiki.pl?Hobbing
Download the ZIP file to see the code.
That is a tab in Touchy, but it would work equally well in Axis.
The trick is link events in the UI to code in the handler file.
For example, looking in the UI file we find:
<signal name="clicked" handler="inc_button" object="teeth"/>
(You would set this up in the editor GUI, not by editing the XML, but this is easier to paste)
Then in the Python handler file we have
This is a slightly advanced example as this particular handler handles all the increment buttons, each of which passes it the name of the object that generated the event.
The spindle start button handler isn't passed any data (that it uses) but does look for a value in a separate control to get the requested speed.
Hopefully there is enough here to get you started? It basically comes down to specifying a handler file in the "loadusr gladevcp" line, and in the GUI editor associating GUI events with functions in the python code.
Replied by andypugh on topic Screen shots of gui designs
Thanks. Just trying to figure out how to add code to a tab in AXIS actually. Thought that might give me a hint.
To do that you will need to use GladeVCP or QTVCP.
There is an example here: wiki.linuxcnc.org/cgi-bin/wiki.pl?Hobbing
Download the ZIP file to see the code.
That is a tab in Touchy, but it would work equally well in Axis.
The trick is link events in the UI to code in the handler file.
For example, looking in the UI file we find:
<signal name="clicked" handler="inc_button" object="teeth"/>
(You would set this up in the editor GUI, not by editing the XML, but this is easier to paste)
Then in the Python handler file we have
Code:
def inc_button(self, label, data=None, mystery=None):
val = float(label.get_text())
name = gtk.Buildable.get_name(label)
val = val + increment[name]
if val > maximum[name]:
val = maximum[name]
elif val < minimum[name]:
val = minimum[name]
label.set_text(str(val))
recalc(self, label)
This is a slightly advanced example as this particular handler handles all the increment buttons, each of which passes it the name of the object that generated the event.
The spindle start button handler isn't passed any data (that it uses) but does look for a value in a separate control to get the requested speed.
Code:
def spindle_start(self, label, data=None):
if ok_for_mdi():
s = float(self.builder.get_object('spindle').get_text())
c.mode(linuxcnc.MODE_MDI)
c.wait_complete() # wait until mode switch executed
if label.get_name() == 'spindle_anti':
c.mdi('M4S%f'%s)
else:
c.mdi('M3S%f'%s)
Hopefully there is enough here to get you started? It basically comes down to specifying a handler file in the "loadusr gladevcp" line, and in the GUI editor associating GUI events with functions in the python code.
Please Log in to join the conversation.
3 years 2 months ago #277436
by andypugh
Replied by andypugh on topic Screen shots of gui designs
Here is a screenshot showing where you set up the link between GUI action and code:
Attachment not found
Please Log in to join the conversation.
- jcdammeyer
- Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 70
- Thank you received: 0
3 years 2 months ago #277445
by jcdammeyer
Replied by jcdammeyer on topic Screen shots of gui designs
Thanks Andy,
Just got the Touchy working on the BeagleBone.Black MachineKit. Not sure if I'll continue with the BBB and as yet I haven't finished my Harmonic Drive. Nice to see yours working so well.
BTW. That link in the document just goes to your video page. This is the one to the hobbing now.
Just got the Touchy working on the BeagleBone.Black MachineKit. Not sure if I'll continue with the BBB and as yet I haven't finished my Harmonic Drive. Nice to see yours working so well.
BTW. That link in the document just goes to your video page. This is the one to the hobbing now.
Please Log in to join the conversation.
3 years 2 months ago #277454
by andypugh
wiki.linuxcnc.org/uploads/hobbing.zip
Replied by andypugh on topic Screen shots of gui designs
I think you are looking at the wrong link. This is the one you should have clicked (just above the screen shot)BTW. That link in the document just goes to your video page.
wiki.linuxcnc.org/uploads/hobbing.zip
Please Log in to join the conversation.
Time to create page: 0.089 seconds
