javaclient
Class EnergyInterface

java.lang.Object
  extended by javaclient.PlayerDevice
      extended by javaclient.EnergyInterface

public class EnergyInterface
extends PlayerDevice

The energy interface provides data about energy storage, consumption and charging. This interface accepts no commands.

Version:
Author:
Radu Bogdan Rusu

Field Summary
 
Fields inherited from class javaclient.PlayerDevice
device, DIFFERENCE_SYNCH_FACTOR, index, is, os, pc, PLAYER_MAX_REQREP_SIZE, PLAYER_STXX, reserved, size, t_sec, t_usec, ts_sec, ts_usec
 
Constructor Summary
EnergyInterface(PlayerClient pc, short indexOfDevice)
          Constructor for EnergyInterface.
 
Method Summary
 byte getCharging()
          Returns the charge exchange status: if 1, the device is currently receiving charge from another energy device.
 void getMapData(byte enable_input, byte enable_output)
          Configuration request: Controll recharging.
 int getMJoules()
          Returns the energy stored, in milliJoules.
 int getMWatts()
          Returns the estimated current energy consumption (negative values) or aquisition (positive values), in milliWatts (milliJoules/sec).
 void readData()
          The energy interface reports the amount of energy stored, current rate of energy consumption or aquisition, and whether or not the device is connected to a charger.
 
Methods inherited from class javaclient.PlayerDevice
getTimeForDataSampled_sec, getTimeForDataSampled_usec, getTimeForDataSampled, getTimeForDataSent_sec, getTimeForDataSent_usec, getTimeForDataSent, handleEARMessage, handleNARMessage, handleResponse, readHeader, sendHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnergyInterface

public EnergyInterface(PlayerClient pc,
                       short indexOfDevice)
Constructor for EnergyInterface.

Parameters:
pc - a reference to the PlayerClient object
indexOfDevice - the index of the device
Method Detail

readData

public void readData()
The energy interface reports the amount of energy stored, current rate of energy consumption or aquisition, and whether or not the device is connected to a charger.

Overrides:
readData in class PlayerDevice

getMJoules

public int getMJoules()
Returns the energy stored, in milliJoules.

Returns:
the energy stored in milliJoules as an integer

getMWatts

public int getMWatts()
Returns the estimated current energy consumption (negative values) or aquisition (positive values), in milliWatts (milliJoules/sec).

Returns:
the estimated current energy consumption/aquisition as an integer

getCharging

public byte getCharging()
Returns the charge exchange status: if 1, the device is currently receiving charge from another energy device. If -1 the device is currently providing charge to another energy device. If 0, the device is not exchanging charge with an another device.

Returns:
the charge exchange status as a byte

getMapData

public void getMapData(byte enable_input,
                       byte enable_output)
Configuration request: Controll recharging.

See the player_energy_command structure from player.h

Parameters:
enable_input - boolean controlling recharging. If FALSE, recharging is disabled. Defaults to TRUE
enable_output - boolean controlling whether others can recharge from this device. If FALSE, charging others is disabled. Defaults to TRUE.