Class HourDataItem

java.lang.Object
com.ed.data.history.ADataItem
com.ed.data.history.HourDataItem
All Implemented Interfaces:
Comparable<HourDataItem>

public class HourDataItem extends ADataItem implements Comparable<HourDataItem>
History Hour data block
  • Field Details

  • Constructor Details

    • HourDataItem

      public HourDataItem(byte[] ba)
      Create object representing a hour History data
      Parameters:
      ba - embedded data (raw)
    • HourDataItem

      public HourDataItem(Date d)
      Create object representing empty hour data
      Parameters:
      d - time
  • Method Details

    • compareTo

      public int compareTo(HourDataItem t)
      Specified by:
      compareTo in interface Comparable<HourDataItem>
    • compareTo

      public int compareTo(Date t)
      Description copied from class: ADataItem
      Compare dates
      Specified by:
      compareTo in class ADataItem
      Parameters:
      t - Date to compare with data block time stamp
      Returns:
      0 - same time period, -1 - parameter is older than current data block 1 - parameter is younger than current data block
    • setNextTimePeriod

      public Date setNextTimePeriod(int amount)
      Description copied from class: ADataItem
      Add time
      Specified by:
      setNextTimePeriod in class ADataItem
      Parameters:
      amount - of time periods to add
      Returns:
      new date
    • getPvPower

      public int getPvPower(float[] dest, int destPos) throws Exception
      Get PV power [W], 2 minutes average values
      Parameters:
      dest - destination buffer to write, required length is 30
      destPos - start index im destination buffer
      Returns:
      new destination position
      Throws:
      Exception - wrong parameters or no inverter data available
    • getHousePower

      public int getHousePower(float[] dest, int destPos) throws Exception
      Get House power [W], 2 minutes average values
      Parameters:
      dest - destination buffer to write, required length is 30
      destPos - start index im destination buffer
      Returns:
      new destination position
      Throws:
      Exception - wrong parameters or no inverter data available
    • getGridPower

      public int getGridPower(float[] dest, int destPos) throws Exception
      Get Grid power [W], 2 minutes average values
      Parameters:
      dest - destination buffer to write, required length is 30
      destPos - start index im destination buffer
      Returns:
      new destination position
      Throws:
      Exception - wrong parameters or no inverter data available
    • getSOC

      public int getSOC(float[] dest, int destPos) throws Exception
      Get battery State of Energy [%], 5 minutes average values
      Parameters:
      dest - destination buffer to write, required length is 12
      destPos - start index im destination buffer
      Returns:
      new destination position
      Throws:
      Exception - wrong parameters or no inverter data available
    • getUL1

      public int getUL1(float[] dest, int destPos) throws Exception
      Get inverter AC Voltage phase L1 [V], 5 minutes average values
      Parameters:
      dest - destination buffer to write, required length is 12
      destPos - start index im destination buffer
      Returns:
      new destination position
      Throws:
      Exception - wrong parameters or no inverter data available
    • getUL2

      public int getUL2(float[] dest, int destPos) throws Exception
      Get inverter AC Voltage phase L2 [V], 5 minutes average values
      Parameters:
      dest - destination buffer to write, required length is 12
      destPos - start index im destination buffer
      Returns:
      new destination position
      Throws:
      Exception - wrong parameters or no inverter data available
    • getUL3

      public int getUL3(float[] dest, int destPos) throws Exception
      Get inverter AC Voltage phase L3 [V], 5 minutes average values
      Parameters:
      dest - destination buffer to write, required length is 12
      destPos - start index im destination buffer
      Returns:
      new destination position
      Throws:
      Exception - wrong parameters or no inverter data available
    • getUPV1

      public int getUPV1(float[] dest, int destPos) throws Exception
      Get inverter PV Voltage 1 [V], 5 minutes average values
      Parameters:
      dest - destination buffer to write, required length is 12
      destPos - start index im destination buffer
      Returns:
      new destination position
      Throws:
      Exception - wrong parameters or no inverter data available
    • getUPV2

      public int getUPV2(float[] dest, int destPos) throws Exception
      Get inverter PV Voltage 2 [V], 5 minutes average values
      Parameters:
      dest - destination buffer to write, required length is 12
      destPos - start index im destination buffer
      Returns:
      new destination position
      Throws:
      Exception - wrong parameters or no inverter data available
    • getUBat

      public int getUBat(float[] dest, int destPos) throws Exception
      Get battery Voltage [V], 5 minutes average values
      Parameters:
      dest - destination buffer to write, required length is 12
      destPos - start index im destination buffer
      Returns:
      new destination position
      Throws:
      Exception - wrong parameters or no inverter data available
    • getTsStart

      public long getTsStart()
      Description copied from class: ADataItem
      Get start of current time period
      Specified by:
      getTsStart in class ADataItem
      Returns:
      time period start, time stamp [ms]
    • getTsEnd

      public long getTsEnd()
      Description copied from class: ADataItem
      Get end of current time period
      Specified by:
      getTsEnd in class ADataItem
      Returns:
      time period start, time stamp [ms]
    • getTabName

      public String getTabName()
      Description copied from class: ADataItem
      Get data block name
      Specified by:
      getTabName in class ADataItem
      Returns:
      name
    • getInstance

      public ADataItem getInstance(byte[] b)
      Description copied from class: ADataItem
      Factory, create object
      Specified by:
      getInstance in class ADataItem
      Parameters:
      b - raw data
      Returns:
      current data item
    • getInstance

      public ADataItem getInstance(Date d)
      Description copied from class: ADataItem
      Factory, create empty object
      Specified by:
      getInstance in class ADataItem
      Parameters:
      d - by time
      Returns:
      current data item