public class ByteDataSymbolicAccess.Variable extends java.lang.Object implements VariableAccessArray_ifc
ByteDataSymbolicAccess
.
Modifier and Type | Field and Description |
---|---|
int |
bitMask |
ByteDataSymbolicAccess |
byteDataAccess |
int |
bytePos |
java.lang.String |
name
The data path.
|
java.lang.String |
nameShow
A simple read-able identifier
|
int |
nrofArrayElements |
int |
nrofBytes
From ZBNF parsing.
|
private char |
typeChar |
version
Constructor and Description |
---|
Variable()
Creates an instance which's fields can be set afterwards, especially while parsing a textual given file.
|
Variable(ByteDataSymbolicAccess XXXbytes)
Deprecated.
|
Variable(java.lang.String name,
java.lang.String nameShow,
int bytePos,
char typeChar,
int nrofArrayElements)
Creates an instance which's fields can be set afterwards, especially while parsing a textual given file.
|
Modifier and Type | Method and Description |
---|---|
int |
getDimension(int dimension)
Returns the number of dimension if it is an array or its number of elements.
|
double |
getDouble()
Gets the value from this variable.
|
double |
getDouble(int... ixArray)
Gets the value from this variable.
|
float |
getFloat()
Gets the value from this variable.
|
float |
getFloat(int... ixArray)
Gets the value from this variable.
|
int |
getInt()
Gets a integer value from this variable.
|
int |
getInt(int... ixArray)
Gets a integer value from this variable.
|
long |
getLastRefreshTime()
Gets the time stamp when this variable was refreshed lastly.
|
int[] |
getLastRefreshTimeShort()
Returns the timeShort of all variable of this sample
This operation does not regard any absolute time stamp.
|
long |
getLong()
Gets a long value from this variable.
|
long |
getLong(int... ixArray)
Gets a long value from this variable.
|
private int |
getNrofBytes() |
java.lang.String |
getString()
Gets the value from this variable.
|
java.lang.String |
getString(int... ixArray)
Gets the value from this variable.
|
char |
getType()
Returns the type of the variable:
|
char |
getTypeChar() |
boolean |
isRefreshed()
Returns true if the variable was refreshed after it was requested.
|
boolean |
isRequestedValue(long timeEarlyRequested,
boolean retryFaultyVariables)
Returns true if the request is newer than the last refresh.
|
void |
requestValue()
Requests a new value from the target device with the
System.currentTimeMillis() |
void |
requestValue(long timeRequested)
Requests a new value from the target device.
|
void |
requestValue(long timeRequested,
java.lang.Runnable run)
Requests a new value from the target device.
|
void |
set_typeChar(java.lang.String src) |
double |
setDouble(double value)
Sets the value from this variable.
|
double |
setDouble(double value,
int... ixArray)
Sets the value from this variable.
|
float |
setFloat(float value)
Sets the value from this variable.
|
float |
setFloat(float value,
int... ixArray)
Sets the value from this variable.
|
int |
setInt(int value)
Sets the value into the variable.
|
int |
setInt(int value,
int... ixArray)
Sets the value into the variable.
|
long |
setLong(long value)
Sets the value into the variable.
|
long |
setLong(long value,
int... ixArray)
Sets the value into the variable.
|
void |
setProps(java.lang.String name,
java.lang.String nameShow,
int bytePos,
char typeChar,
int nrofArrayElements)
Defines which type of variable are found on which position.
|
void |
setRefreshed(long time) |
java.lang.String |
setString(java.lang.String value)
Sets the value into the variable
|
java.lang.String |
setString(java.lang.String value,
int... ixArray)
Sets the value into the variable
|
java.lang.String |
toString() |
public final ByteDataSymbolicAccess byteDataAccess
public java.lang.String name
public java.lang.String nameShow
private char typeChar
public int bytePos
public int bitMask
public int nrofBytes
public int nrofArrayElements
public Variable()
public Variable(java.lang.String name, java.lang.String nameShow, int bytePos, char typeChar, int nrofArrayElements)
@Deprecated public Variable(ByteDataSymbolicAccess XXXbytes)
public char getTypeChar()
public void set_typeChar(java.lang.String src)
public void setProps(java.lang.String name, java.lang.String nameShow, int bytePos, char typeChar, int nrofArrayElements)
name
- Name for internal administration, uniquenameShow
- name to showbytePos
- position in the datagram / byte array.typeChar
- see typeChar
, Z B S I L F D for boolean, byte, short, int, long, float, double
Note: for boolean values not on bit 0 a bitMask should be set.nrofArrayElements
- 0 for scalar, >0 an array more values one after anotherpublic char getType()
VariableAccess_ifc
getType
in interface VariableAccess_ifc
public int getDimension(int dimension)
VariableAccessArray_ifc
getDimension
in interface VariableAccessArray_ifc
dimension
- 0 to get number of dimension, 1... to get the length of the dimension.public int getInt(int... ixArray)
VariableAccessArray_ifc
getInt
in interface VariableAccessArray_ifc
ixArray
- unused if it isn't an indexed variable.public int setInt(int value, int... ixArray)
VariableAccessArray_ifc
setInt
in interface VariableAccessArray_ifc
value
- The value given as int.ixArray
- unused if it isn't an indexed variable.public long getLong(int... ixArray)
VariableAccessArray_ifc
getLong
in interface VariableAccessArray_ifc
ixArray
- unused if it isn't an indexed variable.public long setLong(long value, int... ixArray)
VariableAccessArray_ifc
setLong
in interface VariableAccessArray_ifc
value
- The value given as int.ixArray
- unused if it isn't an indexed variable.public java.lang.String getString(int... ixArray)
VariableAccessArray_ifc
getString
in interface VariableAccessArray_ifc
ixArray
- unused if it isn't an indexed variable.public java.lang.String setString(java.lang.String value, int... ixArray)
VariableAccessArray_ifc
setString
in interface VariableAccessArray_ifc
value
- The value given as String.ixArray
- unused if it isn't an indexed variable.public float getFloat(int... ixArray)
VariableAccessArray_ifc
getFloat
in interface VariableAccessArray_ifc
ixArray
- unused if it isn't an indexed variable.public float setFloat(float value, int... ixArray)
VariableAccessArray_ifc
setFloat
in interface VariableAccessArray_ifc
ixArray
- unused if it isn't an indexed variable.public double getDouble(int... ixArray)
VariableAccessArray_ifc
getDouble
in interface VariableAccessArray_ifc
ixArray
- unused if it isn't an indexed variable.public double setDouble(double value, int... ixArray)
VariableAccessArray_ifc
setDouble
in interface VariableAccessArray_ifc
ixArray
- unused if it isn't an indexed variable.private int getNrofBytes()
public void requestValue(long timeRequested)
VariableAccess_ifc
requestValue
in interface VariableAccess_ifc
timeRequested
- the current time, used to mark the request.public void requestValue()
VariableAccess_ifc
System.currentTimeMillis()
requestValue
in interface VariableAccess_ifc
public void requestValue(long timeRequested, java.lang.Runnable run)
VariableAccess_ifc
requestValue
in interface VariableAccess_ifc
timeRequested
- the current timerun
- method which should be invoked if the request is resolved, optional operation.public boolean isRequestedValue(long timeEarlyRequested, boolean retryFaultyVariables)
VariableAccess_ifc
isRequestedValue
in interface VariableAccess_ifc
timeEarlyRequested
- The earliest time where the variable is requested. If the request time is more early, it is not regarded.
This is since 2016-01. An old request should be ignored but the time stamp of the request should be visible for debug or view the state.retryFaultyVariables
- A variable which is set to invalid is requested though.public boolean isRefreshed()
VariableAccess_ifc
isRefreshed
in interface VariableAccess_ifc
public long getLastRefreshTime()
VariableAccess_ifc
getLastRefreshTime
in interface VariableAccess_ifc
public int[] getLastRefreshTimeShort()
org.vishia.gral.base.GralCurveView
, there either the system time is used as absolute time,
but also the controller can store an absolute time. The absolute time should be associated at point{0,0} of this timestamp.
See concept in Timeshort
.getLastRefreshTimeShort
in interface VariableAccess_ifc
public void setRefreshed(long time)
setRefreshed
in interface VariableAccess_ifc
public double getDouble()
VariableAccess_ifc
getDouble
in interface VariableAccess_ifc
public float getFloat()
VariableAccess_ifc
getFloat
in interface VariableAccess_ifc
public int getInt()
VariableAccess_ifc
getInt
in interface VariableAccess_ifc
public long getLong()
VariableAccess_ifc
getLong
in interface VariableAccess_ifc
public java.lang.String getString()
VariableAccess_ifc
getString
in interface VariableAccess_ifc
public double setDouble(double value)
VariableAccess_ifc
setDouble
in interface VariableAccess_ifc
public float setFloat(float value)
VariableAccess_ifc
setFloat
in interface VariableAccess_ifc
public int setInt(int value)
VariableAccess_ifc
setInt
in interface VariableAccess_ifc
value
- The value given as int.public long setLong(long value)
VariableAccess_ifc
setLong
in interface VariableAccess_ifc
value
- The value given as int.public java.lang.String setString(java.lang.String value)
VariableAccess_ifc
setString
in interface VariableAccess_ifc
value
- The value given as String.public java.lang.String toString()
toString
in class java.lang.Object