Package com.ed.edcom
Class DspVar
java.lang.Object
com.ed.edcom.ADspData
com.ed.edcom.DspVar
Embedded Data Representations.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Float IEEE 754, 32 bitstatic final int
Signed integer, 16 bitstatic final int
Signed integer, 32 bitstatic final int
Signed integer, 8 bitstatic final int
Unsigned integer, 16 bitstatic final int
Unsigned integer, 32 bitstatic final int
Unsigned integer, 8 bitFields inherited from class com.ed.edcom.ADspData
bufRead, bufWrite, data, data_set, externalKey1, externalKey2
-
Constructor Summary
ConstructorDescriptionDspVar
(String name, int type, int len, DspVarListener listner, long refreshPeriod) Class constructor. -
Method Summary
Modifier and TypeMethodDescriptionGet 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
Get integerlong
getLong()
Get long valuelong
getLong
(int ix) Get long valuevoid
getUint32Array
(long[] la) Get array of long.getValue()
Get value.getValue
(int ix) Get value.void
Set valuevoid
Set valueConvert to stringConvert 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 Details
-
TYPE_FLOAT
public static final int TYPE_FLOATFloat IEEE 754, 32 bit- See Also:
-
TYPE_UINT32
public static final int TYPE_UINT32Unsigned integer, 32 bit- See Also:
-
TYPE_INT32
public static final int TYPE_INT32Signed integer, 32 bit- See Also:
-
TYPE_UINT16
public static final int TYPE_UINT16Unsigned integer, 16 bit- See Also:
-
TYPE_INT16
public static final int TYPE_INT16Signed integer, 16 bit- See Also:
-
TYPE_UINT8
public static final int TYPE_UINT8Unsigned integer, 8 bit- See Also:
-
TYPE_INT8
public static final int TYPE_INT8Signed integer, 8 bit- See Also:
-
-
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 listenerrefreshPeriod
- required refresh period in milliseconds, '0' - no refresh required.- Throws:
Exception
- wrong parameters
-
-
Method Details
-
getValue
Get value. -
getValue
Get value.- Parameters:
ix
- index- Returns:
- Float or Long (according to selected type)
-
getCString
Get c string- Returns:
- string
-
toString
Convert one array entry to string.- Parameters:
format
- example "%.1f"ix
- array index- Returns:
- string
-
toString
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
Set value- Parameters:
in
- Float, Long, Integer, ByteBuffer or String
-
setValue
Set value- Parameters:
in
- Float, Long, Integer, ByteBuffer or Stringn
- index in array
-