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 aRemoteGroup
of 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 eventssummaryState
andconfigurationsAvailable
. To represent these resources forUsages.StateTransition
we create aUsagesResources
with those requirements, e.g.:UsagesResources( components_attr = self.components_attr, readonly = False, generics = [ "start", "enable", "disable", "standby", "summaryState", "configurationsAvailable" ] )
- Parameters:
- components_attr
list
ofstr
Name of the components required for this use case. Names must follow the same format as that of the
components_attr
attribute 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
list
ofstr
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.
- components_attr
- Raises:
- TypeError
If
kwargs
argument is not in thecomponents
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, plustakeImages
andendReadout
from ATCamera andlargeFileObjectAvailable
from ATHeaderService. No particular topic for ATOODS would be included.