<
From version < 3.1 >
edited by aas2
on 2017/04/11 23:06
To version < 4.1 >
edited by aas2
on 2017/04/11 23:38
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -30,10 +30,6 @@
30 30  
31 31  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**.
32 32  
33 -\\
34 -
35 -\\
36 -
37 37  [[image:attach:Screenshot_20170411_230005.png]]
38 38  
39 39  After hitting **Finish**, the file has to be opened using **Open With > Mapping Model Editor.**
... ... @@ -40,8 +40,52 @@
40 40  
41 41  [[image:attach:Screenshot_20170411_230257.png]]
42 42  
43 -In the editor that opens, select the **SVG File** element. If there is no Properties view open , select
39 +In the editor that opens, select the **SVG File** element. If there is not 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.
44 44  
45 -\\
41 +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**.
46 46  
47 -\\
43 +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:
44 +
45 +* Input: 0,1,2
46 +* Key: showLight
47 +* Opacity: 1,0,0
48 +
49 +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).
50 +
51 +The animation for the yellow and green circle is created analogously:
52 +
53 +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:
54 +
55 +* Input: 0,1,2
56 +* Key: showLight
57 +* Opacity: 0,1,0
58 +
59 +Add an Opacity animation to theGreenOne and set the properties to the following:
60 +
61 +* Input: 0,1,2
62 +* Key: showLight
63 +* Opacity: 0,0,1
64 +
65 +This will animate the circles according to the value of the variable showLight.
66 +
67 +Additionally, we add an SVG element with the id **theRect **and add a Colorize animation and set its properties to the following:
68 +
69 +* Input: 0,1,2
70 +* Key: showLight
71 +* Fill Color: red,yellow,green
72 +
73 +This will color the rect according to the value of showLight.
74 +
75 +Finally we add another animation to theRect, namely the Rotate animation. Its properties are set to the following:
76 +
77 +* Input: 0..2
78 +* Key: showLight
79 +* Angle Range: 0..90
80 +
81 +This will map the input values from 0 to 2 linearly to the angles from 0 to 90.
82 +
83 +== Problem Solving ==
84 +
85 +Ensure that the KEV Data Observer is added to the list in the Execution Manager (When opening an SCChart, this list might be lost.).
86 +
87 +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).
Confluence.Code.ConfluencePageClass[0]
Id
... ... @@ -1,1 +1,1 @@
1 -25952335
1 +25952337
URL
... ... @@ -1,1 +1,1 @@
1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/25952335/Simulation Visualization Tutorial
1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/25952337/Simulation Visualization Tutorial