
public class PowerDevice
extends org.lsst.ccs.monitor.Device
implements org.lsst.ccs.framework.HasLifecycle
| Modifier and Type | Class and Description |
|---|---|
static class |
PowerDevice.ChannelState
Inner class for saving the power state of a channel.
|
| Modifier and Type | Field and Description |
|---|---|
protected org.lsst.ccs.drivers.commons.DriverConstants.ConnType |
connType |
protected String |
devcId |
protected int |
devcParm |
protected double[] |
maxCurrent |
protected double |
minVoltage |
protected static int |
MON_TYPE_CURRENT |
protected static int |
MON_TYPE_POWER |
protected static int |
MON_TYPE_VOLTAGE |
protected static Map<String,Integer> |
mTypeMap |
protected static int |
NETWORK_CONN_INVALID |
protected org.lsst.ccs.drivers.commons.PowerSupplyDriver |
psd |
protected int |
settlingTime |
protected double |
softMaxCurrent |
| Constructor and Description |
|---|
PowerDevice(String name,
org.lsst.ccs.drivers.commons.PowerSupplyDriver psd,
int options,
int minChan,
int maxChan)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
build()
Build phase
|
protected int[] |
checkChannel(String name,
int hwChan,
String type,
String subtype)
Checks a channel's parameters for validity.
|
protected void |
close()
Closes the connection.
|
void |
enableOutput(int chan,
boolean enable)
Enables the output.
|
org.lsst.ccs.drivers.commons.DriverConstants.ConnType |
getConnType()
Gets the connection type.
|
String |
getDevcId()
Gets the device ID.
|
int |
getDevcParm()
Gets the device parameter.
|
int |
getMaxChannel()
Gets the maximum channel number.
|
int |
getMinChannel()
Gets the minimum channel number.
|
boolean |
getOutput(int chan)
Gets the output state.
|
double |
getPower(int chan)
Gets the power for a channel.
|
boolean |
hasNoLoad(int chan)
Gets whether a "no load" error occurred.
|
boolean |
hasVoltError(int chan)
Gets whether a voltage setting error occurred.
|
protected void |
initDevice()
Performs configuration.
|
protected void |
initialize()
Performs full initialization.
|
boolean |
isEnabled(int chan)
Gets the enabled state.
|
protected void |
maintainPower()
Maintains the power for all channels at their set value.
|
protected double |
readChannel(int hwChan,
int type)
Reads a channel.
|
protected void |
readChannelGroup()
Initializes voltages and currents as unread.
|
double |
readCurrent(int chan)
Reads the current.
|
double |
readVoltage(int chan)
Reads the voltage.
|
void |
setCurrent(int chan,
double value)
Sets the current.
|
protected void |
setOnline(boolean online)
Sets the online state.
|
void |
setOutput(int chan,
boolean value)
Sets the output state.
|
void |
setPower(int chan,
double value)
Sets the power.
|
void |
setVoltage(int chan,
double value)
Sets the voltage.
|
addLine, checkHardware, checkHwLine, checkLine, checkOnline, checkTimeout, configure, disable, dropChannel, enable, getDeviceMonitorUpdateTasks, getFullName, getGroupForChannel, getMonitorUpdateTasksForChannels, getName, getOutputLines, getPath, init, initChannel, initChannel, initSensors, isHwLineSet, isLineSet, isOnline, isTimeout, readChannel, readChannelGroup, readChannelNow, setDisabled, setHwLine, setLine, setLineWarm, setOutputLines, testOnlineclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprotected static final int NETWORK_CONN_INVALID
protected static final int MON_TYPE_POWER
protected static final int MON_TYPE_VOLTAGE
protected static final int MON_TYPE_CURRENT
@ConfigurationParameter(name="connType",
category="Refrig",
isFinal=true)
protected volatile org.lsst.ccs.drivers.commons.DriverConstants.ConnType connType
@ConfigurationParameter(name="devcId",
category="Refrig",
isFinal=true)
protected volatile String devcId
@ConfigurationParameter(name="devcParm",
category="Refrig",
isFinal=true)
protected volatile int devcParm
protected double[] maxCurrent
protected double softMaxCurrent
protected double minVoltage
protected int settlingTime
protected org.lsst.ccs.drivers.commons.PowerSupplyDriver psd
public PowerDevice(String name, org.lsst.ccs.drivers.commons.PowerSupplyDriver psd, int options, int minChan, int maxChan)
name - The device namepsd - The power supply device driver objectoptions - The options wordminChan - The minimum channel numbermaxChan - The maximum channel numberpublic void build()
build in interface org.lsst.ccs.framework.HasLifecyclepublic int getMinChannel()
public int getMaxChannel()
@Command(type=QUERY, description="Gets the connection type") public org.lsst.ccs.drivers.commons.DriverConstants.ConnType getConnType()
@Command(type=QUERY, description="Gets the device ID") public String getDevcId()
@Command(type=QUERY, description="Gets the device parameter") public int getDevcParm()
protected 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.Deviceprotected int[] checkChannel(String name, int hwChan, String type, String subtype) throws Exception
checkChannel in class org.lsst.ccs.monitor.Devicename - The channel namehwChan - The hardware channel numbertype - The channel type stringsubtype - The channel subtype stringException - if any errors found in the parameters.protected void readChannelGroup()
readChannelGroup in class org.lsst.ccs.monitor.Deviceprotected double readChannel(int hwChan,
int type)
readChannel in class org.lsst.ccs.monitor.DevicehwChan - The hardware channel number.type - The encoded channel type returned by checkChannel.protected void setOnline(boolean online)
setOnline in class org.lsst.ccs.monitor.Deviceonline - The online state to set: true or falsepublic void enableOutput(int chan,
boolean enable)
chan - The hardware channelenable - The enabled state to setpublic void setPower(int chan,
double value)
chan - The hardware channelvalue - The power to set, or NaN to use current valueprotected void maintainPower()
public double getPower(int chan)
chan - The hardware channelpublic boolean isEnabled(int chan)
chan - The hardware channelpublic boolean hasVoltError(int chan)
chan - The hardware channelpublic boolean hasNoLoad(int chan)
chan - The hardware channelpublic void setVoltage(int chan,
double value)
throws org.lsst.ccs.drivers.commons.DriverException
chan - The hardware channelvalue - The voltage to setorg.lsst.ccs.drivers.commons.DriverExceptionpublic void setCurrent(int chan,
double value)
throws org.lsst.ccs.drivers.commons.DriverException
chan - The hardware channelvalue - The current to setorg.lsst.ccs.drivers.commons.DriverExceptionpublic void setOutput(int chan,
boolean value)
throws org.lsst.ccs.drivers.commons.DriverException
chan - The hardware channelvalue - The output state to setorg.lsst.ccs.drivers.commons.DriverExceptionpublic double readVoltage(int chan)
throws org.lsst.ccs.drivers.commons.DriverException
chan - The hardware channelorg.lsst.ccs.drivers.commons.DriverExceptionpublic double readCurrent(int chan)
throws org.lsst.ccs.drivers.commons.DriverException
chan - The hardware channelorg.lsst.ccs.drivers.commons.DriverExceptionpublic boolean getOutput(int chan)
throws org.lsst.ccs.drivers.commons.DriverException
chan - The hardware channelorg.lsst.ccs.drivers.commons.DriverExceptionCopyright © 2021 LSST. All rights reserved.