Package com.ed.edcom

Class DspVar


  • public final class DspVar
    extends ADspData
    Embedded Data Representations.
    • Constructor Detail

      • DspVar

        public DspVar​(java.lang.String name,
                      int type,
                      int len,
                      DspVarListener listner,
                      long refreshPeriod)
               throws java.lang.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:
        java.lang.Exception - wrong parameters
    • Method Detail

      • getValue

        public java.lang.Object getValue()
        Get value.
        Specified by:
        getValue in class ADspData
        Returns:
        Float, Long, Integer or List (according to selected type)
      • getValue

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

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

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

        public java.lang.String toString​(java.lang.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​(java.lang.Object in)
        Set value
        Parameters:
        in - Float, Long, Integer, ByteBuffer or String
      • setValue

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