QuantityCounter
The quantity counter component is designed to register data according to the Apis Click&Trace Counter concept and customized for easy connection to simple scalar counter inputs from low level equipment. An instance of the QuantityCounter can count on behalf of one specific counter definition. In addition to registering the counter values in the ACT database, the component can expose the counter values on ports e.g. for logging to APIS Honeystore. The component will count and accumulate events internally, and not necessarily update the database/ports every time the internal counter change. There are several strategies available for when to update the database/ports :
- Updates can be triggered by an external trigger signal.
- Updates can be trigger by change in the active counted enumeration.
- Updates can be performed periodically.
- Updates can be performed every time step.
- Updates can be performed when the accumulated counter value has reached a specific limit.
It is possible to specify combinations of the above 5 strategies. Since the database/ports are not necessarily updated at the time when the physical event(s) happen, and several physical events can be aggregated to one database transaction, the time stamps of the events in the database are approximations. There are 3 approaches for how to approximate the time stamps:
- Use the time stamp of the first aggregated event
- Use the time stamp of the last aggregated event
- Use the mean of the above two time stamps.
When logging port-exposed counter values to APIS Honeystore, the Honeystore time stamp will correspond to the time stamp of the last aggregated event.
Even if the component can count on behalf of only one single counter definition, it is possible to set up several counter inputs in the component. This may be useful if the events to count comes from different signal sources on different formats, but shall be interpreted as one single counted quantity.