herosdevices.core.templates.display¶
Templates for creating camera device representations.
Module Contents¶
- class herosdevices.core.templates.display.DisplayDeviceTemplate(config_dict: dict, default_config: str | None = None, keep_device_open: bool = True)[source]¶
Bases:
herosdevices.interfaces.heros.ConfiguredDeviceTemplate (base class) for displays.
To make a functional display device, the user needs to implement all abstract methods. In addition, this class does not cover the mechanism the actually push the image to eventaual image buffers or to actually display the imag since it is typically special to each vendor/API.
- keep_device_open = True¶
- default_config: str¶
- get_device() collections.abc.Iterator[None][source]¶
Yield a device handle.
# use the device in a with statement with self.get_device() as slm: slm.do_something()
- get_status() dict[source]¶
Get a dict with the current device status.
- Returns:
A dict with the device status
- property config_dict: dict¶
Get a copy of the configuration dict.
- Returns:
Copy of the configuration dict
- update_configuration(new_config_dict: dict, merge: bool = True) None[source]¶
Update the configuration dict with new configuration.
Each dict key corresponds a (new) configuration name. Each value is a dict with config property -> config value.
- Parameters:
new_config_dict – A dict of configurations where the keys are the configuration names
merge – If
True, the new dict is recursively merged with the current set config dict. IfFalsethe old configurations with the provided names (keys) are overwritten.
- get_configuration() dict[source]¶
Get the currently active configuration.
- Returns:
The currently active configuration.
- configure(config: str = '') bool[source]¶
Configure the device with the known configuration config.
To add a configuration to the device, use
update_configuration().- Parameters:
config – Key (name) of the configuration
- set_configuration¶