/ docs / src / gui / gscreen.txt
gscreen.txt
  1  [[cha:gscreen]]
  2  
  3  = Gscreen
  4  
  5  == Intro
  6  
  7  Gscreen is an infrastructure to display a custom screen to control LinuxCNC.
  8  Gscreen borrows heavily from GladeVCP. GladeVCP uses the GTK widget editor
  9  GLADE to build virtual control panels (VCP) by point and click. Gscreen
 10  combines this with python programming to create a GUI screen for running a
 11  CNC machine.
 12  
 13  Gscreen is customizable if you want different buttons and status LEDs. Gscreen
 14  supports GladeVCP which is used to add controls and indicators. To customize
 15  Gscreen you use the Glade editor. Gscreen is not restricted to adding a custom
 16  panel on the right or a custom tab it is fully editable.
 17  
 18  .Gscreen Default Screen
 19  image::images/gscreen-mill.png[align="center", alt="Gscreen Mill Based Screen"]
 20  
 21  .Gscreen Silverdragon Screen
 22  image::images/silverdragon.png[align="center", alt="Gscreen's Silverdragon Screen"]
 23  
 24  .Gscreen Spartan Screen
 25  image::images/spartan.png[align="center", alt="Gscreen's Spartan Screen"]
 26  
 27  .Gscreen Gaxis Screen
 28  image::images/gaxis.png[align="center", alt="Gscreen's Gaxis Screen"]
 29  
 30  .Gscreen Industrial Screen
 31  image::images/industrial.png[align="center", alt="Gscreen's Industrial Screen"]
 32  
 33  Gscreen is based on 'Glade' (the editor), 'PyGTK' (the widget toolkit), and
 34  'GladeVCP' (LinuxCNC's connection to Glade and PyGTK). GladeVCP has some
 35  special widgets and actions added just for LinuxCNC A widget is just the
 36  generic name used for the buttons, sliders, labels etc of the PyGTK toolkit.
 37  
 38  === Glade File
 39  
 40  A Glade file is a text file organized in the XML standard that describes the
 41  layout and the widgets of the screen. PyGTK uses this file to actually display
 42  and react to those widgets. The Glade editor makes it relatively easy to build
 43  and edit this file You must use the Glade 3.8.0 editor that uses the GTK2
 44  widgets. Newer versions of Linux use the newest Glade editor that uses GTK3
 45  widgets. In that case you must download the older Glade editor from their
 46  repository.
 47  
 48  === PyGTK
 49  
 50  PyGTK is the python binding to GTK. GTK is the 'toolkit' of visual widgets,
 51  it's programmed in C. PyGTK uses Python to 'bind' with GTK.
 52  
 53  == GladeVCP
 54  
 55  <<cha:glade-vcp,GladeVCP>> binds LinuxCNC, HAL, PyGTK and Glade all together.
 56  LinuxCNC requires some special widgets so GladeVCP supplies them. Many are just
 57  HAL extensions to existing PyGTK widgets. GladeVCP creates the HAL pins for the
 58  special widgets described in the Glade file. GladeVCP also allows one to add
 59  python commands to interact with the widgets, to make them do things not
 60  available in their default form If you can build a GladeVCP panel you can
 61  customize Gscreen!
 62  
 63  === Overview
 64  
 65  There are two files that can be used, individually or in combination to add
 66  customizations. Local glade files and handler files. Normally Gscreen uses
 67  the stock Glade file and possibly a handler file (if using a sample 'skin')
 68  You can specify Gscreen to use 'local' Glade and handler files. Gscreen looks
 69  in the folder that holds all the configuration files for the configuration you
 70  selected.
 71  
 72  .Local Glade Files
 73  
 74  If present, local glade files in the configuration folder will be loaded instead
 75  of the stock Glade files. Local Glade files allow you to use your customized
 76  designs rather then the default screens. There is a switch in the INI file to
 77  set set the base name: -c name so Gscreen looks for MYNAME.glade and
 78  MYNAME_handler.py.
 79  
 80  You can tell Gscreen to just load the Glade file and not connect it's internal
 81  signals to it. This allows gscreen to load any GTK builder saved Glade file
 82  This means you can display a completely custom screen, but also requires you to
 83  use a handler file. Gscreen uses the Glade file to define the widgets, so it can
 84  show and interact with them. Many of them have specific names, others have Glade
 85  given generic names. If the widget will be displayed but never changed then a
 86  generic name is fine. If one needs to control or interact with the widget then
 87  a hopefully purposeful name is given (all names must be unique). Widgets can
 88  also have signals defined for them in the GLADE editor. It defines what signal
 89  is given and what method to call.
 90  
 91  .Modifying Stock Skins
 92  
 93  If you change the name of a widget, Gscreen might not be able to find it. If
 94  this widget is referenced to from python code, at best this makes the widget
 95  not work anymore at worst it will cause an error when loading Gscreen's default
 96  screens don't use many signals defined in the editor, it defines them in the
 97  python code. If you move (cut and paste) a widget with signals, the signals
 98  will not be copied. You must add them again manually.
 99  
100  .Handler Files
101  
102  A handler file is a file containing python code, which Gscreen adds to it's
103  default routines. A handler file allows one to modify defaults, or add logic
104  to a Gscreen skin without having to modify Gscreen proper. You can combine new
105  functions with Gscreen's function to modify behavior as you like. You can
106  completely bypass all of Gscreen's functions and make if work completely
107  differently. If present a handler file named gscreen_handler.py (or
108  MYNAME_handler.py if using the INI switch) will be loaded and registered only
109  one file is allowed Gscreen looks for the handler file, if found it will look
110  for specific function names and call them instead of the default ones. If
111  adding widgets you can set up signal calls from the Glade editor to call
112  routines you have written in the handler file. In this way you can have custom
113  behavior. Handler routines can call Gscreen's default routines, either before
114  or after running it's own code. In this way you can tack on extra behavior
115  such as adding a sound. Please see the <<cha:glade-vcp,GladeVCP Chapter>> for
116  the basics to GladeVCP handler files. Gscreen uses a very similar technique.
117  
118  .Themes
119  
120  Gscreen uses the PyGTK toolkit to display the screen.
121  Pygtk is the Python language binding to GTK.
122  GTK supports 'themes'.
123  Themes are a way to modify the look and feel of the widgets on the screen.
124  For instance the color or size of buttons and sliders can be changed using
125  themes.
126  There are many GTK2 themes available on the web.
127  Themes can also be customized to modifiy visuals of particular named widgets.
128  This ties the theme file to the glade file more tightly.
129  Some of the sample screen skins allow the user to select any of the themes on 
130  the system. The sample 'gscreen' is an example.
131  Some will load the theme that is the same name in the config file. The sample 
132  'gscreen-gaxis' is an example. This is done by putting the theme folder in the
133   config folder that has the INI and HAL files and naming it: SCREENNAME_theme
134  (SCREENNAME being the base name of the files eg. gaxis_theme)
135  Inside this folder is another folder call gtk-2.0, inside that is the theme 
136  files. If you add this file, Gscreen will default to this theme on start up.
137  gscreen-gaxis has a sample custom theme that looks for certain named widgets 
138  and changes the visual behaivor of those specific widgets. The Estop and 
139  machine-on buttons use different colors then the rest of the buttons so that
140  they stand out. This is done in the handler file by giving them specific names
141  an by adding specific commands in the theme's gtkrc file.
142  For some info on GTK2 theming (The sample theme uses the pixmap theme engine) See:
143  
144  https://wiki.gnome.org/Attic/GnomeArt/Tutorials/GtkThemes[GTK Themes]
145  
146  https://wiki.gnome.org/Attic/GnomeArt/Tutorials/GtkEngines/PixmapEngine[Pixmap Theme Engine]
147  
148  === Build a GladeVCP Panel
149  
150  Gscreen is just a big complicated GladeVCP panel, with python code to control
151  it. To customize it we need the Glade file loaded in the Glade editor.
152  
153  .Installed LinuxCNC
154  
155  If you have LinuxCNC 2.6+ installed on Ubuntu 10.04 just start the Glade editor
156  from the applications menu or from the terminal. Newer versions of Linux will
157  require you to install Glade 3.8.0 - 3.8.6 (you may need to compile it yourself).
158  
159  .RIP compiled commands
160  
161  Using a compiled from source version of
162  http://wiki.linuxcnc.org/cgi-bin/wiki.pl?Installing_LinuxCNC[LinuxCNC] open
163  a terminal and <<faq:cd,cd>> to the top of the LinuxCNC folder. Set up the
164  environment by entering '. ./scripts/rip-environment' now enter 'glade', you
165  see a bunch of warnings in the terminal that you can ignore and the editor
166  should open. The stock Gscreen Glade file is in: src/emc/usr_intf/gscreen/
167  sample skins are in /share/gscreen/skins/. This should be copied to a
168  configuration folder. Or you can make a clean-sheet Glade file by saving it in
169  a configuration folder.
170  
171  Ok you have loaded the stock Glade file and now can edit it. The first thing
172  you notice is it does not look in the editor like what it's displayed like
173  Gscreen uses some tricks, such as hiding all boxes of buttons except one and
174  changing that one depending on the mode. The same goes for notebooks, some
175  screens use notebooks with the tabs not shown. To change pages in the editor
176  you need to temporarily show those tabs.
177  
178  When making changes it is far easier to add widgets then subtract widgets and
179  still have the screen work properly making objects 'not visible' is one way to
180  change the display without getting errors. This won't always work some widgets
181  will be set visible again. Changing the names of Gscreen's regular widgets is
182  probably not gonna work well without changing the python code, but moving a
183  widget while keeping the name is usually workable.
184  
185  Gscreen leverages GladeVCP widgets as much as possible, to avoid adding python
186  code. Learning about <<cha:glade-vcp,GladeVCP>> widgets is a prerequisite.
187  If the existing widgets give you the function you want or need then no python
188  code needs be added, just save the Glade file in your configuration folder.
189  If you need something more custom then you must do some python programming.
190  The name of the parent window needs to be window1. Gscreen assumes this name.
191  
192  Remember, if you use a custom screen option YOU are responsible for fixing it
193  (if required) when updating LinuxCNC.
194  
195  == Building a simple clean-sheet custom screen
196  
197  image::images/tester.png[align="center", alt="simple usable screen"]
198  
199  Lets build a simple usable screen. Build this in the Glade editor (if using a
200  RIP package run it from a terminal after using . scripts/rip-environment ).
201  
202  .Things to note:
203  * The top level window must be called the default name, 'window1' - Gscreen
204    relies on this.
205  * Add actions by right clicking, and selecting 'add as toplevel widget'
206    they don't add anything visual to the window but are added to the
207    right most action list. Add all the ones you see on the top right.
208  * After adding the actions we must link the buttons to the actions for them to
209    work (see below).
210  * The gremlin widget doesn't have a default size so setting a requested size is
211    helpful (see below).
212  * The sourceview widget will try to use the whole window so adding it to a
213    scrolled window will cover this (This is already been done in the example).
214  * The buttons will expand as the window is made larger which is ugly so we will
215    set the box they are in, to not expand (see below).
216  * The button types to use depend on the VCP_action used -eg vcp_toggle_action
217    usually require toggle buttons (Follow the example for now).
218  * The buttons in this example are regular buttons not HAL buttons. We don't
219    need the HAL pins.
220  
221  image::images/tester_editor.png[align="center", alt="Glade editor tester.glade"]
222  
223  In this screen we are using VCP_actions to communicate to LinuxCNC the actions
224  we want. This allows us standard functions without adding python code in the
225  handler file. Let's link the estop toogle button to the estop action Select the
226  estop toggle button and under the general tab look for 'Related Action' and
227  click the button beside it. Now select the toggle estop action. Now the button
228  will toggle estop on and off when clicked. Under the general tab you can change
229  the text of the button's label to describe it's function. Do this for all the
230  buttons.
231  
232  Select the gremlin widget click the common tab and set the requested height to
233  100 and click the checkbox beside it.
234  
235  Click the horizontal box that holds the buttons. Click the packing tab and
236  click 'expand' to 'No'.
237  
238  Save it as tester.glade and save it in sim/gscreen/gscreen_custom/ folder. Now
239  launch LinuxCNC and click to sim/gscreen/gscreen_custom/tester and start it.
240  If all goes well our screen will pop up and the buttons will do their job This
241  works because the tester.ini tells gscreen to look for and load tester.glade
242  and tester_handler.py. The tester_handler.py file is included in that folder
243  and is coded just show the screen and not much else. Since the special widgets
244  directly communicate with LinuxCNC you can still do useful things. If your
245  screen needs are covered by the available special widgets then this is as far
246  as you need to go to build a screen. If you want something more there are still
247  many tricks available from just adding 'function calls' to get canned behaviour.
248  To coding your own python code to customize exactly what you want. But that
249  means learning about handler files.
250  
251  == Handler file example
252  
253  There are special functions Gscreen checks the handler file for.
254  If you add these in you handler file Gscreen will call them instead of gscreen's internal same-named functions. 
255  
256   * initialize_preferences(self): You can install new preference routines.
257  
258   * initialize_keybindings(self) You can install new keybinding routines. In
259     most cases you won't want to do this, you will want to override the
260     individual keybinding calls. You can also add more keybindings that will
261     call an arbitrary function.
262  
263   * initialize_pins(self): makes / initializes HAL pins
264  
265   * connect_signals(self,handlers): If you are using a completely different
266     screen the default Gscreen you must add this or gscreen will try to connect
267     signals to widgets that are not there. Gscreen's default function is called
268     with self.gscreen.connect_signals(handlers) If you wish to just add extra
269     signals to your screen but still want the default ones call this first then
270     add more signals. If you signals are simple (no user data passed) then you
271     can also use the Glade signal selection in the Glade editor.
272  
273   * initialize_widgets(self): You can use this to set up any widgets. Gscreen
274     usually calls 'self.gscreen.initialize_widgets()' which actually calls
275     many separate functions. If you wish to incorporate some of those widgets
276     then just call those functions directly. or add 
277     self.gscreen.init_show_windows() so widgets are just shown. Then if
278     desired, initialize/adjust your new widgets.
279  
280   * initialize_manual_toolchange(self): allows a complete revamp of the manual
281     toolchange system.
282  
283   * set_restart_line(self.line):
284  
285   * timer_interrupt(self): allows one to complete redefine the interrupt
286     routine This is used for calling periodic() and checking for errors from
287     linuxcnc.status.
288  
289   * check_mode(self): used to check what mode the screen is in. Returns a list[]
290     0 -manual 1- mdi 2- auto 3- jog.
291  
292   * on_tool_change(self,widget): You can use this to override the manual tool
293     change dialog -this is called when 'gscreen.tool-change' changes state.
294  
295   * dialog_return(self,dialog_widget,displaytype,pinname): Use this to override
296     any user message or manual tool change dialog. Called when the dialog is
297     closed.
298  
299   * periodic(self): This is called every (default 100) milliseconds. Use it to
300     update your widgets/HAL pins. You can call Gscreen regular periodic
301     afterwards too, self.gscreen.update_position() or just add pass to not
302     update anything. Gscreen's update_position() actually calls many separate
303     functions. If you wish to incorporate some of those widgets then just call
304     those functions directly.
305  
306  You can also add you own functions to be called in this file. Usually you
307  would add a signal to a widget to call your function.
308  
309  === Adding Keybindings Functions
310  
311  Our tester example would be more useful if it responded to keyboard commands. +
312  There is a function called keybindings() that tries to set this up. +
313  While you can override it completely, we didn't - but it assumes some things. +
314  It assumes the estop toggle button is call 'button_estop' and that F1 key controls it. +
315  It assumes the power button is called 'button_machine_on' and the F2 key controls it. +
316  These are easily fixed by renaming the buttons in the Glade editor to match. +
317  But instead we are going to override the standard calls and add our own. +
318   +
319  Add these command to the handler file:
320  ----
321    # override Gscreen Functions
322    # keybinding calls
323    def on_keycall_ESTOP(self,state,SHIFT,CNTRL,ALT):
324      if state: # only if pressed, not released
325        self.widgets.togglebutton1.emit('activate')
326        self.gscreen.audio.set_sound(self.data.alert_sound)
327        self.gscreen.audio.run()
328        return True # stop progression of signal to other widgets
329    def on_keycall_POWER(self,state,SHIFT,CNTRL,ALT):
330      if state:
331        self.widgets.togglebutton2.emit('activate')
332        return True
333    def on_keycall_ABORT(self,state,SHIFT,CNTRL,ALT):
334      if state:
335        self.widgets.button3.emit('activate')
336        return True
337  ----
338  
339  So now we have overridden Gscreen's function calls of the same name and deal with them in our handler file. +
340  We now reference the widgets by the name we used in the Glade editor. +
341  We also added a built in gscreen function to make a sound when Estop changes. +
342  Note that we we call Gscreen's built in functions we must use self.gscreen.[FUNCTION NAME]() +
343  If we used self.[FUNCTION NAME]() it would call the function in our handler file. +
344  
345  Lets add another key binding that loads halmeter when F4 is pressed. +
346   +
347  In the handler file under 'def initialize_widgets(self):' change to:
348  ----
349    def initialize_widgets(self):
350      self.gscreen.init_show_windows()
351      self.gscreen.keylookup.add_conversion('F4','TEST','on_keycall_HALMETER')
352  ----
353  Then add these functions under the 'HandlerClass' class:
354  ----
355    def on_keycall_HALMETER(self,state,SHIFT,CNTRL,ALT):
356      if state:
357        self.gscreen.on_halmeter()
358        return True
359  ----
360  
361  This adds a keybinding conversion that directs gscreen to call on_keycall_HALMETER when F4 is pressed. +
362  Then we add the function to the handle file to call a Gscreen builtin function to start halmeter. +
363  
364  === Linuxcnc State Status
365  
366  The module 'Gstat' polls linuxcnc's state every 100ms and sends callback messages to user functions when state changes. +
367  You can register messages to act on specific state changes. +
368  As an example we will register to get 'file-loaded' messages when linuxcnc loads a new file. +
369  First we must import the module and instantiate it: +
370  In the import section of the handler file add: +
371  ----
372  from hal_glib import GStat
373  GSTAT = GStat()
374  ----
375  
376  In the handler file under 'def \_\_init__(self):' add: +
377  ----
378  GSTAT.connect('file-loaded', self.update_filepath)
379  ----
380  
381  Then in the 'HandlerClass', add the function: +
382  ----
383  self.update_filepath(self, obj, path):
384      self.widgets.my_path_label.set_text(path)
385  ----
386  
387  When linuxcnc loads a new file, Gstat will send a callback message to the funciton 'update_filepath'. +
388  In this example whe update a label with that path name (assuming there is a label nammed 'my_path_label') in the GLADE file. +
389  
390  === Jogging Keys
391  
392  There are no special widgets to do screen-button jogging, so we must do it with python code. +
393  Under the connect_signals function add this code: +
394  ----
395          for i in('x','y','z'):
396              self.widgets[i+'neg'].connect("pressed", self['jog_'+i],0,True)
397              self.widgets[i+'neg'].connect("released", self['jog_'+i],0,False)
398              self.widgets[i+'pos'].connect("pressed", self['jog_'+i],1,True)
399              self.widgets[i+'pos'].connect("released", self['jog_'+i],1,False)
400          self.widgets.jog_speed.connect("value_changed",self.jog_speed_changed)
401  ----
402  
403  Add these functions under the HandlerClass class:
404  ----
405      def jog_x(self,widget,direction,state):
406          self.gscreen.do_key_jog(_X,direction,state)
407      def jog_y(self,widget,direction,state):
408          self.gscreen.do_key_jog(_Y,direction,state)
409      def jog_z(self,widget,direction,state):
410          self.gscreen.do_key_jog(_Z,direction,state)
411      def jog_speed_changed(self,widget,value):
412          self.gscreen.set_jog_rate(absolute = value)
413  ----
414  Finally add two buttons to the GLADE file for each axis - one for positive, one for negative direction jogging. +
415  Name these buttons xneg, xpos, yneg, ypos zneg, zpos respectively. +
416  add a SpeedControl widget to the GLADE file and name it jog_speed +
417  
418  == Gscreen Start Up
419  
420  Gscreen is really just infrastructure to load a custom GladeVCP file and
421  interact with it.
422  
423  . Gscreen reads the options it was started with.
424  . Gscreen sets the debug mode and set the optional skin name.
425  . Gscreen checks to see if there are 'local' XML, handler and/or locale files in the
426    configuration folder. It will use them instead of the default ones
427    (in share/gscreen/skins/) (There can be two separate screens displayed).
428  . The main screen is loaded and translations set up. If present the second
429    screen will be loaded and translations set up.
430  . Optional Audio is initialized if available.
431  . It reads some of the INI file to initialize the units, and the number/type
432    of axes.
433  . Initializes Python's binding to HAL to build a userspace component with the
434    Gscreen name.
435  . GladeVCP's makepins is called to parse the XML file to build HAL pins for
436    the HAL widgets and register the LinuxCNC connected widgets.
437  . Checks for a 'local' handler file in the configuration folder or else uses
438    the stock one from the skin folder.
439  . If there is a handler file gscreen parses it, and registers the function
440    calls into Gscreen's namespace.
441  . Glade matches/registers all signal calls to functions in gscreen and the
442    handler file.
443  . Gscreen checks the INI file for an option preference file name otherwise it
444    uses '.gscreen_preferences' =.
445  . Gscreen checks to see if there is a preference function call
446    ('initialize_preferences(self)') in the handler file otherwise it uses the
447    stock Gscreen one.
448  . Gscreen checks for classicladder realtime component.
449  . Gscreen checks for the system wide GTK theme.
450  . Gscreen collects the jogging increments from the INI file.
451  . Gscreen collects the angular jogging increments from the INI file.
452  . Gscreen collects the default and max jog rate from the INI.
453  . Gscreen collects the max velocity of any axes from the INI's TRAJ section.
454  . Gscreen checks to see if there is angular axes then collects the default and
455    max velocity from the INI file.
456  . Gscreen collect all the override setting from the INI.
457  . Gscreen checks if its a lathe configuration from the INI file.
458  . Gscreen finds the name of the tool_table,tool editor and param file from the
459    INI.
460  . Gscreen checks the handler file for keybindings function
461    ('initialize_keybindings(self)') or else use Gscreen stock one.
462  . Gscreen checks the handler file for pins function ('initialize_pins(self)')
463    or else use Gscreen stock one.
464  . Gscreen checks the handler file for manual_toolchange function
465    ('initialize_manual_toolchange(self)') or else use Gscreen stock one.
466  . Gscreen checks the handler file for connect_signals function
467    ('initialize_connect_signals(self)') or else use Gscreen stock one.
468  . Gscreen checka the handler file for widgets function
469    ('initialize_widgets(self)') or else use Gscreen stock one.
470  . Gscreen seta up messages specified in the INI file.
471  . Gscreen tells HAL the Gscreen HAL component is finished making pins and is
472    ready. If there is a terminal widget in the screen it will print all the
473    Gscreen pins to it.
474  . Gscreen sets the display cycle time based on the INI file.
475  . Gscreen checks the handler file for 'timer_interupt(self)' function call
476    otherwise use Gscreen's default function call.
477  
478  == INI Settings
479  
480  Under the [DISPLAY] heading:
481  
482  ----
483  DISPLAY = gscreen -c tester
484    options:
485     -d debugging on
486     -v verbose debugging on
487  ----
488  The -c switch allows one to select a 'skin'. Gscreen assumes the Glade file and
489  the handler file use this same name. The optional second screen will be the
490  same name with a 2 (eg. tester2.glade) There is no second handler file allowed.
491  It will only be loaded if it is present. Gscreen will search the LinuxCNC
492  configuration file that was launched first for the files, then in the systen
493  skin folder.
494  
495  == User Dialog Messages
496  
497  This function is used to display pop up dialog messages on the screen. +
498  These are defined in the INI file and controlled by HAL pins. +
499  'Boldtext' is generally a title. +
500  'text' is below that and usually longer. +
501  'Detail' is hidden unless clicked on. +
502  'pinname' is the basename of the HAL pins. +
503  'type' specifies whether its a yes/no, ok, or status message. +
504  Status messages will be shown in the status bar and the notify dialog. +
505  it requires no user intervention. +
506  ok messages require the user to click ok to close the dialog. +
507  ok messages have one HAL pin to launch the dialog and one to signify it's waiting 
508  for response. +
509  yes/no messages require the user to select yes or no buttons to close the dialog. +
510  yes/no messages have three hal pins - one to show the dialog, one for waiting, +
511  and one for the answer. +
512  
513  Here is a sample INI code. It would be under the [DISPLAY] heading. +
514  
515  [source,{ini}]
516  ----
517  # This just shows in the status bar and desktop notify popup.
518  MESSAGE_BOLDTEXT = NONE
519  MESSAGE_TEXT = This is a statusbar test
520  MESSAGE_DETAILS = STATUS DETAILS
521  MESSAGE_TYPE = status
522  MESSAGE_PINNAME = statustest
523  
524  # This will pop up a dialog that asks a yes no question
525  MESSAGE_BOLDTEXT = NONE
526  MESSAGE_TEXT = This is a yes no dialog test
527  MESSAGE_DETAILS = Y/N DETAILS
528  MESSAGE_TYPE = yesnodialog
529  MESSAGE_PINNAME = yndialogtest
530  
531  # This pops up a dialog that requires an ok response and it shows in the status bar and
532  # the destop notify popup.
533  MESSAGE_BOLDTEXT = This is the short text
534  MESSAGE_TEXT = This is the longer text of the both type test. It can be longer then the status bar text
535  MESSAGE_DETAILS = BOTH DETAILS
536  MESSAGE_TYPE = okdialog status
537  MESSAGE_PINNAME = bothtest
538  ----
539  
540  === Copy the Stock Handler/Glade File For Modification
541  
542  If you wish to use a stock screen but modify it's handler file, you need to 
543  copy the stock file to your config file folder. +
544  Gscreen will see this and use the 
545  copied file. +
546  But where is the original file? If using a RIP linuxcnc the 
547  sample skins are in /share/gscreen/skins/'SCREENNAME' +
548  Installed versions of linuxcnc have them in slightly different places depending 
549  on the distribution used. +
550  An easy way to find the location is to open a terminal 
551  and start the sim screen you wish to use. +
552  In the terminal the file locations will be printed. +
553  It may help to add the -d switch t0 the gscreen load line in the INI. +
554  
555  Here is a sample:
556  ----
557  chris@chris-ThinkPad-T500 ~/emc-dev/src $ linuxcnc
558  LINUXCNC - 2.7.14
559  Machine configuration directory is '/home/chris/emc-dev/configs/sim/gscreen/gscreen_custom'
560  Machine configuration file is 'industrial_lathe.ini'
561  Starting LinuxCNC...
562  Found file(lib): /home/chris/emc-dev/lib/hallib/core_sim.hal
563  Note: Using POSIX non-realtime
564  Found file(lib): /home/chris/emc-dev/lib/hallib/sim_spindle_encoder.hal
565  Found file(lib): /home/chris/emc-dev/lib/hallib/axis_manualtoolchange.hal
566  Found file(lib): /home/chris/emc-dev/lib/hallib/simulated_home.hal
567  **** GSCREEN WARNING: no audio alerts available - Is python-gst0.10 libray installed?
568  **** GSCREEN INFO ini: /home/chris/emc-dev/configs/sim/gscreen/gscreen_custom/industrial_lathe.ini
569  **** GSCREEN INFO: Skin name = industrial
570  
571  **** GSCREEN INFO:  Using SKIN glade file from /home/chris/emc-dev/share/gscreen/skins/industrial/industrial.glade ****
572  
573  **** GSCREEN INFO:  No Screen 2 glade file present
574  **** GSCREEN INFO: handler file path: ['/home/chris/emc-dev/share/gscreen/skins/industrial/industrial_handler.py']
575  ---- 
576  
577  The line: +
578  ----
579  **** GSCREEN INFO: handler file path: ['/home/chris/emc-dev/share/gscreen/skins/industrial/industrial_handler.py']
580  ----
581  shows where the stock file lives. Copy this file to your config folder. +
582  This works the same for the Glade file.
583