Manager¶
- class acq4.Manager.Manager(configFile=None, argv=None)[source]¶
Manager class is responsible for: - Loading/configuring device modules and storing their handles - Managing the device rack GUI - Creating acquisition task handles - Loading gui modules and storing their handles - Creating and managing DirectoryHandle objects - Providing unified timestamps - Making sure all devices/modules are properly shut down at the end of the program
- currentDirChanged(fh, change=None, args=())[source]¶
Handle situation where currentDir is moved or renamed
- exec_(pyfile)[source]¶
Execute a Python file.
This is used to enable easy loading of customizations from an externally defined file. Note that sys.path is temporarily modified to allow the external file to import from scripts in its own path.
For more complex customizations, it is recommended to build an importable module instead.
- pyfilestr
The full path to the python file to be exec’d
- globsdict
global namespace defined by the exec
- getBaseDir()[source]¶
Return a directory handle to the base directory for data storage.
This is the highest-level directory where acquired data may be stored. If the base directory has not been set, return None.
- getCurrentDir()[source]¶
Return a directory handle to the currently-selected directory for data storage.
- getDirOfSelectedFile()[source]¶
Returns the directory that is currently selected, or the directory of the file that is currently selected in Data Manager.
- getInterface(*args, **kargs)[source]¶
Return the object that was previously declared with name and interface type.
- loadDefinedModule(name, forceReload=False)[source]¶
Load a module and configure as defined in the config file
- loadDevice(devClassName, conf, name)[source]¶
Create a new instance of a device.
- devClassNamestr
The name of a device class that was registered using acq4.devices.registerDeviceClass(). See acq4.devices.DEVICE_CLASSES for access to all available device classes.
- confdict
A structure passed to the device providing configuration options
- namestr
The name of this device. The instantiated device object will be retrievable using
Manager.getDevice(name)
- deviceDevice instance
The instantiated device object
- loadModule(moduleClassName, name=None, config=None, forceReload=False, importMod=None, execPath=None)[source]¶
Create a new instance of an user interface module.
- moduleClassNamestr
The name of the module class to instantiate. The class must have been registered by calling acq4.modules.registerModuleClass(). See acq4.modules.MODULE_CLASSES for access to all available module classes.
- namestr or None
The name to assign to the newly instantiated module. If None, then the class name is used instead. Module names are automatically modified to avoid name collision with previously loaded modules.
- configdict | None
Configuration options to pass to the module constructor
- reserveDevices(devices, timeout=10.0)[source]¶
Return a DeviceLocker that can be used to reserve multiple devices simultaneously:
- with manager.reserveDevices([‘Camera’, ‘Clamp1’, ‘Stage’]):
# .. do stuff