Wiki source code of C Controller
Version 5.1 by Alexander Schulz-Rosengarten on 2014/08/20 11:08
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | |||
2 | |||
3 | {{toc/}} | ||
4 | |||
5 | = Components = | ||
6 | |||
7 | The component diagram below shows the architecture of generated and created Railway Controller. | ||
8 | |||
9 | [[image:attach:components.png]] | ||
10 | |||
11 | == SCCharts Contoroller == | ||
12 | |||
13 | {{noformat}} | ||
14 | scccontroller.h <compiled-sccchart>.c | ||
15 | {{/noformat}} | ||
16 | |||
17 | This component is the compiled Controller-SCChart. | ||
18 | |||
19 | The interface offers an the sequential synchronous tick function and additionally access to some internal variables to determine the internal state of the SCChart during execution. Furthermore the component uses the provided hostcode-interface to control the railway. | ||
20 | |||
21 | == Hostcode == | ||
22 | |||
23 | {{noformat}} | ||
24 | hostcode.h hostcode.c | ||
25 | {{/noformat}} | ||
26 | |||
27 | This component provides an interface to affect the railway and request events. | ||
28 | |||
29 | The interface provides shorter and simpler access to most of the railway API. To prevent conflicts with existing function names all functions in our interface are prefixed with //rail//. | ||
30 | |||
31 | Most controls and requests are forwarded to the controller maintaining the synchronous environment of the tick-function. Some controls which do not require this maintenance are directly forwarded to the railway API. | ||
32 | |||
33 | The hostcode header contains the general documentation for any hostcode call used in the SCChart. | ||
34 | |||
35 | == Controller == | ||
36 | |||
37 | {{noformat}} | ||
38 | controller.h defaults.h controller.c | ||
39 | {{/noformat}} | ||
40 | |||
41 | == State Monitor == | ||
42 | |||
43 | {{noformat}} | ||
44 | statemonitor.h statemonitor.c | ||
45 | {{/noformat}} | ||
46 | |||
47 | == GUI Server == | ||
48 | |||
49 | {{noformat}} | ||
50 | guiserver.h guiserver.c | ||
51 | {{/noformat}} | ||
52 | |||
53 | = Interaction = | ||
54 | |||
55 | === Quit, Pause and Cleanup === | ||
56 | |||
57 | While running the console the following user inputs are provided by the controller: | ||
58 | |||
59 | * **CTRL+C** (SIGINT)** **quits the controller | ||
60 | * **CTRL+\** (SIGQUIT)** **cleans up | ||
61 | * **CTRL+Z **(SIGSTP) pauses and continues |