Package com.ed.edcom

Class DspVar


public final class DspVar extends ADspData
Embedded Data Representations.
  • Field Details

  • Constructor Details

    • DspVar

      public DspVar(String name, int type, int len, DspVarListener listner, long refreshPeriod) throws Exception
      Class constructor.
      Parameters:
      name - variable name (according to embedded software)
      type - variable type (TYPE_FLOAT, TYPE_UINT32 ... etc.)
      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 value.
      Specified by:
      getValue in class ADspData
      Returns:
      Float, Long, Integer or List (according to selected type)
    • getValue

      public Object getValue(int ix)
      Get value.
      Parameters:
      ix - index
      Returns:
      Float or Long (according to selected type)
    • getCString

      public String getCString()
      Get c string
      Returns:
      string
    • toString

      public String toString(String format, int ix)
      Convert one array entry to string.
      Parameters:
      format - example "%.1f"
      ix - array index
      Returns:
      string
    • toString

      public String toString(String format)
      Convert to string
      Parameters:
      format - example "%.1f"
      Returns:
      string
    • getLong

      public long getLong(int ix)
      Get long value
      Parameters:
      ix - index in array
      Returns:
      64bit signed long
    • getLong

      public long getLong()
      Get long value
      Returns:
      64bit signed long
    • getInteger

      public int getInteger()
      Get integer
      Returns:
      integer
    • getFloat

      public float getFloat(int ix)
      Get float value
      Parameters:
      ix - index in array
      Returns:
      float value
    • getFloat

      public float getFloat()
      Get float value
      Returns:
      float value
    • getFloatValue

      public float getFloatValue(int ix, float old, float fk)
      Get float value with filter.
      Parameters:
      ix - position in array
      old - previous value
      fk - filter settings
      Returns:
      output float value
    • getFloatArray

      public void getFloatArray(float[] f)
      Get array of float
      Parameters:
      f - float array to fill
    • getFloatArray

      public void getFloatArray(float[] f, float fk)
      Get array of float with filter.
      Parameters:
      f - output float array
      fk - filter settings
    • getUint32Array

      public void getUint32Array(long[] la)
      Get array of long.
      Parameters:
      la - output long array
    • setValue

      public void setValue(Object in)
      Set value
      Parameters:
      in - Float, Long, Integer, ByteBuffer or String
    • setValue

      public void setValue(Object in, int n)
      Set value
      Parameters:
      in - Float, Long, Integer, ByteBuffer or String
      n - index in array