Class Channel

java.lang.Object
com.flir.thermalsdk.meterlink.model.Channel

public class Channel extends Object
Defines Meterlink Channel data. This contains whole bundle with Meterlink measurement data.
  • Field Details

    • quantity

      public SensorQuantity quantity
      Value quantity (SensorQuantity::INVALID if unknown).
    • auxInfo

      public SensorAuxInfo auxInfo
      Auxillary information (SensorAuxInfo::INVALID if unknown).
    • measure

      public SensorMeasureInfo measure
      Measure information (SensorMeasureInfo::INVALID if unknown).
    • rawValue

      @Deprecated public double rawValue
      Deprecated.
      This is advised to use getValue() instead.
      Channel reading value. Note that it represents raw value. This is advised to use getValue() along with getUnit() methods or simply use getFormatted() to get value and unit in a predictable way.
      See Also:
    • timestamp

      public Date timestamp
      Time when the message was parsed.
    • precision

      public int precision
      Number of significant numbers in value.
    • isDifference

      public boolean isDifference
      True if value is difference, otherwise false.
    • isValueValid

      public boolean isValueValid
      True if value is valid, otherwise false.
    • isActive

      public boolean isActive
      True if value is active, otherwise false.
    • rawQuantity

      public String rawQuantity
      Raw quantity string (if returned by meter). Only valid if quantity == SensorAuxInfo::INVALID.
    • rawUnit

      @Deprecated public String rawUnit
      Deprecated.
      This is advised to use getUnit() instead.
      Raw unit string (if returned by meter). Only valid if quantity == SensorQuantity::INVALID. Note that it represents raw unit. This is advised to use getValue() along with getUnit() methods or simply use getFormatted() to get value and unit in a predictable way.
      See Also:
    • index

      @Nullable public @Nullable Integer index
      Index of value for a multi sensor-reading packet. Only available for protocolVersion>=2, otherwise it's null
    • unitPrefix

      @Nullable public @Nullable Integer unitPrefix
      -9=nano, -6=u, -3=milli, +3=kilo, etc. Only available for protocolVersion>=2
  • Method Details

    • getValue

      public double getValue()
      Gets channel value. Note it is tightly connected to the getUnit() method. So if you will use this method make sure you get proper unit using getUnit(). This method uses default temperature unit conversion to Kelvin.
      Returns:
      Returns channel value.
      See Also:
    • getValue

      public double getValue(TemperatureUnit unit)
      Gets channel value. Note it is tightly connected to the getUnit() method. So if you will use this method make sure you get proper unit using getUnit().
      Parameters:
      unit - temperature unit to be used to value conversion
      Returns:
      Returns channel value.
      See Also:
    • getUnit

      public String getUnit()
      Gets proper unit for the given channel value. Note it is tightly connected to the getValue() method. So if you will use this method make sure you get proper value using getValue(). This method uses default temperature unit conversion to Kelvin.
      Returns:
      Returns proper unit for the given channel value (when using getValue()).
      See Also:
    • getUnit

      public String getUnit(TemperatureUnit unit)
      Gets proper unit for the given channel value. Note it is tightly connected to the getValue() method. So if you will use this method make sure you get proper value using getValue().
      Parameters:
      unit - temperature unit to be used to unit conversion
      Returns:
      Returns proper unit for the given channel value (when using getValue()).
      See Also:
    • getFormatted

      public String getFormatted()
      Creates a formatted string from a Channel's value. Output is in a form of 'value unit', example: '10.5 mV', '24 K', etc. - respecting Locale settings. This method uses default Locale set on a device. To customize Locale, use getFormatted(Locale). This method uses default temperature unit as Kelvin. To customize temperature unit, use getFormatted(TemperatureUnit).

      For custom formatting use getValue() and getUnit() and then format data on your own.

      Returns:
      a formatted string from a Channel's value using the Default Locale
      See Also:
    • getFormatted

      public String getFormatted(Locale locale)
      Creates a formatted string from a Channel's value. Output is in a form of 'value unit', example: '10.5 mV', '24 K', etc. - respecting Locale settings. This method uses default temperature unit as Kelvin. To customize temperature unit, use getFormatted(TemperatureUnit).

      For custom formatting use getValue() and getUnit() and then format data on your own.

      Parameters:
      locale - locale to control output units, separator, etc.
      Returns:
      a formatted string from a Channel's value using the provided Locale
      See Also:
    • getFormatted

      public String getFormatted(TemperatureUnit unit)
      Creates a formatted string from a Channel's value. Output is in a form of 'value unit', example: '10.5 mV', '24 K', etc. - respecting Locale settings. This method uses default Locale set on a device. To customize Locale, use getFormatted(Locale).

      For custom formatting use getValue() and getUnit() and then format data on your own.

      Parameters:
      unit - temperature unit to be used to value and unit conversions
      Returns:
      a formatted string from a Channel's value using the Default Locale and temperature unit
      See Also:
    • getFormatted

      public String getFormatted(Locale locale, TemperatureUnit unit)
      Creates a formatted string from a Channel's value. Output is in a form of 'value unit', example: '10.5 mV', '24 C', etc. - respecting Locale settings and temperature unit. For custom formatting use getValue() and getUnit() and then format data on your own.
      Parameters:
      locale - locale to control output units, separator, etc.
      unit - temperature unit to be used to value and unit conversions
      Returns:
      a formatted string from a Channel's value using the provided Locale and temperature unit
      See Also:
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object