B. oa_pref File: Setting User Preferences
B. OA_PREF FILE: SETTING USER PREFERENCES
It is possible to set "user preferences" in the oa_pref file outside the programme. This file allows customisation of many aspects of the programme: for example colours, function key operations, display attributes, laser file settings, and so on. This can be done in three ways:
- From Options > Edit Prefs in D3PLOT
- From the Preferences editor called from the Shell
- By hand-editing the preference file.
"oa_pref" naming convention and locations
The file is called "oa_pref". It is looked for in the following places in the order given:
- The optional administration directory defined by the environmental variable ( $OA_ADMIN or $OA_ADMIN_xx where xx is the release number).
- The site-wide installation directory defined by the environment variable ( $OA_INSTALL )
- The user's home directory: $HOME (Unix/Linux) or %USERPROFILE% (Windows)
- The current working directory
See Installation organisation for an explanation of the directory structure.
All four files are read (if they exist) and the last preference read
will be the one used, so the file can be customised for a particular job
or user at will.
Files do not have to exist in any of these locations, and if none exists
the programme defaults will be used.
On Windows$HOME on Unix and Linux is usually the home directory specified for each user in the system password file.
The shell command " printenv " (or on some systems " setenv ") will show the value of this variable if set.
If not set then it is defined as the " ~ " directory for the user. The command " cd; pwd " will show this.
%USERPROFILE% on Windows is usually C:\Documents and Settings\ <user id> \
Issuing the " set " command from an MS-DOS prompt will show the value of this and other variables.
Generally speaking you should put
- Organisation-wide options in the version in $OA_ADMIN_xx and/or $OA_INSTALL,
- User-specific options in $HOME / %USERPROFILE%
- Project-specific options in the current working directory.
The file contains preferences for the SHELL (lines commencing shell*), THIS (lines commencing this*), D3PLOT (lines commencing d3plot*), PRIMER (lines commencing primer*)and REPORTER (lines commencing reporter*). All lines take the format <preference name> <preference value>.
The general copy of the preference file should be present in the $OA_ADMIN_xx and/or $OA_INSTALL directory. This should contain the preferences most suitable for all software users on the system.
An individual's specific preferences file can be stored in the individual's home area. This can be used to personally customise the software to the individual's needs.
Whenever one of the programs whose preferences can be stored in the oa_pref file is fired up, the program will take preferences first from the general preference file in the $OA_ADMIN_xx directory (if it exists) then the $OA_INSTALL directory, then from the file in the user's home area, then from the current working directory.
Preferences defined in the general oa_pref file can be modified in the user's personal file but they can't be removed by it.
From Oasys Suite 9.4 onwards preferences can be locked. If a preference is locked it cannot be changed in an oa_pref file in a more junior directory. To lock a preference use the syntax 'd3plot#' rather than 'd3plot*' .