This class presents a window with one table and some buttons to view and edit all fields in one instance
in a target system.
The InspcFieldTable shows one struct from target data or one instance, all fields of a class of Java reflection view.
The fields are stored in instances of
InspcFieldOfStruct
which are referenced as data in the
GralTable
of the private composite reference
widgTable
.
Filling the table with the fields of a reflection target:
guiInspc_getFieldsTableOmd
One of the methods
fillTableFromFocusedVariable()
,
actionBack()
,
getSubStruct(GralTableLine_ifc)
are invoked from operator GUI actions. They call
#fillTableStruct()
This method checks the
InspcStruct
of the variable respectively the shown struct in table whether it is known already,
using
InspcStruct.isUpdated()
. It it is not updated, on selection a new variable, the
InspcTargetAccessor.requestFields(org.vishia.inspcPC.InspcTargetAccessData, InspcAccessExecRxOrder_ifc, Runnable)
is called. This routine sets only the reference to the
InspcTargetAccessData
and the 2 callbacks.
This action is done especially in the graphical thread.
If
InspcStruct.isUpdated()
returns true, then the struct was updated already. Then it can be shown in the
GralTable
with the names of its elements and the last gotten values.
The organization thread of
InspcMng
invokes
InspcMng.procComm()
cyclically to show and request values.
In this thread via calling
InspcTargetAccessor#requestStart(long)
the request for getFields is recognized.
For that the
InspcTargetAccessor.cmdGetFields(String, org.vishia.inspcPC.InspcAccessExecRxOrder_ifc)
is invoked for the path of the struct. That is sent to the target.
The target answers with some items for all fields in one or more datagram but for that request with the same sequence number.
For any item respectively element of the struct the given instance to
InspcStruct.rxActionGetFields
is invoked which fills the struct.
After the last datagram of this answer the stored reference to the
Runnable
:
actionUpdated
of this class
is invoked. This action calls
#fillTableStruct()
now with received and stored fields.
guiInspc_getFieldsTableSeq
Show and request values for the fields
This is simple done by getting maybe with creation of the variable for the requested field:
InspcFieldOfStruct.variable(InspcVariable, org.vishia.byteData.VariableContainer_ifc)
and request a new value with
InspcVariable.requestValue(long, Runnable)
. The callback invoked on end of the last datagram
is a temporary instance
RunOnReceive#RunOnReceive(GralTableLine_ifc)
with the given line of the table which invokes
showValue(GralTableLine_ifc, boolean)
.
guiInspc_getValueTableOmd