08.06.2013 Views

Bernese GPS Software Version 5.0 - Bernese GNSS Software

Bernese GPS Software Version 5.0 - Bernese GNSS Software

Bernese GPS Software Version 5.0 - Bernese GNSS Software

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

19.6.2 Variables in User Scripts<br />

19.6 User Scripts<br />

All information required by the user scripts is available in form of system variables. This<br />

means that, e.g., old scripts written in Bourne shell can directly use the system variable $U<br />

and the Perl scripts could use the corresponding syntax $ENV{U}. However, new Perl scripts<br />

that inherit the run method from the RUNBPE object should refer to the environment variables<br />

through the object reference “$bpe” (see the example in the previous section). There<br />

are two possibilities: $$bpe{variable name} or $bpe->{variable name}. Both syntaxes<br />

are equivalent. The getKeys method from RUNBPE provides a general mechanism to get<br />

variables, see Section 19.6.5.1.<br />

All the variables available in user scripts may be divided into three categories:<br />

1) Environment Variables<br />

The first category contains variables defined in LOAD<strong>GPS</strong>.setvar file (on UNIX platforms –<br />

see Section 19.3.3) or listed in the special variable BERNESE VARIABLES (under Windows).<br />

The user may arbitrarily expand the list of these variables, however at least the following<br />

variables should always be included: ${BPE}, ${C}, ${T}, ${U}, ${X}, ${XG}, ${XQ}<br />

(remember, however, that in the BPE the variable ${U} has been re-defined, its original<br />

value is accessible by $$bpe{U OLD}).<br />

In general environment variables should be accessed in Perl user scripts using the methods<br />

$$bpe{variable name} or $bpe->{variable name} and not with $ENV{U}. It may, e.g.,<br />

be that the client has started on a host where the <strong>Bernese</strong> environment variables are not<br />

available. On UNIX systems the client gets the name of the LOAD<strong>GPS</strong>.setvar file from the<br />

server, extracts the variable names from there and inserts them into the client’s namespace<br />

without defining them as system environment variables.<br />

2) Client Variables<br />

The BPE server sends a list of variables and their values to each client when it commands<br />

the client to start the user script. Table 19.9 gives a list of the variables together with their<br />

values stemming from a run of script ORBGEN in the example BPE RNX2SNX.PCF. Note, that<br />

the script was neither master nor a slave and therefore the variables $CONTROL FILE and<br />

$CONTROL FILE LINE are not defined.<br />

Additional variables are defined and available as client variables. An interesting variable is<br />

$$bpe{SYSOUT} which contains the name of the program output file of the last program<br />

executed in a Perl user script using the run method. The script may then, e.g., append the<br />

file to a protocol file.<br />

In addition to the variables listed in Table 19.9 the plus-minus time variables listed on page<br />

380f of the documentation of <strong>Version</strong> 4.2 [Hugentobler et al., 2001] such as DAYMP1 are still<br />

available for backward compatibility. It is, however, not recommended to use these variables.<br />

Use the method RUNBPE::getKeys instead (see Section 19.6.5.1).<br />

<strong>Bernese</strong> <strong>GPS</strong> <strong>Software</strong> <strong>Version</strong> <strong>5.0</strong> Page 397

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!