next up previous contents
Next: Windows NT / Windows Up: Customising FEMGV Previous: Start-up file

Subsections


Synonyms

            

Up to 300 synonyms may be defined, and read in from a startup file whenever a FEMGV session is initiated.

The intention is that a user may develop a number of additional commands, abbreviations, and command macros, and that these can give FEMGV a more flexible, powerful, and personalised command language, than can be achieved by any other means.

Commands may be translated into other languages using this technique, or commands may be redefined to fit in with other programs with which a particular user is familiar.

The examples in this section are intended only to give the user a broad indication of areas where synonyms can be used to make the software more user-friendly.

Synonym Files

The user can maintain a file of command synonyms in order to customise an installation of FEMGV to particular requirements. This file, if kept in the FEMGV directory, will be read automatically when the program is run.

The name of the synonym file will generally be fgvsyn.syn but if necessary the user should refer to the separate installation notes provided, or consult with his FEMGV distributor.

An example synonym file is included as part of the standard delivery of FEMGV and can be found in the 'demo' sub_directory of the installation. This file can be activated by setting the environment variable FGVSYN to the path of the 'demo' directory. The file can of course be modified and extended by the user.

Single Key Synonyms

There are many single keys on the standard computer keyboard that can be used to have special meanings using synonyms. The examples below are used for the manipulation of synonyms themselves, and will be assumed in the following sections in order to abbreviate synonym handling commands :

   UTILITY SETUP SYNONYM ADD + 1 UTILITY SETUP SYNONYM ADD
   UTILITY SETUP SYNONYM ADD - 1 UTILITY SETUP  SYNONYM DELETE
   UTILITY SETUP SYNONYM ADD = 1 UTILITY SETUP  SYNONYM LIST
   UTILITY SETUP SYNONYM ADD _ 1 UTILITY SETUP  SYNONYM LIST M

The last line defines the underline key (upper case -) to list all synonyms which begin with the letter 'M'. This facilitates the listing of macros if the practice of using 'M' followed by a number is followed to define useful macros.

Function Key Synonyms

It is also possible to assign synonyms to the Function keys on your keyboard. Up to 20 function keys are supported and they may be assigned different synonyms depending upon whether they are modified by the SHIFT and/or CONTROL keys.

The function keys are referenced by the name:

   FnKEY      Function key Fn
   FnSKEY     Function key Fn and SHIFT
   FnCKEY     Function key Fn and CONTROL
   FnSCKEY    Function key Fn and both SHIFT and CONTROL

Command Macros

Synonyms may be used to define macros such that one command will be mapped to a sequence of commands, inhibiting redraws with semi-colons. It is recommended that the letter M followed by a number be used to identify command macros, with two characters specified as the search range.

   + M1 2 E R T 45 45 45;R L L1;R N D A;M B;P S;E F
   + M2 2 E R T 45 45 45;R L L1;R N S XX;R C VO;V M;P P;E F
   + M3 2 E R T 45 45 45;R L L1;R N S XX;R C VO;V H F;
     P C L 12;E F

            etc.

In other cases a more meaningful macro name (or letter) could be used :

   + XSECTION 1 V S C;E N;E L;E F
   + VONMISES 2 R N S XX;R C VO

There is a restriction in the current release, in that the synonyms themselves are limited to 12 characters, of which the search string may be from 1 to 6 characters long, and the strings that are substituted for the synonyms are limited to 60 characters.

Macros cannot refer to other macros in this release of FEMGV. All the commands in the substitution strings of synonyms must be valid FEMGV commands.

Parameter Substitution

It is possible to define synonyms that allow command parameters to be input :

   + PICT 4 R L $1; R N STRESS $2; P C L $3

This defines a synonym called PICT. The $1, $2 and $3 specify that three parameters will be required to satisfy the synonym. If, for example, the user enters :

   PICT CASE1 XX 12

Then this will generate the following command sequence :

   RESULTS LOADCASE CASE1 ;
   RESULTS NODAL STRESS XX ;
   PRESENT CONTOURS LEVEL 12

It is possible to use the same parameter more than once. For example :

   + TURN 4 E R R $1; E R U $1; E R C $1

A parameter may be optional. This is indicated by use of a '-' and is only possible for the last parameter. Thus with the synonym :

   + FRED 4 V G $1 $-2; E F

it is possible to enter either :

   FRED B12

to generate :

   VIEW GEOMETRY B12;
   EYE FRAME

or, to enter :

   FRED B12 BLUE

to generate :

   VIEW GEOMETRY B12 BLUE;
   EYE FRAME

Parameter substitution can be useful when reading command files from other pre-processor systems as it allows the order of input arguments to be changed. Take for example the problem of mapping a command such as TRFM TR1 ROT to the FEMGV command CONSTRUCT TRANSFORM ROT TR1. This can be achieved by the synonym :

   + TRFM 4 CO TR $2 $1

If a command synonym that uses parameter substitution is incompletely entered then the user will be prompted for input with '$1=$\gt$', '$2=$\gt$' ....... '$n=$\gt$' where the prompts will appear in the order the parameters are required in the expanded command.

System synonyms

Operating system commands can also be included in synonyms. The system command needs to be enclosed in double quotation marks, for example UTILITY SETUP SYNONYM ADD DIR "!ls" would create a synonym DIR which will show the directory contents on a UNIX computer.

Selection of Loadcases

Depending upon the names assigned to loadcases at a particular site, the user may wish to establish easy loadcase selection. For example, the loadcases from a particular interface program may be given the names LC0001, LC0002 etc., and these may be selected by synonyms 'L1','L2', etc..

   + L1 2 R L LC0001
   + L2 2 R L LC0002
        etc.

Priority Synonyms

Priority synonyms are synonyms which it is not possible to define, redefine or delete using on-line commands. They may only be defined within an off-line synonym file.

A priority synonym is defined by specifying the search string for the synonym to be 7 characters long, regardless of the actual length of the synonym.

In the following example, the synonyms 'UP' and 'DOWN' are defined as priority synonyms.

   UTILITY SETUP SYNONYM ADD UP 7 EYE ROTATE UP
   U S S A DOWN 7 E R D

Towards a Natural Language

Use of synonyms may be seen as a way to achieve a more natural langauge for the program. By using synonyms it is possible to cut down on the number of keystrokes required to perform a particular task; however, an equally valid aim might be to give FEMGV a more natural feel even if the required number of keystrokes is the same. For example, the following synonyms are probably easier to remember than the actual FEMGV commands:

   + UP 2 E R U
   + DOWN 2 E R D
   + LEFT 2 E R L
   + RIGHT 2 E R R

   + ZOOM 1 E Z
   + ROTATE 3 E R
   + FRAME 2 E F

There are many uses of synonyms which have not been explored here. For example, translation into foreign languages, upward compatibility with superceded commands, cursor enquiry abbreviations, graphing abbreviations, and abbreviation for labeling facilities.


next up previous contents
Next: Windows NT / Windows Up: Customising FEMGV Previous: Start-up file

Femsys Limited
9/10/1999