It is therefore not recommended to use the result of one computed attribute in another computed attribute. The order in which computed attributes are applied to the device is not defined. A ternary operator is a conditional check with examples for this shown below. If you are not certain that the device always reports an attribute, then it is recommended to wrap it in a ternary operator to check if the value is present. Using undefined variables will create warning messages in the log. TestingĮxpression can be tested on the last position of some device. The set of defined attributes different for every device, and it might be different from one reported position to another.Įmpty result of computation ( null, but not the empty string) will not be stored to position. It uses very flexible JEXL Syntax to compute result.Īll position fields are mapped as primitive objects (latitude, longitude, speed, course etc), they are always defined.Īll position attributes also mapped as primitive objects (satellites, battery, ignition, distance etc). ExpressionĮxpression is the heart of computed attributes functionality. There is list of "standard" attributes with predefined types, but it is also possible to use your own. They help control the computing result and format values on the front-end. There are three types: Number, Boolean and String. Type is the data type to which result will be converted after computing. Expression is the expression to compute, written with help of JEXL.Attribute is the name of position attribute where computing result will be stored.Description is just a human readable description.ModelĬomputed attributes have following fields: If user has access to a computed attribute, it means that the User can edit/remove that attribute and link/unlink it to/from devices/groups that he has access to. If computed attribute linked to a group, it means that Traccar will apply this attribute to all members of that group and subgroups. If computed attribute linked to a device, it means that Traccar will apply this attribute to positions from that device. PermissionsĬomputed attributes permissions model is the same as for Geofences. Device does not report desired attribute, but it can be converted or calculated from othersĬomputed attributes are applied to all incoming positions of appropriate device.Different models with same protocol report different data and you want to standardize it.Device has configurable input and outputs that you want to map to a specific value.The Computed Attributes feature allows you to dynamically modify the attributes reported by devices and can assist in solving a number of problems:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |