java.lang.Object | |
↳ | com.datalogic.itemtracking.ItemTrackingManager |
This class provides the main interface to manage the item tracking system,
which enables real-time detection of items added into or removed from a shopping cart.
Applications can register event listeners using the addEventListener(EventListener)
method
to receive notifications about item insertion or extraction events.
To use the algorithm, a session must be created via the createSession()
method.
The session allows control over the algorithm's execution, including starting
(start()
), pausing (pause()
), and stopping
(stop()
) the tracking process.
The session is shared across all applications.
The first application that calls createSession()
creates the session,
while subsequent applications invoking the same method receive a reference to the session
created by the first application.
The state of the current active session can be retrieved using getState()
.
Once the session is no longer needed by an application, it must be released using release()
to free resources and ensure proper cleanup.
The session remains active until all applications referencing it release it using release()
.
Only when the last application releases its reference, the session is destroyed,
freeing resources and preparing for the next tracking session.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ItemTrackingManager.EventListener | Listener interface for receiving item tracking events. | ||||||||||
ItemTrackingManager.ImageSavingConfiguration | Configuration used when setting up the storage of camera images processed by the item tracking algorithm. | ||||||||||
ItemTrackingManager.Session | The item tracking session created by the manager. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an instance of the ItemTrackingManager.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds an item tracking event listener.
| |||||||||||
Creates an item tracking session that can be used to control the algorithm execution.
| |||||||||||
Gets the current image saving configuration.
| |||||||||||
Removes a previously added item tracking event listener.
| |||||||||||
Setup the configuration parameters for storing the camera frames processed by the item tracking
algorithm.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Constructs an instance of the ItemTrackingManager.
This constructor initializes the manager, allowing applications to interact
with the item tracking functionality. The manager serves as the entry point
for creating sessions and managing event listeners for item tracking events.
Adds an item tracking event listener.
The listener will receive notifications about item tracking events, such as
item insertion or extraction, through the onEvent(EventType, int, List)
method.
Applications can use this method to register their implementation of the ItemTrackingManager.EventListener
interface
and handle events accordingly.
listener | The event listener to add. Must not be null .
|
---|
Creates an item tracking session that can be used to control the algorithm execution.
The session provides methods to start, stop, and pause the item tracking algorithm,
as well as to retrieve its current state. The session is shared across all applications,
and the first application to call this method creates the session. Subsequent calls
return a reference to the same session.
Once the session is no longer needed, it must be released using the release()
method
to free resources and ensure proper cleanup. Failing to release the session may lead to resource leaks
or prevent other applications from creating new sessions.
null
if the device does not support item tracking.
Gets the current image saving configuration.
ItemTrackingException | in case of error, when exceptions are enabled
through the ErrorManager singleton.
|
---|
Removes a previously added item tracking event listener.
This method de-registers the specified listener, ensuring it no longer receives
notifications about item tracking events. If the listener was not previously registered,
this method has no effect.
listener | The event listener to remove. Must not be null .
|
---|
Setup the configuration parameters for storing the camera frames processed by the item tracking
algorithm.
In case the algorithm is currently in the STARTED
state, this
configuration will be applied only when the state becomes STOPPED
or PAUSED
.
In case no session is currently acquired, this configuration will be applied when a new
one is created.
imageSavingConfiguration | The configuration object. |
---|
SUCCESS
in case of success, otherwise
a possible error code, matching one of the ItemTrackingException
error
constants.ItemTrackingException | in case of error, when exceptions are enabled
through the ErrorManager singleton.
|
---|