Event Definitions#
Instantaneous changes are captured using Events.
ATLAS has a dedicated display for events, and renders them in the waveform timeline alongside sampled data.
picture?
How are events different from sampled data?
Sampled data is generally a measure of a value varying continuously within a time interval, whereas an event is generated at a precise moment.
For example: an event can capture a switch position change at the moment it happens, together with a value indicating the new position; sampled data would typically check the switch position at intervals and record the current state as a value.
Events are parameterized — they can have associated values or text.
Like parameters for sampled data, events have an Event Definition in configuration, which provides extra description and formatting rules for the data.
Properties#
Id
(integer):- Unique id. This should be unique amongst all apps — which can be awkward, but is really necessary for ATLAS to work correctly in all scenarios, including hardware logging where only the ID is present in the data stream.
Id Code
(text):- Alternate id for display and filtering. Not currently used by ATLAS — see note below.
Description
(text):-
Human-readable description of the event.
By convention, this is a short title. The event itself can carry further text when raised.This should include the Id Code at the start &mdash see note below.
Priority
(enum):-
Priority (severity), which can then be used for filtering.
Can be one of:
Debug
,Low
,Medium
,High
. Conversions
:-
Conversion names — in order — to format the data associated with events when they are raised.
Events can contain values or text. If there is no text, the values (if present) are formatted and concatenated to status text using the conversions — commonly using Text Conversions. If text is present in the event, ATLAS will render that instead.
The number and order of conversions must match the data. ATLAS is currently limited to handling up to three data values in each event.
Important
Id Code
is currently not used by ATLAS.
To get the expected result, we recommend formatting the Description
to include the Id
and app name as a prefix:
Id
as four-digit hex:
separator- App name
- space
- Description text
For example: "01AF:app Some event"
var config = new ConfigurationBuilder
{
Applications =
{
new ApplicationBuilder("demo")
{
EventDefinitions =
{
new EventDefinitionBuilder(1, "Turbine State Changed")
{
Priority = EventPriority.High,
ConversionNames =
{
"turbineBool:demo"
}
}
},
Conversions =
{
new TextConversionBuilder("turbineBool:demo")
{
Table =
{
[0] = "false",
[1] = "true"
},
DefaultValue = "?",
Format = "Deployed: %s"
}
}
}
}
}.BuildConfiguration();
{
"demo": {
"events": [
{
"id": 1,
"code": "0001:demo",
"desc": "Turbine State Changed",
"pri": "high",
"convs": [
"turbineBool:demo"
]
}
],
"conversions": [
{
"name": "turbineBool:demo",
"unit": "",
"format": "Deployed: %s",
"text": {
"keys": [
0.0,
1.0
],
"values": [
"false",
"true"
],
"default": "?"
}
}
]
}
}