public class BrakePowerMonitor extends Object implements org.lsst.ccs.framework.HasLifecycle, org.lsst.ccs.messaging.StatusMessageListener, org.lsst.ccs.services.alert.AlertListener
brakePowerChange() events for the central state machine based on status messages
sent by a target subsystem, normally the quadbox subsystem (see org-lsst-ccs-subsystem-power).
We assume that brake power has been lost if the target subsystem does any of the following:
We assume that brake power has been restored if the target subsystem:
It's not enough for the target subsystem to be on-line; we need to get a positive indication that brake power is on.
The brakeVoltageKey configuration parameter contains the name of the PDU channel supplying
the voltage. It's used as the key for the voltage value in the KeyValueDataList published by the
quadbox subsystem periodically. It's also use as the ID of the alert raised to signal problems with
the voltage.
The quadbox subsystem is recognized not by name but by it's having an agent property named
PowerAgentProperties.QUAD_BOX_AGENT which is transmitted with all of its messages.
Since the callbacks used to monitor the status bus should not block and the order of events must be preserved, we add power-is-on flags to an unbounded queue which is read by a dedicated task. The task undertakes to send the required events to the central state machine and waits for the state machine to reply to each event before sending the next.
| Modifier and Type | Method and Description |
|---|---|
void |
init()
Starts listening for alerts from the target subsystem.
|
void |
onAlert(org.lsst.ccs.services.alert.AlertEvent event) |
void |
onStatusMessage(org.lsst.ccs.bus.messages.StatusMessage rawMsg) |
void |
postShutdown()
Stops listening for power status messages.
|
void |
postStart()
Starts listening for power status messages from the publisher.
|
public void init()
init in interface org.lsst.ccs.framework.HasLifecyclepublic void postStart()
postStart in interface org.lsst.ccs.framework.HasLifecyclepublic void postShutdown()
postShutdown in interface org.lsst.ccs.framework.HasLifecyclepublic void onStatusMessage(org.lsst.ccs.bus.messages.StatusMessage rawMsg)
onStatusMessage in interface org.lsst.ccs.messaging.StatusMessageListenerpublic void onAlert(org.lsst.ccs.services.alert.AlertEvent event)
onAlert in interface org.lsst.ccs.services.alert.AlertListenerCopyright © 2024 LSST. All rights reserved.