Next: Interaction with FORTRAN programs
Up: Programming in GILDAS
Previous: Symbol Manipulation Routines
This section describes how GreG normally used as an interactive
plot utility, can also be used as a high level plot library.
GreG can be used exactly as a standard graphic library, but
because of the possibilities of the command line monitor, many
other possibilities are accessible.
Before presenting in detail the ``Library Version'' of GreG we should
distinguish between three different possible applications
of the GreG Library :
- 1.
- The occasional user who has a single repetitive graphic
problem which is part of another complex program. Interactive
control is not wanted. This case can often be solved using command procedures
and SIC images as data format when formatted I/O is definitely too slow.
This is very efficient and flexible.
If the user already
discarded this possibility, he (she) most likely wants the simplest programming
ever possible, will be satisfied by standard default values, and is not
really worried about optimum efficiency.
- 2.
- A programmer wanting to solve a single repetitive graphic
problem for use by other people. Interactive action is not wanted.
Simple programming is of little importance, but efficiency is a major problem.
- 3.
- A programmer wishing to
integrate elaborate and flexible graphic applications as
part of a more complete data analysis system. Interactive control by the user
and error recovery are necessary. Then all GreG capabilities are wanted, and
in addition this programmer may well be interested to use the possibilities of
the SIC monitor to ``supervise'' the data analysis system.
The library version of GreG allows all three cases to be solved adequately
by offering three different ways to call GreG services :
- 1.
- Passing a command to GreG using the routine GR_EXEC
GR_EXEC('Command Argument/Option') will execute the command
line exactly as if you had typed it interactively. Instead of
GR_EXEC, it is recommended to use GR_EXEC1, GR_EXEC2 and GR_EXECL for commands of languages GREG1, GREG2 and GTVL
respectively.
- 2.
- Calling an intermediate formatting routine which generates
the appropriate call to GR_EXEC from its own arguments.
Special entries are used to process possible options.
The advantage of this mode is to provide a more standard
program interface. Not all commands will be accessible in that way,
and it is marginally slower than the previous mode.
- 3.
- Calling subroutines which do not correspond to GreG commands
but directly generates plot actions. This way is the most
optimised access, since it bypasses the command line interpretor.
However, only standard things can be done like this, and it requires
some precautions because of the segmented nature of the graphic
library.
All three ways can be used within a single program, and the choice
between one or the other is just a matter of convenience and/or
efficiency.
In addition, the GreG plot library can be used either as a
classic package of subroutines (``Library Only''), or as an interactive
facility allowing user control at run time by means of the SIC monitor
possibilities (``Interactive''). The two modes can be mixed in a subroutine,
with the important restriction that the ``Library Only'' mode is just a subset
of the ``Interactive'' mode. It is not possible to change the mode during
program execution. A program using GreG plot library in
``Interactive'' mode in fact appears as a superset of the GreG interactive
utility.
Next: Interaction with FORTRAN programs
Up: Programming in GILDAS
Previous: Symbol Manipulation Routines
Gildas manager
2002-06-07