In the course of the tutorial discipline components were created once through a mass import. Then formulas (for example to calculate a plug) were entered for the parameter values.
If a macro was changed, for example another parameter added and the discipline component synchronized with the changed macro, the parameter values were lost.
For this reason each discipline component is enclosed (encapsulated) in a mechatronic component. In the mechatronic component the same parameters are created and the formulas inserted. The parameters of the discipline components then always reference the parameters (interface parameters) of the same name of the encapsulating mechatronic components. After a synchronization you then only have to insert the references on the interface parameter again.
Creating a unit for mechatronic components
The encapsulating mechatronic components are to be created in a unit parallel to Word_Components.
- Select the T_Office_Word library.
- Select New > Unit in the shortcut menu.
- Specify the Wrapper name.
- Save the unit.
Creating mechatronic components
For each mechatronic component an encapsulating mechatronic component now has to be created.
Creating encapsulation for the discipline components
- Select the new Wrapper unit.
- From the popup menu select New > Mechatronic > Function.
- Specify the M_Body name.
- Switch to the Interfaces editor page.
- Click to open the Finder dialog.
- Click [Search].
- Select the IBody.
- Confirm with [OK].
- Drag the Body discipline component into the component editor.
- Select the installed discipline component Body.
- Mark all parameters.
- Select Add interface temperature from the popup menu.
- Save the component.
- Repeat steps 1 to 13 with the names M_Chapter with the interface IChapter and the discipline component Chapter.
- Repeat steps 1 to 13 with the names M_Row with the interface IRow and the discipline component Row.
A reference to the parameter of the superior component (capsule) by the same name is now entered as the value. These parameters were inserted into the capsule during the same step. The parameter values are entered at a later step.
Adding plugs and sockets to discipline components
To generate the Word discipline structure independent of the structure of the mechatronics, the discipline components have to be extended with plugs and sockets.
This takes place in two steps:
- Extend the discipline components with the parameters Plug and Socket.
- Extend the encapsulating mechatronic components.
Extending Plugs and Sockets to discipline components:
- Open the component Body.
- Open the Parameters editor page.
- Drag the Socket parameter from the Word.Parameter unit in the editor.
- Repeat steps 1 to 3 for the Chapter component with the Plug and Socket parameters.
- Repeat steps 1 to 3 for the Row with the parameter Plug.
Extending encapsulating mechatronic components:
- Open the component M_Body.
- Select the installed Body discipline component.
- In the editor open the popup menu of the Socket parameter.
- Select Adding interface temperature.
- Save the editor.
- Repeat steps 1 to 5 for the M_Chapter and M_Row components with the newly added Plug and Socket parameters.