This is an old revision of the document!
Event Manager
Script Reference
Change Property
Changes the value of the specified property on a component to the specified value.
Method Signatures
changeProperty("[Component Id]", "[Property Name]", "[Property Value]")
Parameter | Type | Description | Required? |
---|---|---|---|
Component Id | string | The id of the property you want to change a property of. | Yes |
Property Name | string | The name of the property you would like to alter. | Yes |
Property Value | any | The value to set the property to. | Yes |
Set Position
Changes the position of a component to the provided XY co-ordinate.
Method Signatures
setPosition("[Component Id]", "[X Position]", "[Y Position]")
Parameter | Type | Description | Required? |
---|---|---|---|
Component Id | string | The id of the property you want to change the position of. | Yes |
X Position | numeric | The x co-ordinate of the position to move the component to. | Yes |
Property Value | numeric | The y co-ordinate of the position to move the component to. | Yes |
Set Query
Changes the query settings of the dashboard.
Method Signatures
setQuery("[Start Time]", "[End Time]", "[Interval]", "[Data Function]")
Parameter | Type | Description | Required? |
---|---|---|---|
Start Time | string | The start date to set the query to, which can either be an absolute date in ISO format or a relative value e.g. *-10d, *-1h. | Yes |
End Time | string | The end date to set the query to, which can either be an absolute date in ISO format or a relative value e.g. *, *-1h. | Yes |
Interval | string | The interval to set the query to e.g. 1d, 1h, 1m. | Yes |
Data Function | string | The data function to set the query to e.g. PLOT, MAX, MIN, INTERP, AVG or RAW | Yes |
Write Value
Writes a value to the snapshot of the specified tag.
Method Signatures
writeValue("[Datasource Name]", "[Tag Name]", "[Value To Write]", "[Note]", "[Success Callback]", "[Fail Callback]")
Parameter | Type | Description | Required? |
---|---|---|---|
Data Source Name | string | The qualified data source name the tag belongs to. | Yes |
Tag Name | string | The name of the tag the value is to be written to. | Yes |
Value To Write | string/numeric | The value to be written to the tag. It can be a string value or a numeric value. | Yes |
Note | string | A note to be attached to the value being written | No |
Success Callback | function | Function that will be called when the write is successful. | No |
Fail Callback | function | Function that will be called when the write fails. | No |
Get Value
Retrieves the value for the specified tag.
Method Signatures
getValue("[Data Source]", "[Tag Name]", "[Use Selected]", "[Index]")
Parameter | Type | Description | Required? |
---|---|---|---|
Data Source | string | The data source of the tag to retrieve the value for. | Yes |
Tag Name | string | The name of the tag to retrieve the value for. | Yes |
Use Selected | boolean | Indicates whether to return the currently selected point, or the latest. True will return the select and false will return the lates. | No |
Index | boolean | The index of a specific value in the data array to return. If Use Selected is true this will have no effect. | No |
Get String Value
Retrieves the string value for the specified tag.
Method Signatures
getStringValue("[Data Source]", "[Tag Name]")
Parameter | Type | Description | Required? |
---|---|---|---|
Data Source | string | The data source of the tag to retrieve the string value for. | Yes |
Tag Name | string | The name of the tag to retrieve the string value for. | Yes |
Get Tag Data
Retrieves the entire data array for the specified tag.
Method Signatures
getTagData("[Data Source]", "[Tag Name]")
Parameter | Type | Description | Required? |
---|---|---|---|
Data Source | string | The data source of the tag to retrieve the data for. | Yes |
Tag Name | string | The name of the tag to retrieve the data for. | Yes |
Get Timestamp
Retrieves the latest timestamp for the specified tag.
Method Signatures
getTimeStamp("[Data Source]", "[Tag Name]")
Parameter | Type | Description | Required? |
---|---|---|---|
Data Source | string | The data source of the tag to retrieve the latest timestamp for. | Yes |
Tag Name | string | The name of the tag to retrieve the latest timestamp for. | Yes |
Swap Tags
Swaps out the current set of tags present in the page for a new set.
Method Signatures
Transform Tags
Applies a transform to the names of the tags present in the page.
Method Signatures
Get Page State
Retrieves a value under the given key from the page state store.
Method Signatures
getPageState("[key]")
Set Page State
Sets a value under the given key from the page state store.
Method Signatures
setPageState("[key]", "[value]")
Get Component
Retrieves the object reference of the component matching the specified ID.
Method Signatures
getComponent("[Component Id]")