5 TUTORIAL: IMPLEMENTING A STARTUP TOOL FROM SCRATCH
This chapter is intended to help programmers, who are starting from scratch with the implementation of a startup tool for a new instrument, to implement a working prototype for their specific instrument. Experienced developers are encouraged to use this tutorial as a checklist, to avoid missing some minor implementation points.
5.1 ROADMAP
The implementation of the startup/shutdown scripts consists of the following main steps:
If your instrument is based in the Template Instrument, then the first steps can be skipped. See below for details.
5.2 IMPLEMENTATION ORDER OF ICS, DCS, OS AND STARTUP SCRIPTS
The instrumentation software is normally implemented in the following order: ICS and at least one DCS, then OS. The instrumentation startup/shutdown scripts can be configured in parallel as each instrumentation software component is completed.
By default, xxinsStart will always try to start all applications it knows. If a certain application is not ready yet, but is already described in the configuration file, then the default startup can be suppressed setting a corresponding keyword to `F' (see section 6.15, keywords OCS.CON.DEFAULT, OCS.INS1.DEFAULT, OCS.DETi.DEFAULT).
If your instrument is based on the Template Instrument, and you first followed the tutorials to implement and configure ICS and OS (based on Base ICS and BOSS), then the first sections of this tutorial can be skipped, and this tutorial can be followed starting with section 5.5.
5.3 INSTRUMENT IDENTIFIER AND SOFTWARE MODULE PREFIX
The instrument identifier (e.g. `UVES', represented with `XXXX' or `NNNN' in this document) and the software module prefix are widely used in the instrumentation software to identify files, processes, classes and data items related to the instrument.
The software module prefix are the two first letters of the instrumentation software modules (e.g. `uv', represented with `xx' or `nn' in this document). You have to select a two letters prefix, which is not reserved yet by any other instrument. The prefix is usually the network subnet name assigned to the instrument, as listed in [12], section 5.1; however, it is important to agree this prefix together with ESO: once selected, this prefix can not be modified.
5.4 RETRIEVING THE TEMPLATE INSTRUMENT MODULES
Retrieve the Template Instrument software modules storing them under a directory named according to your own instrument identifier. The startup scripts only need to update files located in modules xxins and xxmcfg. To retrieve the Template Instrument items, you need access to an UNIX account at ESO, in particular to the ESO Software Archive.
5.5 DEFINING THE STARTUP TOOL CONFIGURATION
The complete startup tool configuration is kept in a set of FITS keywords stored in two configuration files shared with other parts of the instrumentation software. Please read [23] and the beginning of the Configuration Guide (chapter 6) to understand how configuration works.
It is recommended to supply the complete startup tool configuration before trying to use the startup/shutdown scripts. If ICS (based on Base ICS) and OS (based on BOSS) are already configured, then most of the configuration needed by the startup tool is already available. Please refer to the Configuration Guide for details (sections 6.6 to 6.15). It is advisable to register the config. parameters in the NNNN Instrument User's and Maintenance Manuals, before starting with the implementation itself.
As a result of this step, the following files should have been updated:
5.6 ADAPTING THE TEMPLATE MODULES TO A NEW INSTRUMENT
2. You have defined the startup tool configuration and that you have documented it in your NNNN Instrument User's and Maintenance Manuals as described in section 5.5.
This section describes the files supplied in the template software modules that need to be adapted to your specific instrument, to be able to use the startup tool. The files are supplied in two modules: xxmcfg and xxins.
5.6.1 Module nnins
Module nnins is the integration module of the complete instrumentation software of the instrument, therefore, the module contains files not related with the startup tool. From the startup tool point of view, the following files are needed:
File nninsStoo.tcl is the source for file nninsStoo. This file may contain instrument specific startup code. See section 7.2 for details (this file can be updated later, once the startup script at least starts correctly without this code).
Normally, it should be possible to use the standard startup panel supplied by the startup tool. In this case, the file nninsStartup_uifClass.tcl is not needed and can be deleted. If an instrument specific panel is needed, then this file has to be updated (see section 5.7).
These files contain the description for the VUE menus described in section 4.1. These files are manually installed under the ~/.vue directory. The first file may be used in the xxxx account of the instrument workstation, to have the VUE menu available during development. The second file is installed in the xxxx account of the user station at Paranal, i.e. file nninsUwsVuewmrc is the actual file used at Paranal.
Make sure that the scripts nninsStartup, nninsStart and nninsStop, TCL script nninsStoo (if needed), panel nninsStartup.pan (if this panel is used, delete the nninsStartup script), nninsVuewmrc and nninsUwsVuewmrc files are registered in the Makefile. Replace all xxins strings with nnins, as necessary.
5.6.2 Module nnmcfg (MS/nnmcfg)
Module nnmcfg contains the instrument configuration files. From the startup tool point of view, the following files are needed:
File nnmcfgCONFIG.cfg must contain the basic description of the configuration sets INS and START. The files nnmcfgINS.cfg and nnmcfgSTART.cfg should be registered in this file (keywords CONFIG.SETi.FILEi), together with the corresponding dictionaries (usually: "ICB_CFG OSB_CFG STOO_CFG" is registered in keyword CONFIG.SETi.DICT). See [23], section 3.1 for details.
The configuration files nnmcfgINS.cfg and nnmcfgSTART.cfg should have been updated according to the instrument configuration, as described in section 5.5.
Note: Both files are installed by user xxxxmgr in the INS_ROOT, however user xxxx should have permission to update file nnmcfgSTART.cfg. Make sure that file nnmcfgSTART.cfg has group write permission, specially after evtl. manually installing it in the INS_ROOT. If in doubt, run after the installation:
5.7 IMPLEMENTING AN INSTRUMENT SPECIFIC STARTUP PANEL
The standard startup panel allows to update a specific set of keywords stored in the nnmcfgSTART.cfg file. If a different set of keywords needs to be updated, then an instrument specific version of this panel is needed. Proceed as follows:
Delete the script nninsStartup that is not longer needed. Delete it also from the Makefile and register instead the panel nninsStartup.
Use file xxinsStartup.pan supplied in module xxins as a starting point, rename it with the panel editor: Start the panel editor, load the xxinsStartup panel and save it with name nninsStartup.pan. After this, edit the file to rename the string XXXX with NNNN.
Edit the panel with the panel editor. Any widget can be removed or added, but it is recommended to maintain the standard look & feel.
To assign e.g. the logical keyword START.PANEL1.DEFAULT to a UifCheckButton widget, create the widget, open the widget configuration panel and register:
· variable: "cfg__START.PANEL1.DEFAULT", i.e. the keyword name prefixed with "cfg__" (with two underscores).
There is no need to register any TCL command in the widget. The code available in the panel template takes care of loading the keyword value into the widget when the panel is started and to update the keyword value according to the widget state when the Save button is pressed.
5.8 INSTALLING AND TESTING
It is possible to install and test the startup tool, when at least:
1. The applications to be started (ICS, DCS and/or OS) are properly implemented, configured and installed.
2. The startup tool is properly configured according to the available subsystems as described in the previous sections.
5.8.1 Installation
Install the instrument software as usual; if the installation is based on pkginBuild, then basically:
5.8.2 Testing the Startup Tool
Run and test as described in the demo session (chapter 3) or in the user's guide (chapter 4). Adjust the configuration as needed.
5.9 FINAL REMARKS
1. At the end, when the software is approx. stable, it is recommended to archive all software modules (cmmCopy), delete (or rename) the main ~/NNNN directory and test if the instrument software can be rebuilt and installed correctly from the Software Archive.
Quadralay Corporation http://www.webworks.com Voice: (512) 719-3399 Fax: (512) 719-3606 sales@webworks.com |