class InspcCmdStore extends java.lang.Object implements InspcAccess_ifc
InspcMng#cmdSetValueByPath(String, float, org.vishia.inspcPC.InspcAccessExecRxOrder_ifc)
The preparation of the telegram is only done in one thread. Therefore the command is stored here.Modifier and Type | Field and Description |
---|---|
(package private) InspcAccessExecRxOrder_ifc |
actionOnRx |
(package private) int |
cmd
The command like defined in
InspcDataExchangeAccess.Inspcitem |
(package private) int |
handle |
(package private) InspcMng |
inspc |
(package private) java.lang.String |
sDataPath |
(package private) int |
typeofValue |
(package private) long |
value
A value is stored in a long format, as float or double bit image though it is a double or float value.
|
(package private) java.lang.String |
values |
idLogFailedSeq, idLogGetAddress, idLogGetFields, idLogGetOther, idLogGetValueByIdent, idLogGetValueByPath, idLogRcvGetAddress, idLogRcvGetFields, idLogRcvGetOther, idLogRcvGetValueByIdent, idLogRcvGetValueByPath, idLogRcvRegisterByPath, idLogRcvSetValueByPath, idLogRegisterByPath, idLogRx, idLogRxError, idLogRxItem, idLogRxLast, idLogRxNotlast, idLogRxRepeat, idLogSetValueByPath, idLogTx, sVersion
Constructor and Description |
---|
InspcCmdStore(InspcMng inspc) |
Modifier and Type | Method and Description |
---|---|
void |
addUserTxOrder(java.lang.Runnable order)
Adds any program snippet which is executed while preparing the telegram for data request from target.
|
boolean |
cmdGetAddressByPath(java.lang.String sDataPath,
InspcAccessExecRxOrder_ifc actionOnRx)
Adds the info block to send 'get value by path'
|
int |
cmdGetFields(java.lang.String sDataPath,
InspcAccessExecRxOrder_ifc actionOnRx) |
boolean |
cmdGetValueByHandle(int ident,
InspcAccessExecRxOrder_ifc actionOnRx)
Adds the info block to send 'register by path'
|
int |
cmdGetValueByPath(java.lang.String sDataPath,
InspcAccessExecRxOrder_ifc actionOnRx)
Adds the info block to send 'get value by path'
|
int |
cmdRegisterHandle(java.lang.String sDataPath,
InspcAccessExecRxOrder_ifc actionOnRx)
Adds the info block to send 'register by path'
|
void |
cmdSetDoubleByPath(java.lang.String sDataPath,
double value,
InspcAccessExecRxOrder_ifc actionOnRx)
Adds the info block to send 'get value by path'
|
void |
cmdSetFloatByPath(java.lang.String sDataPath,
float value,
InspcAccessExecRxOrder_ifc actionOnRx)
Adds the info block to send 'get value by path'
|
void |
cmdSetInt32ByPath(java.lang.String sDataPath,
int value,
InspcAccessExecRxOrder_ifc actionOnRx)
Adds the info block to send 'get value by path'
|
void |
cmdSetStringByPath(VariableAccessArray_ifc var,
java.lang.String value)
Adds the info block to send 'set value by path'
|
void |
cmdSetValueByPath(java.lang.String sDataPath,
long value,
int typeofValue,
InspcAccessExecRxOrder_ifc actionOnRx)
Adds the info block to send 'get value by path'
|
(package private) void |
exec()
Executes the stored command in this thread.
|
InspcTargetAccessData |
getTargetAccessFromPath(java.lang.String sDataPath,
boolean strict)
Splits a given full data path with device:datapath maybe with alias:datapath in the device, path, name and returns a struct.
|
boolean |
isOrSetReady(long timeCurrent)
Checks readiness of communication cycle.
|
void |
requestFields(InspcTargetAccessData data,
InspcAccessExecRxOrder_ifc rxActionGetFields,
java.lang.Runnable runOnReceive)
Set the request for all fields of the given variable.
|
final InspcMng inspc
java.lang.String sDataPath
int handle
int cmd
InspcDataExchangeAccess.Inspcitem
long value
typeofValue
contains the type. That is the convention of communication.java.lang.String values
int typeofValue
InspcAccessExecRxOrder_ifc actionOnRx
public InspcCmdStore(InspcMng inspc)
public int cmdGetFields(java.lang.String sDataPath, InspcAccessExecRxOrder_ifc actionOnRx)
cmdGetFields
in interface InspcAccess_ifc
public int cmdGetValueByPath(java.lang.String sDataPath, InspcAccessExecRxOrder_ifc actionOnRx)
InspcAccess_ifc
cmdGetValueByPath
in interface InspcAccess_ifc
public int cmdRegisterHandle(java.lang.String sDataPath, InspcAccessExecRxOrder_ifc actionOnRx)
InspcAccess_ifc
cmdRegisterHandle
in interface InspcAccess_ifc
public boolean cmdGetValueByHandle(int ident, InspcAccessExecRxOrder_ifc actionOnRx)
InspcAccess_ifc
cmdGetValueByHandle
in interface InspcAccess_ifc
public void cmdSetValueByPath(java.lang.String sDataPath, long value, int typeofValue, InspcAccessExecRxOrder_ifc actionOnRx)
InspcAccess_ifc
cmdSetValueByPath
in interface InspcAccess_ifc
value
- The value as long-image, it may be a double, float, int etc.typeofValue
- The type of the value, use InspcDataExchangeAccess#kScalarTypes
+ ClassJc#REFLECTION_double
etc.public void cmdSetInt32ByPath(java.lang.String sDataPath, int value, InspcAccessExecRxOrder_ifc actionOnRx)
InspcAccess_ifc
cmdSetInt32ByPath
in interface InspcAccess_ifc
value
- The value as long-image, it may be a double, float, int etc.public void cmdSetStringByPath(VariableAccessArray_ifc var, java.lang.String value)
InspcAccess_ifc
cmdSetStringByPath
in interface InspcAccess_ifc
value
- The value as long-image, it may be a double, float, int etc.public void cmdSetFloatByPath(java.lang.String sDataPath, float value, InspcAccessExecRxOrder_ifc actionOnRx)
InspcAccess_ifc
cmdSetFloatByPath
in interface InspcAccess_ifc
value
- The value as long-image, it may be a double, float, int etc.public void cmdSetDoubleByPath(java.lang.String sDataPath, double value, InspcAccessExecRxOrder_ifc actionOnRx)
InspcAccess_ifc
cmdSetDoubleByPath
in interface InspcAccess_ifc
value
- The value as long-image, it may be a double, float, int etc.public boolean cmdGetAddressByPath(java.lang.String sDataPath, InspcAccessExecRxOrder_ifc actionOnRx)
InspcAccess_ifc
cmdGetAddressByPath
in interface InspcAccess_ifc
sDataPath
- Either the path inside the target or the path with target identification,
depends on implementation. Maybe possible with alias.actionOnRx
- it will be added to a list with its order. Executed in the receive thread.public boolean isOrSetReady(long timeCurrent)
InspcAccess_ifc
States.StateIdle
or States.StateFilling
Returns false if not all answer telegrams were received from the last request.
It is in all other states of States
.
If the time of the last send request was before timeLastTxWaitFor
then it is assumed that the communication was faulty. Therefore all older pending requests are removed.
Note: On InspcMng it return false;isOrSetReady
in interface InspcAccess_ifc
timeCurrent
- The current time. It is compared with the time of the last transmit telegram which's answer is expected,
and the timeout. If the timeout is expired, older requests are removed and this routine returns true.public void addUserTxOrder(java.lang.Runnable order)
InspcAccess_ifc
addUserTxOrder
in interface InspcAccess_ifc
order
- the program snippet.public void requestFields(InspcTargetAccessData data, InspcAccessExecRxOrder_ifc rxActionGetFields, java.lang.Runnable runOnReceive)
InspcAccess_ifc
InspcAccess_ifc.cmdGetFields(String, InspcAccessExecRxOrder_ifc)
in the inspector thread.requestFields
in interface InspcAccess_ifc
data
- The variablerxActionGetFields
- Action on gotten fieldsrunOnReceive
- Action should be run if all fields are received, if all datagrams are received for that communication cycle.public InspcTargetAccessData getTargetAccessFromPath(java.lang.String sDataPath, boolean strict)
InspcAccess_ifc
#indexTargetAccessor
to get the target accessor instance.
It uses #idxAllStruct
to get the existing InspcStruct
for the variablegetTargetAccessFromPath
in interface InspcAccess_ifc
sDataPath
- The user given data path maybe with alias, necessary with target.
An alias is written in form "alias:rest.of.path". A device is written "device:rest.of.path".
The distinction between alias and device is done with checking whether the charsequence before :
is detected as alias.strict
- true then throws an error on faulty device, if false then returns null if faulty.void exec()