Class SunSpecPoint.PointImpl

  • Enclosing interface:
    SunSpecPoint

    public static class SunSpecPoint.PointImpl
    extends java.lang.Object
    The internal PointImpl object for easier handling in Enums.
    • Field Detail

      • label

        public final java.lang.String label
      • description

        public final java.lang.String description
      • notes

        public final java.lang.String notes
      • mandatory

        public final boolean mandatory
      • unit

        public final Unit unit
      • scaleFactor

        public final java.util.Optional<java.lang.String> scaleFactor
    • Constructor Detail

      • PointImpl

        public PointImpl​(java.lang.String channelId,
                         java.lang.String label,
                         java.lang.String description,
                         java.lang.String notes,
                         SunSpecPoint.PointType type,
                         boolean mandatory,
                         AccessMode accessMode,
                         Unit unit,
                         java.lang.String scaleFactor,
                         OptionsEnum[] options)
    • Method Detail

      • generateModbusElement

        public final AbstractModbusElement<?> generateModbusElement​(java.lang.Integer startAddress)
        Generates a Modbus Element for the given point + startAddress.
        Parameters:
        startAddress - the startAddress of the Point
        Returns:
        a new Modbus Element
      • getMatchingOpenemsType

        public final OpenemsType getMatchingOpenemsType​(boolean hasScaleFactor)
        Gets the OpenemsType that matches this SunSpec-Type.
        Parameters:
        hasScaleFactor - true if this Point has a ScaleFactor. If true, a floating point type is applied to avoid rounding errors.
        Returns:
        the OpenemsType