Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.atnf.csiro.au/computing/software/gipsy/hermes/tasks.html
Дата изменения: Unknown
Дата индексирования: Fri Jan 16 21:49:06 2009
Кодировка:

Поисковые слова: п п п п р п р п
Tasks

Tasks


Tasks in GIPSY are the application programs which do useful work for the user. They consist of one or more processes (usually one) which communicate with the user through a formalized collection of interface routines. Because of the use of these interface routines, tasks can be run from any version of Hermes. A COLA-script can also be started as a task.

A list of currently available tasks can be found in a separate document.

Running tasks

Tasks can be started with or without specifying parameters. To start a task without parameters, only the name of the task needs to be supplied.
taskname
To specify parameters, any number of keyword-value pairs separated by blanks can be added to the taskname:
taskname keyword1=value1 keyword2=value2 ....
When running interactively, this format can also be used to supply parameters to an already running task.

Tasknames may be preceded by an explicit directory. In this case, the task must be present in the specified directory; the task path is not searched. The directory may contain one or more environment variables (indicated by a leading $-character). If no explicit directory is specified, Hermes will search its task path to find it.

Run again with same parameters (``macro'')

Tasks can be run again with (partly) the same parameters by prefixing the task start command with an exclamation mark (!). Any explicitly specified parameters will supersede the corresponding old parameters. In this case the default file is not used. For historical reasons the previous parameters of a task are called the task's macro.

Run under a different name (``alias'')

Tasks can be run under a different name (``alias''). The command to do this is:
aliasname(filename) ...
Aliasname is the taskname under which the task will run and filename is the name of the task's executable file, specified in the correct case (lowercase for standard GIPSY tasks).

User input

Parameters for a task are passed to it via keywords. A keyword is a character string followed by an equal sign, e.g. INSET=. Keyword names are case-insensitive, i.e. uppercase and lowercase letters have the same meaning.

Parameters for a task can be specified in the command that starts the task and thereafter at any moment while the task is active. A task requiring input from the user causes Hermes to find out whether it has already been specified and if not, prompt the user. Before a parameter value is passed to a task, Hermes first checks whether it meets the task's request and if not, Hermes rejects that value and prompts again.

As the execution of the task proceeds, Hermes builds up a table of the task's keywords and associated values. At task termination this table is saved in order to allow the user to run the task again with (partly) the same parameters. When running interactively, a task's set of user inputs can be monitored, saved to a file, or edited.

Keyword classes

Three classes of keywords are recognized: The user can set a parameter in the task context to change requests for hidden keywords into requests for defaulted keywords. (``Unhide'' hidden keywords.)

Hidden keywords are sometimes used to control looping in a task. Each cycle round the loop, the task requests the value of a hidden keyword. If it has not been specified, the task takes the default and looping continues. If the user defines the keyword then that value is sent to the task which could cause the task to terminate the loop.

It is possible to pre-specify the input for a keyword that is requested repeatedly. This can be done on the command line or by using a `recall file'.

Default files

Keywords can be prespecified in a text file with a name like ``name.def'', where name is the name of a task. This default file can contain any number of keyword= value pairs. Any user supplied parameters will supersede those obtained from a default file.

The name of the task determines which default file will be read, not the name of the executable. This has consequences (and possibilities) for tasks which are run under an alias name.

User input formats

Basically Hermes is capable of providing tasks with the following types of parameters: numbers (integers, reals and double precision reals), logicals and character strings. Tasks may however request input in the form of character strings and perform their own decoding to obtain numerical information. One parameter value can contain one or more elements.

Task context

Tasks all run in a context. This context consists of a number of user-settable parameters: Tasks normally inherit their context from a template context. If a task is started by an other task, it inherits the context of that task.

When running interactively, both the template context and the context of any running task can be changed by the user. When Hermes is started, the template context contains the sensible defaults listed above, possibly modified by parameters from the Hermes defaults file.


Hermes GIPSY