mxcubecore.model.protocols.tango#
Models the tango section of YAML hardware configuration file.
Provides an API to read configured tango channels and commands.
Classes
|
Tango channel configuration. |
|
Tango command configuration. |
|
Configuration of a tango device. |
|
The 'tango' section of the hardware object's YAML configuration file. |
- class mxcubecore.model.protocols.tango.Channel(*, attribute: str | None = None, polling_period: int | None = None, timeout: int | None = None)[source]#
Bases:
BaseModel
Tango channel configuration.
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'attribute': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'polling_period': FieldInfo(annotation=Union[int, NoneType], required=False, default=None), 'timeout': FieldInfo(annotation=Union[int, NoneType], required=False, default=None)}#
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class mxcubecore.model.protocols.tango.Command(*, name: str | None = None)[source]#
Bases:
BaseModel
Tango command configuration.
- Parameters:
name (str | None) –
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class mxcubecore.model.protocols.tango.Device(*, commands: Dict[str, Command | None] | None = None, channels: Dict[str, Channel | None] | None = None)[source]#
Bases:
BaseModel
Configuration of a tango device.
- Parameters:
- get_channels() Iterable[Tuple[str, Channel]] [source]#
Get all channels configured for this device.
This method will fill in optional configuration properties for a channel.
- get_commands() Iterable[Tuple[str, Command]] [source]#
Get all commands configured for this device.
This method will fill in optional configuration properties for commands.
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'channels': FieldInfo(annotation=Union[Dict[str, Union[Channel, NoneType]], NoneType], required=False, default=None), 'commands': FieldInfo(annotation=Union[Dict[str, Union[Command, NoneType]], NoneType], required=False, default=None)}#
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class mxcubecore.model.protocols.tango.TangoConfig(root: RootModelRootType = PydanticUndefined)[source]#
Bases:
RootModel[Dict[str, Device]]
The ‘tango’ section of the hardware object’s YAML configuration file.
- Parameters:
root (RootModelRootType) –
- get_tango_devices() Iterable[Tuple[str, Device]] [source]#
Get all tango devices specified in this section.
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].