Interfaces package includes the connectors and interfaces of the interactive graphic elements. These packages contain classes describing the interactive graphic elements and the base classes of these elements. There are four type of connectors. The following information about each connector is shown in Figure 1: name, icon, terminal variables and interfaces that include instances of the connector.
The ParentL and ChildL connectors have the following pair of variables: nodeReference and BorderLayout. The nodeReference variable is an integer number that identifies one of the interactive graphic elements of the class describing the virtual-lab view. The BorderLayout variable is a boolean variable. The value of this variable is true only if the component identified by the nodeReference variable of this connector has the layout policy BorderLayout.
The Parent and Child connectors have the following variable: nodeReference. The meaning of this variable is the same as the nodeReference variable of the ParentL and ChildL connectors.
The interfaces included in the Interfaces package are the following: IContainer, IContainerDrawables, IDrawables and IViewElements.
The description of these four interfaces includes the declaration of an integer variable named num. The value of this variable, which is obtained during the model initialization process, identifies one of the interactive graphic elements of the Modelica view description.
Name | Description |
---|---|
![]() | Connector of drawables components - Parent information |
![]() | Connector of drawables components |
![]() | Connector of non drawable components - Parent information |
![]() | Connector of non drawable components |
![]() | Interfaces of the classes describing containers that can't host drawable elements |
![]() | Interfaces of the classes describing containers that only can host drawable elements |
![]() | Interfaces of the classes describing drawable elements |
![]() | Interfaces of the classes describing interactive elements |
Type | Name | Description |
---|---|---|
Integer | nodeReference | Number identifying the component hosting the element |
connector Parent "Connector of drawables components - Parent information" Integer nodeReference "Number identifying the component hosting the element"; end Parent;
Type | Name | Description |
---|---|---|
Integer | nodeReference | Number of a container that host drawables |
connector Child "Connector of drawables components" Integer nodeReference "Number of a container that host drawables"; end Child;
Type | Name | Description |
---|---|---|
Integer | nodeReference | Number identifying the component hosting the element |
Boolean | borderLayout | True if the component hosting the element has the BorderLayout layout policy |
connector ParentL "Connector of non drawable components - Parent information" Integer nodeReference "Number identifying the component hosting the element"; Boolean borderLayout "True if the component hosting the element has the BorderLayout layout policy"; end ParentL;
Type | Name | Description |
---|---|---|
Integer | nodeReference | Number identifying the component |
Boolean | borderLayout | True if the component has the BorderLayout layout policy |
connector ChildL "Connector of non drawable components" Integer nodeReference "Number identifying the component"; Boolean borderLayout "True if the component has the BorderLayout layout policy"; end ChildL;
The IContainer interface is inherited from classes describing containers that don't host drawable elements.
It contains the following two connectors on one side (''left'' connectors): pLLeft and cLLeft. And it contains the following connector on the other side (''right'' connector): cLRight. This interface includes the definition of a String parameter, named LayoutPolicy. The value of this parameter sets the layout policy of the container (i.e. BorderLayout(), HorizontalBox(), VerticalBox(), GridLayout or FlowLayout).
According to the connection rules, only a component hosted inside the container with this interface should be connected to the ''right'' connector. The ''right'' connector transmit the two following variables:According to the connection rules, only the container hosting the container with this interface or a component hosted inside the same container should be connected to its pLLeft connector. And only a component hosted inside the same container should be connected to its cLLeft connector. The variables nodeReference and borderLayout of the cLLeft connector have the same value than the variables with the same name of the pLLeft connector.
Type | Name | Default | Description |
---|---|---|---|
LayoutPolicy | LayoutPolicy | "BorderLayout()" | Layout policy |
Type | Name | Description |
---|---|---|
ParentL | pLLeft | Connector of non drawable components - Parent information |
ChildL | cLRight | Connector of non drawable components - Child information |
ChildL | cLLeft | Connector of non drawable components - Parent information |
partial model IContainer "Interfaces of the classes describing containers that can't host drawable elements" import Modelica.Utilities.*; Interfaces.ParentL pLLeft "Connector of non drawable components - Parent information"; Interfaces.ChildL cLRight "Connector of non drawable components - Child information"; Interfaces.ChildL cLLeft "Connector of non drawable components - Parent information"; parameter TypesDef.LayoutPolicy LayoutPolicy = "BorderLayout()" "Layout policy"; protected Integer num "Number identifying the component in the virtual-lab view description"; initial algorithm cLRight.nodeReference :=num; cLRight.borderLayout :=if (Strings.compare(LayoutPolicy, "BorderLayout()") == Types.Compare.Equal) then true else false; cLLeft.nodeReference :=pLLeft.nodeReference; cLLeft.borderLayout :=pLLeft.borderLayout; equation when false then num = pre(num); cLRight.nodeReference = pre(cLRight.nodeReference); cLRight.borderLayout = pre(cLRight.borderLayout); cLLeft.nodeReference = pre(cLLeft.nodeReference); cLLeft.borderLayout = pre(cLLeft.borderLayout); end when; end IContainer;
The IContainerDrawable interface is inherited from classes describing containers that host drawable elements.
It contains the following two connectors on one side (''left'' connectors): pLLeft and cLLeft. And it contains the following connector on the other side (''right'' connector): cRight.
According to the connection rules, only a component hosted inside the container with this interface should be connected to the ''right'' connector. The ''right'' connector transmit the following variables:
According to the connection rules, only the container hosting the container with this interface or a component hosted inside the same container should be connected to its pLLeft connector. And only a component hosted inside the same container should be connected to its cLLeft connector. The variables nodeReference and borderLayout of the cLLeft connector have the same value than the variables with the same name of the pLLeft connector.
Type | Name | Description |
---|---|---|
ParentL | pLLeft | Connector of non drawable components - Parent information |
ChildL | cLLeft | Connector of non drawable components - Parent information |
Child | cRight | Connector of drawable components - Child information |
partial model IContainerDrawables "Interfaces of the classes describing containers that only can host drawable elements" import Modelica.Utilities.*; import Modelica.Utilities.*; Interfaces.ParentL pLLeft "Connector of non drawable components - Parent information"; Interfaces.ChildL cLLeft "Connector of non drawable components - Parent information"; Interfaces.Child cRight "Connector of drawable components - Child information"; protected Integer num "Number identifying the component in the virtual-lab view description"; initial algorithm cRight.nodeReference :=num; cLLeft.nodeReference :=pLLeft.nodeReference; cLLeft.borderLayout :=pLLeft.borderLayout; equation when false then num = pre(num); cRight.nodeReference = pre(cRight.nodeReference); cLLeft.nodeReference = pre(cLLeft.nodeReference); cLLeft.borderLayout = pre(cLLeft.borderLayout); end when; end IContainerDrawables;
The IDrawable interface is inherited from classes describing drawable elements. It contains the following two ''left'' connectors: pLeft and cLeft.
According to the connection rules, only the container hosting the drawable with this interface or a drawable element hosted inside the same container should be connected to its pLeft connector. And only a drawable element hosted inside the same container should be connected to its cLeft connector. The variable nodeReference of the cLeft connector has the same value than the variable nodeReference of the pLeft connector.
Type | Name | Description |
---|---|---|
Parent | pLeft | Connector of drawable components |
Child | cLeft | Connector of drawable components |
partial model IDrawable "Interfaces of the classes describing drawable elements" import Modelica.Utilities.*; import Modelica.Utilities.*; Interfaces.Parent pLeft "Connector of drawable components "; Interfaces.Child cLeft "Connector of drawable components "; protected Integer num "Number identifying the component in the virtual-lab view description"; Integer dummy; initial algorithm cLeft.nodeReference :=pLeft.nodeReference; dummy :=num; equation when false then num = pre(num); dummy = pre(dummy); cLeft.nodeReference = pre(cLeft.nodeReference); end when; end IDrawable;
The IViewElement interface is inherited from classes describing basic and interactive elements. It contains the following two ''left'' connectors: pLLeft and cLLeft.
According to the connection rules, only the container hosting the element with this interface or an element hosted inside the same container should be connected to its pLLeft connector. And only an element hosted inside the same container should be connected to its cLLeft connector. The variable nodeReference and borderLayout of the cLeft connector has the same value than the variable nodeReference and borderLayout of the pLLeft connector.
Type | Name | Description |
---|---|---|
ParentL | pLLeft | Connector of non drawable components |
ChildL | cLLeft | Connector of non drawable components |
model IViewElement "Interfaces of the classes describing interactive elements" import Modelica.Utilities.*; import Modelica.Utilities.*; Interfaces.ParentL pLLeft "Connector of non drawable components "; Interfaces.ChildL cLLeft "Connector of non drawable components "; protected Integer num "Number identifying the component in the virtual-lab view description"; Integer dummy; initial algorithm cLLeft.nodeReference :=pLLeft.nodeReference; cLLeft.borderLayout :=pLLeft.borderLayout; dummy := num; equation when false then num = pre(num); dummy = pre(dummy); cLLeft.nodeReference = pre(cLLeft.nodeReference); cLLeft.borderLayout = pre(cLLeft.borderLayout); end when; end IViewElement;