Geographic
To UTM
toUTM · toUTM(lat: double, lon: double)
Converts a latitude and longitude to Universal Transverse Mercator coordinates - metres, so distances between two points can be worked out by subtraction.
Parameters
| Name | Type | Description |
|---|---|---|
lat |
double |
The latitude in decimal degrees, positive north. |
lon |
double |
The longitude in decimal degrees, positive east. |
Returns object: A record holding northing and easting in metres, and zone, the zone number and latitude band letter as text ("19H").
Examples
toUTM(-33.45, -70.66) → {easting: 345713.051560063, northing: 6297591.954234887, zone: "19H"}
toUTM(-33.45, -70.66).zone → "19H"
round(toUTM(-33.45, -70.66).easting) → 345713
Data Orchester Site: provided by the Site; the description says where it acts.
Site
Close panel
closePanel · closePanel(id: string)
Takes away the panel occupying this id on the current screen, wherever it was opened from. Does nothing when nothing is showing there. It acts only in an Action button's script: anywhere else - a variable formula, a widget property - it does nothing and gives null.
Parameters
| Name | Type | Description |
|---|---|---|
id |
string |
The slot the panel was opened under. |
Returns any: Always null - the function is called for its effect on the view.
Examples
closePanel("detail") → null
Data Orchester Site: provided by the Site; the description says where it acts.
Open dashboard
openDashboard · openDashboard(code: string, [bindings: object])
Replaces what the current view is showing with another dashboard - how an Action button navigates the operator somewhere. From inside a panel it navigates the panel. Does nothing when no dashboard carries that code. It acts only in an Action button's script: anywhere else - a variable formula, a widget property - it does nothing and gives null.
Parameters
| Name | Type | Description |
|---|---|---|
code |
string |
The code of the dashboard to open. |
bindings |
object (optional) |
Parameters of the dashboard mapped onto the variables they should stand for, as in {TEMP: "BOILER_TEMP"}. Each variable is named by its code in quotes - written bare it would be read for its value instead. Only parameters the dashboard declares are bound; a dashboard normally declares none. |
Returns any: Always null - the function is called for its effect on the view.
Examples
openDashboard("OVERVIEW") → null
openDashboard("PUMP_DETAIL", {PUMP: "P_101"}) → null
Data Orchester Site: provided by the Site; the description says where it acts.
Open panel
openPanel · openPanel(id: string, code: string, dX: double, dY: double, [bindings: object])
Shows a panel over the current view, centred at an offset from the component that ran this script. One panel per id: asking again for an id that is already showing the same panel in the same place changes nothing, and asking for a different one replaces it. Close it with closePanel. Does nothing when no panel carries that code. It acts only in an Action button's script: anywhere else - a variable formula, a widget property - it does nothing and gives null.
Parameters
| Name | Type | Description |
|---|---|---|
id |
string |
The slot the panel occupies on this screen. Only one panel can occupy an id at a time. |
code |
string |
The code of the panel to open. |
dX |
double |
Horizontal offset, in canvas units, from the centre of the calling component to the centre of the panel. |
dY |
double |
Vertical offset, in canvas units, from the centre of the calling component to the centre of the panel. Negative places the panel above. |
bindings |
object (optional) |
Parameters of the panel mapped onto the variables they should stand for, as in {TEMP: "BOILER_TEMP"}. Each variable is named by its code in quotes - written bare it would be read for its value instead. A parameter left unbound is read as a global of its own name. |
Returns any: Always null - the function is called for its effect on the view.
Examples
openPanel("detail", "PUMP_PANEL", 0, -120, {PUMP: "P_101"}) → null
openPanel("detail", "PUMP_PANEL", 0) → syntax error
Data Orchester Site: provided by the Site; the description says where it acts.
This page describes Amtiri Script 5.4.1 as shipped with Data Orchester engine 6.12.1 and Site 1.22.7.