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 Monitor.AlarmHandler |
alarmH
TODO make package protected
|
protected Logger |
log |
static String |
MONITOR_CHECK_TASK |
static String |
MONITOR_PUBLISH_TASK |
static String |
MONITOR_UPDATE_TASK |
| Modifier | Constructor and Description |
|---|---|
protected |
Monitor() |
protected |
Monitor(Agent a,
Monitor.AlarmHandler alarmHand) |
|
Monitor(Subsystem a)
Base Monitor framework constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkLimits()
Deprecated.
|
void |
clearLimitChanges()
Clears limits-changed indicators.
|
Alarm |
getAlarm(String name)
Gets the alarm with the given name.
|
Monitor.AlarmHandler |
getAlarmHandler()
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.
|
Map<String,Object> |
getConfigurationMap()
Deprecated.
use the configuration framework instead
|
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 |
initConfiguration()
Deprecated.
The subsystem's monitor should be used instead.
|
void |
initSensors()
Deprecated.
This method is no longer needed LSSTCCS-103
|
void |
initSensors(int checkPeriod)
Deprecated.
This method is no longer needed LSSTCCS-1032
|
void |
postStart()
Called from the enclosing
Subsystem after
HardwareController components have been handled. |
void |
publishData()
Deprecated.
the monitor provides a dedicated timer task to publish monitored
quantities. The period is controlled by the configuration parameter
monitor_PublishData/taskPeriodMillis
|
void |
publishLimits()
Deprecated.
this method can be safely removed, the monitor publishes the
limits in its post-start implementation.
|
void |
publishState()
Deprecated.
this method can be safely removed, the monitor publishes its state
in its poststart implementation.
|
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 |
start(int period)
Deprecated.
This method is no longer needed LSSTCCS-1032
|
void |
updateState()
Updates the state of the monitoring system.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpostInit, postShutdown, shutdownNow, start@LookupField(strategy=TREE) protected Monitor.AlarmHandler alarmH
protected 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(Subsystem 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 HasLifecycle@Deprecated public void initConfiguration()
@Deprecated public void initSensors()
@Deprecated public void initSensors(int checkPeriod)
checkPeriod - The online check period (ms)public void readSensors()
@Deprecated public void start(int period)
period - The update period (ms)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()
@Deprecated public void publishState()
@Deprecated public void publishData()
@Deprecated public void publishLimits()
public void updateState()
@Deprecated public void checkLimits()
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()
@Deprecated @Command(type=QUERY, description="Get the map of all configured values") public Map<String,Object> getConfigurationMap()
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()
public Monitor.AlarmHandler getAlarmHandler()
Copyright © 2017 LSST. All rights reserved.