public class OdgModule
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String[] |
cmp2Operators |
private static java.lang.String |
dbgFbNamePin_prcConnection
Set it for debugging to force a
Debugutil.stop() |
(package private) java.util.Map<java.lang.String,OdgReader.Alias> |
idxAlias
Alias between type names and the real existing types and the files where the definition is done (import, includes,
after evaluation of the ofbImport shape.
|
java.util.Map<java.lang.String,java.util.List<Write_FBlock_FBwr>> |
idxFBlockArray
Index of all graphic FBlocks which are defined as array.
|
java.util.TreeMap<java.lang.String,OdgGBlock> |
idxGAccessByName
Index of all expression graphic blocks sorted by name do get reproducible output
|
java.util.Map<java.lang.Integer,OdgGBlock> |
idxGBlock
Index of all graphic FBlocks sorted by graphic position or posNr do get reproducible output
|
java.util.Map<java.lang.String,OdgGBlock> |
idxGBlockById
Instance index sorted by Id to find connections.
|
java.util.TreeMap<java.lang.String,OdgGBlock> |
idxGExprByName
Index of all expression graphic blocks sorted by name + graphic position.
|
java.util.TreeMap<java.lang.String,OdgGBlock> |
idxGExprVarByName
Index of all expressions with variable after, sorted by the variable name,
to find the proper expression if only the variable is shown and accessed in the graphic.
|
java.util.Map<java.lang.String,OdgGPin> |
idxGPinById
All pins of this module sorted by the graphic id to find them for connection.
|
java.util.Map<java.lang.Integer,OdgGBlock> |
idxModuleIfc
Index of Graphic FBlocks which are marked with kind "ofbMdlPins" containing the module pins.
|
java.util.Map<java.lang.String,OdgXrefGraphic> |
idxXrefGraphicByName
Index of all Xref GBlock to create only one OdgXref per name and for post processing.
|
java.util.List<OdgGBlock> |
listDemux
List of all connection GBlocks, it is ofbDemux, ofbConnPoint but not Xref.
|
java.util.List<OdgNameTypeArray> |
listFreeVar
Found free expression output variables, later merged with the real used expression variable.
|
(package private) java.util.List<OdgPage> |
listPage
List of all pages, also refers the xml-page info
XmlForOdg.Draw_page
used for more evaluation module wise, especially the connections. |
Write_Module_FBwr |
mdlw
The real module.
|
protected int |
nAutoVariable |
protected int |
nAutoVariableAccess
Counter for the name for FBaccess, start with 1 in this module.
|
(package private) Prj_FBCLrd |
prj
The project used for the translation session.
|
private static java.lang.String[] |
shiftOperators |
(package private) java.lang.String |
sNameMdl |
(package private) long |
timeCmpFBcl |
(package private) long |
timeCompleteModule |
(package private) long |
timeDataPropg |
(package private) long |
timeEndModule |
(package private) long |
timeEventPropg |
(package private) long |
timePrep |
(package private) long |
timeStartModule |
(package private) long |
timeWrCmpCode |
(package private) long |
timeWrFBcl |
Constructor and Description |
---|
OdgModule(java.lang.String mdlName,
Prj_FBCLrd prj)
Constructor of the module with the odg data.
|
Modifier and Type | Method and Description |
---|---|
private void |
addPinConnected(Pin_FBcl pinSrc,
java.lang.String connText,
OdgConnection.ECkind connKind,
Pin_FBcl pinDst,
java.lang.String sElemSrc,
java.lang.String sElemDst,
java.lang.String sVariant)
Qualifies or checks admissibility of the pin with the connection kind
and adds the pin to the correct idx... in the FBlock of the source pin.
|
private void |
buildAssociatedEventDataPins(OdgGBlock fbg,
Write_Module_FBwr mdlwr,
boolean bFirstCall)
Associates events and data from graphic for one graphic fblock.
|
private void |
buildAssociatedFBtypeEventDataPins(Write_Module_FBwr mdlwr) |
private void |
buildAssociatedMdlEventDataPins(Write_Module_FBwr mdlwr)
Evaluates all graphic blocks of the module interface of kind "ofbMdlPins" given in
OdgReader#idxFBlockGraphicModuleIfc . |
void |
buildFbgData()
This operation sorts the graphic raw data to build a FBcl-kind mapping of data.
|
private java.lang.String[] |
checkPrepareExprOperator(java.lang.String sDescr,
boolean bCast,
FBexpr_FBcl fbx)
Checks the input text of the expression input pin due to:
first ".[" is searched, 'posAccDst' set internally.
|
private void |
connectPinSrcDstObj(OdgGPin gpinStart,
OdgGPin gpinSrc,
java.lang.String deMuxSelSrc,
java.lang.String deMuxSelDst,
int ixPinMux,
OdgConnection conn,
OdgGPin gpinDst)
Connect immediately the gpinStart
OdgGPin.pinObj to the gpinDst OdgGPin.pinObj
with given selection of deMuxSelSrc and deMuxSelDst. |
private void |
connectViaDemux(OdgGPin gpinStart,
OdgGPin gpinSrc,
java.lang.String deMuxSelSrc,
java.lang.String deMuxSelDst,
OdgGPin gpinDst,
OdgGBlock gfbDst,
int ixPinMux,
int recursion) |
private void |
connectViaDemuxXref(OdgGPin gpinStart,
OdgGPin gpinSrc,
java.lang.String deMuxSelSrc,
java.lang.String deMuxSelDst,
int ixPinMux,
int recursion)
This is the commonly used connection function from given graphic connections to the FBcl connections.
|
private void |
createAccessPins(OdgGBlock fbg)
|
private DinExpr_FBcl |
createDinExpr(java.lang.String nameSpec,
int[] nrDinout,
EvinType_FBcl evint,
java.lang.String sOper,
OdgGBlock fbg,
OdgGPin gpin)
Creates a
DinExpr_FBcl with the given infos. |
private Dout_FBcl |
createDoutExpr(OdgGPin gpin,
java.lang.String sAccess,
int[] ixArray,
OdgGBlock fbg,
FBexpr_FBcl fbx,
EvoutType_FBcl evoutt,
java.lang.String sOper,
DType_FBcl dtype,
OdgGPin gExprOut,
int[] nrDinout) |
private Dout_FBcl |
createDoutMdlVar(Dout_FBcl pinSrc,
PinKind_FBcl pinKind,
java.lang.String sNameFBy,
DType_FBcl dtype)
Creates a variable in the module which is used either as variable after an expression
or also as call by reference variable for an FBoper.
|
private static void |
createExpressionFB(OdgGBlock fbg,
FBtype_FBcl fbt,
OdgModule odgMdl,
java.util.List<Write_FBlock_FBwr> fbwRef)
Creates an
FBexpr_FBcl as expression inside the OdgGBlock . |
private Din_FBcl |
createExprPinAndKpin(OdgGPin gpin,
OdgGBlock fbg,
FBexpr_FBcl fbx,
EvinType_FBcl evint,
EvoutType_FBcl evoutt,
java.lang.String sOper,
OdgGPin gExprOut,
int[] nrDinout,
java.lang.String[] sExpr)
Creates the expression pin(s) from the given graphic pin gpin.
|
private void |
createExprPins(OdgGBlock fbg)
|
private void |
createFBclConnectionsFromGraphic()
Gets the connections from the graphic and stores it to the real used pins.
|
private boolean |
createFBlockPin(OdgGPin gpin,
OdgGBlock fbg)
Creates or gets the pin(s) in the non graphic instance from given Graphic pin gpin:
OdgGBlock.fbw , maybe more as one, OdgGBlock.fbtw
and sets the pin reference in gpin: OdgGPin.pinType , OdgGPin.pinObj . |
private void |
createFBlockPins(OdgGBlock fbg)
|
(package private) void |
createFBPins_duetoGBlockPins()
completes the graphic Pins() with the FBlock_FBcl pins,
create or search the adequate pins in
FBlock_FBcl and FBtype_FBcl |
private void |
createInheritanceFBclConnectionsFromGraphic(Write_Module_FBwr mdlwr)
Gets the connections from the graphic for inheritance and stores it to the real used pins.
|
private DinExprK_FBcl |
createKinExpr(DinExpr_FBcl exprInp,
java.lang.String sOpK,
OdgGBlock fbg) |
private PinRef_FBcl |
createThizRefForFBoper(OdgGPin gpin,
OdgGBlock fbg,
FBexpr_FBcl fbx) |
private void |
evalPinForAssociatedEvDataPins(OdgGPin pi,
Write_FBlock_FBwr fbw,
java.util.List<EvinoutType_FBcl> listEvin,
java.util.List<EvinoutType_FBcl> listEvout,
EvinoutType_FBcl evUpdin,
EvinoutType_FBcl evUpdout,
Write_Module_FBwr mdlwr,
boolean bFirstCall)
Associate any pin to evin, evout, evUpdin evUpdout, due to its functionality.
|
private void |
fulfillVariablesInExpressionFactors() |
private java.lang.String |
getAccess(java.lang.String text,
int zText) |
private void |
getListDstXrefPins(java.util.List<OdgConnection> listAdd,
OdgXref xref,
int recursion) |
private java.lang.String |
getNextNamePin(java.lang.String sNameType,
int[] nrDinout,
int ixDinout)
Builds the name of the next pin for a multiple pin or returns sNameType if it is not a multiple type
|
private PinType_FBcl |
getPinTypeViaDemux(OdgGPin gpin)
Searches and returns the PinType on the opposite end of the deMux
|
private void |
processFBlockPinGraphicConnectionTextual(OdgGPin pi)
Processes the textual given connection.
|
private void |
processGraphicConnections(OdgGBlock fbg)
This routine processes all pins of the given GBlock in
OdgGBlock.idxPinInstance
and then their OdgGPin.connections . |
private void |
processGraphicPinConnections(OdgGPin gpin,
OdgGBlock fbg,
OdgConnection.ECkind onlyConnKind)
Process all connections in the graphic from the given graphic pin (excl. inheritance, should be already processed).
|
private void |
processGraphicPinInheritance(OdgGPin pi,
OdgGBlock fbg)
Process all graphic connections which are inheritances.
|
private boolean |
processTypePinGraphicConnection(OdgGPin gpinSrc,
OdgConnection.ECkind onlyConnKind,
java.util.Iterator<OdgConnection> iterConn,
OdgConnection conn,
boolean bInstanceConn)
Process the graphic connection due to type connection which determines the type of src pin
|
private void |
resolveXrefGraphicConnections(OdgXrefGraphic xref)
Resolves the Xref connections to the real connections, now also over pages.
|
private void |
XXXconnectPinsDstDemux(OdgGPin gpinSrc,
OdgGPin gpinDemux,
java.lang.String connText,
OdgConnection.ECkind connKind)
Connects the selected
Pin_FBcl of gpinSrc.pinObj() due to the FBlock designation in gpinDemux
The FBlock_FBcl.name() of the source Pin_FBcl is build from the gpinSrc.fbg.nameTypeArray.descr till [ 'NAME[slices]'
and the selected slice in gpinDemux.nameType.descr. |
private boolean |
XXXfulfillSrcXref(java.util.Map.Entry<java.lang.String,OdgXref> exref) |
final java.lang.String sNameMdl
public final Write_Module_FBwr mdlw
final java.util.List<OdgPage> listPage
XmlForOdg.Draw_page
used for more evaluation module wise, especially the connections.java.util.Map<java.lang.String,OdgReader.Alias> idxAlias
public final java.util.Map<java.lang.String,OdgGBlock> idxGBlockById
public final java.util.List<OdgNameTypeArray> listFreeVar
OdgNameTypeArray.descr
contains the name, OdgNameTypeArray.pinC
contains the id from xml for connection.public final java.util.Map<java.lang.String,OdgGPin> idxGPinById
public final java.util.Map<java.lang.Integer,OdgGBlock> idxModuleIfc
public final java.util.Map<java.lang.Integer,OdgGBlock> idxGBlock
public final java.util.Map<java.lang.String,java.util.List<Write_FBlock_FBwr>> idxFBlockArray
public java.util.TreeMap<java.lang.String,OdgGBlock> idxGExprByName
OdgNameTypeArray.descr
.
Some GBlocks with the same name, and hence the same only one representing FBgl instance can be existing.
They should all contained here, separately. Hence the graphic position is added to the key.
To search one occurrence of the GBlock with only the correct name use TreeMap.ceilingEntry(Object)
.public java.util.TreeMap<java.lang.String,OdgGBlock> idxGExprVarByName
public java.util.TreeMap<java.lang.String,OdgGBlock> idxGAccessByName
public java.util.List<OdgGBlock> listDemux
public final java.util.Map<java.lang.String,OdgXrefGraphic> idxXrefGraphicByName
final Prj_FBCLrd prj
protected int nAutoVariable
protected int nAutoVariableAccess
long timeStartModule
long timePrep
long timeDataPropg
long timeEventPropg
long timeCompleteModule
long timeWrFBcl
long timeCmpFBcl
long timeWrCmpCode
long timeEndModule
private static java.lang.String dbgFbNamePin_prcConnection
Debugutil.stop()
private static java.lang.String[] shiftOperators
private static java.lang.String[] cmp2Operators
public OdgModule(java.lang.String mdlName, Prj_FBCLrd prj)
Module_FBcl
and its writing wrapper Write_Module_FBwr
.mdlName
- name from the ofbTitle shape.prj
- args
- public void buildFbgData()
createFBPins_duetoGBlockPins()
#buildAssociatedMdlEventDataPins(OdgReader)
#createFBclConnectionsFromGraphic(OdgReader)
#supplementNotConnectedPins()
DataTracking_FBcL#propagateTypesEvents(Module_FBcl)
DataTracking_FBcL#propagateTypesEvents(Module_FBcl)
#processDflow()
odg
- void createFBPins_duetoGBlockPins()
FBlock_FBcl
and FBtype_FBcl
private void createFBlockPins(OdgGBlock fbg)
Pin_FBcl
with the PinType_FBcl
for the given OdgGPin
in the given FBlock.
The OdgGPin.kind
contains the kind of the Pin.
If it is an expression, the expression operand stored in OdgGPin.sText
will be transferred to Din_FBcl.sConstant
.fbg
- private boolean createFBlockPin(OdgGPin gpin, OdgGBlock fbg)
OdgGBlock.fbw
, maybe more as one, OdgGBlock.fbtw
and sets the pin reference in gpin: OdgGPin.pinType
, OdgGPin.pinObj
.
The pins may be already existing in the non graphic instances, also get from OdgGBlock.fbt()
.
For connection processing the pins can be used in gpin.
From gpin also the FBlock_FBcl
and FBtype_FBcl
instances are accessible via Pin_FBcl.fb
and PinType_FBcl.fbt
.
The gpin.pinObj is an array of pins, due to the array of FBlock_FBcl
in fbg.fbw.
Usual used only one instance, but possible more for Multi-FBlocks.gpin
- Given graphic pin with name and maybe type in OdgGPin.nameType
and also Destination where gpin.pinObj and gpin.pinType is set.
OdgGPin.pinObj
, OdgGPin.pinType
fbg
- Source where and from where the non graphic pins are set and get, using OdgGBlock.fbw
and OdgGBlock.fbtw
private static void createExpressionFB(OdgGBlock fbg, FBtype_FBcl fbt, OdgModule odgMdl, java.util.List<Write_FBlock_FBwr> fbwRef)
FBexpr_FBcl
as expression inside the OdgGBlock
.
It adds the event pins "prep" and "prepO". FBlock_FBcl#_kindFBlock
is FBlock_FBcl.Blocktype#expr
FBexpr_FBcl.cOp
== '('.
FBexpr_FBcl.cOp
== '!'
see org.vishia.fbcl.writeFBcl.WriterCodegen#prepareExprTextGiven(Appendable, FBexpr_FBcl, String, String)
fbg
- The existing and stored Graphic block
OdgGBlock.sFrameText
should contain the text of the graphic block frame maybe used for expression name
private void createExprPins(OdgGBlock fbg)
Pin_FBcl
with the PinType_FBcl
for the given OdgGPin
in the given FBlock.
The OdgGPin.kind
contains the kind of the Pin.
If it is an expression, the expression operand stored in OdgGPin.sText
will be transferred to Din_FBcl.sConstant
.fbg
- odgr
- private Din_FBcl createExprPinAndKpin(OdgGPin gpin, OdgGBlock fbg, FBexpr_FBcl fbx, EvinType_FBcl evint, EvoutType_FBcl evoutt, java.lang.String sOper, OdgGPin gExprOut, int[] nrDinout, java.lang.String[] sExpr)
OdgGPin.kind
either a input or output pin is created: PinKind_FBcl.exprInp
or PinKind_FBcl.fbdst
:
An DinExpr_FBcl
is created and stored as input in Write_FBlock_FBwr.idxDin
,
with the name X1... and the PinType_FBcl#Din
.
PinKind_FBcl.exprOut
or PinKind_FBcl.Dout
or PinKind_FBcl.vout
or PinKind_FBcl.zout
:
An Dout_FBcl
is created and stored as output in Write_FBlock_FBwr.idxDout
with the name either y, Y, Vm, Q and that given PinKind_FBcl
from OdgGPin.kind
.
But not that the PinKind comes from the name of the pin y Y V Q and then from the name of the pin in the FBtype_FBcl
representing the expression. But it is asserted it is the same.
DinExpr_FBcl.sOperator
determined from the sExpr
gpin
- graphic pinfbg
- graphic block where the pin is member of. For expression only one fbg exists.
OdgGBlock.fbw
is the writer to the FBexpr_FBcl
where the pin(s) is/are inserted.sExpr
- should be String[2].
Din_FBcl.sConstant
for the "expr" pin.
Din_FBcl.sConstant
for the "expr" pin.
Din_FBcl.sConstant
for the "expr" pin.
return null of a din for K... to add at last.private java.lang.String[] checkPrepareExprOperator(java.lang.String sDescr, boolean bCast, FBexpr_FBcl fbx)
FBexpr_FBcl#getOperator
is used as operator.
FBexpr_FBcl.setOperatorToPins(Prj_FBCLrd)
, in this form taken from the 'sExpr' pin.
This evaluation is not done here. Only the content of 'sExpr' pin is prepared here.
sDescr
- Given text from shape ofpExprPartsNameIn
- fbx
- The expressionDinExpr_FBcl.sOperator
and if an accDst is given, "@[123]" or "@.element" for the access to the variable after expression.
[1] to evaluate for the K-pin. Ot it is the Din_FBcl.setConstant(String)
if the pin has not a connection.private DinExpr_FBcl createDinExpr(java.lang.String nameSpec, int[] nrDinout, EvinType_FBcl evint, java.lang.String sOper, OdgGBlock fbg, OdgGPin gpin)
DinExpr_FBcl
with the given infos.
DinExpr_FBcl.sOperator
is left empty here.
It is set in FBexpr_FBcl.setOperatorToPins(Prj_FBCLrd)
which is called in Write_Module_FBwr.setExprOperatorToPins()
after reading all content, before further evaluation.
nameSpec
- if not null then it is a specific name for a specific version of FBexpr. null if not specific, in the ordinary case.nrDinout
- on pos [0] either -1 for a single pin or only one multiple pin or >=0 for the number of the multiple pin.
if nameSpec is a multiple pin or null, then this will be used and increment if >=0fbg
- used for access to FBlock, type etc.gpin
- The pin from graphic. The OdgGPin.nameType
holds all necessary information for the data type and the graphic position.private void createAccessPins(OdgGBlock fbg)
Pin_FBcl
with the PinType_FBcl
for the given OdgGPin
in the given FBlock.
The OdgGPin.kind
contains the kind of the Pin.
If it is an expression, the expression operand stored in OdgGPin.sText
will be transferred to Din_FBcl.sConstant
.fbg
- odgr
- private java.lang.String getNextNamePin(java.lang.String sNameType, int[] nrDinout, int ixDinout)
sNameType
- If ends with "999" the part without "x999" is used.nrDinout
- array with the current index start from 0 or 1 to take this index and increment
or nrDinout[ixDinout] == -1 if only the base name should be used because there is only one pin instead multiple.ixDinout
- the position in nrDinout where the index is stored, usual 0 for input, 1 for outputprivate DinExprK_FBcl createKinExpr(DinExpr_FBcl exprInp, java.lang.String sOpK, OdgGBlock fbg)
private Dout_FBcl createDoutExpr(OdgGPin gpin, java.lang.String sAccess, int[] ixArray, OdgGBlock fbg, FBexpr_FBcl fbx, EvoutType_FBcl evoutt, java.lang.String sOper, DType_FBcl dtype, OdgGPin gExprOut, int[] nrDinout)
gpin
- sAccess
- ixArray
- fbg
- fbx
- evoutt
- given if bOper = true, as evin to associate with the created dout typebOper
- dtype
- gExprOut
- nrDinout
- private Dout_FBcl createDoutMdlVar(Dout_FBcl pinSrc, PinKind_FBcl pinKind, java.lang.String sNameFBy, DType_FBcl dtype)
pinSrc
- The output which should be connected to the Var..._OFB.X inputpinKind
- kind of the variable, PinKind_FBcl.Dout
or ~Vout or ~ZoutsNameFBy
- Name of the variable resp. the representing Var---OFB FBlockdtype
- data type same as the expression or operation outputprivate PinRef_FBcl createThizRefForFBoper(OdgGPin gpin, OdgGBlock fbg, FBexpr_FBcl fbx)
private java.lang.String getAccess(java.lang.String text, int zText)
private void buildAssociatedMdlEventDataPins(Write_Module_FBwr mdlwr)
OdgReader#idxFBlockGraphicModuleIfc
.
Any of this block can contain PinBase_FBcl#addAssociatedEvData(PinBase_FBcl)
.
EvinType_FBcl#setPrepUpdEvent(EvinoutType_FBcl)
odg
- The gathered graphic data.private void buildAssociatedFBtypeEventDataPins(Write_Module_FBwr mdlwr)
private void buildAssociatedEventDataPins(OdgGBlock fbg, Write_Module_FBwr mdlwr, boolean bFirstCall)
OdgGBlock.iterPin()
.
This operation is called twice for a fbg which is first not unique.
fbg
- The graphic blockmdlwr
- null if executed for a fbg inside the module, the module for a module pin graphic block.
It is used in #evalPinForAssociatedEvDataPins(OdgGPin, Write_FBlock_FBwr, List, EvinoutType_FBcl, EvinoutType_FBcl, EvinoutType_FBcl, Write_Module_FBwr)
to associate an EccAction_FBcl
stored in the module to event pins.private void evalPinForAssociatedEvDataPins(OdgGPin pi, Write_FBlock_FBwr fbw, java.util.List<EvinoutType_FBcl> listEvin, java.util.List<EvinoutType_FBcl> listEvout, EvinoutType_FBcl evUpdin, EvinoutType_FBcl evUpdout, Write_Module_FBwr mdlwr, boolean bFirstCall)
Write_FBtype_FBwr.completeMissingEventPins()
. Not all pins need to be drawn in the graphic.pi
- The pin from the graphic block From OdgGBlock
listEvin
- given more as one evin of the block or emtpyevout
- given evout in the graphic appearance , or nullevUpdin
- same for updateevUpdout
- mdlwr
- null if this is not a module pin FBlock.private void createInheritanceFBclConnectionsFromGraphic(Write_Module_FBwr mdlwr)
OdgGPin.connections
which are only stored in the graphic level in OdgReader
Write_FBtype_FBwr.listInheritance
.
Write_FBtype_FBwr.createInheritanceType()
and FBtype_FBcl.WriteFBT.createIdxInheritance()
the inheritances are stored in the FBtype_FBcl.inheritance
array.
But this routines must be called only after gather all inheritances in the graphic.odg
- graphic dataprivate void createFBclConnectionsFromGraphic()
OdgGPin.connections
which are only stored in the graphic level in OdgReader
The PinInstances are referred from OdgGBlock.idxPinInstance
and also OdgGBlock.fbPinSrc
and OdgGBlock.fbPinDst
.
FBlock
in the adequate specific idx...
PinConnection#idxPinConnected
and PinConnection#idxPinBackConnected
odg
- graphic dataprivate void resolveXrefGraphicConnections(OdgXrefGraphic xref)
xref
- private void processGraphicConnections(OdgGBlock fbg)
OdgGBlock.idxPinInstance
and then their OdgGPin.connections
.
The FBcl connections are built from the graphic connections:
OdgGPin.pinObj()
are created, but have not connections.
OdgGPin.pinObj()
are connected each other.
Pin_FBcl#connect
which refers immediately the dst pin in the FBlock_FBcl
/ FBlock_FBcl
All idxXrefGraphicByName
which are no more necessary (all connections are used) are deleted.
TODO?? From the yet existing OdgXref
Variable of the mdlMain are built, as Variable for free.fbg
- the GBlock or GExpession graphical instance which contains the pins with their connections.private void processGraphicPinConnections(OdgGPin gpin, OdgGBlock fbg, OdgConnection.ECkind onlyConnKind)
processTypePinGraphicConnection(OdgGPin, org.vishia.fbcl.readOdg.OdgConnection.ECkind, Iterator, OdgConnection, boolean)
.
This is to clarify types of data and references.
connectViaDemuxXref(OdgGPin, OdgGPin, String, String, int, int)
,
because the connections maybe made over XRef and DeMux.
Din_FBcl
instead of the correct Dout_FBcl
.
The problem is solved from Pin_FBcl.connectFrom(Pin_FBcl)
: Either the real source is found in the immediately connected Din_FBcl by the existing source connection,
or the source connection is catched up if the connection from the real source is processed. Then all indirect connections are resolved.gpin
- The pin in graphic. For textual connection it is the dst pin. For graphic connection it is only used as OdgConnection.piSrc
of all found connections, means only as source pin of the connection.fbg
- the graphic FBlock. More as one graphic FBlock can exist for one really FBlock_FBcl
or FBtype_FBcl
.
They are referenced from OdgGBlock.fbw
and OdgGBlock.fbtw
onlyKind
- if null process all pins. If given process only this pin Kind.private boolean processTypePinGraphicConnection(OdgGPin gpinSrc, OdgConnection.ECkind onlyConnKind, java.util.Iterator<OdgConnection> iterConn, OdgConnection conn, boolean bInstanceConn)
gpinSrc
- the pin instance which's connections are handledfbg
- the graphic block from which comes pinonlyConnKind
- null for all, or handle only this connection kinditerConn
- iterator in pin to remove the connectionconn
- the given connectionbInstanceConn
- true then it is also an instance connectionprivate PinType_FBcl getPinTypeViaDemux(OdgGPin gpin)
gpin
- given pin of a Demux, may be a Demux pin or Mux pin as src or dst, OdgGBlock.fbPinSrc
private void connectViaDemuxXref(OdgGPin gpinStart, OdgGPin gpinSrc, java.lang.String deMuxSelSrc, java.lang.String deMuxSelDst, int ixPinMux, int recursion)
Pin_FBcl.connectDst
and Pin_FBcl.connectSrc
is set. Pin_FBcl.connDst()
.
This operation regards destination of ofpDemux and ofbDemux and also Xref.
The connection paths is tracked through all these path parts.
Also connections of arrays is regarded.
OdgGPin.connections
are tracked, the OdgConnection.piDst
is used,
the OdgConnection.piSrc
should be equal gpinSrc.
OdgConnection.eKind
"rpagdze" are used.
This excludes composition, dependency, inheritance, docu, requirement, attrib and evDataRel.
OdgGBlock.styleGraphicFrame
is FBkind_FBcl.demux
,
then either the pin is a deMux pin (style ofpDemux) or the pin is the source or destination of a DeMux FBlock (style ofbDemux).
Then connectViaDemux(OdgGPin, OdgGPin, String, String, OdgGPin, OdgGBlock, int, int)
is called
for further tracking.
gpinStart
- The pin from where the connection startsgpinSrc
- The pin of the current connectiondeMuxSelSrc
- For sliced FBlocks as source or bus connections using Demux: The name in the ofpDemux pin.deMuxSelDst
- For sliced FBlocks as destination using ofpDemux as input and ofbDemux OdgGBlock.fbPinSrc
as output to a sliced block.
The name in the ofpDemux input pin.recursion
- countered for all connection pathsprivate void connectViaDemux(OdgGPin gpinStart, OdgGPin gpinSrc, java.lang.String deMuxSelSrc, java.lang.String deMuxSelDst, OdgGPin gpinDst, OdgGBlock gfbDst, int ixPinMux, int recursion)
private void connectPinSrcDstObj(OdgGPin gpinStart, OdgGPin gpinSrc, java.lang.String deMuxSelSrc, java.lang.String deMuxSelDst, int ixPinMux, OdgConnection conn, OdgGPin gpinDst)
OdgGPin.pinObj
to the gpinDst OdgGPin.pinObj
with given selection of deMuxSelSrc and deMuxSelDst.
The following constellations are possible:
FBlock-sliced.pin --->|deMuxSelSrc--->pinDstIn the chain a deMux is given with input on mux and output on a selected ofpDemux pin. Then the sliced fbSrc is accessed with the required deMuxSelSrc.
pinStart --->deMuxSelDst|--->pinDstIn the chain a deMux is given with input on a selected ofpDemux pin and mux output. Then the sliced fbDst is accessed with the required deMuxSelDst.
gpinStart
- The original output pin before all deMuxgpinSrc
- The current pin after given deMuxdeMuxSelSrc
- String for selection deMux on gpinSrcdeMuxSelDst
- String for selection deMux before gpinDstconn
- Info about connectiongpinDst
- the current destination pin.private void XXXconnectPinsDstDemux(OdgGPin gpinSrc, OdgGPin gpinDemux, java.lang.String connText, OdgConnection.ECkind connKind)
Pin_FBcl
of gpinSrc.pinObj() due to the FBlock designation in gpinDemux
FBlock_FBcl.name()
of the source Pin_FBcl is build from the gpinSrc.fbg.nameTypeArray.descr till [ 'NAME[slices]'
and the selected slice in gpinDemux.nameType.descr.
Pin_FBcl.fb
gpinSrc
- The GPin as source before the Demux, to the common multiplexed inputgpinDemux
- The outgoing pin of the Demux as demultiplexed connectionconnText
- text of the connectionconnKind
- kind of the connectionprivate void processFBlockPinGraphicConnectionTextual(OdgGPin pi)
OdgGPin.nameType
. OdgNameTypeArray.sConnection
.
It is written in form "fb.pin" or ".modulePin" or "fbVariable".pi
- The graphic pin instanceprivate void processGraphicPinInheritance(OdgGPin pi, OdgGBlock fbg)
pi
- fbg
- private void fulfillVariablesInExpressionFactors()
private void getListDstXrefPins(java.util.List<OdgConnection> listAdd, OdgXref xref, int recursion)
private void addPinConnected(Pin_FBcl pinSrc, java.lang.String connText, OdgConnection.ECkind connKind, Pin_FBcl pinDst, java.lang.String sElemSrc, java.lang.String sElemDst, java.lang.String sVariant)
Pin.ECkind#inheritance
: Instead connection to FBbase#fbPinDst
a new pin with PinKind_FBcl.impl
is created and stored in FBtype_FBcl#idxImpl
.
FBbase#fbPinSrc
of a FBlock_FBcl
a new pin is created and stored
in FBlock_FBcl#pinExpr
.
#addPinConnected(FBbase, PinConnection, PinConnection, ECdst, String)
is called
which calls FBlock#addPinKind(PinKind_FBcl, Pin_FBcl, PinConnection, ECdst, String)
.
This puts the correct pin in the correct index, means FBlock#idxAggr
etc. and also
FBtype_FBcl#idxAggr
etc.
PinConnection#idxPinConnected
and the back connection in PinConnection#idxPinBackConnected
.pinSrc
- The original found pin maybe without exact designation PinKind_FBcl.unspec
or PinKind_FBcl.fbsrc
.
Either the pin will be qualified by the kind of connection, or the connection kind is checked whether it is admissible for the pin kind,
or a second qualified pin will be created additionally for this connection.connText
- possible text of the connectionconnKind
- kind of connection (adequate the style in the graphic data)pinDst
- The pin for destination of this connection.sElemSrc
- written to PinConnect_FBcl.sElementSrc
used for code generation.sElemDst
- written to PinConnect_FBcl.sElementDst
used for code generation.private boolean XXXfulfillSrcXref(java.util.Map.Entry<java.lang.String,OdgXref> exref)