mxcubecore.CommandContainer#
CommandContainer module
Classes: - CommandContainer, a special mixin class to be used with Hardware Objects. It defines a container for command launchers and channels (see Command package). - C*Object, command launcher & channel base class
Classes
|
|
Mixin class for generic command and channel containers |
|
|
Exceptions
General Connection Error |
- class mxcubecore.CommandContainer.CommandContainer[source]#
Bases:
object
Mixin class for generic command and channel containers
- add_channel(attributes_dict: Dict[str, Any], channel: str, add_now: bool = True) ChannelObject | None [source]#
Add channel.
- Parameters:
- Raises:
ConnectionError – If a connection error occured while adding the channel.
- Returns:
Channel object or None if adding later.
- Return type:
Union[ChannelObject, None]
- add_command(arg1: Dict[str, Any], arg2: str | None = None, add_now: bool = True) CommandObject | None [source]#
Add command.
- Parameters:
- Raises:
ConnectionError – If a connection error occured while adding the command.
- Returns:
Command object or None if adding later.
- Return type:
Union[CommandObject, None]
- execute_command(command_name: str, *args, **kwargs) Any [source]#
Execute command.
- Parameters:
- Raises:
AttributeError – If command not found.
- Returns:
Execution output.
- Return type:
Any
- get_channel_names_list() List[str] [source]#
Get a list of all channel names.
- Returns:
Channel names.
- Return type:
List[str]
- get_channel_object(channel_name: str, optional: bool = False) ChannelObject | None [source]#
Get channel.
- get_channel_value(channel_name: str) Any [source]#
Get channel value.
- Parameters:
channel_name (str) – Channel name.
- Returns:
Channel value.
- Return type:
Any
- get_channels() Generator[ChannelObject, None, None] [source]#
Get object channels.
- Yields:
Generator[ChannelObject, None, None] – Object channels.
- Return type:
Generator[ChannelObject, None, None]
- get_command_names_list() List[str] [source]#
Get list of command names.
- Returns:
Command names.
- Return type:
List[str]
- get_command_object(cmd_name: str) CommandObject | None [source]#
Get command object.
- Parameters:
cmd_name (str) – Command name.
- Returns:
Command object or None if not found.
- Return type:
Union[CommandObject, None]