-
Notifications
You must be signed in to change notification settings - Fork 0
Generics
Allow storing data without writing java code or to be able to add a sensor at runtime.
Everything is defined in the settings.xml and needs to be in the 'generics' tag. An example of the minimum
<generics>
<generic id="sbe38" table="sbe38">
<real index="0">temperature</real>
<generic>
</generics>
This tells Dcafs to process data with the label generic:sbe38 by converting the received data to a real/double and store it in a table called sbe38. How to setup this sqlite and the stream can be found in their respective part of the wiki. The above is the minimum...
- id -> the reference to this generic, used as the label eg. label="generic:id" or multiple label="generic:id1,id2"
- db -> one or more id's from databases (except InfluxDB) , multiple are allowed if the table is identical
- group -> the group the defined rtvals belong to unless specified otherwise
- influx -> id of the influx db to write to
- delimiter -> the characters used to split the received data
For example, a meteo sensor outputs temperature,humidity and pressure in the wixdr nmea string.
<generics>
<generic id="meteo" delimiter="," group="aws" db="sensors:aws">
<real index="2">temperature</real>
<integer index="6">humidity</integer> <!-- low accuracy humidity in percentage -->
<real group="pressures" index="10">pressure</real>
</generic>
</generics>
To use it, the label needs to be generic:meteo
This tells Dcafs:
- Create rtvals according to the given items, with default group id being 'aws'
- The real 'pressure' uses the 'pressures' group instead of the default 'aws'
- Where to find the values after splitting on ',' and store these in the given rtvals
- Write to the table 'aws' in the database with id 'sensors'
This is added for the use case that multiple of the same devices are connected and part of the data contains an unique identifier.
<macro index="0"/> <!-- This means that the first element of the array contains the unique identifier -->
<real index="1">@macro_temperature</real> <!-- When this value is written to rtvals, @macro will be replaced with the content of value found with index="0" -->
When this generic is used to fill in a database table, this needs to be defined during table creation
<real alias="@macro_temperature">temperature</real> <!-- this is how it should be used, see the SqliteDB/SQliteTable section for the rest of th -->
- Getting to know dcafs
- Filterforward
- MathForward
- EditForward (todo)
- Combining
- TaskManager
- LabelWorker
- CommandPool
- DebugWorker
- Realtimevalues
- IssuePool