CATKBEFL2DEntity Functions

This document describes the functions you can use when creating Checks and Rules with the Engineering Rules Capture app. These Knowledge functions enable you to set/get 2D related information for functional and logical entities.

This page discusses:

Associate2DMainview

This function associates a main view to a logical component without any associated main view.

Signature

Associate2DMainview(iComponent : RFLVPMLogicalReference) : Boolean

Arguments

NameInput/OutputRequired?TypeComment
iComponentInRFLVPMLogicalReference-

ReturnType

Boolean

Example

let reference(RFLVPMLogicalReference)
let bResult(Boolean)
reference = new (“RFLVPMLogicalReference”, “RefName”, NULL)
bResult = Associate2DMainview(reference)

Associate2DMainview

This function associates a main view to a function component without any associated main view.

Signature

Associate2DMainview(iComponent : RFLPLMFunctionalReference) : Boolean

Arguments

NameInput/OutputRequired?TypeComment
iComponentInRFLPLMFunctionalReference-

ReturnType

Boolean

Example

let reference(RFLPLMFunctionalReference)
let bResult(Boolean)
reference = new (“RFLPLMFunctionalReference”, “RefName”, NULL)
bResult = Associate2DMainview(reference)

FLAttachToEditor

This function create the RFLP window and insert the created element under the corresponding node (R , F, L ot P).

Signature

FLAttachToEditor(iComponent : SysConnectable) : Boolean

Arguments

NameInput/OutputRequired?TypeComment
iComponentInSysConnectable-

ReturnType

Boolean

Example

let reference(RFLVPMLogical2DReference)
let syscon(SysConnectable)
let bResult(Boolean)
reference = new ("RFLVPMLogical2DReference","MyL2", NULL)
set  syscon= reference
Message("Root Created")
FLAttachToEditor(syscon)

FLExtract2DGraph

This function extracts the 2D graph a function or logical component into a file of EMF format.

Signature

FLExtract2DGraph(iComponent : SysConnectable, iDirectory : String, iFileName : String) : Boolean

Arguments

NameInput / OutputRequired?TypeComment
iComponentInYes

SysConnectable

or FunctionalOccurrence

or LogicalOccurrence

Reference Functional/Logical (if an instance is passed, the graph of its reference is extracted).
iDirectoryInYesString Path of the directory of the file to be generated.
iFileNameInYesString EMF File name (including extension) - I.e. MyFile.emf.

ReturnType

Boolean

TRUE if the image file is generated successfully, FALSE if not.

Example

# Assuming “FLcomp” if the function/logical component reference of interest
let FLInput (SysConnectable)
let b(Boolean)
let path(String)
let filename(String)
 set FLInput = FLcomp
set path = "C:\Images"
set filename = "Instance2DGraph.emf"
b = FLExtract2DGraph (FLInput, path, filename)

FLGet2DGraphicalProperties

This function extracts the graphical properties of a functional or logical instance/reference/connection.

Signatures

FLGet2DGraphicalProperties(iComponent : FunctionalOccurrence, ioListPropertiesNames : List, oListPropertiesValues : List) : Boolean
FLGet2DGraphicalProperties(iComponent : FunctionalOccurrence, iCnx : SysConnection, ioListPropertiesNames : List, oListPropertiesValues : List) : Boolean
FLGet2DGraphicalProperties(iComponent : FunctionalOccurrence, iPort : SysPort, ioListPropertiesNames : List, oListPropertiesValues : List) : Boolean
FLGet2DGraphicalProperties(iComponent : LogicalOccurrence, ioListPropertiesNames : List, oListPropertiesValues : List) : Boolean
FLGet2DGraphicalProperties(iComponent : LogicalOccurrence, iCnx : SysConnection, ioListPropertiesNames : List, oListPropertiesValues : List) : Boolean
FLGet2DGraphicalProperties(iComponent : LogicalOccurrence, iPort : SysPort, ioListPropertiesNames : List, oListPropertiesValues : List) : Boolean
FLGet2DGraphicalProperties(iComponent : SysConnection, ioListPropertiesNames : List, oListPropertiesValues : List) : Boolean
FLGet2DGraphicalProperties(iComponent : SysConnectable, ioListPropertiesNames : List, oListPropertiesValues : List) : Boolean
FLGet2DGraphicalProperties(iComponent : SysConnectable, iPort : SysPort, ioListPropertiesNames : List, oListPropertiesValues : List) : Boolean

