
public class Monitor extends Object implements HasLifecycle
| Modifier and Type | Class and Description |
|---|---|
static interface |
Monitor.AlarmHandler
Interface for handling alarm events.
|
| Modifier and Type | Field and Description |
|---|---|
protected Logger |
log |
static String |
MONITOR_CHECK_TASK |
static String |
MONITOR_PUBLISH_TASK |
static String |
MONITOR_UPDATE_TASK |
| Modifier | Constructor and Description |
|---|---|
protected |
Monitor() |
|
Monitor(Agent a)
Base Monitor framework constructor
|
protected |
Monitor(Agent a,
Monitor.AlarmHandler alarmHand) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearLimitChanges()
Clears limits-changed indicators.
|
static Monitor |
create(Agent agent) |
void |
dropLimitChanges()
Drop the limit values.
|
Alarm |
getAlarm(String name)
Gets the alarm with the given name.
|
List<Monitor.AlarmHandler> |
getAlarmHandlersList()
Here for tests
|
Channel |
getChannel(int id)
Gets the channel with the given ID.
|
Channel |
getChannel(String name)
Gets the channel with the given name.
|
int |
getChannelId(String name)
Gets the ID of the channel with the given name.
|
List<String> |
getChannelNames()
Gets the list of channel names.
|
Double |
getChannelValue(String name)
Gets a monitored channel value.
|
Device |
getDevice(String name)
Gets the device with the given name.
|
List<String> |
getDeviceNames()
Gets the list of all device names.
|
MonitorFullState |
getFullState()
Gets the full monitoring state.
|
Line |
getLine(String name)
Gets the line with the given name.
|
MonitorFullState |
getMonitorFullState() |
int |
getNumChans()
Gets the number of channels.
|
void |
init()
Called from the enclosing
Subsystem at construction
phase. |
void |
postStart()
Called from the enclosing
Subsystem after
HardwareController components have been handled. |
Double |
readChannelValue(String name)
Reads a monitored channel value.
|
void |
readSensors()
Reads the sensor data.
|
void |
saveLimits()
Saves the limit values.
|
void |
setOnline(BitSet mask,
boolean online)
Sets channels on- or off-line.
|
void |
setPublishData()
Sets the publish data flag.
|
void |
updateState()
Updates the state of the monitoring system.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpostInit, postShutdown, shutdownNow, startprotected Logger log
public static final String MONITOR_CHECK_TASK
public static final String MONITOR_UPDATE_TASK
public static final String MONITOR_PUBLISH_TASK
public Monitor(Agent a)
a - The Agent that will own the Monitor framework,protected Monitor()
protected Monitor(Agent a, Monitor.AlarmHandler alarmHand)
public void init()
HasLifecycleSubsystem at construction
phase.
This method is called before the children components of this
object have their init method called.
At the time it is called, connection to the messaging layer is not yet
done, so there should be no attempt to send messages in the body of
this method. Configuration for message listening can nevertheless be
done here, such as adding MessageListener
objects.
It is unnecessary to call super.init()
init in interface HasLifecyclepublic void readSensors()
public void postStart()
throws HardwareException
HasLifecycleSubsystem after
HardwareController components have been handled. At the time it
is called :
HardwareController components have been handled without
throwing HardwareException
If successful, the enclosing subsystem's
PhaseState will change to
OPERATIONAL and the subsystem will invoke
startTicking on its modules components.
If an HardwareException is thrown, the
OperationalState will change to
ENGINEERING_FAULT until a call to
completeInitialization
is successful
It is unnecessary to call super.postStart()
TO-DO: Does this really need to throw a HardwareException? Don't we have
other Hardware specific interfaces?
postStart in interface HasLifecycleHardwareException - if any failure interacting with the hardware
occurs.public MonitorFullState getFullState()
@Command(type=QUERY, description="Get the full monitoring state") public MonitorFullState getMonitorFullState()
public void updateState()
public void setPublishData()
public void clearLimitChanges()
public Device getDevice(String name)
name - The device name@Command(type=QUERY, description="Get the list of all devices") public List<String> getDeviceNames()
public Line getLine(String name)
name - The line namepublic Alarm getAlarm(String name)
name - The alarm namepublic Channel getChannel(String name)
name - The channel namepublic Channel getChannel(int id)
id - The channel IDpublic int getChannelId(String name)
name - The channel namepublic void setOnline(BitSet mask, boolean online)
mask - Mask of affected channelsonline - True if channels to be set online, false otherwisepublic int getNumChans()
@Command(type=QUERY, description="Get the list of channel names") public List<String> getChannelNames()
@Command(type=QUERY, description="Get a channel value") public Double getChannelValue(String name)
name - The channel name@Command(type=QUERY, description="Read a channel value") public Double readChannelValue(String name)
name - The channel name@Command(type=ACTION, description="Save the monitoring limits") public void saveLimits()
@Command(type=ACTION, description="Drop the changes to the monitoring limits") public void dropLimitChanges()
public List<Monitor.AlarmHandler> getAlarmHandlersList()
Copyright © 2017 LSST. All rights reserved.