public class Module_FBcl
extends java.lang.Object
FBtype_FBcl build with FBcl connections.
It means it contains FBlocks with connections to fulfill its functionality.
It is completely described with FBcl.
FBlock_FBcl, this is the module itself.
| Modifier and Type | Class and Description |
|---|---|
static class |
Module_FBcl.CreateMdl
Helper class to create an
FBlock_FBcl and its properties. |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
bAllDTypesDeterministic |
(package private) static DoutMdl_FBcl[] |
doutPortEmpty |
private java.util.List<EccState_FBcl> |
eccStates |
java.util.List<Evchain_FBcl> |
evChains
All detected chains of simple connected operations (evin to evout of some FBs).
|
Evout_FBcl[] |
evoutMdlIntern
Contains all events which should trigger internal execution.
|
protected EvtreeNode_FBcl |
evTree_const
This three nodes for const, ctor, init play a special role for code generation.
|
protected FBexpr_FBcl[] |
exprEv
Array of all existing 'exprEv' associated to the condition bits.
|
protected FBlock_FBcl |
fbActual
Valid used DTypes on code generation for the module.
|
FBlock_FBcl |
fbmdlPins
Reference to the inner pins of the module.
|
FBtype_FBcl |
fbtMdlifc
The Type FBlock to this module usable as
FBtype_FBcl for FBlock_FBcl using this module from outside. |
FBtype_FBcl.CreateFBT |
fbtMdlPinsCr
Reference to the FBtype creator of the inner module pins.
|
protected java.util.Map<java.lang.String,FBlock_FBcl> |
idxFBlock
All FBlocks inside the module sorted by name
Note: The inport and outport are accessible via
FBlock_FBcl.din and FBlock_FBcl.dout sorted by port index. |
protected java.util.Map<java.lang.String,FBlock_FBcl> |
idxFBlockTEST
All FBlocks inside the module sorted by name with type name starting with "TEST"
Note: The inport and outport are accessible via
FBlock_FBcl.din and FBlock_FBcl.dout sorted by port index. |
protected java.util.Map<java.lang.String,FBtype_FBcl> |
idxFBlockType
Types which are defined locally in this module.
|
protected java.util.Map<java.lang.String,Dout_FBcl> |
idxVariables
All variables which are outputs of expressions, accessible by name used in K1999-Inputs of other expressions
and appears in code as variables.
|
java.util.Map<java.lang.String,OdgXref> |
idxXrefByName
The Xref has a extra meaning, because they are also aliases for data connection which should be regard to build the expressions.
|
int |
ixChainConst
Bit-index in
Pin_FBcl#mEvoutMdlChain for const pins, or -1 if there are not const pins. |
int |
ixChainCtor
Bit-index in
Pin_FBcl#mEvoutMdlChain for ctor pins, or -1 if there are not ctor pins. |
int |
ixChainFwd
Bit-index in
Pin_FBcl#mEvoutMdlChain for pins which are not backward reached by an evin, or -1 if there are not such pins. |
int |
ixChainInit
Bit-index in
Pin_FBcl#mEvoutMdlChain for init pins, or -1 if there are not init pins. |
int |
ixChainTest
Bit-index in
Pin_FBcl#mEvoutMdlChain for test output pins, or -1 if there are not such pins. |
protected java.util.List<EccAction_FBcl> |
listAction |
protected java.util.List<EvtreeNode_FBcl> |
listEvTreeRoot
root nodes of all evTree.
|
private java.util.Map<java.lang.String,Algorithm_FBcl> |
mapAlgorithm |
java.lang.String |
name |
Network_FBcl[] |
networks
Networks in the order of representation.
|
private Algorithm_FBcl |
simpleFBalgm
It is null if the FBlock is not a Simple FB.
|
java.lang.String |
sLibFile |
protected java.lang.String |
sMdlType |
ModuleStateM_FBcl |
stm |
static java.lang.String |
sVersion
Version, history and license.
|
| Constructor and Description |
|---|
Module_FBcl(java.lang.String name,
Prj_FBcl prj)
Creates a Module which is a
FBlock_FBcl and creates also the associated FBtype_FBcl
which is adequate to the inner pins of the module,
with the FBtype_FBcl.kindFBt = FBlock_FBcl.Blocktype.TheModule. |
| Modifier and Type | Method and Description |
|---|---|
void |
adjustFBexrFnDtypes()
Adjust the type designations in
FBexpr_FBcl.sFn for all expressions due to the propagated pin data types. |
boolean |
allDTypesAreDeterministic() |
java.lang.Iterable<EccAction_FBcl> |
allOperations() |
EccAction_FBcl |
allOperations(int ix) |
FBlock_FBcl |
changeFBactual(FBlock_FBcl src)
Change the relevant data types for code generation with dedicated types.
|
void |
checkAllDTypesDeterministic() |
DType_FBcl |
dTypeMdl(DType_FBcl.DtIxmdl dtix)
Returns the real valid type with the given ixDTmld in
DType_FBcl.DtIxmdl.ixMdl()
It calls dTypeMdl(DType_FBcl.DtIxmdl, char[], int[], int) with null for return info |
DType_FBcl |
dTypeMdl(DType_FBcl.DtIxmdl dtix,
char[] cDtBack,
int[] ixDTmdlBack,
int recursion)
Returns the real valid expected deterministic DType with the given ixDTmld in
DType_FBcl.DtIxmdl.ixMdl(). |
FBexpr_FBcl[] |
exprEv() |
DType_FBcl.DtIxmdl |
getCreateDtype(DType_FBcl dtref,
int[] sizeArray) |
DType_FBcl.DtIxmdl |
getCreateDtype(java.lang.String sDTypeArg,
LogMessage log) |
DType_FBcl.DtIxmdl |
getCreateDtypeDeterm(DType_FBcl dtGiven,
DType_FBcl.DtIxmdl dtixSrc) |
Dout_FBcl[] |
getdinPortToInnerMdl()
Gets the inner connection, output of the module
|
DoutMdl_FBcl[] |
getdoutPortFromInnerMdl()
Gets the inner connection, output of the module
|
(package private) DType_FBcl.DtIxmdl |
getDType(java.lang.String key) |
(package private) DType_FBcl.DtIxfb |
getDTypeIxfb(java.lang.String key) |
Evout_FBcl |
getEvinMdlforChain(Pin_FBcl pin) |
FBlock_FBcl |
getFBactual() |
FBlock_FBcl |
getFBlock(java.lang.String name) |
java.util.Map<java.lang.String,FBlock_FBcl> |
getFBlocks() |
FBlock_FBcl |
getFBlockTest(java.lang.String name)
Returns !
|
FBtype_FBcl |
getFBlockType(java.lang.String name) |
FBtype_FBcl |
getIfcFB() |
java.lang.String |
getMdlTypename()
Returns the module's type name as used for code generation in the actual level.
|
java.lang.String |
getMdlTypenameRaw() |
Dout_FBcl |
getVariable(java.lang.String name)
Gets a variable in the module.
|
boolean |
isSimpleFB() |
java.lang.Iterable<java.util.Map.Entry<java.lang.String,Algorithm_FBcl>> |
iterAlgorithm() |
java.lang.Iterable<EvtreeNode_FBcl> |
iterEvtreeRoot() |
java.lang.Iterable<FBlock_FBcl> |
iterFBlock() |
java.lang.Iterable<FBtype_FBcl> |
iterFBtype() |
java.lang.Iterable<EccState_FBcl> |
iterStates() |
java.lang.Iterable<Dout_FBcl> |
iterVariable() |
java.lang.String |
name()
Returns the name of the module.
|
int |
nrofFBlockType() |
int |
nrofStates() |
Algorithm_FBcl |
simpleAlgorithm() |
java.lang.String |
toString() |
public static java.lang.String sVersion
public final java.lang.String name
protected java.lang.String sMdlType
public final FBtype_FBcl fbtMdlifc
FBtype_FBcl for FBlock_FBcl using this module from outside.
The pins here and in fbmdlPins FBlock_FBcl.fbt are mirrored:
Inner pins (maybe named "bonds") for output are the outer pins of the module as inputs and vice versa.
The FBtype_FBcl.idxDType and FBtype_FBcl.dTypesType are the same,
set on end of translation of the module in Write_Module_FBwr.completeAllMdlPins(org.vishia.fbcl.translate.TranslationScripts).public final FBlock_FBcl fbmdlPins
FBtype_FBcl representation of the inner module pins,
but they are not necessary. The real type is the fbtMdlifc.
This FBlock_FBcl of the inner pins and the fbtMdlifc mirrors the pins.
A FBlock_FBcl.din is correspond to FBtype_FBcl.doutPin etc.
Adequate the FBlock_FBcl#fbtype of this fbp mirrors the pins to fbtMdlifc.public final ModuleStateM_FBcl stm
protected boolean bAllDTypesDeterministic
public java.lang.String sLibFile
static DoutMdl_FBcl[] doutPortEmpty
public Network_FBcl[] networks
public java.util.List<Evchain_FBcl> evChains
Evchain_FBcl.operation
which is referred from the associated EvinType_FBcl from the interface too.public int ixChainConst
Pin_FBcl#mEvoutMdlChain for const pins, or -1 if there are not const pins.public int ixChainCtor
Pin_FBcl#mEvoutMdlChain for ctor pins, or -1 if there are not ctor pins.public int ixChainInit
Pin_FBcl#mEvoutMdlChain for init pins, or -1 if there are not init pins.public int ixChainTest
Pin_FBcl#mEvoutMdlChain for test output pins, or -1 if there are not such pins.public int ixChainFwd
Pin_FBcl#mEvoutMdlChain for pins which are not backward reached by an evin, or -1 if there are not such pins.private Algorithm_FBcl simpleFBalgm
private java.util.Map<java.lang.String,Algorithm_FBcl> mapAlgorithm
protected FBlock_FBcl fbActual
#changeDTypes(DType_FBcl[][]).public FBtype_FBcl.CreateFBT fbtMdlPinsCr
FBtype_FBcl.CreateFBT#addDType(String, DType_FBcl) using the FBtype_FBcl.dTypesType
all used data types which are variants. Sometimes only one.
This is the String sorted index, whereas FBtype_FBcl.dTypesType contains the types sorted to index.
This refers THE SAME instance as in Write_FBtype_FBwr
of the Write_Module_FBwr.fbtwMdlprotected FBexpr_FBcl[] exprEv
Module_FBcl.CreateMdl.addAllExprEv(List)
which is called inprotected java.util.Map<java.lang.String,Dout_FBcl> idxVariables
protected java.util.Map<java.lang.String,FBlock_FBcl> idxFBlock
FBlock_FBcl.din and FBlock_FBcl.dout sorted by port index.protected java.util.Map<java.lang.String,FBlock_FBcl> idxFBlockTEST
FBlock_FBcl.din and FBlock_FBcl.dout sorted by port index.protected java.util.Map<java.lang.String,FBtype_FBcl> idxFBlockType
public final java.util.Map<java.lang.String,OdgXref> idxXrefByName
protected java.util.List<EvtreeNode_FBcl> listEvTreeRoot
protected EvtreeNode_FBcl evTree_const
protected java.util.List<EccAction_FBcl> listAction
private java.util.List<EccState_FBcl> eccStates
public Evout_FBcl[] evoutMdlIntern
Evin_FBcl.
Then some Evout_FBcl follows which are used internally especially from state machines.
listEvTreeRoot, from all this events trees of instances of EvtreeNode_FBcl are built.
The the inner events for this array are original gathered in Write_Module_FBwr.idxInnerEvout.public Module_FBcl(java.lang.String name,
Prj_FBcl prj)
FBlock_FBcl and creates also the associated FBtype_FBcl
which is adequate to the inner pins of the module,
with the FBtype_FBcl.kindFBt = FBlock_FBcl.Blocktype.TheModule.
This is not the interface to the module.
The Interface of the module in #ifcFB is created as separate FBtype_FBcl.
with the FBtype_FBcl.kindFBt = FBlock_FBcl.Blocktype.Libmodule.
FBtype_FBcl are mirrored.
A FBtype_FBcl.doutPin of the module's inner FBlock_FBcl as input to the inner of the module
is represented by a FBtype_FBcl.dinPin as input pin to the interface FBlock of the module
and adequate.name - Name of the module.public FBexpr_FBcl[] exprEv()
public java.lang.String name()
name() returns "$module" as name of the inner FBlock_FBcl of the module pinspublic java.lang.String getMdlTypename()
sMdlType. If that contains '...%pin%...' then
'%pin%' is replaced by the actual DType of the pin in its unique form,
means such as 'F' or 'F3'. The pin should have a deterministic DTypeBase_FBcl
and only at least a one dimensional array specification.
The approach and algorithm is similar as in FBlock_FBcl.typeName()WriterCodegenpublic java.lang.String getMdlTypenameRaw()
public FBlock_FBcl getFBlock(java.lang.String name)
public FBlock_FBcl getFBlockTest(java.lang.String name)
name - public java.util.Map<java.lang.String,FBlock_FBcl> getFBlocks()
public java.lang.Iterable<FBlock_FBcl> iterFBlock()
public FBtype_FBcl getFBlockType(java.lang.String name)
public java.lang.Iterable<FBtype_FBcl> iterFBtype()
public java.lang.Iterable<EvtreeNode_FBcl> iterEvtreeRoot()
public int nrofFBlockType()
public Dout_FBcl getVariable(java.lang.String name)
name - name of the FBlock which contains the output variable. This is the stored name of the Dout_FBclpublic java.lang.Iterable<Dout_FBcl> iterVariable()
public FBtype_FBcl getIfcFB()
public boolean isSimpleFB()
public java.lang.Iterable<EccAction_FBcl> allOperations()
public EccAction_FBcl allOperations(int ix)
public java.lang.Iterable<java.util.Map.Entry<java.lang.String,Algorithm_FBcl>> iterAlgorithm()
public int nrofStates()
public java.lang.Iterable<EccState_FBcl> iterStates()
public Algorithm_FBcl simpleAlgorithm()
public Dout_FBcl[] getdinPortToInnerMdl()
public DoutMdl_FBcl[] getdoutPortFromInnerMdl()
DType_FBcl.DtIxmdl getDType(java.lang.String key)
DType_FBcl.DtIxfb getDTypeIxfb(java.lang.String key)
public DType_FBcl.DtIxmdl getCreateDtype(DType_FBcl dtref, int[] sizeArray)
public DType_FBcl.DtIxmdl getCreateDtype(java.lang.String sDTypeArg, LogMessage log)
public DType_FBcl.DtIxmdl getCreateDtypeDeterm(DType_FBcl dtGiven, DType_FBcl.DtIxmdl dtixSrc)
public final DType_FBcl dTypeMdl(DType_FBcl.DtIxmdl dtix)
DType_FBcl.DtIxmdl.ixMdl()
It calls dTypeMdl(DType_FBcl.DtIxmdl, char[], int[], int) with null for return infodtix - As stored in a instance independent of determined DTypes of the module.public final DType_FBcl dTypeMdl(DType_FBcl.DtIxmdl dtix, char[] cDtBack, int[] ixDTmdlBack, int recursion)
DType_FBcl.DtIxmdl.ixMdl().
This is the core operation.
DType_FBcl.DtIx_.dt is returned.
fbActual is given (call the module target code generation in an parent environment)
and the FBlock_FBcl.dTypes are set, and the appropriate element for dtIx is set,
then this element is taken. If the fbActual as also a FBlock_FBcl.mdl assigned,
then this operation is called again recursively to detect the effective DType in the outer or parent module.
The recursively is broken on 100 levels to prevent an unterminated loop on errors with an error message.
The recursively call should return the last deterministic DType.
fbActual is given (call the module target code generation in an parent environment)
and the FBlock_FBcl.dTypes are set, but this is the last module in the parent's recursively,
then the DType_FBcl.DtIx_.dt is returned.
But usual, the case '+' should be applied for that in the recursive call.
fbActual is not given (no parent module), then the appropriate FBlock_FBcl.dTypes
of the fbmdlPins is returned, if given. This is the type registered for the module's pins.
It is often the deterministic type for a non deterministic type on a FBlock inside the module.
FBlock_FBcl.dTypes on fbmdlPins is not set,
then the defined DType in the module's interface fbtMdlifc is used. This is the DType defined in the graphic of the module.
fbmdlPins its FBlock_FBcl.fbt and then FBtype_FBcl.dTypesType.
But this should be the same as n '°'.
DType_FBcl.DtIx_.dt itself without deterministic resolving.
dtix - given DType with DType_FBcl.DtIx_.ixMdlcDtBack - The character noted above for log infoixDTmdlBack - The original DType_FBcl.DtIx_.ixMdl for log inforecursion - for recursively count should be called with increment 'recursion +1'public FBlock_FBcl getFBactual()
public FBlock_FBcl changeFBactual(FBlock_FBcl src)
#dTypesActual.src - the valid data types for this code generation.public Evout_FBcl getEvinMdlforChain(Pin_FBcl pin)
public void adjustFBexrFnDtypes()
FBexpr_FBcl.sFn for all expressions due to the propagated pin data types.public void checkAllDTypesDeterministic()
public boolean allDTypesAreDeterministic()
public java.lang.String toString()
toString in class java.lang.Object