Class HourDataItem

  • All Implemented Interfaces:
    java.lang.Comparable<HourDataItem>

    public class HourDataItem
    extends ADataItem
    implements java.lang.Comparable<HourDataItem>
    History Hour data block
    • Constructor Summary

      Constructors 
      Constructor Description
      HourDataItem​(byte[] ba)
      Create object representing a hour History data
      HourDataItem​(java.util.Date d)
      Create object representing empty hour data
    • Constructor Detail

      • HourDataItem

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

        public HourDataItem​(java.util.Date d)
        Create object representing empty hour data
        Parameters:
        d - time
    • Method Detail

      • compareTo

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

        public int compareTo​(java.util.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 java.util.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 java.lang.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:
        java.lang.Exception - wrong parameters or no inverter data available
      • getHousePower

        public int getHousePower​(float[] dest,
                                 int destPos)
                          throws java.lang.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:
        java.lang.Exception - wrong parameters or no inverter data available
      • getGridPower

        public int getGridPower​(float[] dest,
                                int destPos)
                         throws java.lang.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:
        java.lang.Exception - wrong parameters or no inverter data available
      • getSOC

        public int getSOC​(float[] dest,
                          int destPos)
                   throws java.lang.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:
        java.lang.Exception - wrong parameters or no inverter data available
      • getUL1

        public int getUL1​(float[] dest,
                          int destPos)
                   throws java.lang.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:
        java.lang.Exception - wrong parameters or no inverter data available
      • getUL2

        public int getUL2​(float[] dest,
                          int destPos)
                   throws java.lang.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:
        java.lang.Exception - wrong parameters or no inverter data available
      • getUL3

        public int getUL3​(float[] dest,
                          int destPos)
                   throws java.lang.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:
        java.lang.Exception - wrong parameters or no inverter data available
      • getUPV1

        public int getUPV1​(float[] dest,
                           int destPos)
                    throws java.lang.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:
        java.lang.Exception - wrong parameters or no inverter data available
      • getUPV2

        public int getUPV2​(float[] dest,
                           int destPos)
                    throws java.lang.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:
        java.lang.Exception - wrong parameters or no inverter data available
      • getUBat

        public int getUBat​(float[] dest,
                           int destPos)
                    throws java.lang.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:
        java.lang.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 java.lang.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​(java.util.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