public class FBlock_FBcl extends Block_FBcl
OdgGBlock), whereas more as one GBlock gives information to one FBlock.
In other familiar FBlock graphics an FBlock is often unique in a module.
Module_FBcl.idxFBlock.
mdl.
fbt() to the FBtype_FBcl.
FBtype_FBcl.
This functionality can either be given outside of the FBtype related with the FBtype name, able to found for example as C code,
or it can be contained also in a graphical module. See FBtype_FBcl.mdl.
The FBlock itself contains the connections for usage of this functionality. That are its pins:
FBtypeSpecific_s fbName[5];
sizeArrayFB contains the necessary information for that, also for multi dimensional arrays.
ixSlice is set.
PinType_FBcl via the basic class Pin_FBcl.pint.
evin Event inputs of type Evin_FBcl with its related EvinType_FBcl.
which controls the execution of code of the FBlock.
evout Event outputs of type Evout_FBcl
din Data inputs of type Din_FBcl with its related DinType_FBcl.
dout Data outputs of type Dout_FBcl with its related DoutType_FBcl.
DinoutType_FBcl.dType
or sometimes also in derived classes of Din_FBcl, for example DinExpr_FBcl.bCastToDTypePart.
reference Reference inputs of type PinRef_FBcl This are aggregations or associations in UMl thinking,
which are pointers in for example C/++ language.
port Reference outputs of type PinPort_FBcl. This are compositions (target of aggregation or association),
which refers data inside this FBlock instance (in the implementation).
PinTypeRef_FBcl in its DinoutType_FBcl.dType.
It can be a FBtype_FBcl, another type of the referenced or offered inner FBlock type,
see DTypeBase_FBcl.typeRef.
idxPins as named index of all pins.
DType_FBcl which are used in the FBlock may be different from the DType_FBcl
given in the pins of the FBtype_FBcl. This is especially if the FBtype_FBcl is related to non determined types.
dTypes contains all actual DTypes of this FBlock with the index
contained in FBtype_FBcl.dTypesType
| Modifier and Type | Class and Description |
|---|---|
static class |
FBlock_FBcl.Blocktype
This enum describes the general FBlock usage.
|
static class |
FBlock_FBcl.WriteFB
Helper class to create an
FBlock_FBcl and its properties. |
| Modifier and Type | Field and Description |
|---|---|
Din_FBcl[] |
din
Array of all connections to other Block_Mdl in the same module for inputs of this.
|
Dout_FBcl[] |
dout
Array of all connections to other Block_Mdl in the same module for outputs of this.
|
(package private) static Dout_FBcl[] |
doutempty |
protected DType_FBcl.DtIxmdl[] |
dTypes
Array of all variant data types or null if not given.
|
Evin_FBcl[] |
evin |
Evout_FBcl[] |
evout |
protected FBtype_FBcl |
fbt
The type of this FBlock.
|
XY_FBcl |
graphicPos
The graphic position of the first occurence of this FBlock in the graphic.
|
private java.util.Map<java.lang.String,Pin_FBcl> |
idxPins |
protected int |
ixSlice
It this ix is >=0 especially in OFB graphic (LibreOffice),
if the Graphic FBlock is named as 'name{x,y,z}'.
|
Module_FBcl |
mdl
The module
Module_FBcl where this FBlock is member of. |
PinPort_FBcl[] |
port |
PinRef_FBcl[] |
reference |
protected int[] |
sizeArrayFB
If not null, then this FBlock was drawn as GBlock either as sliced or as array.
|
java.lang.String[] |
sOperators
Deprecated.
|
(package private) SteptimeRef_FBcl |
steptime
Deprecated.
|
static java.lang.String |
sVersion
Version, history and license.
|
PinFbDst_FBcl |
XXXfbPinDst
Deprecated.
|
PinFbSrc_FBcl |
XXXfbPinSrc
Deprecated.
|
graphicIntPos, name| Constructor and Description |
|---|
FBlock_FBcl(FBtype_FBcl typeFb,
java.lang.String name,
Module_FBcl parentModule,
XY_FBcl graphicPos)
Create an FBlock yet without dout, din because the number of din may depend on wiring in the module.
|
| Modifier and Type | Method and Description |
|---|---|
Pin_FBcl[] |
din()
Returns the originally value of
din as getter access. |
Din_FBcl[] |
dinForeach()
Returns never null, able to use in a for-loop.
|
Dout_FBcl[] |
dout()
Returns the originally value of
dout as getter access. |
Dout_FBcl[] |
doutForeach()
Returns never null, able to use in a for-loop.
|
DType_FBcl |
dtNonArrayFB(DType_FBcl dtSrc) |
DType_FBcl.DtIxmdl[] |
dTypes() |
Evin_FBcl[] |
evin()
Returns the originally value of
evin as getter access. |
Evin_FBcl |
evin(int ix) |
Evout_FBcl[] |
evout()
Returns the originally value of
evout as getter access. |
Evout_FBcl |
evout(int ix) |
FBtype_FBcl |
fbt() |
PinFbSrc_FBcl |
getFbPinSrc()
Creates if not given the PinInstance for a connection from the FBlock_FBcl itself, not from a dedicated pin.
|
int |
getNrofConnin(Pin_FBcl.XXXXXEKind kind) |
int |
getNrofConnout(Pin_FBcl.XXXXXEKind kind) |
int |
getNrofDin() |
int |
getNrofDout() |
int |
getNrofEvin() |
int |
getNrofEvout() |
DoutType_FBcl.EProps |
getOut1Properties()
Returns the output property of conout[0] as representer of the function blocks property.
|
Pin_FBcl |
getPin(java.lang.String name) |
Evin_FBcl |
getPinEvInByName(java.lang.String name) |
Evout_FBcl |
getPinEvOutByName(java.lang.String name) |
Din_FBcl |
getPinInByName(java.lang.String name)
Searches the Din pin with the given name.
|
Dout_FBcl |
getPinOutByName(java.lang.String name) |
SteptimeRef_FBcl |
getSteptime() |
java.lang.String |
getSteptimeStr() |
FBtype_FBcl |
getTypeFB() |
boolean |
isKind(java.lang.String cKinds)
Check whether the
FBtype_FBcl of this has one of the given kind. |
java.lang.Iterable<Evout_FBcl> |
iterEvout(Evin_FBcl evin) |
java.lang.Iterable<Evout_FBcl> |
iterEvout(Evin_FBcl evin,
boolean bCreate)
Iterator over all associated evout to a evin (usual one) using the
#listEvout. |
java.lang.Iterable<Pin_FBcl> |
iterPins() |
int |
ixSlice()
Returns the information about the index of the FBlock in a sliced GBlock, also important for connection data types
|
FBlock_FBcl.Blocktype |
kind()
Returns the kind of the FBlock which is determined by the kind of the
FBtype_FBcl.kind()
Hint: The kind is taken from fbt. |
boolean |
kindWhatis(java.lang.String cKinds)
Check whether the
FBtype_FBcl of this is one of the given kind. |
protected java.lang.String |
setDtypeInFBlock(int ixDTfb,
DType_FBcl.DtIxmdl dtix,
LogMessage log)
Sets or changes the DType for a pin or several pins addressed by
ixDTfb
and sets also all depending DTypes for this FBlock. |
boolean |
setSizeArray(int[] sizeArray)
This operation is called if a dout of array Dtype is connected to a din of a FBlock which is scalar
respectively has a lesser array dimension.
|
boolean |
setSliceIndex(int ixSlice,
LogMessage log)
Sets the one dimensional index of the number in the slice if the FBlock is part of a sliced GBlock.
|
int[] |
sizeArray()
Returns the information about the array properties of this FBlock
|
int |
sizeArray(int dim) |
java.lang.String |
toString() |
java.lang.String |
typeName()
Returns a proper type name for FBCL and generated code.
|
Pin_FBcl |
XXXgetConnin(Pin_FBcl.XXXXXEKind what,
int ixPin) |
Pin_FBcl |
XXXgetConnout(Pin_FBcl.XXXXXEKind what,
int ixPin) |
addGpos, name, setNamepublic static java.lang.String sVersion
protected int[] sizeArrayFB
setSliceIndex(int, LogMessage) sets a positive value to '[0]' on sliced FBlock
as index of this FBlock in the slices
setSizeArray(int[]) sets the array size as given with positive values,
but here stored as negative value as identification, it is a size.
For example [-3] describes a 1 dimensional FBlock with 3 elements.
protected int ixSlice
OdgGBlock)
Such a sliced GBlock forces more instances of FBlocks
with the dedicated names 'namex', 'namey' and 'namez' (example).
But the access to other pins can connect to an array, for example an Array of FBlocks
or an Array as data type such as 'float[3]' in the target code.
To handle such connections the FBlocks which are determined from the sliced GBlock
have an index in this field starting with 0 for the first FBlock.
Non sliced FBlocks have -1 here.
sizeArray().
Then this field has -1, except the array of FBlocks are also sliced.public final XY_FBcl graphicPos
protected FBtype_FBcl fbt
public final Module_FBcl mdl
Module_FBcl where this FBlock is member of.@Deprecated public java.lang.String[] sOperators
ProcessSlxBlocks_Slx for Gain etc.
but this should use an Expression.and hence the Expression Pins .@Deprecated public PinFbSrc_FBcl XXXfbPinSrc
OdgGBlock.fbPinDst and fbPinSrc is used!@Deprecated public PinFbDst_FBcl XXXfbPinDst
public Din_FBcl[] din
public Dout_FBcl[] dout
static Dout_FBcl[] doutempty
protected DType_FBcl.DtIxmdl[] dTypes
DType_FBcl.dtBase() is changed if the data type will be more specified.@Deprecated SteptimeRef_FBcl steptime
public Evin_FBcl[] evin
public Evout_FBcl[] evout
public PinRef_FBcl[] reference
public PinPort_FBcl[] port
private final java.util.Map<java.lang.String,Pin_FBcl> idxPins
public FBlock_FBcl(FBtype_FBcl typeFb, java.lang.String name, Module_FBcl parentModule, XY_FBcl graphicPos)
FBlock_FBcl.WriteFBtypeFb - name - graphicPos - if null then creates internally an empty one, for secondary FBlocks not found in graphic.parentModule - public boolean setSliceIndex(int ixSlice,
LogMessage log)
#sizeArrayIxSlice().
Note that all sliced GBlocks for the same FBlock representation should have the same kind of slicing,
elsewhere it is not possible using a unique indexing.
If #sizeArrayIxSlice is already set with another value, an error message occurs.
ixSlice - The number from 0 for the sliced FBlock.log - for error message.public boolean setSizeArray(int[] sizeArray)
sizeArray - public int[] sizeArray()
public int sizeArray(int dim)
public DType_FBcl dtNonArrayFB(DType_FBcl dtSrc)
public int ixSlice()
public java.lang.Iterable<Pin_FBcl> iterPins()
public Pin_FBcl getPin(java.lang.String name)
public Pin_FBcl[] din()
din as getter access.public Dout_FBcl[] dout()
dout as getter access.public Din_FBcl[] dinForeach()
din is null, the DinType_FBcl.nullist is returned, an array with length 0.public Dout_FBcl[] doutForeach()
dout is null, the DoutType_FBcl.nullist is returned, an array with length 0.public Evin_FBcl[] evin()
evin as getter access.public Evin_FBcl evin(int ix)
public Evout_FBcl[] evout()
evout as getter access.public Evout_FBcl evout(int ix)
public Pin_FBcl XXXgetConnin(Pin_FBcl.XXXXXEKind what, int ixPin)
public Pin_FBcl XXXgetConnout(Pin_FBcl.XXXXXEKind what, int ixPin)
public PinFbSrc_FBcl getFbPinSrc()
PinObj is stored in XXXfbPinSrc in the FBlock_FBcl or Clazz (via this super class).
The returned OdgGPin is stored in idxPinSrcById.
If it is existing, the existing is returned and used more as one time for a connection.fbi - The graphic FBlock_FBcl (with id and posxy)public final int getNrofConnin(Pin_FBcl.XXXXXEKind kind)
public final int getNrofConnout(Pin_FBcl.XXXXXEKind kind)
public final int getNrofEvin()
public final int getNrofEvout()
public final int getNrofDin()
public final int getNrofDout()
public Evin_FBcl getPinEvInByName(java.lang.String name)
public Evout_FBcl getPinEvOutByName(java.lang.String name)
public Dout_FBcl getPinOutByName(java.lang.String name)
public Din_FBcl getPinInByName(java.lang.String name)
name - public SteptimeRef_FBcl getSteptime()
public java.lang.String getSteptimeStr()
public DoutType_FBcl.EProps getOut1Properties()
public FBtype_FBcl getTypeFB()
public FBtype_FBcl fbt()
public FBlock_FBcl.Blocktype kind()
FBtype_FBcl.kind()
Hint: The kind is taken from fbt. FBtype_FBcl.kind()
If a FBlock instance is created, but has not a type assigned, then returns null.
This occurs if a FBlock only with the name is drawn, and later it is declared with a type.public boolean kindWhatis(java.lang.String cKinds)
FBtype_FBcl of this is one of the given kind.cKinds - Possible characters for FBlock_FBcl.Blocktype.whatispublic boolean isKind(java.lang.String cKinds)
FBtype_FBcl of this has one of the given kind.cKinds - Possible characters for FBlock_FBcl.Blocktype.descrpublic java.lang.String typeName()
fbt is not given, it returns the Block_FBcl.name of this FBlock itself, this is a special case.
fbt.
FBtype_FBcl.mdl is given, this is a FBtype which is designed in the same project.
For that situation, the FBtype_FBcl.name is the simple name of the module in the graphic
without the '%pin%' DType designations.
This is necessary to find the module, and also to reference the used non-determinisitic description of the module
in the FBcl (IEC61499) language.
Module_FBcl.sMdlType which is accessed via Module_FBcl.getMdlTypenameRaw().
This is used here.
Module_FBcl.getMdlTypename() returns sometimes the module's non deterministic DType
and sometimes the deterministic DType, because Module_FBcl#dTypesActual was set meanwhile.
This is irritating. Idea: Use the actual FBlock also as argument for Dinout_FBcl.dTypeCix(char[], int[]).
FBtype_FBcl.mdl is not given, this FBlock refers to a FBtype related to a already code generated FBtype.
For that case the FBtype_FBcl.name may contain immediately the '%pin%' designation for DType depending names.
This is used.
idxPins
DType_FBcl.sDType()
Prj_FBcl#replaceTypename(String)
and then stored in the replaced from in the internal map WriterCodegen.MdlData.idxReplaceType
for faster second access. But this is outside of this operation.
public DType_FBcl.DtIxmdl[] dTypes()
public java.lang.Iterable<Evout_FBcl> iterEvout(Evin_FBcl evin, boolean bCreate)
#listEvout.evin - Any evin of this FBlockpublic java.lang.Iterable<Evout_FBcl> iterEvout(Evin_FBcl evin)
protected java.lang.String setDtypeInFBlock(int ixDTfb,
DType_FBcl.DtIxmdl dtix,
LogMessage log)
ixDTfb
and sets also all depending DTypes for this FBlock.
This secondary operation is called from Dinout_FBcl#setDType(org.vishia.fbcl.fblock.DType_FBcl.DtIxmdl, DType_FBcl, LogMessage)
Hence it is package private
dTypes and #ixDTypeInMdl if not exists yet.
DType_FBcl on this position ixDTfb in dTypes for compatibility.
If it is not compatible then returns the error message.
If compatible or null, then sets the given dtype argument to this position and further:
dTypes array
using the FBtype_FBcl.dTypesForDependencyCorr().
FBtype_FBcl.isCompleted
Because elsewhere the information in FBtype are not definitive and hence cannot be used.ixDTfb - The place for the DType in the FBlock, determined from the DinoutType_FBcl#ixDtypedepId - dtix - The DType to set with the ixDTmdl as place for this maybe new DType in the module,
The DType is stored in dTypes() and the ixDTmdl is stored in #ixDTypeInMdl
on this ixDTfb position.log - to write a message if there are difficulties in the user's module.public java.lang.String toString()
toString in class java.lang.Object