Resource file 2 is intended to be used by developers of multi-user applications to set resources specific to an application for all users of that application. For example, the developer may want to default the viewport resources for a particular output device.
Resource files 3 and 4 are for users; 3 allows the user to provide default resources for all HLU applications, similar to Resource file 1, $(NCARG_SYSRESFILE). 4 allows the user to provide resources on an application-specific basis, similar to Resource file 2, the System Application Specific Resource file.
The final value assigned to each resource is determined by proceeding from file 1 through file 4 with each succeeding value taking precedence over the previous one.
Each HLU program needs an application (App) object. It is either created through an NhlOpen call, or explicitly created in your program through an NhlCreate call after an NhlInitialize call as in:
Fortran: call nhlfcreate(appid,'xy05',nhlfappclass,0,rlist,ierr) C: NhlCreate(&appid,"xy05",NhlappClass,NhlDEFAULT_APP,rlist);
The resource list, rlist, in the above examples could contain the pathnames of the system application specific resource file (file 2), and the users application specific resource file (file 4), as in:
Fortran: call nhlfrlsetstring(rlist,'appUsrDir','./',ierr) Fortran: call nhlfrlsetstring(rlist,'appFileSuffix','.res1',ierr) Fortran: call nhlfrlsetstring(rlist,'appSysDir','~/',ierr) C: NhlRLSetString(rlist,NhlNappUsrDir,"./"); C: NhlRLSetString(rlist,NhlNappFileSuffix,".res1"); C: NhlRLSetString(rlist,NhlNappSysDir,"~/");Adding resource values in the rlist is simply adding them to a dynamic array that is not actually applied until the NhlFCreate or NhlCreate call. Note that we can also set the suffix of a type 4 file. The default value is .res.
These resources are also settable from the resource database; however, they cannot be specified in the application-specific resource files (2 and 4) because these resources are used to find resource files 2 and 4.
setenv NCARG_ROOT /path/name/where/installedin your .cshrc file. We can then locate the default resource files relative to this install location.
NhlCreate(&appid,"ti01",NhlappClass,NhlDEFAULT_APP,rlist);shows the creation of an application named ti01. Thus, if the resource file suffix for this application is allowed to default to .res, the file will be named ti01.res.
% ncargpath sysresfile % ncargpath sysappres % ncargpath usrresfileThe file usrresfile will not exist unless the user creates it.
NG4.1 Home, Index, Examples, Glossary, Feedback, UG Contents, UG WhereAmI?