[Home]History of Gscreen Customization

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org

Revision 35 . . October 26, 2017 11:34 pm by KimK [Add nowiki tags to LinuxCNC mentions. Other nowiki tags and edits as needed. ]
Revision 34 . . April 21, 2014 11:29 pm by Cmorley [more Gscreen startup info]
  

Difference (from prior major revision) (no other diffs)

Removed: 1d0
Describe the new page here.

Changed: 7,8c6,7
Gscreen borrows heavily from gladeVCP.

GladeVCP? uses the GTK widget editor GLADE to build virtual control panels (VCP) by point and click.

Gscreen borrows heavily from GladeVCP.

GladeVCP uses the GTK widget editor GLADE to build virtual control panels (VCP) by point and click.


Changed: 10,16c9,15
Which is great right? As long as you like the screen I built it is - which has got to be right cause it's perfect :)

Well ok you have a special machine and you want some buttons and status LEDs - no problem thats what gladeVCP is for and Gscreen supports it.

But gladeVCP is restricted to positions on the screen that were made for embedding and you want the button on the left side damn it!

hmmm well gladeVCP uses the GLADE editor to build the panels and so does Gscreen - so why don't we just use the editor to edit Gscreen?

Well that is the first level of real customisation of Gscreen!

So the first three you need to know something about is [GLADE] (the editor), [PyGTK] (the widget toolkit), and [gladeVCP] (linuxcnc's connection to GLADE/PyGTK?)

You must know how to use the GLADE editor, PyGTK? is the widget toolkit so you need to know what the widgets are and can do, GladeVCP? has some special widgets added just for linuxcnc
And if you were wondering a widget is just the generic name used for the buttons, sliders, labels etc of the PyGTK? toolkit.

Which is great, right? As long as you like the screen I built it is - which has got to be right cause it's perfect :)

Well, OK, you have a special machine and you want some buttons and status LEDs - no problem, that's what GladeVCP is for and Gscreen supports it.

But GladeVCP is restricted to positions on the screen that were made for embedding, and you want the button on the left side, damn it!

Hmmm, well, GladeVCP uses the GLADE editor to build the panels and so does Gscreen - so why don't we just use the editor to edit Gscreen?

Well, that is the first level of real customisation of Gscreen!

So the first three you need to know something about are [GLADE] (the editor), [PyGTK] (the widget toolkit), and [GladeVCP] (LinuxCNC's connection to GLADE/PyGTK)

You must know how to use the GLADE editor, PyGTK is the widget toolkit so you need to know what the widgets are and can do, GladeVCP has some special widgets added just for LinuxCNC
And if you were wondering, a widget is just the generic name used for the buttons, sliders, labels, etc. of the PyGTK toolkit.


Changed: 19c18
Hey didn't you read the link I showed you?

Hey, didn't you read the link I showed you?


Changed: 21c20
PyGTK? uses this file to actually display and react to those widgets.

PyGTK uses this file to actually display and react to those widgets.


Changed: 26,36c25,35

1.1. PyGTK? thats a funny name



PyGTK? is the python binding to GTK - That clear it all up???

Ok GTK really is the one that display everything, it's programmed in a language called C.

PyGTK? uses a language called Python to interact with GTK. Python is much easier/faster to work with then C

1.2. GladeVCP?



GladeVCP? binds linuxcnc, HAL, PyGTK? and GLADE all together.

Linuxcnc requires some special widgets so gladeVCP supplies them. Many are just HAL extensions to existing PyGTK? widgets

GladeVCP? creates the HAL pins for the special widgets described in the GLADE file.

GladeVCP? also allows one to add python commands to interact with the widgets, to make them do things not available in their default form

If you can build a gladeVCP panel you can customise Gscreen

3.1. PyGTK, that's a funny name



PyGTK is the python binding to GTK - That clear it all up???

OK, GTK really is the one that displays everything, it's programmed in a language called C.

PyGTK uses a language called Python to interact with GTK. Python is much easier/faster to work with then C

3.2. GladeVCP



GladeVCP binds LinuxCNC, HAL, PyGTK and GLADE all together.

LinuxCNC requires some special widgets so GladeVCP supplies them. Many are just HAL extensions to existing PyGTK widgets

GladeVCP creates the HAL pins for the special widgets described in the GLADE file.

GladeVCP also allows one to add python commands to interact with the widgets, to make them do things not available in their default form

If you can build a GladeVCP panel you can customise Gscreen


Changed: 72c71
Please see the gladevcp write-up about the basics to gladeVCP handler files - Gscreen uses a very similar technique


Please see the GladeVCP write-up about the basics to GladeVCP handler files - Gscreen uses a very similar technique



Changed: 74,75c73,74

2. Hey I can build a gladeVCP panel! What about Gscreen



Gscreen is just a really big complicated gladeVCP panel, with a bunch of python code to control it.

4. Hey, I can build a GladeVCP panel! What about Gscreen?



Gscreen is just a really big complicated GladeVCP panel, with a bunch of python code to control it.


Changed: 78,79c77,78
Use a compiled from source 'master' version of linuxcnc

open a terminal and cd to the top of the linuxcnc folder

Use a compiled from source 'master' version of LinuxCNC

open a terminal and cd to the top of the LinuxCNC folder


Changed: 86c85
Ok you have loaded the stock glade file and now can edit it. the first thing you notice is it does not look in the editor like what it's displayed like

OK, you have loaded the stock glade file and now can edit it. The first thing you notice is it does not look in the editor like what it's displayed as.


Changed: 90,92c89,91
When making changes it is far easier to add widgets then subtract widgets and still have the screen work properly

making objects 'not visible' is one way to change the display without getting errors - this won't always work some widgets will be set visible again

Changing the names of Gscreen's regular widgets is probably not gonna work well without python code - but moving a widget while keeping the name is usually workable

When making changes it is far easier to add widgets then subtract widgets and still have the screen work properly.

Making objects 'not visible' is one way to change the display without getting errors - this won't always work, some widgets will be set visible again.

Changing the names of Gscreen's regular widgets will probably not work well without python code - but moving a widget while keeping the name is usually workable.


Changed: 94c93
Gscreen leverages gladeVCP widgets as much as possible, to avoid adding python code. Learning about gladeVCP widgets is a prerequisite.

Gscreen leverages GladeVCP widgets as much as possible, to avoid adding python code. Learning about GladeVCP widgets is a prerequisite.


Changed: 99c98
Remember, if you use a custom screen option YOU are responsible for fixing it (if required) when updating linuxcnc.

Remember, if you use a custom screen option YOU are responsible for fixing it (if required) when updating LinuxCNC.


Changed: 113c112
add all the ones you see on the top right.

-Add all the ones you see on the top right.


Changed: 115,117c114,116
-the gremlin widget doesn't have a default size so setting a requested size is helpful.(see below)

-The sourceview widget will try to use the whole window so adding it to a scrolled window will cover this.(This is already been done in the example)

-The buttons will expand as the window is made larger which is ugly so we will set the box they are in, to not expand (see below)

-The gremlin widget doesn't have a default size, so setting a requested size is helpful.(see below)

-The sourceview widget will try to use the whole window, so adding it to a scrolled window will cover this. (This has already been done in the example).

-The buttons will expand as the window is made larger, which is ugly, so we will set the box they are in to not expand (see below).


Changed: 120c119
In this screen we are using emc_actions to communicate to linuxcnc the actions we want.

In this screen we are using emc_actions to communicate to LinuxCNC the actions we want.


Changed: 124c123
under the general tab you can change the text of the button's label to describe it's function.

Under the general tab you can change the text of the button's label to describe it's function.


Changed: 128c127
select the gremlin widget click the common tab and set the requested height to 100 and click the checkbox beside it.

Select the gremlin widget. Click the common tab, set the requested height to 100, and click the checkbox beside it.


Changed: 130c129
click the horizontal box that holds the buttons. click the packing tab and click 'expand' to 'No'

Click the horizontal box that holds the buttons. Click the packing tab and click 'expand' to 'No'


Changed: 132,135c131,134
Ok that it - we need to save it as tester.glade and save it in sim/gscreen/gscreen_custom/ folder.

now launch linuxcnc and click to sim/gscreen/gscreen_custom/tester and start it.

If all goes well our screen will pop up and the buttons will do their job

This works because the tester.ini tells gscreen to look for and load tester.glade and tester_handler.py

OK, that's it - we need to save it as tester.glade and save it in sim/gscreen/gscreen_custom/ folder.

Now launch LinuxCNC and click to sim/gscreen/gscreen_custom/tester and start it.

If all goes well our screen will pop up and the buttons will do their job.

This works because the tester.ini tells gscreen to look for and load tester.glade and tester_handler.py.


Changed: 137c136
Since the special widgets directly communicate with linuxcnc - you can still do useful things.

Since the special widgets directly communicate with LinuxCNC - you can still do useful things.


Changed: 139,140c138,139
If you want something more there are still many tricks available from just adding 'function calls' to get canned behaviour,

To coding your own python code to customize exactly what you want. But that means learning about handler files.

If you want something more there are still many tricks available, from just adding 'function calls' to get canned behaviour,

to coding your own python code to customize exactly what you want. But that means learning about handler files.


Changed: 143c142
Here is gaxis and it's handler file:

Here is gaxis and its handler file:


Changed: 166,168c165,167

3. what does Gscreen do when it starts up?



Gscreen is really just infrastructure to load a custom gladeVCP file and interact with it.

Originally There was going to be just one customizable 'Skin', later I switch to making Gscreen more general and the handler file control more detail.

5. What does Gscreen do when it starts up?



Gscreen is really just infrastructure to load a custom GladeVCP file and interact with it.

Originally there was going to be just one customizable 'Skin', later I switched to making Gscreen more general and the handler file control more detailed.

Changed: 170,171c169,170
gscreen starts by reading the options it was started.
It sets the debug mode and set the optional skin name.

Gscreen starts by reading the options it was started with.
It sets the debug mode and sets the optional skin name.


Changed: 175c174
optional Audio is initialized if available.

Optional Audio is initialized if available.


Changed: 178c177
Gladevcp's makepins is called to parse the XML file to build HAL pins for the HAL widgets and register The linuxcnc connected widgets.

GladeVCP's makepins is called to parse the XML file to build HAL pins for the HAL widgets and register the LinuxCNC connected widgets.


Changed: 180,182c179,181
If there is a handler file gscreen parses it, and registers the function calls into Gscreen's namespace.

At this point Glade matches/registers all signal calls to functions in gscreen and the handler file.

gscreen checks the INI file for an option preference file name other wise it uses '.gscreen_preferences'

If there is a handler file Gscreen parses it, and registers the function calls into Gscreen's namespace.

At this point Glade matches/registers all signal calls to functions in Gscreen and the handler file.

Gscreen checks the INI file for an option preference file name otherwise it uses '.gscreen_preferences'


Changed: 184,189c183,188
checks for classicladder realtime component.

checks for the system wide GTK theme.

collects the jogging increments from the INI file.

collects the angular jogging increments from the INI file.

collects the default and max jog rate from the INI.

collects the max velocity of any axes from the INI's TRAJ section.

Checks for classicladder realtime component.

Checks for the system wide GTK theme.

Collects the jogging increments from the INI file.

Collects the angular jogging increments from the INI file.

Collects the default and max jog rate from the INI.

Collects the max velocity of any axes from the INI's TRAJ section.


Changed: 191,201c190,200
collect all the override setting from the INI.

check if its a lathe config from the INI file.

find the name of the tool_table,tool editor and param file from the INI.

check the handler file for keybindings function ('initialize_keybindings(self)') or else use Gscreen stock one.

check the handler file for pins function ('initialize_pins(self)') or else use Gscreen stock one.

check the handler file for manual_toolchange function ('initialize_manual_toolchange(self)') or else use Gscreen stock one.

check the handler file for connect_signals function ('initialize_connect_signals(self)') or else use Gscreen stock one.

check the handler file for widgets function ('initialize_widgets(self)') or else use Gscreen stock one.

set up messages specified in the INI file.

tell HAL the Gscreen HAL component is finished making pins and is ready.

if there is a terminal widget in the screen it will print all the Gscreen pins to it.

Collect all the override setting from the INI.

Check if its a lathe config from the INI file.

Find the name of the tool_table,tool editor and param file from the INI.

Check the handler file for keybindings function ('initialize_keybindings(self)') or else use Gscreen stock one.

Check the handler file for pins function ('initialize_pins(self)') or else use Gscreen stock one.

Check the handler file for manual_toolchange function ('initialize_manual_toolchange(self)') or else use Gscreen stock one.

Check the handler file for connect_signals function ('initialize_connect_signals(self)') or else use Gscreen stock one.

Check the handler file for widgets function ('initialize_widgets(self)') or else use Gscreen stock one.

Set up messages specified in the INI file.

Tell HAL the Gscreen HAL component is finished making pins and is ready.

If there is a terminal widget in the screen it will print all the Gscreen pins to it.


Changed: 203c202
checks the handler file for 'timer_interupt(self)' function call otherwise use Gscreen's default function call.

Checks the handler file for 'timer_interupt(self)' function call otherwise use Gscreen's default function call.


Changed: 206,207c205,206
Here is another screen : it's GTK widgets placed on top of a image file:

The axes DROs in this pic are actual numbers from a running linuxcnc


Here is another screen: it's GTK widgets placed on top of an image file:

The axes DROs in this pic are actual numbers from a running LinuxCNC



LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org
Search:
Published under a Creative Commons License