Built-In Namespace _global_
Field Attributes | Field Name and Description |
---|---|
<static> |
An associative array containing the user supplied arguments identical to arg.
|
<static> |
A magic variable which is always set to the modification time of the
JavaScript file currently executed, if any.
|
<static> |
A magic variable which is always set to the filename of the
JavaScript file currently executed, if any.
|
<static> <constant> |
A magic variable which is always set to the start time when the
current JavaScript session was started.
|
<static> |
An associative array containing the user supplied arguments identical to $.
|
Method Attributes | Method Name and Description |
---|---|
checkStates(table, timeout, wait)
Waits for the timeout (in ms) for the given servers to be online
and in one of the provided states.
|
|
<static> |
exit()
Forecefully exit the current script.
|
<static> |
File(name, delim)
Reads a file as a whole.
|
<static> |
include(name)
Includes another java script.
|
reconnect(list, txt)
reconnect to problematic FADs
Dis- and Reconnects to FADs, found to be problematic by call-back function
onchange() to have a different CONNECTION value than 66 or 67.
|
|
<static> |
version()
|
Field Detail
<static>
{Array}
$
An associative array containing the user supplied arguments identical to arg.
Defined in: _global_.js.
Defined in: _global_.js.
var value = $['name'];
<static>
{Date}
__DATE__
A magic variable which is always set to the modification time of the
JavaScript file currently executed, if any.
Defined in: _global_.js.
Defined in: _global_.js.
console.out(__DATE__);
<static>
{String}
__FILE__
A magic variable which is always set to the filename of the
JavaScript file currently executed, if any.
Defined in: _global_.js.
Defined in: _global_.js.
console.out(__FILE__);
<static> <constant>
{Date}
__START__
A magic variable which is always set to the start time when the
current JavaScript session was started.
Defined in: _global_.js.
Defined in: _global_.js.
console.out(__START__);
<static>
{Array}
arg
An associative array containing the user supplied arguments identical to $.
Defined in: _global_.js.
Defined in: _global_.js.
for (var key in arg) console.out("arg["+key+"]="+arg[key]);
Method Detail
checkStates(table, timeout, wait)
Waits for the timeout (in ms) for the given servers to be online
and in one of the provided states.
Returns true if MAGIC_WEATHER is online, FTM_CONTROL is in Idle
and LID_CONTROL is either in Open or Closed.
Returns false if all given servers are online, but at least one is
not in the expected state.
Throws an exception if not all provided servers are online after
the given timeout.
If you want to wait infinitely: CheckStates(table, null)
If the timeout is negative (e.g. -500 means 500ms) or zero,
no exception is thrown but false is returned.
Defined in: CheckStates.js.
Defined in: CheckStates.js.
var table = [ [ "MAGIC_WEATHER" ], [ "FTM_CONTROL", [ "Idle" ] ], [ "LID_CONTROL", [ "Open", "Closed" ] ], ]; checkStates(table);
- Parameters:
- table
- {Integer} timeout Optional, Default: 5000
- timeout in milliseconds
- wait
- Throws:
- Returns:
<static>
exit()
Forecefully exit the current script. This function can be called
from anywhere and will terminate the current script.
The effect is the same than throwing a null expecption ("throw null;")
in the main thread. In every other thread or callback, the whole script
will terminate which is different from the behaviour of a null exception
which only terminates the corresponding thread.
Defined in: _global_.js.
Defined in: _global_.js.
<static>
{String|Array[String]}
File(name, delim)
Reads a file as a whole.
Files can be split into an array when reading the file. It is
important to note that no size check is done. So trying to read
a file larger than the available memory will most probably crash
the program. Strictly speaking only reading ascii fils make sense.
Also gzip'ed files are supported.
Note that this is only meant for debugging purpose and should
not be usd in a production environment. Scripts should not
access any files by defaults. If external values have to be
provided arguments should be given to the script.
Defined in: _global_.js.
Defined in: _global_.js.
var string = File("fact++.rc"); var array = File("fact++.rc", "\n");
- Parameters:
- {String} name
- Name of the file to read. The base directory is the current working directory
- {String} delim Optional, Default: undefined
- A delimiter used to split the file into an array. If provided it must be a String of length 1.
- Throws:
- If number or type of arguments is wrong
- If there was an error reading the file, the system error is thrown
- Returns:
- {String|Array[String]} If no delimiter is given, a StringObject with the file (read until \0) is returned. If a delimiter is given, an array of Strings is returned, one for each chunk. Both objects contain the property 'name' with the file name and the array contains the property 'delim' with the used delimiter.
<static>
{Array}
include(name)
Includes another java script.
Note that it is literally included,
i.e. its code is executed as if it were at included at this
place of the current file.
Defined in: _global_.js.
Defined in: _global_.js.
- Parameters:
- {String} name Optional, Default: "test"
- Name of the file to be included. The base directory is the directory in which dimctrl was started.
- {String} . . . Optional
- More files to be included
reconnect(list, txt)
reconnect to problematic FADs
Dis- and Reconnects to FADs, found to be problematic by call-back function
onchange() to have a different CONNECTION value than 66 or 67.
Defined in: takeRun.js.
Defined in: takeRun.js.
if (!sub_connections.reconnect()) exit();
- Parameters:
- list
- txt
- Returns:
- a boolean is returned. reconnect returns true if: * nothing needed to be reset --> no problems found by onchange() * the reconnection went fine. reconnect *never returns false* so far.
<static>
{String}
version()
Defined in: _global_.js.
- Returns:
- {String} A string with the JavaScript V8 version is returned.