SequenceHandler¶
Bases: object
SequenceHandler class manages sequence preparation progress and cancellation.
This abstract class provides a mechanism for users to be notified of preparation progress (0.0 to 1.0) and to request cancellation of the process.
__init__(interval=1000000)
¶
Constructor with interval.
Initializes a new instance of the SequenceHandler class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
interval
|
int
|
Interval between two notifications in microseconds (default: 1,000,000 us = 1s) |
1000000
|
onProgress(status, progress)
¶
Progress notification.
This callback method is invoked at each time interval to report the current status and progress of the preparation. Must be overridden.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
status
|
int
|
The current preparation status |
required |
progress
|
float
|
The preparation progress (0.0 to 1.0) |
required |
cancelPreparation()
¶
Cancel preparation.
Requests the cancellation of the current sequence preparation.
isCancelled()
¶
Check if cancelled.
Checks whether a cancellation request has been issued.
Returns:
| Type | Description |
|---|---|
boolean
|
True if cancellation has been requested, false otherwise |
setInterval(interval)
¶
Set notification interval.
Sets the time interval between consecutive progress notifications.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
interval
|
int
|
The interval in microseconds |
required |
getInterval()
¶
Get notification interval.
Retrieves the current time interval between progress notifications.
Returns:
| Type | Description |
|---|---|
int
|
The interval in microseconds |