public class APC7900Device
extends org.lsst.ccs.monitor.Device
implements org.lsst.ccs.StateChangeListener
| Modifier and Type | Field and Description |
|---|---|
protected org.lsst.ccs.services.alert.AlertService |
alertService |
static int |
CHAN_CURRENT |
static int |
CHAN_POWER |
protected Map<String,PduOutlet> |
mapOfOutlets |
protected int |
maxReadFailures |
protected String |
node |
protected int |
numberOfOutlets |
protected List<String> |
outlets |
protected Logger |
sLog
Deprecated.
|
protected org.lsst.ccs.services.AgentStateService |
stateService |
static int |
TYPE_POWER |
protected boolean |
updateNamesInPDU |
| Constructor and Description |
|---|
APC7900Device() |
| Modifier and Type | Method and Description |
|---|---|
void |
build() |
void |
causePDUFailure() |
void |
causeUnintendedOutletFlipOfState(String name) |
protected int[] |
checkChannel(org.lsst.ccs.monitor.Channel ch)
Checks a channel's parameters for validity.
|
protected void |
close()
Closes the connection.
|
void |
forceOutletOff(String name)
Forces an outlet to turn off.
|
void |
forceOutletOn(String name)
Forces an outlet to turn on.
|
protected String |
getGroupForChannel(org.lsst.ccs.monitor.Channel ch) |
List<String> |
getOutletNames()
Gets the list of outlet names.
|
Map<String,Boolean> |
getOutletOnStateMap()
Gets the map of outlet on states.
|
void |
init() |
protected void |
initDevice()
Performs configuration.
|
protected void |
initialize()
Initializes the device.
|
boolean |
isOutletOn(String name)
Gets whether an outlet is on.
|
void |
outletOff(String name)
Turns an outlet off.
|
void |
outletOn(String name)
Turns an outlet on.
|
protected double |
readChannel(org.lsst.ccs.monitor.Channel ch)
Reads a channel.
|
protected void |
readChannelGroup(String group) |
void |
setOutletState(String name,
PduOutletState state,
boolean force)
Change the state of an outlet
|
void |
start() |
void |
stateChanged(org.lsst.ccs.utilities.taitime.CCSTimeStamp stateTransitionTimestamp,
Object changedObj,
Enum<?> newState,
Enum<?> oldState) |
addLine, checkChannel, checkHwLine, checkLine, checkOnline, checkTimeout, configure, disable, dropChannel, dropChannel, enable, getDeviceMonitorUpdateTasks, getFullName, getMonitorUpdateTasksForChannels, getName, getOutputLines, getPath, initChannel, initChannel, initChannel, initSensors, isEnabled, isHwLineSet, isLineSet, isOnline, isTimeout, readChannel, readChannelGroup, readChannelNow, setDisabled, setHwLine, setLine, setLineWarm, setOnline, setOutputLines, testOnlinepublic static final int TYPE_POWER
public static final int CHAN_CURRENT
public static final int CHAN_POWER
@ConfigurationParameter(isFinal=true) protected volatile String node
@ConfigurationParameter(isFinal=true) protected volatile int numberOfOutlets
@ConfigurationParameter(isFinal=true) protected volatile boolean updateNamesInPDU
@ConfigurationParameter protected volatile int maxReadFailures
@Deprecated protected final Logger sLog
@LookupField(strategy=TREE) protected org.lsst.ccs.services.AgentStateService stateService
@LookupField(strategy=TREE) protected org.lsst.ccs.services.alert.AlertService alertService
public void build()
build in interface org.lsst.ccs.framework.HasLifecyclepublic void init()
init in interface org.lsst.ccs.framework.HasLifecycleinit in class org.lsst.ccs.monitor.Devicepublic void start()
start in interface org.lsst.ccs.framework.HasLifecyclestart in class org.lsst.ccs.monitor.Deviceprotected void initDevice()
initDevice in class org.lsst.ccs.monitor.Deviceprotected void initialize()
initialize in class org.lsst.ccs.monitor.Deviceprotected void close()
close in class org.lsst.ccs.monitor.Devicepublic void stateChanged(org.lsst.ccs.utilities.taitime.CCSTimeStamp stateTransitionTimestamp,
Object changedObj,
Enum<?> newState,
Enum<?> oldState)
stateChanged in interface org.lsst.ccs.StateChangeListenerprotected int[] checkChannel(org.lsst.ccs.monitor.Channel ch)
throws Exception
checkChannel in class org.lsst.ccs.monitor.Devicech - The Channel to check.Exception - If parameters are invalidprotected double readChannel(org.lsst.ccs.monitor.Channel ch)
readChannel in class org.lsst.ccs.monitor.Devicech - The Channel to readprotected String getGroupForChannel(org.lsst.ccs.monitor.Channel ch)
getGroupForChannel in class org.lsst.ccs.monitor.Deviceprotected void readChannelGroup(String group)
readChannelGroup in class org.lsst.ccs.monitor.Device@Command(name="getOutletNames", description="Get the list of outlet names") public List<String> getOutletNames()
@Command(name="getOutletOnStateMap", description="Get the map of outlet on states") public Map<String,Boolean> getOutletOnStateMap() throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="outletOn", description="Turn outlet on") public void outletOn(@Argument(name="name",description="Outlet name") String name) throws org.lsst.ccs.drivers.commons.DriverException
name - The outlet nameorg.lsst.ccs.drivers.commons.DriverException@Command(name="outletOff", description="Turn outlet off") public void outletOff(@Argument(name="name",description="Outlet name") String name) throws org.lsst.ccs.drivers.commons.DriverException
name - The outlet nameorg.lsst.ccs.drivers.commons.DriverException@Command(name="forceOutletOn", description="Force outlet to turn on") public void forceOutletOn(@Argument(name="name",description="Outlet name") String name) throws org.lsst.ccs.drivers.commons.DriverException
name - The outlet nameorg.lsst.ccs.drivers.commons.DriverException@Command(name="forceOutletOff", description="Force outlet to turn off") public void forceOutletOff(@Argument(name="name",description="Outlet name") String name) throws org.lsst.ccs.drivers.commons.DriverException
name - The outlet nameorg.lsst.ccs.drivers.commons.DriverException@Command(name="causeUnintendedOutletFlipOfState", description="Cause an unintended state transition which raises an alert.", simulation=true) public void causeUnintendedOutletFlipOfState(@Argument(name="name",description="Outlet name") String name) throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="causePDUFailure", description="Cause a PDU failure.", simulation=true) public void causePDUFailure() throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="isOutletOn", description="Get whether outlet is on") public boolean isOutletOn(@Argument(name="name",description="Outlet name") String name) throws org.lsst.ccs.drivers.commons.DriverException
name - The outlet nameorg.lsst.ccs.drivers.commons.DriverException@Command(name="setOutletState", description="Set the outlet state to a given OutletState") public void setOutletState(@Argument(allowedValueProvider="getOutletNames",name="name",description="Outlet name") String name, @Argument(name="state",description="The desired PduOutletState") PduOutletState state, @Argument(name="force",description="true to force the state change",defaultValue="false") boolean force) throws org.lsst.ccs.drivers.commons.DriverException
name - The outlet namestate - The desired PduOutletState for the outlet.force - true if the state change is to be forced.org.lsst.ccs.drivers.commons.DriverExceptionCopyright © 2022 LSST. All rights reserved.