Using Libraries in Elipse E3: Lesson 8.

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.

  1. Access the scripts of the Speedometer XControl and choose the CustomConfig event:

Figure 2

  1. Write down the following script:
Sub Speedometer_CustomConfig()
'Initial speed of the Speedometer
Velocity = InputBox("Velocity:")
End Sub
  1. Save and register the Library.
  2. Access a screen where there is a Speedometer, right-click it and choose the Configure option.

Figure 3

  1. 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.

  1. Access the scripts of the MaintenanceTime XObject and choose the CustomConfig event.

Figure 5

  1. Write down the following script:
Sub MaintenanceTime_CustomConfig()
'Maximum time turned on
MaximumTime = InputBox("Maximum time of the device:")
End Sub
  1. Save and register the Library.
  2. Access a data server where there is a MaintenanceTime object, right-click it and choose the Configure option.

Figure 6

  1. 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

  1. Create a configuration window for the Level property of the XControl Bottle.
  2. Create a configuration window for the Source property of the XControl Engine.
  3. Create a configuration window for the SumDemoTag properties of the XControl.

Attachments:

LibrariesCap8.zip

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *