The upgrade to extension points has the advantage that during the configuration of a machine or plant only mechatronic components are involved and the data model therefore remains smaller. Only when the documents of a discipline have to be generated for the completely configured machine or plant, are the discipline components installed per import of the discipline library and update of the extension points.
Both the import as well as the update are to be triggered through actions by means of buttons of a user interface. The actions are based on a command and a SequenceSelectionAction that are created in the following steps.
Creating a command for the import of a library
- Select the T_Mechatronic_ModularSystem library.
- Select New > Unit in the shortcut menu.
- Specify the Actions name.
- Select the new Actions unit.
- Select New > Object from the popup menu.
- Click Object > Command.
- Confirm with [Finish].
- Specify the ImportLibCommand name.
- Switch to the Methods editor page.
- Click .
The New Name has to be entered in the table and the Name field.
- Specify execute as the name.
- In the drop-down list select LanguageSequence.
- In the Arguments area click on .
- The New Argument with the Engineering.Object type is entered in the table of the arguments.
- Enter root as the name.
- Enter Engineering.Root as the type.
- Repeat Steps 12 to 15 with the name libNames and the type Engineering.List.
The new arguments are entered as values for the signature of the method. It is now an execute method that requires the root node of the mechatronic and the list of the libraries to be imported as arguments.
Below a table is shown with the specification of type names, method names and method arguments.
- Click above the table.
- In the Select method dialog, click Object > Command > FrameworkCommand > ImportLibrariesCommand.
- Confirm with [Finish].
- Repeat Steps 18 to 20 with Object > Command > FrameworkCommand > SaveObjectCommand.
- Save the command.
This concludes the creation of the command for the import of a library. With this command the framework commands for the import of libraries and the subsequent saving are performed.
Creating SequenceSelectionAction for the update of extension points
- Select the Actions unit.
- Select New > Object from the popup menu.
- Click Object > Action > SelectionAction > SequenceSelectionAction.
- Confirm with [Finish].
- Specify the UpdateExtensionPointsAction name.
- Specify Update Extension Points in the Displayed Name field.
- Switch to the Methods editor page.
- Click .
- Click Object > Command > FrameworkCommand > StartFormulaCacheCommand.
- Confirm with [Finish].
- Repeat Steps 8 to 10 with Object > Command > FrameworkCommand > UpdateExtensionsCommand.
- Repeat Steps 8 to 10 with Object > Command > FrameworkCommand > StopFormulaCacheCommand.
- Repeat Steps 8 to 10 with Object > Command > FrameworkCommand > SaveObjectCommand.
- Switch to the Attributes editor page.
- Specify Component in the Selected object field.
- Save the SequenceSelectionAction.
This completes the creation of the SequenceSelectionAction for updating the extension points. With this SequenceSelectionAction the framework commands for starting the formula cache, the update of extension points, stopping the formula cache and the subsequent saving are performed consecutively.
The created actions are then linked with interfaces in a small user interface. The user interface (Form-UI) is created for the component Feeder and therefore is available directly after the creation of a project.
Creating Form-UI for Feeder
With the user interface you can not only set up the interfaces for the import of the library but you can also make the option for checking workpiece available for selection.
- Open the Feeder component.
- Change to the UI configuration editor page.
- Change to the Source tab.
- In the <form> tag specify the Feeder title and the ID feeder.
- Insert the following lines after the opening tag <form>:
<line>
<label font="Arial-20-bold">Feeder configuration</label>
</line>
<line>
<gap hSizePx="10"/>
</line>
<line>
<input receiver="=parameter('Option_Inspect_available')" type="check" ></input>
<label font="Arial-12">Add workpiece inspection</label>
</line>
<line>
<gap hSizePx="10"/>
</line>
<action name="T_Mechatronic_ModularSystem.Actions.ImportLibCommand"
arguments="=List{this.mroot.parent, List{'T_ECAD_P8'}}"
type="button"
text="Import ECAD P8 Discipline">
</action>
<action name="T_Mechatronic_ModularSystem.Actions.UpdateExtensionPointsAction"
arguments="=mroot"
type="button"
text="Update extensions">
</action>
Through the first three rows the user interface receives the Feeder configuration header.
The header is followed by three rows to create space.
Below that is a row with a check box, followed by a text. The check box influences the Option_Inspect_available parameter that amongst others is used for the Disabler of the function groups Inspect and Discard.
Three further lines follow to create space to the buttons.
This is followed by two buttons that can each perform actions.
The first button triggers the action to import the library T_ECAD_P8.
With the second button the action for updating the extension points is performed.
Setting the default value for the Option_Inspect_available parameter
The check box for the Option_Inspect_available parameter in the user interface should always have a defined state at the beginning of the configuration. In this case the check box should not be selected, so that the value is false.
- Open the Option_Inspect_available parameter.
- Switch to the Formula editor page.
- Enter false in the Value field.
- Save the parameter.
This value is now specified as the default value. As a result the Add workpiece inspection option will not be selected when opening the user interface for the first time.
See also: