public interface InspcAccess_ifc
org.vishia.inspcPc.mng.InspcMng
to access all known targets
and for the org.vishia.inspcPc.accTarget.InspcTargetAccessor
to access a specific target.Modifier and Type | Field and Description |
---|---|
static int |
idLogFailedSeq
Some adding values for the message number for the log system.
|
static int |
idLogGetAddress
Some adding values for the message number for the log system.
|
static int |
idLogGetFields
Some adding values for the message number for the log system.
|
static int |
idLogGetOther
Some adding values for the message number for the log system.
|
static int |
idLogGetValueByIdent
Some adding values for the message number for the log system.
|
static int |
idLogGetValueByPath
Some adding values for the message number for the log system.
|
static int |
idLogRcvGetAddress
Some adding values for the message number for the log system.
|
static int |
idLogRcvGetFields
Some adding values for the message number for the log system.
|
static int |
idLogRcvGetOther
Some adding values for the message number for the log system.
|
static int |
idLogRcvGetValueByIdent
Some adding values for the message number for the log system.
|
static int |
idLogRcvGetValueByPath
Some adding values for the message number for the log system.
|
static int |
idLogRcvRegisterByPath
Some adding values for the message number for the log system.
|
static int |
idLogRcvSetValueByPath
Some adding values for the message number for the log system.
|
static int |
idLogRegisterByPath
Some adding values for the message number for the log system.
|
static int |
idLogRx
Some adding values for the message number for the log system.
|
static int |
idLogRxError
Some adding values for the message number for the log system.
|
static int |
idLogRxItem
Some adding values for the message number for the log system.
|
static int |
idLogRxLast
Some adding values for the message number for the log system.
|
static int |
idLogRxNotlast
Some adding values for the message number for the log system.
|
static int |
idLogRxRepeat
Some adding values for the message number for the log system.
|
static int |
idLogSetValueByPath
Some adding values for the message number for the log system.
|
static int |
idLogTx
Some adding values for the message number for the log system.
|
static java.lang.String |
sVersion
Version, history and license.
|
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 sPath,
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'
|
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.
|
static final java.lang.String sVersion
cmdGetAddressByPath(String, InspcAccessExecRxOrder_ifc)
yet.
InspcTargetAccessor
static final int idLogGetValueByPath
static final int idLogGetValueByIdent
static final int idLogGetAddress
static final int idLogGetFields
static final int idLogRegisterByPath
static final int idLogSetValueByPath
static final int idLogGetOther
static final int idLogTx
static final int idLogRx
static final int idLogRxLast
static final int idLogRxNotlast
static final int idLogRxItem
static final int idLogFailedSeq
static final int idLogRxRepeat
static final int idLogRxError
static final int idLogRcvGetValueByPath
static final int idLogRcvGetValueByIdent
static final int idLogRcvGetAddress
static final int idLogRcvGetFields
static final int idLogRcvRegisterByPath
static final int idLogRcvSetValueByPath
static final int idLogRcvGetOther
int cmdGetFields(java.lang.String sDataPath, InspcAccessExecRxOrder_ifc actionOnRx)
int cmdGetValueByPath(java.lang.String sDataPath, InspcAccessExecRxOrder_ifc actionOnRx)
sDataPath
- int cmdRegisterHandle(java.lang.String sDataPath, InspcAccessExecRxOrder_ifc actionOnRx)
sDataPath
- boolean cmdGetValueByHandle(int ident, InspcAccessExecRxOrder_ifc actionOnRx)
sDataPath
- void cmdSetValueByPath(java.lang.String sDataPath, long value, int typeofValue, InspcAccessExecRxOrder_ifc actionOnRx)
sDataPath
- 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.void cmdSetStringByPath(VariableAccessArray_ifc var, java.lang.String value)
sDataPath
- 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.void cmdSetInt32ByPath(java.lang.String sDataPath, int value, InspcAccessExecRxOrder_ifc actionOnRx)
sDataPath
- 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.void cmdSetFloatByPath(java.lang.String sDataPath, float value, InspcAccessExecRxOrder_ifc actionOnRx)
sDataPath
- 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.void cmdSetDoubleByPath(java.lang.String sDataPath, double value, InspcAccessExecRxOrder_ifc actionOnRx)
sDataPath
- 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.boolean cmdGetAddressByPath(java.lang.String sPath, InspcAccessExecRxOrder_ifc actionOnRx)
sPath
- 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.java.lang.IllegalArgumentException
- if too many requests are done without answer.
Hint: Write all activities in try-catch with a common error log.boolean isOrSetReady(long timeCurrent)
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;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.void addUserTxOrder(java.lang.Runnable order)
order
- the program snippet.void requestFields(InspcTargetAccessData data, InspcAccessExecRxOrder_ifc rxActionGetFields, java.lang.Runnable runOnReceive)
cmdGetFields(String, InspcAccessExecRxOrder_ifc)
in the inspector thread.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.InspcTargetAccessData getTargetAccessFromPath(java.lang.String sDataPath, boolean strict)
#indexTargetAccessor
to get the target accessor instance.
It uses #idxAllStruct
to get the existing InspcStruct
for the variablesDataPath
- 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.