Hide last authors
Alexander Schulz-Rosengarten 1.1 1
2
Alexander Schulz-Rosengarten 6.1 3 {{toc maxLevel="2"/}}
Alexander Schulz-Rosengarten 1.1 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
Alexander Schulz-Rosengarten 5.1 27 This component provides an interface to affect the railway and request events.
Alexander Schulz-Rosengarten 1.1 28
Alexander Schulz-Rosengarten 5.1 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
Alexander Schulz-Rosengarten 1.1 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
Alexander Schulz-Rosengarten 3.1 33 The hostcode header contains the general documentation for any hostcode call used in the SCChart.
34
Alexander Schulz-Rosengarten 1.1 35 == Controller ==
36
37 {{noformat}}
38 controller.h defaults.h controller.c
39 {{/noformat}}
Alexander Schulz-Rosengarten 3.1 40
Alexander Schulz-Rosengarten 7.1 41 The core controller component sets up a connection to the railway, maintains an environment for the synchronous tick-function and invokes the tick-function in a loop.
42
43 Additionally some time tracking is performed to determine time consumption of the tick function and its environment.
44
45 To increase the robustness of the system the controller checks internal permissions of the SCChart-Controller against detected trains on the railway.
46
Alexander Schulz-Rosengarten 3.1 47 == State Monitor ==
48
49 {{noformat}}
Alexander Schulz-Rosengarten 4.1 50 statemonitor.h statemonitor.c
Alexander Schulz-Rosengarten 3.1 51 {{/noformat}}
Alexander Schulz-Rosengarten 4.1 52
Alexander Schulz-Rosengarten 8.1 53 The state monitor component allows a thread-safe communication between connected GUIs and the running controller. This communication is also tick-safe and
54
Alexander Schulz-Rosengarten 4.1 55 == GUI Server ==
56
57 {{noformat}}
58 guiserver.h guiserver.c
59 {{/noformat}}
Alexander Schulz-Rosengarten 5.1 60
61 = Interaction =
62
Alexander Schulz-Rosengarten 6.1 63 == GUI ==
64
65 The controller allows multiple [[doc:GUIs]] to connect and interact with the controller.
66
67 == Interrupts ==
68
Alexander Schulz-Rosengarten 5.1 69 === Quit, Pause and Cleanup ===
70
71 While running the console the following user inputs are provided by the controller:
72
73 * **CTRL+C** (SIGINT)** **quits the controller
74 * **CTRL+\** (SIGQUIT)** **cleans up
75 * **CTRL+Z **(SIGSTP) pauses and continues