Skip to content
Menu
Menu

Knowledge Base

KB050117 | DYNAMIC ELEMENTS IN THE ELVIS OPERATOR STATION

KB050117 | DYNAMIC ELEMENTS IN THE ELVIS OPERATOR STATION

Product: Elvis
Version: from 2.0 (example project created with 2.3)
Booth: 2005-01-18

Summary

Here you will find information and downloads for graphical elements that are moved or changed by the event processing of the operator station.

Attention: No control elements are changed here, but “normal” graphical elements such as lines or polygons. So this area is not intended for solving standard tasks or even for a beginner in Elvis, but for the Elvis professionals or for programmers who want to bring even more dynamism to the pages.

Details

General
Attunement

Download the small dynamic.zip project, open the “blind” page in the configuration and play with the slider (user mode!). The “polygon” page also contains an interesting effect.

A nice touch? You want to know how it works? Read on!

Access to graphic elements

All properties of graphical elements can be changed via the event processing of the operator station – yes, really!
Initially, the difficulty lies only in the access to the element. Unfortunately, the elements do not have a name (such as the control elements). However, all elements have a data point name (DatapointName). [Bitte keine Kommentare dazu – ich kann das auch nicht nachvollziehen.]
We can make good use of the data point name.
Unfortunately, there is no user interface for setting or changing this data point name for the graphical elements (is not included in the properties dialog). Workaround: we use a small macro to give the element a data point name. With that, we have already cleared all the hurdles for access!

Dynamically change the fill type of a polygon
set_dpname

The macro sets the data point name for a selected graphical element (e.g. a polygon). It has a fairly simple structure. The program actually contains only two interesting lines:
Here, the object “Element” is set to the selected element of the drawing:
Set Element = Drawing.ActiveElement

and here the data point name from the dialog is stored in the “DatapointName” property of the element:
Element.DatapointName = dlg.ctlDatapointName

RTEmagicC 2b7e9b0a11.jpg

Download set_dpname.idm

Change the fill type of a polygon using data point values

If you want to set the fill effect of polygons over data point values, there are some events to process. Here you will find a small example that sets the fill effect via data point values and is thus better adapted to the use in a project.

Download dynamic_dp.zip

Event Processing

Now let’s change the graphic element. To do this, we must first find it on a page and then modify one or more of its properties. In order for us to be able to find an element, it has been given a data point name (see above).
Finding should be as fast as possible. That’s why it’s good if we don’t have to do the search in the whole document (i.e. in all layers), but can limit ourselves to one layer. Of course, if there are only a few elements in this layer, the search will be even faster.
Conclusion: We use a separate layer for our dynamic elements. We call this layer “dynamics” (of course, any other name can be used – this must of course be taken into account in event processing).

In order to keep the event processing clear, we use a subroutine that we put in the global area of the form. The subroutine should be called “SetFillStyle” because we use it to switch the fill of the element between filled and unfilled. It has two parameters: the data point name and the value. The subroutine finds all elements of the Dynamic layer whose data point name matches the passed name and sets their FillStyle to 1 if the value is not null, otherwise the FillStyle is set to 0.

RTEmagicC fb3d4df7b2.jpg

The program is included in the sample project (polygon page).

Increase: Rotate line

If we have understood the fundamentals of changing properties of graphical elements (polygon), we can venture into a somewhat larger task.
The slat position of blinds can be graphically represented by lines. The coordinates of the lines must be calculated for the respective control value. The mathematical basics are included on the “blind” page.

The peculiarity of the solution is the storage of the coordinates of the center. This is necessary so that the line is always drawn in one and the same place and retains its position even after many calculations. In addition, the length of the line is also saved. Because there are no properties for this data, the coordinates of the center and longitude are stored together in the HistoryName property. That’s a bit of a messy use of this property. However, since the property is meaningless for graphic elements, we shouldn’t have any problems with it.

set_blind

To make it easy to set the data point name, midpoint, and longitude, I’ve provided a small macro here as well:

Download set_blind.idm

Event Processing

For event processing, we again use a subroutine (“blind”). In principle, the program is structured as above (SetFillStyle), but now the data from the HistoryName is also used to calculate and reset the coordinates of the line.

RTEmagicC 82f7f35a81.jpg

You shouldn’t have any trouble transferring the examples to the use of data point values. If there are any questions here, please contact the webmaster.

set_blinds

Here’s an increase in the whole thing! The macro set_blinds automatically generates the slats (lines) and connects them to the data point.

RTEmagicC 42b2967afc.jpg

The result then looks like this, for example:

RTEmagicC b1c1e5734e.jpg

Download dyn.zip

Support Area

KB050117 | DYNAMIC ELEMENTS IN THE ELVIS OPERATOR STATION

Knowledge Base

Here you will find answers, solutions to problems and examples of our products.
KB050117 | DYNAMIC ELEMENTS IN THE ELVIS OPERATOR STATION

Case Studies

Successful in use: practical examples of our products and individual developments.
KB050117 | DYNAMIC ELEMENTS IN THE ELVIS OPERATOR STATION

Support

Describe your concern using our support form.
KB050117 | DYNAMIC ELEMENTS IN THE ELVIS OPERATOR STATION

License registration

Register your Elvis license!

IT GmbH · An der Kaufleite 12 · D-90562 Kalchreuth

© Copyright 2024. IT GmbH | Webdesign by Appear Online