Package com.ed.edcom
Class DspVar
- java.lang.Object
-
- com.ed.edcom.ADspData
-
- com.ed.edcom.DspVar
-
public final class DspVar extends ADspData
Embedded Data Representations.
-
-
Field Summary
Fields Modifier and Type Field Description static int
TYPE_FLOAT
Float IEEE 754, 32 bitstatic int
TYPE_INT16
Signed integer, 16 bitstatic int
TYPE_INT32
Signed integer, 32 bitstatic int
TYPE_INT8
Signed integer, 8 bitstatic int
TYPE_UINT16
Unsigned integer, 16 bitstatic int
TYPE_UINT32
Unsigned integer, 32 bitstatic int
TYPE_UINT8
Unsigned integer, 8 bit-
Fields inherited from class com.ed.edcom.ADspData
bufRead, bufWrite, data, data_set, externalKey1, externalKey2
-
-
Constructor Summary
Constructors Constructor Description DspVar(java.lang.String name, int type, int len, DspVarListener listner, long refreshPeriod)
Class constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getCString()
Get c stringfloat
getFloat()
Get float valuefloat
getFloat(int ix)
Get float valuevoid
getFloatArray(float[] f)
Get array of floatvoid
getFloatArray(float[] f, float fk)
Get array of float with filter.float
getFloatValue(int ix, float old, float fk)
Get float value with filter.int
getInteger()
Get integerlong
getLong()
Get long valuelong
getLong(int ix)
Get long valuevoid
getUint32Array(long[] la)
Get array of long.java.lang.Object
getValue()
Get value.java.lang.Object
getValue(int ix)
Get value.void
setValue(java.lang.Object in)
Set valuevoid
setValue(java.lang.Object in, int n)
Set valuejava.lang.String
toString(java.lang.String format)
Convert to stringjava.lang.String
toString(java.lang.String format, int ix)
Convert one array entry to string.-
Methods inherited from class com.ed.edcom.ADspData
addListener, canRead, canReadAfterModify, canWrite, enableReqOptionalField, getByte, getBytes, hasChanged, isValid, refresh, refreshTime, setKey2, setModifiedNow, setReqOptionalField, setSynchReadDspVar, setValidPeriod
-
-
-
-
Field Detail
-
TYPE_FLOAT
public static final int TYPE_FLOAT
Float IEEE 754, 32 bit- See Also:
- Constant Field Values
-
TYPE_UINT32
public static final int TYPE_UINT32
Unsigned integer, 32 bit- See Also:
- Constant Field Values
-
TYPE_INT32
public static final int TYPE_INT32
Signed integer, 32 bit- See Also:
- Constant Field Values
-
TYPE_UINT16
public static final int TYPE_UINT16
Unsigned integer, 16 bit- See Also:
- Constant Field Values
-
TYPE_INT16
public static final int TYPE_INT16
Signed integer, 16 bit- See Also:
- Constant Field Values
-
TYPE_UINT8
public static final int TYPE_UINT8
Unsigned integer, 8 bit- See Also:
- Constant Field Values
-
TYPE_INT8
public static final int TYPE_INT8
Signed integer, 8 bit- See Also:
- Constant Field Values
-
-
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 listenerrefreshPeriod
- 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.
-
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 arrayold
- previous valuefk
- 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 arrayfk
- 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 Stringn
- index in array
-
-