Changes for page Examples (sct)

Last modified by Alexander Schulz-Rosengarten on 2023/09/11 16:17

From version 11.1
edited by Alexander Schulz-Rosengarten
on 2014/08/13 11:21
Change comment: Activated SCCharts code highlighting
To version 12.1
edited by ssm
on 2015/06/23 16:55
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.als
1 +XWiki.ssm
Content
... ... @@ -2,6 +2,110 @@
2 2  
3 3  = SCCharts Examples =
4 4  
5 +A few SCCharts examples...
6 +
7 +|=(((
8 +Example
9 +)))|=(((
10 +
11 +)))|=(((
12 +SCChart  (Graphical)
13 +)))|=(% colspan="1" %)(% colspan="1" %)
14 +(((
15 +SCChart (Textual SCT)
16 +)))
17 +|(% colspan="1" %)(% colspan="1" %)
18 +(((
19 += clock =
20 +
21 +(Referenced SCCharts Example)
22 +
23 +**To enable the referenced SCCharts feature,**
24 +
25 +**activate the Xtext nature for your project!**
26 +)))|(% colspan="1" %)(% colspan="1" %)
27 +(((
28 +
29 +)))|(% colspan="1" %)(% colspan="1" %)
30 +(((
31 +[[image:attach:delay.png]]
32 +
33 +[[image:attach:emitter.png]]
34 +
35 +[[image:attach:clock2h.png]]
36 +)))|(% colspan="1" %)(% colspan="1" %)
37 +(((
38 +{{code title="shifter3.sct" language="sct"}}
39 +scchart delay {
40 + input int ticksToWait;
41 + input bool clock;
42 + int counter = 0;
43 + initial state init
44 + --> done immediate with
45 + counter >= ticksToWait
46 + --> init with
47 + clock / counter = counter + 1;
48 + final state done;
49 +}
50 +{{/code}}
51 +
52 +{{code title="shifter3.sct" language="sct"}}
53 +scchart emitter {
54 + input bool clock;
55 + input bool delay;
56 + output bool emit = false;
57 + initial state wait
58 + references delay
59 + bind clock to clock,
60 + ticksToWait to delay
61 + >-> emit;
62 +
63 + state emit {
64 + entry / emit = true;
65 + exit / emit = false;
66 + }
67 + --> wait;
68 +}
69 +{{/code}}
70 +
71 +{{code title="shifter3.sct" language="sct"}}
72 +scchart clock {
73 + input bool msClock;
74 + output bool second;
75 + output bool minute;
76 + output bool hour;
77 + const int SEC = 1000;
78 + const int MIN = 60;
79 + const int HOUR = 60;
80 + region seconds:
81 + initial state seconds
82 + references emitter
83 + bind clock to msClock,
84 + metrum to SEC,
85 + emit to second
86 + >-> seconds;
87 +
88 + region minutes:
89 + initial state minutes
90 + references emitter
91 + bind clock to second,
92 + metrum to MIN,
93 + emit to minute
94 + >-> minutes;
95 +
96 + region hours:
97 + initial state hours
98 + references emitter
99 + bind clock to minute,
100 + metrum to HOUR,
101 + emit to hour
102 + >-> hours;
103 +}
104 +{{/code}}
105 +)))
106 +
107 += SCCharts Evaluation Examples =
108 +
5 5  In the following, you find some examples used for evaluation. Be advised that there currently is no tool integrated evaluation possible. Please refer to the SCCharts superpage for the [[project status>>doc:SCCharts]] and [[known limitations>>doc:SCCharts]]. You may use our [[online compiler>>doc:Online Compiler]] or the [[command line compiler >>doc:Command Line Compiler]]to play around with the following SCCharts. On the right side you'll find the textual SCChart (SCT) description, on the left side you see the equivalent synthesized SCChart diagram for it. You can use our [[online SCChart synthesis>>doc:Command Line Rendering]] for rendering SCCharts diagrams from textual SCCharts descriptions.
6 6  
7 7  |=(((
Confluence.Code.ConfluencePageClass[0]
Id
... ... @@ -1,1 +1,1 @@
1 -12288417
1 +16810196
URL
... ... @@ -1,1 +1,1 @@
1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/12288417/Examples
1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/16810196/Examples