Package edu.wpi.first.wpilibj
Class PowerDistributionPanel
- java.lang.Object
-
- edu.wpi.first.wpilibj.PowerDistributionPanel
-
- All Implemented Interfaces:
Sendable,AutoCloseable
public class PowerDistributionPanel extends Object implements Sendable, AutoCloseable
Class for getting voltage, current, temperature, power and energy from the Power Distribution Panel over CAN.
-
-
Constructor Summary
Constructors Constructor Description PowerDistributionPanel()Constructor.PowerDistributionPanel(int module)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearStickyFaults()Clear all PDP sticky faults.voidclose()doublegetCurrent(int channel)Query the current of a single channel of the PDP.doublegetTemperature()Query the temperature of the PDP.doublegetTotalCurrent()Query the current of all monitored PDP channels (0-15).doublegetTotalEnergy()Query the total energy drawn from the monitored PDP channels.doublegetTotalPower()Query the total power drawn from the monitored PDP channels.doublegetVoltage()Query the input voltage of the PDP.voidinitSendable(SendableBuilder builder)Initializes thisSendableobject.voidresetTotalEnergy()Reset the total energy to 0.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface edu.wpi.first.wpilibj.Sendable
addChild, getName, getSubsystem, setName, setName, setName, setName, setSubsystem
-
-
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable
-
getVoltage
public double getVoltage()
Query the input voltage of the PDP.- Returns:
- The voltage of the PDP in volts
-
getTemperature
public double getTemperature()
Query the temperature of the PDP.- Returns:
- The temperature of the PDP in degrees Celsius
-
getCurrent
public double getCurrent(int channel)
Query the current of a single channel of the PDP.- Returns:
- The current of one of the PDP channels (channels 0-15) in Amperes
-
getTotalCurrent
public double getTotalCurrent()
Query the current of all monitored PDP channels (0-15).- Returns:
- The current of all the channels in Amperes
-
getTotalPower
public double getTotalPower()
Query the total power drawn from the monitored PDP channels.- Returns:
- the total power in Watts
-
getTotalEnergy
public double getTotalEnergy()
Query the total energy drawn from the monitored PDP channels.- Returns:
- the total energy in Joules
-
resetTotalEnergy
public void resetTotalEnergy()
Reset the total energy to 0.
-
clearStickyFaults
public void clearStickyFaults()
Clear all PDP sticky faults.
-
initSendable
public void initSendable(SendableBuilder builder)
Description copied from interface:SendableInitializes thisSendableobject.- Specified by:
initSendablein interfaceSendable- Parameters:
builder- sendable builder
-
-