Package com.ed.edcom

Class DspFloat


public final class DspFloat extends ADspData
Float data representation.
  • Field Details

    • DSP_FLOAT_SIZE

      public static final int DSP_FLOAT_SIZE
      IEEE 754 Float type size.
      See Also:
  • Constructor Details

    • DspFloat

      public DspFloat(String name, int len, DspVarListener listner, long refreshPeriod) throws Exception
      Class constructor.
      Parameters:
      name - variable name (according to embedded software)
      len - array length ('1' for non array)
      listner - on change listener
      refreshPeriod - required refresh period in milliseconds, '0' - no refresh required.
      Throws:
      Exception - wrong parameters
  • Method Details

    • getValue

      public Object getValue()
      Get variable value by index.
      Specified by:
      getValue in class ADspData
      Returns:
      Float value
    • getFloat

      public float getFloat(int ix) throws IndexOutOfBoundsException
      Get float value by index.
      Parameters:
      ix - index in float array ('0' for non array)
      Returns:
      float value
      Throws:
      IndexOutOfBoundsException - If index is negative or not smaller than the limit
    • setFloat

      public void setFloat(float fv, int ix) throws IndexOutOfBoundsException
      Set float value by index.
      Parameters:
      fv - new float value
      ix - index in float array
      Throws:
      IndexOutOfBoundsException - If index is negative or not smaller than the limit