UsagesResources

class lsst.ts.observatory.control.UsagesResources(components_attr: Iterable[str], readonly: bool, generics: Iterable[str] = (), **kwargs: Iterable[str])

Bases: object

Represent the resources needed for Usages.

When defining Usages for a RemoteGroup of CSCs one need to specify what CSCs and topics are required. For instance, take the generic usage Usages.StateTransition. It is relevant to all CSCs in the group, requires the generic state transition commands (start, enable, disable, standby) and the generic events summaryState and configurationsAvailable. To represent these resources for Usages.StateTransition we create a UsagesResources with those requirements, e.g.:

UsagesResources(
    components_attr = self.components_attr,
    readonly = False,
    generics = [
                "start",
                "enable",
                "disable",
                "standby",
                "summaryState",
                "configurationsAvailable"
               ]
    )
Parameters:
components_attrlist of str

Name of the components required for this use case. Names must follow the same format as that of the components_attr attribute in RemoteGroup, which is the name of the CSC in lowercase replacing the “:” by “_”, e.g. Hexapod:1 is hexapod_1 and MTDomeTrajectory is mtdometrajectory.

readonlybool

Should the remotes be readonly? That means no command can be sent to any component.

genericslist of str

List of generic topics (common to all components) required for this use case.

**kwargs

Used to specify list of topics for individual components. See Notes section bellow.

Raises:
TypeError

If kwargs argument is not in the components list.

Notes

The kwargs argument can contain attributes with the name of the CSC, as it appears in the components_attr parameter list. They must be a list of strings with the name of the topics for the individual CSC. For example,:

UsagesResources(
    components=["atcamera", "atoods", "atheaderservice"],
    readonly=False,
    generics=["summaryState"],
    atcamera=["takeImages", "endReadout"],
    atheaderservice=["largeFileObjectAvailable"],
)

Will include the summaryState event for ATCamera, ATOODS and ATHeaderService components, plus takeImages and endReadout from ATCamera and largeFileObjectAvailable from ATHeaderService. No particular topic for ATOODS would be included.