Arguments

NameInput / OutputRequired?TypeComment
iComponentInYes

SysConnectable

or FunctionalOccurrence

or LogicalOccurrence

Functional/Logical Instance/reference.
iCnxInYesSysConnectionFunctional/Logical connection.
iPortInYesSysPortFunctional/Logical port.
ioListPropertiesNamesIn/OutYesListList of graphical property names you want to get. If the list is empty, all the properties are returned. See below for the list of available properties.
oListPropertiesValuesOutYesListValues of the graphical properties. See below for the list of available properties.

Available 2D Graphical Properties on Functions and Logical Components

Property name MeaningType and Value Range
Gph_BackgroundColorColor of the background

List of 4 integers (RGBA):

1st 3 values (RGB): [0;255] + 1000

4th value (transparency): [0;100]

All RGB values set to 1000 = No value (no background)

Gph_ContourLineColorColor of the outline List of 3 integer RGB [0;255]
Gph_ContourLineThickness Thickness of the outline Integer [1;55] + 1000 (no line)
Gph_ContourLineType Type of the outline (dashes) Integer [1;7] + 1000 (no line)
Gph_TitleAreaPosition Title area position 0 for bottom; 1 for Top
Gph_TitleAreaFillColorTitle area background Color

List of 4 integers (RGBA):

1st 3 values (RGB): [0;255] + 1000

4th value (transparency): [0;100]

All RGB values set to 1000 = No value (no background)

Gph_TitleAreaFontHeightTitle text font sizeInteger [3;100]
Gph_TitleAreaTextColorTitle text colorList of 3 integer RGB [0;255]
TitleAreaVisibilityTitle area visibilityBoolean. TRUE: visible. FALSE: hidden
PictureMarginSize between a function or logical component box border and its picture borderInteger [0;10]
IsVisibleObject is hidden or shownBoolean. TRUE: visible. FALSE: hidden

ReturnType

Boolean

TRUE if the properties are retrieved successfully, FALSE if not.

Example 1

# Assuming “FLcomp” is the function/logical component reference/instance of interest and FLPortA is
the port of interest
let FLInput (SysConnectable)
let FLPortInput (SysPort)
let b(Boolean)
let nameList (List)
let valueList (List)
set FLInput = FLcomp
set FLPortInput = FLPortA
b = FLGet2DGraphicalProperties (FLInput, FLPortInput, nameList, valueList) 

Example 2

# Assuming “FLcomp” if the function/logical component reference/instance of interest
let FLInput (SysConnectable)
let b(Boolean)
let nameList (List)
let valueList (List)
let RGBAValues(List)
let LineThickness (integer)
let LineColorRed (integer)
let LineColorRed (integer)
let LineColorGreen (integer)
let LineColorBlue (integer)
let i(Integer)
let name(String)
set FLInput = FLcomp
b = FLGet2DGraphicalProperties (FLInput, nameList, valueList)
 set i=1
 for i while i<= valueList->Size()
 {
set name = nameList->GetItem(i)
 if (name == "Gph_ContourLineThickness")
 {
set LineThickness = valueList->GetItem(i)
 }
if (name == "Gph_ContourLineColor")
   {
    set RGBAValues = valueList->GetItem(i)
    set LineColorRed = RGBAValues->GetItem(1)
    set LineColorGreen = RGBAValues->GetItem(2)
    set LineColorBlue = RGBAValues->GetItem(3)
   }
 }

FLGet2DPosition

This function extracts the 2D position of a functional/logical instance/reference or port.

Signatures

