next up previous
Next: Creating I/O Drivers Up: Enhancing XRTiC Previous: Example Calls

Adding Tokens

Users can add tokens which can be parsed from the user's user_GUI.par file by doing all of the following. Tokens are used to manipulate the defaults of both the reactive and embedded tasks. In what follows, assume that the user wants to add a new token by the name of ``mywidget'':

  1. write a C source code ``mywidget.c'' which has an entry point such as ``mywidget()'' that accepts the appropriate number of parameters, and links a certain action on the given GTK widgets to an event handling routine. The event handling routine must load all the appropriate values into the parameter transfer structure denoted by its unique identifier and call the ``parameter_send()'' function. It is recommended that you take a look at the non_rt_tasks/toolbox/slider.c widget source code for a better description of how to develop your own widgets which update scalar parameters.

  2. write a header source file ``mywidget.h'' which declares the user's new world accessible functions. Again, refer to the file slider.h for a better description of this header file.

  3. altering the parsing rules file utilities/GUIparse.y: this file describes the rules that will be used when parsing. This new rule must parse in a token ``mywidget'' from the user's user_GUI.par file, including a unique identifier, and write out appropriate source code to stdout, which when compiled will allow the user to call the entry function in the user's new ``mywidget.c'' file.

  4. altering the file non_rt_tasks/toolbox/Makefile.am: this file tells RTiC-Lab to include the user's C files while compiling the code, and

  5. non_rt_tasks/toolbox/toolbox.h: this file must include the user's header file

Token developers are highly encouraged to take a look at the files and entries for the tokens trigger, toggle, and slider, for a complete example of how to develop the user's own token set.

Token developers are fully encouraged to share their tokens with the controls community. To do so, please submit your new tokens to the author: efhilton@fsmlabs.com . Tokens will be added to future releases of RTiC-Lab and/or will be posted on the web for others to download.


next up previous
Next: Creating I/O Drivers Up: Enhancing XRTiC Previous: Example Calls
Michael Barabanov 2001-06-19