UsagesResources#
- class lsst.ts.observatory.control.UsagesResources(components_attr, readonly, generics=(), **kwargs)#
Bases:
objectRepresent the resources needed for
Usages.When defining
Usagesfor aRemoteGroupof CSCs one need to specify what CSCs and topics are required. For instance, take the generic usageUsages.StateTransition. It is relevant to all CSCs in the group, requires the generic state transition commands (start,enable,disable,standby) and the generic eventssummaryStateandconfigurationsAvailable. To represent these resources forUsages.StateTransitionwe create aUsagesResourceswith those requirements, e.g.:UsagesResources( components_attr = self.components_attr, readonly = False, generics = [ "start", "enable", "disable", "standby", "summaryState", "configurationsAvailable" ] )
- Parameters:
components_attr (
listofstr) – Name of the components required for this use case. Names must follow the same format as that of thecomponents_attrattribute inRemoteGroup, which is the name of the CSC in lowercase replacing the “:” by “_”, e.g. Hexapod:1 is hexapod_1 and MTDomeTrajectory is mtdometrajectory.readonly (
bool) – Should the remotes be readonly? That means no command can be sent to any component.generics (
listofstr) – List of generic topics (common to all components) required for this use case.**kwargs (
Iterable[str]) – Used to specify list of topics for individual components. See Notes section bellow.
Notes
The kwargs argument can contain attributes with the name of the CSC, as it appears in the
components_attrparameter 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
summaryStateevent for ATCamera, ATOODS and ATHeaderService components, plustakeImagesandendReadoutfrom ATCamera andlargeFileObjectAvailablefrom ATHeaderService. No particular topic for ATOODS would be included.- Raises:
TypeError – If
kwargsargument is not in thecomponentslist.