public class DataFlow2EvChainBackward_FBrd
extends java.lang.Object
prc()
. this does the following:
connectConst(Write_FBlock_FBwr)
, createConnectCtorEvents()
, createConnectInitEvents()
:
These three operations connects const, ctor and init with a forward algorithm.
prcbackEventChainFromEvoutMdl()
: This starts on the evoutMdl and also evUpdoutMdl
and tracks back the graphical connected event flow and data flow to create information about the necessary event flow.
For data flow the Din_FBcl.bBreakChain
is considered, it is set on a 'ofcDataGet' connection,
access data from another event chain. Second, connections to VorZ_OFB are not considered.
This operation writes connection information to idxEvoutConn
sorted by the prepDst Pin_FBcl.nameFBpin()
and also the listEvConn
which contains each connection as DataFlow2EvChainBackward_FBrd.Evout4Evin
unsorted.
-----------+ FB12 prepO <-----+ Evout4Evin <---------+ idxEvoutCon +----->prepDst -----------+ | | prepDst------.|.-------.|.-------------+ | +---}list2EvoutSrc | prepDst.nameFBpin() as Key <--+ -----------+ +<---ListThe event connection is stored backward from the evin'prepDst' because this element is found as key, then more as one possible Join-OR event inputs can be given, often only one, as Element in the ListFBx prepO <-----+ | -----------+ | Evout4Evin <--------+ | | prepDst -----------+ +----}list2EvoutSrc FBy prepO <----------} -----------+
idxEvoutConn
and also each element of the DataFlow2EvChainBackward_FBrd.Evout4Evin.list2EvoutSrc
contains the Join-AND event outputs.
all in backward direction. Join-OR means, more as one event triggers the prepDst event.
Join-AND means really a Join_OFB FBlock to Join events, all have to be coming. Respectively all evout 'prepO'
should be considered in code order for line-code generation.
prcbackFreeEvin()
does adequate for all evin of FBlocks which are not reached
from the backward event/data tracking from the module's evoutMdl done in prcbackEventChainFromEvoutMdl()
.
With this second operation all Evin_FBcl
of the module and all FBlocks should found for connection.
prcfwdRepresentingEvents()
now all evout of all FBlocks are marked
via Evout_FBcl.setRepresentingEvent(Evout_FBcl)
with the corresponding driven events.
This is the first action outside only storing event connection data in idxEvoutConn
( DataFlow2EvChainBackward_FBrd.Evout4Evin
),
it is necessary for the next both steps.
searchUnboundEvoutSrc()
is called for such evout which are not driven by an evin
because they have only data inputs from other event chains, but not only const.
(const are considered by createConnectConstEvents()
already).
These events are not gathered till now because no evin resp. evoutMdl is existing which is tracked back these evout.
As solution: The correspond evin is connected to that evout, which's other evin needs the data.
See docu on this operation searchUnboundEvoutSrc()
for details.
cleanupDependingEvents()
: This is the essential operation to remove unnecessary event connections.
Such event connections are detected till now if an FBlock needs data from an FBlock earlier before,
but also from an FBlock near before, which is driven from the evout of the earlier FBlock already.
Not removing this unnecessary evout would require some Join-AND FBlocks which are have all events if the last occurs anyway,
means they are unnecessary. This operation uses the information about Evout_FBcl.idxRepresentingEvents
which are written in prcfwdRepresentingEvents()
.
connectEvents()
can now really connect the necessary events using the listEvConn
and the information about event connection in DataFlow2EvChainBackward_FBrd.Evout4Evin
.
DataFlow2EvChainBackward_FBrd.Evout4Evin.evUpdinMdl
.
For each FBlock which has a correspond evUpdin to the processed evin, and has no data to the evUpdin (presumed),
the connection from the evUpdinMdl to the evUpdin of the FBlock can be done.
propgfwdConditions()
is the last action based on all existing event connections.
The conditions to events are given in specific evout, then stored in the following evout in the chain
stored in Evinout_FBcl.condBits
.
Modifier and Type | Class and Description |
---|---|
private static class |
DataFlow2EvChainBackward_FBrd.Evout4Evin
Instances of this class are a proxy for the yet not done event connection
build during back data tracking for event queue.
|
protected static class |
DataFlow2EvChainBackward_FBrd.EvPrepUpdInQueue
Internal structure to store the prepare and update event together in a queue
also with the start events of the chain.
|
Modifier and Type | Field and Description |
---|---|
private int |
ctConnectedEvents
Counter of connected events.
|
protected Evout_FBcl |
evinMdl_ctor |
protected Evout_FBcl |
evinMdl_init |
protected int |
idEventParallel |
private java.util.Map<java.lang.String,java.util.List<DataFlow2EvChainBackward_FBrd.Evout4Evin>> |
idxEvinConn |
private java.util.Map<java.lang.String,java.util.List<DataFlow2EvChainBackward_FBrd.Evout4Evin>> |
idxEvoutConn
Contains all raw event connections before it is established in the really connection of the event pins.
|
(package private) short |
ixEvCluster
This index marks events which builds a cluster (events of one chain).
|
(package private) static short |
ixEvClusterConst |
(package private) static short |
ixEvClusterCtor |
(package private) static short |
ixEvClusterInit |
private java.util.List<DataFlow2EvChainBackward_FBrd.Evout4Evin> |
listEvConn
List of all instances of
DataFlow2EvChainBackward_FBrd.Evout4Evin , used for execution of connection. |
private java.util.List<FBexpr_FBcl> |
listExprEv
The order in this list is the bit position in
Evinout_FBcl.condBits . |
private java.util.List<DataFlow2EvChainBackward_FBrd.Evout4Evin> |
listUnboundEvin |
protected org.vishia.msgDispatch.LogMessage |
log |
private java.util.TreeMap<java.lang.Long,DataFlow2EvChainBackward_FBrd.EvPrepUpdInQueue> |
mapEvPrepUpdInQueue
Map to regain the existing instances of the events as bundle of
DataFlow2EvChainBackward_FBrd.EvPrepUpdInQueue
The key to find is the Evinout_FBcl#idEvent for all for events used with 16 bits (max. 65536 event instances possible)
which is assembled to a long value. |
protected long |
mBitEvinMdlCtor
Bits corresponding to
Evinout_FBcl#mEvoutClusterStart for the init and the ctor Evout_FBcl of the module's inner interface
in Write_Module_FBwr.fbtwMdl in Write_FBtype_FBwr.listEvout
That masks are used to detect whether a chain is driven by "init" or "ctor..." event. |
protected long |
mBitEvinMdlInit
Bits corresponding to
Evinout_FBcl#mEvoutClusterStart for the init and the ctor Evout_FBcl of the module's inner interface
in Write_Module_FBwr.fbtwMdl in Write_FBtype_FBwr.listEvout
That masks are used to detect whether a chain is driven by "init" or "ctor..." event. |
protected Write_Module_FBwr |
mdlWr
Set in
#prc(Module_FBcl) , the only one public routine of this class. |
protected Prj_FBCLrd |
prj |
(package private) static java.lang.String |
sNlIndent |
static java.lang.String |
version
Version, history and license.
|
private java.util.List<Evin_FBcl> |
XXXlistEvUpdin |
Constructor and Description |
---|
DataFlow2EvChainBackward_FBrd(Prj_FBCLrd prj,
Write_Module_FBwr mdlwr,
org.vishia.msgDispatch.LogMessage log) |
Modifier and Type | Method and Description |
---|---|
private void |
addNewBackEvin2Queue(Evout_FBcl evoutSrc,
Write_FBlock_FBwr fbwSrc,
short ixEvCluster,
java.util.List<Evin_FBcl> queueEvin)
Adds the next entry for further back tracking of evinDst in the queue for back tracking.
|
private void |
addNewEvoutSrc2Evout4Evin(Evin_FBcl XXXevinDst,
Evin_FBcl XXXevoutMdl,
java.util.Map<java.lang.String,java.util.List<Evout_FBcl>> idxVariantListEvoutSrc,
java.util.Map<java.lang.String,DataFlow2EvChainBackward_FBrd.Evout4Evin> idxVariantEvout4EvinDin)
Adds new evout to
DataFlow2EvChainBackward_FBrd.Evout4Evin.list2EvoutSrc . |
private void |
cleanupDependingEvents()
This operation tracks the event chain with connection stored in
idxEvoutConn and DataFlow2EvChainBackward_FBrd.Evout4Evin forward,
uses the Evout_FBcl.isDrivenInChainBy(Evout_FBcl)
respectively Evout_FBcl.idxRepresentingEvents and removes evout from DataFlow2EvChainBackward_FBrd.Evout4Evin.list2EvoutSrc
which are contained in another event in the same list already, means drives this event
and is anyway present. |
private void |
connectConst(Write_FBlock_FBwr fbw)
|
private void |
connectEvents()
Connect the events only due to the
listEvConn of the internal event connection instances
of type DataFlow2EvChainBackward_FBrd.Evout4Evin . |
private void |
createConnectConstEvents()
Should be a first const event exist?
|
private void |
createConnectCtorEvents()
Checks whether all FBlocks have their ctor evin.
|
private void |
createConnectInitEvents()
Connect the a con graphic connected init event of each FBlock with the module's evinMdl 'init'.
|
private void |
createExprEvCondBits(Write_FBlock_FBwr fbw,
Evout_FBcl evinMdl,
long[][] condBefore,
java.util.List<Evout_FBcl> evqu)
Creates condition bits for a given ExprEv on evoutSrc.
|
private void |
createJoinCondBits(Write_FBlock_FBwr fbw,
Evout_FBcl evinMdl,
java.util.List<Evout_FBcl> evqu) |
java.util.List<FBexpr_FBcl> |
listExprEv() |
void |
prc() |
private boolean |
prcbackDin4EvinConnectEvoutSrc(Evin_FBcl evinDst,
short ixEvCluster,
java.util.List<Evin_FBcl> queueEvin,
Evin_FBcl evoutMdl)
Process all DinDst to a given EvinDst
------+
evout-----+ +--------------
------+ +---->>evin
+--->din
------+ | din
dout-------+ +---------------
|
private void |
prcbackEventChainFromEvoutMdl()
Operation for back tracking event chain starting from the module's evoutMdl.
|
private boolean |
prcbackEvoutSrcFromDin(Din_FBcl dinDst,
Evin_FBcl evinDst,
java.util.Map<java.lang.String,DataFlow2EvChainBackward_FBrd.Evout4Evin> idxVariantEvout4EvinDin,
short ixEvCluster,
java.util.List<Evin_FBcl> queueEvin,
Evin_FBcl evoutMdl)
Checks all dout for given dinDst and fills listEvoutSrc with the necessary source events,
and adds following evin to the queue to process evin backward.
|
private boolean |
prcbackEvoutSrcFromEvin(Evin_FBcl evinDst,
java.util.Map<java.lang.String,DataFlow2EvChainBackward_FBrd.Evout4Evin> idxVariantEvout4EvinDin,
short ixEvCluster,
java.util.List<Evin_FBcl> queueEvin,
Evin_FBcl evoutMdl)
Track the event connection backward for given graphic connection.
|
private void |
prcbackFreeEvin()
Iterates over all existing FBlocks and looks for not used evin.
|
private void |
prcfwdRepresentingEvents()
This is also the first time where the found event connection by back propagation are used.
|
private void |
prcfwdRepresentingEvents(Evout_FBcl evinMdl,
Evout_FBcl evUpdinMdl,
Evout_FBcl evoutSrc,
java.util.List<Evout_FBcl> evqu) |
private void |
propgfwdConditions() |
private void |
searchUnboundEvoutSrc()
This is a specific operation to detect evin of FBlocks without event driven connection.
|
private void |
XXXconnectUpdateEvents() |
public static final java.lang.String version
static java.lang.String sNlIndent
protected final org.vishia.msgDispatch.LogMessage log
protected final Prj_FBCLrd prj
protected final Write_Module_FBwr mdlWr
#prc(Module_FBcl)
, the only one public routine of this class.protected final Evout_FBcl evinMdl_init
protected final Evout_FBcl evinMdl_ctor
protected final long mBitEvinMdlInit
Evinout_FBcl#mEvoutClusterStart
for the init and the ctor Evout_FBcl
of the module's inner interface
in Write_Module_FBwr.fbtwMdl
in Write_FBtype_FBwr.listEvout
That masks are used to detect whether a chain is driven by "init" or "ctor..." event.protected final long mBitEvinMdlCtor
Evinout_FBcl#mEvoutClusterStart
for the init and the ctor Evout_FBcl
of the module's inner interface
in Write_Module_FBwr.fbtwMdl
in Write_FBtype_FBwr.listEvout
That masks are used to detect whether a chain is driven by "init" or "ctor..." event.protected int idEventParallel
short ixEvCluster
static final short ixEvClusterConst
static final short ixEvClusterCtor
static final short ixEvClusterInit
private final java.util.List<FBexpr_FBcl> listExprEv
Evinout_FBcl.condBits
.
The list is transferred to the Module_FBcl#exprEv
,
it can be used in code generation to select the name of the FBexpr by given bits.private final java.util.List<DataFlow2EvChainBackward_FBrd.Evout4Evin> listUnboundEvin
private final java.util.List<Evin_FBcl> XXXlistEvUpdin
private java.util.TreeMap<java.lang.Long,DataFlow2EvChainBackward_FBrd.EvPrepUpdInQueue> mapEvPrepUpdInQueue
DataFlow2EvChainBackward_FBrd.EvPrepUpdInQueue
The key to find is the Evinout_FBcl#idEvent
for all for events used with 16 bits (max. 65536 event instances possible)
which is assembled to a long value.private java.util.Map<java.lang.String,java.util.List<DataFlow2EvChainBackward_FBrd.Evout4Evin>> idxEvoutConn
---------+ fb.evout--->>Evout4Evin +----------- | evin----->>evin:fb2 | +---------- | Evout4Evin +----------- evin----->>evin:fb3 +----------The value of this index is a List of
DataFlow2EvChainBackward_FBrd.Evout4Evin
for more as one destination for the evout.
Intrinsically only the DataFlow2EvChainBackward_FBrd.Evout4Evin.evin
is necessary for the connection aspect.
The DataFlow2EvChainBackward_FBrd.Evout4Evin.list2EvoutSrc
contains also the fb.evout which is used as key,
but also maybe other event sources for the evin.private java.util.Map<java.lang.String,java.util.List<DataFlow2EvChainBackward_FBrd.Evout4Evin>> idxEvinConn
private java.util.List<DataFlow2EvChainBackward_FBrd.Evout4Evin> listEvConn
DataFlow2EvChainBackward_FBrd.Evout4Evin
, used for execution of connection.private int ctConnectedEvents
#propgEvent(EvPrepUpdInQueue, List, List)
or #prcEventUpd(Evout_FBcl, List)
.
If a progress is not given more as times of nr of evoutSrc in the queues, then the algorithm should be aborted,
because there is not progress to expect.
Elsewhere the algorithm hangs.
This occurs if event inputs are missing, and they are not fulfilled with the other event propagations.
Then the module is not proper, but the generation of files should be finished,
Which is not proper, this should be seen in evaluation of the result files.public DataFlow2EvChainBackward_FBrd(Prj_FBCLrd prj, Write_Module_FBwr mdlwr, org.vishia.msgDispatch.LogMessage log)
public void prc()
public java.util.List<FBexpr_FBcl> listExprEv()
private void createConnectConstEvents()
Dout_FBcl.setToConstant()
.
So it needs no event connection.private void connectConst(Write_FBlock_FBwr fbw)
fbw
- private void createConnectCtorEvents()
PinType_FBcl.addAssociatedInOut(PinType_FBcl)
with the ctor.private void createConnectInitEvents()
private void prcbackEventChainFromEvoutMdl()
private void prcbackFreeEvin()
Evin_FBcl.ixEvCluster
,
the default value for 'non used' is -1.
prcbackDin4EvinConnectEvoutSrc(Evin_FBcl, short, List, Evin_FBcl)
is started in a queue with all associated Din pins in the same kind as for all evoutMdl pins.
private boolean prcbackDin4EvinConnectEvoutSrc(Evin_FBcl evinDst, short ixEvCluster, java.util.List<Evin_FBcl> queueEvin, Evin_FBcl evoutMdl)
------+ evout-----+ +-------------- ------+ +---->>evin +--->din ------+ | din dout-------+ +---------------
evinDst
- can be also the evoutMdlfbwDst
- associated fb, given extra because it can be the moduleprivate boolean prcbackEvoutSrcFromEvin(Evin_FBcl evinDst, java.util.Map<java.lang.String,DataFlow2EvChainBackward_FBrd.Evout4Evin> idxVariantEvout4EvinDin, short ixEvCluster, java.util.List<Evin_FBcl> queueEvin, Evin_FBcl evoutMdl)
DataFlow2EvChainBackward_FBrd.Evout4Evin
for the maybe given variant is searched,
and created if not found. Usual first time it is not found, hence always first created.
DataFlow2EvChainBackward_FBrd.Evout4Evin.list2EvoutSrc
,
and the given graphic connection is removed. This is necessary because the event connections
may be necessary to sort newly.
Given connections in graphic are handled in the same manner as automatic found ones.
For adding the evoutSrc the operation addNewEvoutSrc2Evout4Evin(Evin_FBcl, Evin_FBcl, Map, Map)
is called with all found connections.
addNewBackEvin2Queue(Evout_FBcl, Write_FBlock_FBwr, short, List)
enters the evin of the source for further back tracking.
evinDst
- for this evinDstidxVariantEvout4EvinDin
- Container with all possible DataFlow2EvChainBackward_FBrd.Evout4Evin
with the proper variant.
It may be first empty, (it is empty in calling environment).ixEvCluster
- queueEvin
- queue for further back tracking.evoutMdl
- Necessary for Evout4Evin#Evout4Evin(Evin_FBcl, Evin_FBcl, PinConnect_FBcl)
for its creation.private boolean prcbackEvoutSrcFromDin(Din_FBcl dinDst, Evin_FBcl evinDst, java.util.Map<java.lang.String,DataFlow2EvChainBackward_FBrd.Evout4Evin> idxVariantEvout4EvinDin, short ixEvCluster, java.util.List<Evin_FBcl> queueEvin, Evin_FBcl evoutMdl)
Pin_FBcl.connectSrc
to get all doutSrc,
maybe more as one on conditional inputs (join-OR).
PinKind_FBcl.zout
and evoutMdl is not an evUpdoutMdl,
then this evout is not considered.
Dout_FBcl.isConstant()
.
The property Dout_FBcl#setConstant()
is called during connection of const events, see connectConst(Write_FBlock_FBwr)
.
DataFlow2EvChainBackward_FBrd.Evout4Evin
for the maybe given variant is searched inside 'idxVariantEvout4EvinDin',
and created if not found. On first time it is not found, hence hence here created
with the necessary variant from the data PinConnect_FBcl.sVariant
.
addNewBackEvin2Queue(Evout_FBcl, Write_FBlock_FBwr, short, List)
.
dinDst
- The din which in face.evinDst
- the associated evinDst from where dinDst is associated.
It is also the argument to create Evout4Evin#Evout4Evin(Evin_FBcl, Evin_FBcl, PinConnect_FBcl)
if not found.idxVariantEvout4EvinDin
- Container with all possible DataFlow2EvChainBackward_FBrd.Evout4Evin
with the proper variant.
It may be first empty, not empty if other connections are found before.ixEvCluster
- The number or index of the event chain clusterqueueEvin
- the queue for processing all back events and data. New found evin are added to.evoutMdl
- Information of the evoutMdl, especially whether it is an evUpdoutMdl or evoutMdl.
It is also the argument to create Evout4Evin#Evout4Evin(Evin_FBcl, Evin_FBcl, PinConnect_FBcl)
private void addNewEvoutSrc2Evout4Evin(Evin_FBcl XXXevinDst, Evin_FBcl XXXevoutMdl, java.util.Map<java.lang.String,java.util.List<Evout_FBcl>> idxVariantListEvoutSrc, java.util.Map<java.lang.String,DataFlow2EvChainBackward_FBrd.Evout4Evin> idxVariantEvout4EvinDin)
DataFlow2EvChainBackward_FBrd.Evout4Evin.list2EvoutSrc
.
This operation is called only inside prcbackEvoutSrcFromDin(Din_FBcl, Evin_FBcl, Map, short, List, Evin_FBcl)
and prcbackDin4EvinConnectEvoutSrc(Evin_FBcl, short, List, Evin_FBcl)
to store found evout.
XXXevinDst
- XXXevoutMdl
- idxVariantListEvoutSrc
- found evoutSrc for given variants.idxVariantEvout4EvinDin
- index of DataFlow2EvChainBackward_FBrd.Evout4Evin
to add the evout.private void addNewBackEvin2Queue(Evout_FBcl evoutSrc, Write_FBlock_FBwr fbwSrc, short ixEvCluster, java.util.List<Evin_FBcl> queueEvin)
evoutSrc
- from this evoutSrc the correspond evinSrc (may be more as one) will be detected.fbwSrc
- ixEvCluster
- queueEvin
- Queue for back tracking.private void prcfwdRepresentingEvents()
idxEvoutConn
to search the connection for the evout
and continues on the evin. Note that the key of idxEvoutConn
is the fb.name of the evout.
a log is written which can be studied afterwards whether all connections are met.
private void prcfwdRepresentingEvents(Evout_FBcl evinMdl, Evout_FBcl evUpdinMdl, Evout_FBcl evoutSrc, java.util.List<Evout_FBcl> evqu)
private void searchUnboundEvoutSrc()
private void cleanupDependingEvents()
idxEvoutConn
and DataFlow2EvChainBackward_FBrd.Evout4Evin
forward,
uses the Evout_FBcl.isDrivenInChainBy(Evout_FBcl)
respectively Evout_FBcl.idxRepresentingEvents
and removes evout from DataFlow2EvChainBackward_FBrd.Evout4Evin.list2EvoutSrc
which are contained in another event in the same list already, means drives this event
and is anyway present.
evout1---+------------------------->>this event is unnecessary | +-->>evoutX contains evout1 +->>evinX=>>FB=evoutX--+
private void connectEvents()
listEvConn
of the internal event connection instances
of type DataFlow2EvChainBackward_FBrd.Evout4Evin
.
This operation does not track through the events, only connect it from list.private void propgfwdConditions()
private void createExprEvCondBits(Write_FBlock_FBwr fbw, Evout_FBcl evinMdl, long[][] condBefore, java.util.List<Evout_FBcl> evqu)
evinMdl
- Necessary to register the condition bits calling evinMdl:Evout_FBcl.addConditionBit(int)
evoutSrc
- refers in Pin_FBcl.fb
the EvExpr FBlock.
can have a 'true' and 'false' output, whereby one of this is this conditional output.
only this given evoutSrc is marked with the condition bit,
the other (may existing) is marked it is used.
Note: The FBlock_FBcl
is not completed in this phase of execution,
the pins are only referenced in the associated Write_FBlock_FBwr
.private void createJoinCondBits(Write_FBlock_FBwr fbw, Evout_FBcl evinMdl, java.util.List<Evout_FBcl> evqu)
private void XXXconnectUpdateEvents()