CustomConfig
The CustomConfig resource, available from Elipse E3 3.2 on, which allows creating Configuration Wizards for instances of an ElipseX object inside E3 Studio.
A configuration option is always displayed in the menu of the ElipseX instances (XControl and XObject) when there is a script linked to the CustomConfig event.
The text displayed in the menu option can be informed in the CustomConfigText property of the Library object definition. If this property is empty, a text “Configure” is displayed.
Figure 1
Let’s create an example of using CustomConfig in an XControl and an XObject.
XControl
The Speedometer is an XControl developed in a previous chapter which has a property named Velocity. Let’s configure it so that when choosing the Configure option, an edit box is displayed to type the initial speed of the object.
- Access the scripts of the Speedometer XControl and choose the CustomConfig event:
Figure 2
- Write down the following script:
Sub Speedometer_CustomConfig() 'Initial speed of the Speedometer Velocity = InputBox("Velocity:") End Sub
- Save and register the Library.
- Access a screen where there is a Speedometer, right-click it and choose the Configure option.
Figure 3
- In the open window, type a value for the speed and check if the object assumes that value.
Figure 4
XObject
MaintenanceTime is an XObject developed in a previous chapter which has the following properties: OnOff, OnTime, and MaximumTime. Let’s configure it so that when choosing the Configure option, an edit box is displayed to type the initial MaximumTime of the object.
- Access the scripts of the MaintenanceTime XObject and choose the CustomConfig event.
Figure 5
- Write down the following script:
Sub MaintenanceTime_CustomConfig() 'Maximum time turned on MaximumTime = InputBox("Maximum time of the device:") End Sub
- Save and register the Library.
- Access a data server where there is a MaintenanceTime object, right-click it and choose the Configure option.
Figure 6
- In the open window, type a value for the maximum time of the device and check if the object assumes that value.
Figure 7
Exercises
- Create a configuration window for the Level property of the XControl
Bottle
. - Create a configuration window for the Source property of the XControl
Engine
. - Create a configuration window for the
SumDemoTag
properties of the XControl.