edu.wpi.first.wpilibj

## Class PowerDistributionPanel

- java.lang.Object
- - edu.wpi.first.wpilibj.SensorBase
  - - edu.wpi.first.wpilibj.PowerDistributionPanel

- All Implemented Interfaces:
    LiveWindowSendable, Sendable

      public class PowerDistributionPanel
      extends SensorBase
      implements LiveWindowSendable

  Class for getting voltage, current, temperature, power and energy from the Power Distribution Panel over CAN.

- - ### Field Summary

    - ### Fields inherited from class edu.wpi.first.wpilibj.SensorBase

      `kAnalogInputChannels, kAnalogOutputChannels, kDigitalChannels, kPCMModules, kPDPChannels, kPDPModules, kPwmChannels, kRelayChannels, kSolenoidChannels, kSystemClockTicksPerMicrosecond`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PowerDistributionPanel()` Constructor.
    `PowerDistributionPanel(int module)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clearStickyFaults()` Clear all PDP sticky faults.
    `double` | `getCurrent(int channel)` Query the current of a single channel of the PDP.
    `java.lang.String` | `getSmartDashboardType()` The string representation of the named data type that will be used by the smart dashboard for this `Sendable`.
    `double` | `getTemperature()` Query the temperature of the PDP.
    `double` | `getTotalCurrent()` Query the current of all monitored PDP channels (0-15).
    `double` | `getTotalEnergy()` Query the total energy drawn from the monitored PDP channels.
    `double` | `getTotalPower()` Query the total power drawn from the monitored PDP channels.
    `double` | `getVoltage()` Query the input voltage of the PDP.
    `void` | `initTable(NetworkTable subtable)` Initializes a table for this `Sendable` object.
    `void` | `resetTotalEnergy()` Reset the total energy to 0.
    `void` | `startLiveWindowMode()` PDP doesn't have to do anything special when entering the LiveWindow.
    `void` | `stopLiveWindowMode()` PDP doesn't have to do anything special when exiting the LiveWindow.
    `void` | `updateTable()` Update the table for this sendable object with the latest values.

    - ### Methods inherited from class edu.wpi.first.wpilibj.SensorBase

      `checkAnalogInputChannel, checkAnalogOutputChannel, checkDigitalChannel, checkPDPChannel, checkPDPModule, checkPWMChannel, checkRelayChannel, checkSolenoidChannel, checkSolenoidModule, free, getDefaultSolenoidModule, setDefaultSolenoidModule`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PowerDistributionPanel

          public PowerDistributionPanel(int module)

      Constructor.
      Parameters:
        `module` - The CAN ID of the PDP

    - #### PowerDistributionPanel

          public PowerDistributionPanel()

      Constructor. Uses the default CAN ID (0).

  - ### Method Detail

    - #### 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.

    - #### getSmartDashboardType

          public java.lang.String getSmartDashboardType()

      Description copied from interface: `Sendable`
      The string representation of the named data type that will be used by the smart dashboard for this `Sendable`.
      Specified by:
        `getSmartDashboardType` in interface `Sendable`
      Returns:
        The type of this `Sendable`.

    - #### initTable

          public void initTable(NetworkTable subtable)

      Description copied from interface: `Sendable`
      Initializes a table for this `Sendable` object.
      Specified by:
        `initTable` in interface `Sendable`
      Parameters:
        `subtable` - The table to put the values in.

    - #### updateTable

          public void updateTable()

      Description copied from interface: `LiveWindowSendable`
      Update the table for this sendable object with the latest values.
      Specified by:
        `updateTable` in interface `LiveWindowSendable`

    - #### startLiveWindowMode

          public void startLiveWindowMode()

      PDP doesn't have to do anything special when entering the LiveWindow. Start having this sendable object automatically respond to value changes reflect the value on the table.
      Specified by:
        `startLiveWindowMode` in interface `LiveWindowSendable`

    - #### stopLiveWindowMode

          public void stopLiveWindowMode()

      PDP doesn't have to do anything special when exiting the LiveWindow. Stop having this sendable object automatically respond to value changes.
      Specified by:
        `stopLiveWindowMode` in interface `LiveWindowSendable`