FLGet2DPosition(iComponent : FunctionalOccurrence, oX : Real, oY : Real) : Boolean
FLGet2DPosition(iComponent : FunctionalOccurrence, iPort : SysPort, oX : Real, oY : Real) : Boolean
FLGet2DPosition(iComponent : LogicalOccurrence, oX : Real, oY : Real) : Boolean
FLGet2DPosition(iComponent : LogicalOccurrence, iPort : SysPort, oX : Real, oY : Real) : Boolean
FLGet2DPosition(iComponent : SysConnectable, oX : Real, oY : Real) : Boolean
FLGet2DPosition(iComponent : SysConnectable, iPort : SysPort, oX : Real, oY : Real) : Boolean

Arguments

NameInput / OutputRequired?TypeComment
iComponentInYes

SysConnectable

or FunctionalOccurrence

or LogicalOccurrence

Functional/Logical Instance/reference.
iPortInYesSysPortFunctional/Logical port.
oXOutYesRealX position of the entity of interest.
oYOutYesRealY position of the entity of interest.
Note: The port position (X;Y) is expressed as a percentage of the size of its owner. For a port positioned in the middle of the left side of a function, X = 0 and Y = 0.5. A port cannot be exactly in the corners of its parent. The positions (0;0) (0;1) (1;0) and (1;1) are not available.

ReturnType

Boolean

TRUE if the position is retrieved successfully, FALSE if not.

Example 1

# Assuming “FLcomp” is the function/logical component reference/instance of interest
let FLInput (SysConnectable)
let b(Boolean)
let x (Real)
let y (Real)
set FLInput = FLcomp
b = FLGet2DPosition (FLInput, x, y)

Example 2

# Assuming “FLcomp” is the function/logical component reference/instance of interest and FLPortA is
the port of interest
let FLInput (SysConnectable)
let FLPortInput (SysPort)
let b(Boolean)
let x (Real)
let y (Real)
set FLInput = FLcomp
set FLPortInput = FLPortA
b= FLGet2DPosition (FLInput, FLPortInput, x, y)

FLGet2DSize

This function extracts the 2D size of a function/logical component instance or reference.

Signatures

FLGet2DSize(iComponent : LogicalOccurrence, oWidth : Real, oHeight : Real) : Boolean
FLGet2DSize(iComponent : FunctionalOccurrence, oWidth : Real, oHeight : Real) : Boolean
FLGet2DSize(iComponent : SysConnectable, oWidth : Real, oHeight : Real) : Boolean

Arguments

NameInput / OutputRequired?TypeComment
iComponentInYes

SysConnectable

or FunctionalOccurrence

or LogicalOccurrence

Functional/Logical Instance/reference.
oWidthOutYesRealWidth of the entity of interest.
oHeightOutYesRealHeight of the entity of interest.

ReturnType

Boolean

TRUE if the size is retrieved successfully, FALSE if not.

Example

# Assuming “FLcomp” is the function/logical component reference/instance of interest
let FLInput (SysConnectable)
let b(Boolean)
let width (Real)
let height (Real)
set FLInput = FLcomp
b = FLGet2DSize (FLInput, width, height)

FLGetMinimizedStatus

This function extracts the minimized status of a function, logical component or port.

Signatures

FLGetMinimizedStatus(iComponent : FunctionalOccurrence, oStatus : Boolean) : Boolean
FLGetMinimizedStatus(iComponent : FunctionalOccurrence, iPort : SysPort, oStatus : Boolean) : Boolean
FLGetMinimizedStatus(iComponent : LogicalOccurrence, oStatus : Boolean) : Boolean
FLGetMinimizedStatus(iComponent : LogicalOccurrence, iPort : SysPort, oStatus : Boolean) : Boolean
FLGetMinimizedStatus(iComponent : SysConnectable, oStatus : Boolean) : Boolean
FLGetMinimizedStatus(iComponent : SysConnectable, iPort : SysPort, oStatus : Boolean) : Boolean

Arguments

NameInput / OutputRequired?TypeComment
iComponentInYes

SysConnectable

or FunctionalOccurrence

