Adding simple graphics objects to GladeVCP?
- RetrofitTools
- Offline
- New Member
Less
More
- Posts: 12
- Thank you received: 2
26 May 2019 13:34 #134996
by RetrofitTools
Adding simple graphics objects to GladeVCP? was created by RetrofitTools
Looking for comments on difficulty of adding simple graphic elements in GladeVCP...
Have custom machines, just two axes (one rotary, one linear), currently controlled by ancient DOS PCs with motion control boards. The UI is simple, but does include a machine work envelope (basically some lines/bars/rectangles) and filled and unfilled circles.
Thought LinuxCNC would be an elegant upgrade for control, but haven't done any GUIs from scratch yet. A quick look at tutorials and GladeVCP didn't give any example of adding custom elements like this, so curious for any feedback on this approach. Idea is to give a solution which can be supported a long time... the existing PC program dates from the mid 90s!
Thanks!
Have custom machines, just two axes (one rotary, one linear), currently controlled by ancient DOS PCs with motion control boards. The UI is simple, but does include a machine work envelope (basically some lines/bars/rectangles) and filled and unfilled circles.
Thought LinuxCNC would be an elegant upgrade for control, but haven't done any GUIs from scratch yet. A quick look at tutorials and GladeVCP didn't give any example of adding custom elements like this, so curious for any feedback on this approach. Idea is to give a solution which can be supported a long time... the existing PC program dates from the mid 90s!
Thanks!
Please Log in or Create an account to join the conversation.
- newbynobi
- Offline
- Platinum Member
Less
More
- Posts: 2075
- Thank you received: 406
26 May 2019 14:47 #135001
by newbynobi
Replied by newbynobi on topic Adding simple graphics objects to GladeVCP?
You can use the Drawimg area to make what you want.
I used that to create a custom widget called speedcontrol.
self.draw = gtk.DrawingArea()
self.draw.connect("expose-event", self.expose)
and in the def expose you can draw the circles etc.
Norbert
I used that to create a custom widget called speedcontrol.
self.draw = gtk.DrawingArea()
self.draw.connect("expose-event", self.expose)
and in the def expose you can draw the circles etc.
Norbert
The following user(s) said Thank You: RetrofitTools
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
Less
More
- Posts: 7760
- Thank you received: 2055
26 May 2019 15:13 #135008
by cmorley
Replied by cmorley on topic Adding simple graphics objects to GladeVCP?
It is possible to add graphics objects to gremlin with programming - I dabbled with it in qtvcp - but as far as I know no-one has demoed a practical working example.
In qtvcp one had to use opengl programming do make the shape.
None of it is documented.
Chris M
In qtvcp one had to use opengl programming do make the shape.
None of it is documented.
Chris M
The following user(s) said Thank You: RetrofitTools
Please Log in or Create an account to join the conversation.
- pl7i92
- Offline
- Platinum Member
Less
More
- Posts: 1890
- Thank you received: 356
26 May 2019 15:55 #135012
by pl7i92
Replied by pl7i92 on topic Adding simple graphics objects to GladeVCP?
you may look into the tread of show new Gui there are files of redy made graphics for gscrren(preferd) and gmoccapy
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23310
- Thank you received: 4858
28 May 2019 22:06 #135206
by andypugh
Replied by andypugh on topic Adding simple graphics objects to GladeVCP?
You can also use an SVG file for a canvas, but positioning control on it can be a bit awkward. I used a table with many, many, empty cells when I did this:
forum.linuxcnc.org/41-guis/26550-lathe-macros?start=150#82743
forum.linuxcnc.org/41-guis/26550-lathe-macros?start=150#82743
The following user(s) said Thank You: RetrofitTools
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
Less
More
- Posts: 7760
- Thank you received: 2055
28 May 2019 23:39 #135221
by cmorley
Maybe I miss understood - did you want to add custom objects to linuxcnc's graphics gcode view or graphics to widgets?
Chris
Replied by cmorley on topic Adding simple graphics objects to GladeVCP?
It is possible to add graphics objects to gremlin with programming - I dabbled with it in qtvcp - but as far as I know no-one has demoed a practical working example.
In qtvcp one had to use opengl programming do make the shape.
None of it is documented.
Chris M
Maybe I miss understood - did you want to add custom objects to linuxcnc's graphics gcode view or graphics to widgets?
Chris
Please Log in or Create an account to join the conversation.
- RetrofitTools
- Offline
- New Member
Less
More
- Posts: 12
- Thank you received: 2
06 Jun 2019 14:36 #136054
by RetrofitTools
Replied by RetrofitTools on topic Adding simple graphics objects to GladeVCP?
Chris
I don't think the toolpath viewer would be particularly useful in this application.
Envision if you will a display showing a box full of cans. Each can's position would be either an outline circle (location defined but not used) or a filled circle (location filled).
This is not the actual application, but it gives you the idea. My thought is that use of G-code would be completely obscured, and the user would only have UI controls with X & Y dimensions, number of items to place, etc.
Further input appreciated!
I don't think the toolpath viewer would be particularly useful in this application.
Envision if you will a display showing a box full of cans. Each can's position would be either an outline circle (location defined but not used) or a filled circle (location filled).
This is not the actual application, but it gives you the idea. My thought is that use of G-code would be completely obscured, and the user would only have UI controls with X & Y dimensions, number of items to place, etc.
Further input appreciated!
Please Log in or Create an account to join the conversation.
- RetrofitTools
- Offline
- New Member
Less
More
- Posts: 12
- Thank you received: 2
06 Jun 2019 14:45 #136055
by RetrofitTools
Replied by RetrofitTools on topic Adding simple graphics objects to GladeVCP?
Andy
That's pretty elegant and impressive. I wish it were possible to dynamically generate a 3D graphic like that, but it's probably beyond my pay grade
Basically I want to do the same thing you are... set some parameters via the gui and the operations take place with no worries about G-code.
That's pretty elegant and impressive. I wish it were possible to dynamically generate a 3D graphic like that, but it's probably beyond my pay grade
Basically I want to do the same thing you are... set some parameters via the gui and the operations take place with no worries about G-code.
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23310
- Thank you received: 4858
06 Jun 2019 14:50 #136056
by andypugh
It very much is possible, but might not be considered trivial.
Generating SVG is pretty easy, it's a human-legible format. However you probably wouldn't do that for a GUI, you would use Cairo (maybe OpenGL) or similar.
The Wikipedia page on Cairo has a fairly illustrative example:
en.wikipedia.org/wiki/Cairo_(graphics)
Replied by andypugh on topic Adding simple graphics objects to GladeVCP?
I wish it were possible to dynamically generate a 3D graphic like that, but it's probably beyond my pay grade.
It very much is possible, but might not be considered trivial.
Generating SVG is pretty easy, it's a human-legible format. However you probably wouldn't do that for a GUI, you would use Cairo (maybe OpenGL) or similar.
The Wikipedia page on Cairo has a fairly illustrative example:
en.wikipedia.org/wiki/Cairo_(graphics)
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
Less
More
- Posts: 7760
- Thank you received: 2055
07 Jun 2019 02:31 #136157
by cmorley
That sounds a lot like an LED - a two state, custom drawn object.
If you want to be able to 'click it' that can be done too.
put a 'box' type static back ground and it sounds similar to your example idea.
rewriting the LED widget to draw something else would be a relatively easy project.
Depends on what you you wish to draw and how detailed.
As Andy says SVG is another way to display different static images.
Would work fine if there isn't a lot of different objects.
Chris M
Replied by cmorley on topic Adding simple graphics objects to GladeVCP?
Chris
I don't think the toolpath viewer would be particularly useful in this application.
Envision if you will a display showing a box full of cans. Each can's position would be either an outline circle (location defined but not used) or a filled circle (location filled).
This is not the actual application, but it gives you the idea. My thought is that use of G-code would be completely obscured, and the user would only have UI controls with X & Y dimensions, number of items to place, etc.
Further input appreciated!
That sounds a lot like an LED - a two state, custom drawn object.
If you want to be able to 'click it' that can be done too.
put a 'box' type static back ground and it sounds similar to your example idea.
rewriting the LED widget to draw something else would be a relatively easy project.
Depends on what you you wish to draw and how detailed.
As Andy says SVG is another way to display different static images.
Would work fine if there isn't a lot of different objects.
Chris M
Please Log in or Create an account to join the conversation.
Moderators: HansU
Time to create page: 0.080 seconds