- class acq4.Manager.Manager(configFile=None, argv=None)¶
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
- __init__(configFile=None, argv=None)¶
Load the devices, modules, stylesheet, and storageDir defined in cfg
Creates a new Task instance from the specified command structure.
- currentDirChanged(fh, change=None, args=())¶
Handle situation where currentDir is moved or renamed
- dirHandle(d, create=False)¶
Return a directory handle for the specified directory string.
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.
The full path to the python file to be exec’d
global namespace defined by the exec
Return a file or directory handle for d
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.
Return the database currently selected in the Data Manager
Return a directory handle to the currently-selected directory for data storage.
Return a device instance given its name.
Returns the directory that is currently selected, or the directory of the file that is currently selected in Data Manager.
- getInterface(*args, **kargs)¶
Return the object that was previously declared with name and interface type.
Return an already loaded module
Return a list of the named configurations available
List module configurations defined in the config file
Return a list of the names of available devices.
List names of currently loaded modules.
- loadDefinedModule(name, forceReload=False)¶
Load a module and configure as defined in the config file
- loadDevice(devClassName, conf, name)¶
Create a new instance of a device.
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.
A structure passed to the device providing configuration options
The name of this device. The instantiated device object will be retrievable using
- deviceDevice instance
The instantiated device object
- loadModule(moduleClassName, name=None, config=None, forceReload=False, importMod=None, execPath=None)¶
Create a new instance of an user interface module.
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
Nicely request that all devices and modules shut down
Read configuration file, create device objects, add devices to list
Reload all python code
- reserveDevices(devices, timeout=10.0)¶
Return a DeviceLocker that can be used to reserve multiple devices simultaneously:
- with manager.reserveDevices([‘Camera’, ‘Clamp1’, ‘Stage’]):
# .. do stuff
Convenience function that runs a task and returns its results.
Set the base directory for data storage.
Set the currently-selected directory for data storage.
Set the directory to which log messages are stored.
Show the Manager GUI
Given a DirHandle with a dirType, suggest a set of meta-info fields to use.
- writeConfigFile(data, fileName)¶
Write a file into the currently used config directory.