Class RfidScanGroup
java.lang.Object
com.tccc.kos.ext.freestyle.service.rfid.RfidScanGroup
A group of
RfidScanner
objects that are run in a
specific order when the group itself matches a requested
scan type. Scanners can be added to the group in the specific
order in which they should be run. It is possible to add a
scanner more than once in order to provide fine grained
control over how tags should be scanned. For example, consider
multiple shelves of ingredients on a device that also contains
an antenna on the door which can be used to scan ingredients.
One approach is to add all the shelf scanners and then the
door scanner. In this case the door scanner will only be
run after all shelves are scanned. However, to improve latency
when reading from the door antenna, the door scanner could be
added after each shelf antenna, resulting in three door scans
for each group scan.
When requesting scans from RfidService
, a scanType
is specified. This will iterate through all registered groups
and only scan those that have a matching scanType
. This
allows different groups to be created with different purposes.
For example, if an inventory scan of all the shelves doesn't
want to include door scans, two groups can be created, one with
the inventory scan type and the other without.
- Version:
- 2023-10-14
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addScanner
(RfidScanner<?> scanner) Add aRfidAntennaScanner
to the group.void
Add a type of scan this group should be included in.getName()
void
removeType
(String scanType) Remove a type of scan this group should be included in.
-
Constructor Details
-
RfidScanGroup
Create a new scan group with the specified name. The name will be added as a scan type for the group. Multiple groups can have the same name, allowing all groups with that name to be scanned in the same cycle.
-
-
Method Details
-
addType
Add a type of scan this group should be included in. Scanning is triggered by a type and all groups tagged with this type will be run.- Parameters:
scanType
- the type to add to the list
-
removeType
Remove a type of scan this group should be included in.- Parameters:
scanType
- the type to remove from the list
-
addScanner
Add aRfidAntennaScanner
to the group. Scanners will be run in the order in which they're added, and scanners can be added to the group multiple times. This allows a group to provide fine grained control over scanning order and different groups can define different scan ordering.- Parameters:
scanner
- the scanner to add to the group
-
getName
-
getScanTypes
-