public class FBexpr_FBcl extends FBlock_FBcl
FBlock_FBcl.Blocktype, FBlock_FBcl.WriteFB
Modifier and Type | Field and Description |
---|---|
private char |
cAccess
A char determining the kind of access to this FBexpr:
'~' it is inline in a expression term with only one output
'&' it is inline in an expression term but with some additional outputs necessary as call by reference in C/++.
|
private char |
cOp
A char determining the basic function of the expression.
|
int |
nrBitTrueFalse
The bit number used in the module's event mask to set result true and false if it is an
StdLibFBlocks_FBcl.fbtExprEv_OFB
-1 if not used. |
private java.lang.String |
sFn
A more complex function given as String, null if not used.
|
din, dout, doutempty, dTypes, evin, evout, fbPinDst, fbPinSrc, fbt, graphicPos, idxPins, name, port, reference, sizeArrayIxSlice, sOperators, steptime, sVersion
Constructor and Description |
---|
FBexpr_FBcl(FBtype_FBcl typeFb,
java.lang.String name,
Module_FBcl parentModule,
XY_FBcl graphicPos) |
Modifier and Type | Method and Description |
---|---|
void |
adjustFBexrFnDtypes()
Adjust the type designations in
sFn for all expressions due to the propagated read pin types. |
char |
cAccess()
Returns the kind of access, see
cAccess |
char |
cOp() |
char |
getAccess() |
java.lang.String |
getFunction() |
char |
getOperation() |
java.lang.Iterable<DinExpr_FBcl> |
iterDinExpr()
Returns an container which contains only the value inputs of this expression.
|
boolean |
setAccess(char cAccess)
Set the
cAccess() . |
void |
setExprPinFromPinsExprFn()
Sets the din[0] with name "expr" content to the
Din_FBcl.sConstant
from the values on all pins on Dinout_FBcl#sOperator and the sFn ,
as it was read before with #setOperatorToPins() and maybe after adjustment written back. |
boolean |
setFunction(java.lang.String sFn) |
boolean |
setOperation(char cOp)
Set the
cOp() . |
void |
setOperatorToPins(Prj_FBCLrd prj)
Prepares the
DinExpr_FBcl.sOperator in that kind which is proper for code generation
following the expression term stored as constant on the first input with name 'expr'. |
din, dinForeach, dout, doutForeach, dtypes, evin, evin, evout, evout, fbt, getFbPinSrc, getNrofConnin, getNrofConnout, getNrofDin, getNrofDout, getNrofEvin, getNrofEvout, getOut1Properties, getPin, getPinEvInByName, getPinEvOutByName, getPinInByName, getPinOutByName, getSteptime, getSteptimeStr, getTypeFB, isKind, iterEvout, iterEvout, iterPins, ixSlice, kind, kindWhatis, name, setDtype, setName, setSizeArray, setSliceIndex, sizeArray, sizeArrayIxSlice, toString, typeName, XXXgetConnin, XXXgetConnout
private java.lang.String sFn
private char cOp
sFn
is set by a text in the expression graphic frame itself. It can be a function or a free expression text.
If the expression contains also an aggregation it is used in the expression generation TODO in a special way not implemented yet. 2024-03
DinExpr_FBcl.sOperator
contains the name of the element to set.
The expression should have unconditionally an output variable of the proper type.
DinExpr_FBcl.sOperator
contains the access text.
Dout_FBcl
determines the access.
The Dout_FBcl
is one of maybe more members of the FBexpr_FBcl
based on FBlock_FBcl.dout
respectively Write_FBlock_FBwr.idxDout
setOperation(char)
to see under which condition it is set.private char cAccess
public int nrBitTrueFalse
StdLibFBlocks_FBcl.fbtExprEv_OFB
-1 if not used.public FBexpr_FBcl(FBtype_FBcl typeFb, java.lang.String name, Module_FBcl parentModule, XY_FBcl graphicPos)
public boolean setOperation(char cOp)
cOp
- public char cOp()
public char getOperation()
public boolean setAccess(char cAccess)
cOp
- public char cAccess()
cAccess
public char getAccess()
public boolean setFunction(java.lang.String sFn)
public java.lang.String getFunction()
public java.lang.Iterable<DinExpr_FBcl> iterDinExpr()
DinExpr_FBcl.pinK
.
This is for code generation from the inputs.public void setOperatorToPins(Prj_FBCLrd prj)
DinExpr_FBcl.sOperator
in that kind which is proper for code generation
following the expression term stored as constant on the first input with name 'expr'.
For example a first "*" is removed in a multiplication term and a first "/" is replaced by "1/" to force a division.
The form for code generation is always: An expression has operators only between its operands, not on first position.
Only for ADD a "+" or "-" is admissible, it is a unary operator for the expression.
See alsoprj
- public void setExprPinFromPinsExprFn()
Din_FBcl.sConstant
from the values on all pins on Dinout_FBcl#sOperator
and the sFn
,
as it was read before with #setOperatorToPins()
and maybe after adjustment written back.
The value on din[0] for Din_FBcl.sConstant
is important for write out in IEC61499.
The operation setOperatorToPins(Prj_FBCLrd)
is the backward operation,
if 'expr' was read from fbd file in IEC61499 coding.
For internal use the values on Dinout_FBcl#sOperator
and the sFn
are relevant.
OdgModule.createExprPins(org.vishia.fbcl.readOdg.OdgGBlock)
.public void adjustFBexrFnDtypes()
sFn
for all expressions due to the propagated read pin types.
#fb
instanceof FBexpr_FBcl
sFn
- already read from the original