nomad_camels_driver_SweepMe_device package
Submodules
nomad_camels_driver_SweepMe_device.SweepMe_device module
- nomad_camels_driver_SweepMe_device.SweepMe_device.get_configs_from_ophyd(ophyd_instance)
- nomad_camels_driver_SweepMe_device.SweepMe_device.replace_underscores_in_keys(original_dict)
- class nomad_camels_driver_SweepMe_device.SweepMe_device.subclass(**kwargs)
Bases:
Device
- get_channels()
returns self.channels, should be overwritten for special purposes (e.g. leaving out some keys of the dictionary)
- Returns:
self.channels – dictionary containing the device’s channels
- Return type:
dict
- update_driver()
- class nomad_camels_driver_SweepMe_device.SweepMe_device.subclass_config(parent=None, device_name='', data='', settings_dict=None, config_dict=None, additional_info=None)
Bases:
Device_Config
- driver_changed()
- get_config()
Returns the config_dict of the device. Overwrite this function for each device to specify the config.
- get_settings()
Updates the settings_dict with the current settings. Overwrite this function for each device to specify the settings. It is recommended to still call the super() method for the connection-settings.
- staticMetaObject = PySide6.QtCore.QMetaObject("subclass_config" inherits "Device_Config": )
nomad_camels_driver_SweepMe_device.SweepMe_device_ophyd module
- class nomad_camels_driver_SweepMe_device.SweepMe_device_ophyd.SweepMe_Device(prefix='', *, name, kind=None, read_attrs=None, configuration_attrs=None, parent=None, driver=None, port='', **kwargs)
Bases:
Device
This class is a parent for wrappers of SweepMe! drivers. It loads the given driver and gives it to all its components. It also initializes the driver and connects to the device. The driver is disconnected and powered off when the device is finalized.
- Parameters:
driver (str) – The path to the driver file.
port (str) – The port the device is connected to.
- component_names = ()
- configure(d)
Calls ophyd’s parent configure method, then calls configure on the driver to actually set the parameters.
- finalize_steps()
Powers the device off, unconfigures it, deinitializes it and disconnects it.
- subscriptions: ClassVar[FrozenSet[str]] = frozenset({'acq_done'})
- class nomad_camels_driver_SweepMe_device.SweepMe_device_ophyd.SweepMe_Parameter_Signal(parameter_name, driver=None, **kwargs)
Bases:
Signal
This class is a wrapper to make SweepMe!’s parameters settable. It sets the parameter of the driver to the value of the signal before writing the value. The driver is given to the signal when it is created, but can also be changed later.
- put(value, *, timestamp=None, force=False, metadata=None, **kwargs)
Sets the parameter of the driver to the value of the signal. It does not call configure, since this is done by the SweepMe_Device or when changing the SweepMode.
- subscriptions: ClassVar[FrozenSet[str]] = frozenset({'meta', 'value'})
- class nomad_camels_driver_SweepMe_device.SweepMe_device_ophyd.SweepMe_Signal(mode_name, driver=None, channel=None, **kwargs)
Bases:
Signal
This class is a wrapper to make SweepMe!’s SweepMode a settable signal. It sets the SweepMode of the driver to the mode of the signal before writing the value. The driver is given to the signal when it is created, but can also be changed later.
- Parameters:
mode_name (str) – The name of the SweepMode to set.
driver (pysweepme.Driver) – The driver to use for communication.
- check_last_channel()
Checks if the driver’s last channel is the same as the one of the signal.
- put(value, *, timestamp=None, force=False, metadata=None, **kwargs)
Sets the SweepMode of the driver to the mode of the signal, then calls configure on the driver, before writing the value.
- subscriptions: ClassVar[FrozenSet[str]] = frozenset({'meta', 'value'})
- class nomad_camels_driver_SweepMe_device.SweepMe_device_ophyd.SweepMe_SignalRO(variable_name, driver=None, channel=None, **kwargs)
Bases:
SignalRO
This class is a wrapper to make SweepMe!’s variables readable. It reads the value from the driver when the signal is read. The driver is given to the signal when it is created, but can also be changed later.
- Parameters:
variable_name (str) – The name of the variable to read. It is used to get the position of the variable in the driver’s variables list.
driver (pysweepme.Driver) – The driver to use for communication.
- check_last_channel()
Checks if the driver’s last channel is the same as the one of the signal.
- get(**kwargs)
Reads the value from the driver and returns it.
- subscriptions: ClassVar[FrozenSet[str]] = frozenset({'meta', 'value'})
- nomad_camels_driver_SweepMe_device.SweepMe_device_ophyd.get_driver(path)
Returns the SweepMe! driver instance for the driver at the given path.
- nomad_camels_driver_SweepMe_device.SweepMe_device_ophyd.get_ports(driver)
Uses SweepMe!’s port manager to get the available ports for the given driver.
- nomad_camels_driver_SweepMe_device.SweepMe_device_ophyd.make_SweepMe_ophyd_class(driver_path, class_name, GUI_config=None)
Creates an ophyd class for the given driver. The driver’s GUI parameters are used to create the configuration signals, the sweep modes are used to create the set channels and the variables are used to create the readback signals. The class is created with the given class name.
- nomad_camels_driver_SweepMe_device.SweepMe_device_ophyd.make_SweepMe_ophyd_instance(prefix='', *args, name, driver, kind=None, read_attrs=None, configuration_attrs=None, parent=None, port='', **kwargs)
Creates an ophyd instance for the given driver. The driver is used to create the ophyd class using make_SweepMe_ophyd_class and the instance is created with the given parameters.
- Parameters:
driver (str) – The path to the SweepMe! driver
port (str) – The port the device is connected to. This is handled by SweepMe’s port manager
- nomad_camels_driver_SweepMe_device.SweepMe_device_ophyd.make_valid_python_identifier(s)
Returns a valid python identifier for the string “s”. This is necessary since the parameters from SweepMe! drivers are handled as strings while they are python variables in the ophyd classes used by NOMAD CAMELS.