public class

ItemTrackingManager

extends Object
java.lang.Object
   ↳ com.datalogic.itemtracking.ItemTrackingManager

Class Overview

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.

Summary

Nested Classes
interface ItemTrackingManager.EventListener Listener interface for receiving item tracking events. 
class ItemTrackingManager.ImageSavingConfiguration Configuration used when setting up the storage of camera images processed by the item tracking algorithm. 
class ItemTrackingManager.Session The item tracking session created by the manager. 
Public Constructors
ItemTrackingManager()
Constructs an instance of the ItemTrackingManager.
Public Methods
void addEventListener(ItemTrackingManager.EventListener listener)
Adds an item tracking event listener.
ItemTrackingManager.Session createSession()
Creates an item tracking session that can be used to control the algorithm execution.
ItemTrackingManager.ImageSavingConfiguration getImageSavingConfiguration()
Gets the current image saving configuration.
void removeEventListener(ItemTrackingManager.EventListener listener)
Removes a previously added item tracking event listener.
int setImageSavingConfiguration(ItemTrackingManager.ImageSavingConfiguration imageSavingConfiguration)
Setup the configuration parameters for storing the camera frames processed by the item tracking algorithm.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ItemTrackingManager ()

Added in revision 46

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.

Public Methods

public void addEventListener (ItemTrackingManager.EventListener listener)

Added in revision 46

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.

Parameters
listener The event listener to add. Must not be null.

public ItemTrackingManager.Session createSession ()

Added in revision 46

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.

Returns
  • An item tracking session instance if the algorithm can be executed on the device, otherwise null if the device does not support item tracking.

public ItemTrackingManager.ImageSavingConfiguration getImageSavingConfiguration ()

Added in revision 46

Gets the current image saving configuration.

Returns
  • The image saving configuration currently in use or null in case of error.
Throws
ItemTrackingException in case of error, when exceptions are enabled through the ErrorManager singleton.

public void removeEventListener (ItemTrackingManager.EventListener listener)

Added in revision 46

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.

Parameters
listener The event listener to remove. Must not be null.

public int setImageSavingConfiguration (ItemTrackingManager.ImageSavingConfiguration imageSavingConfiguration)

Added in revision 46

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.

Parameters
imageSavingConfiguration The configuration object.
Returns
Throws
ItemTrackingException in case of error, when exceptions are enabled through the ErrorManager singleton.