Versions Compared

Key

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

...

  1. create an SVG image
  2. create a mapping file for this SVG
  3. open the mapping file in KEV
  4. create a street light controller in SCCharts
  5. simulation the controller, including visualization

...

Finally, save the result as Inkscape-SVG or Normal-SVG and name it Lights.svg.

2. Mapping animations to SVG elements

In the following a mapping of animations, domains and variables to elements in the SVG is created. Therefore one has to create a new mapping file in KIELER using File > New > Other > Mapping Model. Name the file Lights.mapping and select SVG File as Model Object.

...

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

3. Creating a Light Controller with SCChart

Create an empty SCChart and fill it with the following content:

Code Block
languagejava
titleTraffic light controller
scchart TrafficLight {

    output int showLight;

    initial state init
    --> init with / showLight += 1; showLight = showLight % 3;
}

This model will set showLight successively to 0, 1 and 2.

4. Starting the simulation


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

...