navigate.model.features.common_features.WaitToContinue
- class navigate.model.features.common_features.WaitToContinue(model)
Bases:
object
WaitToContinue class for synchronizing signal and data acquisition.
This feature is used to synchronize signal and data acquisition processes, allowing the faster one to wait until the other one ends.
Notes:
This class is used to synchronize signal and data acquisition processes in a
controlled manner. It ensures that the faster process waits for the slower one to complete, improving synchronization during microscopy experiments.
The synchronization process involves using locks to control when the signal and
data acquisition processes are allowed to proceed.
The config_table attribute defines the configuration for each stage of the
synchronization process, including initialization, main execution, and cleanup steps.
The first_enter_node attribute tracks which process (signal or data) enters the
node first to determine synchronization order.
The WaitToContinue class helps maintain order and synchronization between signal
and data acquisition nodes in microscopy experiments.
- __init__(model)
Initialize the WaitToContinue class.
Parameters:
- modelMicroscopeModel
The microscope model object used for synchronization.
Methods
__init__
(model)Initialize the WaitToContinue class.
cleanup
()Release any remaining locks during cleanup.
data_func
(frame_ids)Synchronize data acquisition and release locks.
Prepare for the data acquisition stage and synchronize with signal acquisition.
Prepare for the signal acquisition stage and synchronize with data acquisition.
Synchronize signal acquisition and release locks.
Attributes
The microscope model associated with the synchronization.
A lock for the signal acquisition process.
A lock for the data acquisition process.
A variable to track which process enters the node first.
A dictionary defining the configuration for the synchronization
- cleanup()
Release any remaining locks during cleanup.
This method releases any locks that may still be held during cleanup.
- data_func(frame_ids)
Synchronize data acquisition and release locks.
This method synchronizes the data acquisition process with signal acquisition and releases any locks held.
Parameters:
- frame_idslist
A list of frame IDs for which data acquisition should be performed.
Returns:
- bool
A boolean value indicating the success of the synchronization process.
- pre_data_func()
Prepare for the data acquisition stage and synchronize with signal acquisition.
This method prepares for the data acquisition stage and synchronizes with the signal acquisition process, ensuring that the slower process proceeds first.
- pre_signal_func()
Prepare for the signal acquisition stage and synchronize with data acquisition.
This method prepares for the signal acquisition stage and synchronizes with the data acquisition process, ensuring that the slower process proceeds first.
- signal_func()
Synchronize signal acquisition and release locks.
This method synchronizes the signal acquisition process with data acquisition and releases any locks held.
Returns:
- bool
A boolean value indicating the success of the synchronization process.
- config_table
A dictionary defining the configuration for the synchronization
- Type:
dict
- first_enter_node
A variable to track which process enters the node first.
- Type:
- model
The microscope model associated with the synchronization.
- Type:
MicroscopeModel
- pause_data_lock
A lock for the data acquisition process.
- Type:
Lock
- pause_signal_lock
A lock for the signal acquisition process.
- Type:
Lock