or LogicalOccurrence

Functional/Logical instance or occurence.
iPortInYesSysPortFunctional/Logical port.
oStatusOutYesBooleanMinimized status (True: minimized, False: maximized).

ReturnType

Boolean

TRUE if minimized state retrieved successfully, FALSE if not.

Example 1

# Assuming "FLcomp" is the function/logical occurrence of
interest
let FLInput (FunctionalOccurrence
let b(Boolean)
let min(Boolean)
set FLInput = FLcomp
b = FLGetMinimizedStatus (FLInput, min)

Example 2

# Assuming "FLcomp" is the function/logical occurrence of
interest and "FLPort" the port of interest
let FLInput (FunctionalOccurrence)
let FLPortInput (SyspPort)
let b(Boolean)
let min(Boolean)
set FLInput = FLcomp
set FLPortInput = FLport
b = FLGetMinimizedStatus (FLInput, min)

FLGetWayPoints

This function extracts the position of the waypoints of a function or logical connection.

Signature

FLGetWayPoints(iComponent : SysConnection, oListOfX : List, oListOfY : List) : Boolean

Arguments

NameInput / OutputRequired?TypeComment
iComponentInYesSysConnectionFunctional/Logical Connection.
oListOfXOutYesListList of X position for the different waypoints.
oListOfYOutYesListList of Y position for the different waypoints.

ReturnType

Boolean

TRUE if the waypoints are retrieved successfully, FALSE if not.

Example

# Assuming “FLcnx” is the function/logical component reference/instance of interest
let FLInput (SysConnection)
let b(Boolean)
let ListX (Real)
let ListY (Real)
let i(Integer)

set FLInput = FLcnx
b = FLGetWayPoints (FLInput, ListX, ListY)

set i=1
if (ListX->Size() == ListY->Size())
{
          for i while i<= ListX->Size()
          {
                set X = ListX->GetItem(i)
                set Y = ListY->GetItem(i)

                Message("WayPt nb#: X = # and Y = #", i, X, Y)

           }
}

FLSet2DGraphicalProperties

This function sets the graphical properties of a functional or logical instance/reference/connection.

Signatures

FLSet2DGraphicalProperties(iComponent : FunctionalOccurrence, iListPropertiesNames : List, iListPropertiesValues : List) : Boolean
FLSet2DGraphicalProperties(iComponent : FunctionalOccurrence, iPort : SysPort, iListPropertiesNames : List, iListPropertiesValues : List) : Boolean
FLSet2DGraphicalProperties(iComponent : FunctionalOccurrence, iConnection : SysConnection, iListPropertiesNames : List, iListPropertiesValues : List) : Boolean
FLSet2DGraphicalProperties(iComponent : LogicalOccurrence, iListPropertiesNames : List, iListPropertiesValues : List) : Boolean
FLSet2DGraphicalProperties(iComponent : LogicalOccurrence, iPort : SysPort, iListPropertiesNames : List, iListPropertiesValues : List) : Boolean
FLSet2DGraphicalProperties(iComponent : LogicalOccurrence, iConnection : SysConnection, iListPropertiesNames : List, iListPropertiesValues : List) : Boolean
FLSet2DGraphicalProperties(iComponent : SysConnectable, iListPropertiesNames : List, iListPropertiesValues : List) : Boolean
FLSet2DGraphicalProperties(iComponent : SysConnectable, iPort : SysPort, iListPropertiesNames : List, iListPropertiesValues : List) : Boolean
FLSet2DGraphicalProperties(iComponent : SysConnection, iListPropertiesNames : List, iListPropertiesValues : List) : Boolean

Arguments

NameInput / OutputRequired?TypeComment
iComponentInYes

SysConnectable

or FunctionalOccurrence

or LogicalOccurrence

Functional/Logical Instance/reference.
iPortInYesSysPortFunctional/Logical port.
iConnectionInYesSysConnectionFunctional/Logical connection.
iListPropertiesNamesInYesListList of graphical property names you want to get. If the list is empty, all the properties are returned. See below for the list of available properties.
iListPropertiesValuesInYesListValues of the graphical properties defined in the above list.

ReturnType

Boolean

TRUE if the properties are retrieved successfully, FALSE if not.

Example 1

# Assuming “FLcomp” is the function/logical component reference/instance of interest
let FLInput (SysConnectable)
let b(Boolean)
let nameList (List)
let valueList (List)
let name (String)
let value (Integer)
let colorList (List)
set FLInput = FLcomp
set name = "Gph_ContourLineColor"
set value = 10
nameList->Append(name)
valueList->Append(value)
# Set list of colors (RGBA) as value for color attribute
set name = "Gph_BackgroundColor"
set value = 10
colorList->Append(value)
set value = 150
colorList->Append(value)
set value = 75
colorList->Append(value)
set value = 50
colorList->Append(value)
nameList->Append(name)
valueList->Append(colorList)
b = FLSet2DGraphicalProperties
(FLInput, nameList, valueList)

Example 2

# Assuming “FLcomp” is the function/logical component reference/instance of interest and FLPortA is
the port of interest
let FLInput (SysConnectable)
let FLPortInput (SysPort)
let b(Boolean)
let nameList (List)
let valueList (List)
let name (String)
let value (Integer)
set FLInput = FLcomp
set FLPortInput = FLPortA
set name ="Gph_ContourLineThickness"
set value = 10
nameList -> Append(name)
valueList -> Append(name)
# Set list of colors (RGB) as value for color attribute
set name = "Gph_ContourLineColor"
let colorList (List)
set value = 10
colorList->Append(value)
set value = 150
colorList->Append(value)
set value = 75
colorList->Append(value)
nameList->Append(name)
valueList->Append(colorList)
b = FLSet2DGraphicalProperties (FLInput, FLPortInput, nameList, valueList)

FLSet2DPosition

This function set the 2D position of a functional or logical instance/reference/port.

Signatures

FLSet2DPosition(iComponent : FunctionalOccurrence, iPort : SysPort, iX : Real, iY : Real) : Boolean
FLSet2DPosition(iComponent : FunctionalOccurrence, iX : Real, iY : Real) : Boolean
FLSet2DPosition(iComponent : LogicalOccurrence, iX : Real, iY : Real) : Boolean
FLSet2DPosition(iComponent : LogicalOccurrence, iPort : SysPort, iX : Real, iY : Real) : Boolean
FLSet2DPosition(iComponent : SysConnectable, iPort : SysPort, iX : Real, iY : Real) : Boolean
FLSet2DPosition(iComponent : SysConnectable, iX : Real, iY : Real) : Boolean

Arguments

NameInput / OutputRequired?TypeComment
iComponentInYes

SysConnectable

or FunctionalOccurrence

or LogicalOccurrence

Functional/Logical Instance/reference.
iPortInYesSysPortFunctional/Logical port.
iXInYesRealX position of the entity of interest.
iYInYesRealY position of the entity of interest.
Note: The port position (X;Y) is expressed as a percentage of the size of its owner. For a port positioned in the middle of the left side of a function, X = 0 and Y = 0.5. A port cannot be exactly in the corners of its parent. The positions (0;0) (0;1) (1;0) and (1;1) are not available. If such value is set, the port is moved along Y axis to avoid such case.

ReturnType

Boolean

TRUE if the position is retrieved successfully, FALSE if not.

Example 1

# Assuming “FLcomp” is the function/logical component reference/instance of interest
let FLInput (SysConnectable)
let b(Boolean)
let x (Real)
let y (Real)
set FLInput = FLcomp
set x = 15.5
set y = 10.2
b = FLSet2DPosition (FLInput, x, y)

Example 2

# Assuming “FLcomp” is the function/logical component reference/instance of interest and FLPortA is
the port of interest
let FLInput (SysConnectable)
let FLPortInput (SysPort)
let b(Boolean)
let x (Real)
let y (Real)
set FLInput = FLcomp
set x = 0
set y = 0.5
b = FLset2DPosition (FLInput, FLPortInput, x, y)

FLSet2DSize

This function extracts the 2D size of a function/logical component instance or reference.

Signature

FLSet2DSize(iComponent : FunctionalOccurrence, iWidth : Real, iHeight : Real) : Boolean
FLSet2DSize(iComponent : LogicalOccurrence, iWidth : Real, iHeight : Real) : Boolean
FLSet2DSize(iComponent : SysConnectable, iWidth : Real, iHeight : Real) : Boolean

Arguments

NameInput / OutputRequired?TypeComment
iComponentInYes

SysConnectable

or FunctionalOccurrence

or LogicalOccurrence

Functional/Logical Instance/reference.
iWidthInYesRealWidth of the entity of interest.
iHeightInYesRealHeight of the entity of interest.

ReturnType

Boolean

TRUE if the size is retrieved successfully, FALSE if not.

Example

# Assuming “FLcomp” is the function/logical component reference/instance of interest
let FLInput (SysConnectable)
let b(Boolean)
let width (Real)
let height (Real)
set FLInput = FLcomp
b = FLSet2DSize (FLInput, width, height)

FLSetMinimizedStatus

This function minimizes (or maximizes) a function, logical component or port.

Signatures

FLSetMinimizedStatus(iComponent : SysConnectable, iStatus : Boolean) : Boolean
FLSetMinimizedStatus(iComponent : LogicalOccurrence, iPort : SysPort, iStatus : Boolean) : Boolean
FLSetMinimizedStatus(iComponent : FunctionalOccurrence, iPort : SysPort, iStatus : Boolean) : Boolean
FLSetMinimizedStatus(iComponent : SysConnectable, iPort : SysPort, iStatus : Boolean) : Boolean
FLSetMinimizedStatus(iComponent : LogicalOccurrence, iStatus : Boolean) : Boolean
FLSetMinimizedStatus(iComponent : FunctionalOccurrence, iStatus : Boolean) : Boolean

Arguments

NameInput / OutputRequired?TypeComment
iComponentInYes

SysConnectable

or FunctionalOccurrence

or LogicalOccurrence

Functional/Logical instance or occurence.
iPortInYesSysPortFunctional/Logical port.
iStatusInYesBooleanMinimized status (True: minimized, False: maximized).

ReturnType

Boolean

TRUE if minimized state set successfully, FALSE if not.

Example 1

# Assuming "FLcomp" is the function/logical component instance
of interest
let FLInput (SysConnectable)
let b(Boolean)
let min(Boolean)
set FLInput = FLcomp
set min = true
 b = FLSetMinimizedStatus (FLInput,
min)

Example 2

# Assuming "FLcomp" is the function/logical occurrence of
interest and "FLPort" the port of interest
let FLInput (FunctionalOccurrence)
let FLPortInput (SyspPort)
let b(Boolean)
let min(Boolean)
set FLInput = FLcomp
set FLPortInput = FLport
b = FLSetMinimizedStatus (FLInput, min)

FLSetWayPoints

This function sets the number of waypoint and their position for a function or logical connection.

Signature

FLSetWayPoints(iComponent : SysConnection, iListOfX : List, iListOfY : List) : Boolean

Arguments

NameInput / OutputRequired?TypeComment
iComponentInYesSysConnectionFunctional/Logical Connection.
iListOfXInYesListList of X position for the different waypoints.
iListOfYInYesListList of Y position for the different waypoints.

ReturnType

Boolean

TRUE if the waypoints are set successfully, FALSE if not.

Example

# Assuming “FLcnx” is the function/logical component reference/instance of interest
let FLInput (SysConnection)
let b(Boolean)
let ListX (Real)
let ListY (Real)
let X(Real)
let Y(Real)

set FLInput = FLcnx
set X = 300
set Y = 200
ListX ->Append(X)
ListY ->Append(Y)
set X = 350
List Y = 250
ListX ->Append(X)
ListY ->Append(Y)
b = FLSetWayPoints (FLInput, ListX, ListY)