Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In the editor that opens, select the SVG File element. If there is no Properties view open , selectnot yet a Properties View open in your workbench, select Window > Show View > Other > General > Properties. This view works together with the Mapping Model Editor, such that the fields of elements can be manipulated.

Set the saved Lights.svg as property Filename of the SVG File element. Afterwards new children of the SVG File can be created. These represent the elements in the SVG file, which should be animated. Right click on the SVG File element and select New Child > SVG Element. Set the id of this element in the properties view to theRedOne.

This element can have any number of animations. In this tutorial, we will add an Opacity animation and configure it, such that it will be visible or invisible, depending on the value of a variable named showLight. Therefore we right click on the element, select New Child > Opacity and set its properties in the Property View to the following:

  • Input: 0,1,2
  • Key: showLight
  • Opacity: 1,0,0

This will map the input values 0, 1 and 2 of a variable showLight to the opacity values 1, 0 and 0 of the element in the SVG image (showLight = 0 → opacity = 1, showLight = 1 →opacity = 0, and so on).

The animation for the yellow and green circle is created analogously:

Create SVG Elements and set the id to theYellowOne and theGreenOne respectively. Add an Opacity animation to theYellowOne and set the properties to the following:

  • Input: 0,1,2
  • Key: showLight
  • Opacity: 0,1,0

Add an Opacity animation to theGreenOne and set the properties to the following:

  • Input: 0,1,2
  • Key: showLight
  • Opacity: 0,0,1

This will animate the circles according to the value of the variable showLight.

Additionally, we add an SVG element with the id theRect and add a Colorize animation and set its properties to the following:

  • Input: 0,1,2
  • Key: showLight
  • Fill Color: red,yellow,green

This will color the rect according to the value of showLight.

Finally we add another animation to theRect, namely the Rotate animation. Its properties are set to the following:

  • Input: 0..2
  • Key: showLight
  • Angle Range: 0..90

This will map the input values from 0 to 2 linearly to the angles from 0 to 90.

Problem Solving

Ensure that the KEV Data Observer is added to the list in the Execution Manager (When opening an SCChart, this list might be lost.).

Ensure that the KEV view has been (re-)loaded with the correct mapping file (saving the file on disk does not reload it in the KEV View automatically).