-
Notifications
You must be signed in to change notification settings - Fork 11
SignalSets and Signals
Master data are kept in a MySQL database, but the framework mostly works only with data in a temporary storage provided by the ElasticSearch. IVIS framework uses concepts of signal set and signals to categorize data.
A signalSet is a container which groups related signals together. The data are saved in form of records, each of which contains values for the signals in the signalSet. One of the signals in a signalSet is usually the time of the observation, so the data can be treated as a time series.
A signal is an element representing a piece of information. For example, should we set up two sensors in an office, humidity sensor and temperature sensor, incoming data could be stored in one signalSet with two signals, each representing data of one sensor.
IVIS supports different types of signals including numbers (both integers and floating point numbers), strings and timestamps:
integer
long
float
double
boolean
-
keyword
(short string, often one word) text
-
date
(date and time) json
(JSON objects) WORK IN PROGRESS
A signal set can contain additional signals that are computed from other signals in the same record. This is useful for rudimentary filtering, e.g., for clamping or filtering values that exceed the reasonable range, or for fixing data that are known to be broken in a certain time period. This allows leaving the master data intact, yet visualize correct data. The computed signals use the Painless Scripting Language.
To create a computed signal, go to the signalSet settings and create a new signal in the Signals tab of the desired signalSet. The Source has to be set to Derived
. Then fill in the Painless script code.
To get the other signals from the signalSet, use {{signal_id}}
in the Painless script.
Let's assume that there exists a signal with Id example_signal_id
and we want to clamp its values to a range of [-2.0, 2.0]:
return Math.min(Math.max(doc.{{example_signal_id}}.value, -2.0), 2.0)
Let's assume that there exists a signal with Id example_signal_id
and we want to filter out values equal to zero:
if (doc['{{example_signal_id}}'].value == 0) return [];
return doc['{{example_signal_id}}'].value;