<
From version < 3.1 >
edited by nbw
on 2014/07/05 12:02
To version < 5.1 >
edited by nbw
on 2014/07/05 12:39
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -35,3 +35,51 @@
35 35  ** **currentIndex** -an integer describing the current position in the schedule
36 36  ** **schedule** - a JSON Array of integer values, representing the station tracks in the normal encoding (Hoermann API)
37 37  * **{{status colour="Yellow" title="Need to change this to enable KH-Reverse tracks"/}}locks** - a JSON Array containing the current value of the track permissions, ordered by the default encoding (Hoermann API)
38 +
39 +{{code title="Sample status" language="js" collapse="true"}}
40 +{"msgType":"status",
41 + "data":{
42 + "debug":false,
43 + "cleanup":false,
44 + "pause":false,
45 + "trainCount":8,
46 + "trains":[
47 + {"trainNum":0, "spdSlow":40, "spdCaution":60, "spdNormal":100, "currentIndex":2, "schedule":[8, 10, 25, 29, 41, 43]},
48 + {"trainNum":1, "spdSlow":50, "spdCaution":70, "spdNormal":100, "currentIndex":0, "schedule":[8]},
49 + ... ],
50 + "locks":[-1, -1, -1, 5, -1, -1, 2, 10, -1, -1, ..., -1]}}
51 +{{/code}}
52 +
53 +== Messages received by controller ==
54 +
55 +* Every message must contain the key **command**.
56 +* Depending on the command, additional keys might be required.
57 +
58 +=== Valid commands ===
59 +
60 +* //SHUTDOWN// - Causing the controller to end the program and close all sockets
61 +* //LOGOUT// - Closing the connection, leaving the controller running
62 +* //STATUS// - Poll for the current status, should trigger a status reply message
63 +* //CLEANUP// - Start the cleanup procedure, sending the trains back to their home tacks
64 +* //DEBUG// - enable or disable verbose output, must supply additional payload
65 +** **state** - boolean value, true if verbose output should be activated
66 +* //PAUSE// - suspend or resume the controller, must supply additional payload
67 +** **state** - boolean value, true if controller should be suspended\\
68 +* //LIGHT// - activate or deactivate the lights on the railway, must supply additional payload\\
69 +** **state** - boolean value, true if lights should be lit
70 +* //WAIT// - Force a train to wait in the next station, must supply additional payload
71 +** **train** - integer train identification
72 +* //START// - Force a waiting train to immediately abort the waiting timer, must supply additional payload
73 +** **train** - integer train identification
74 +* //SCHEDULE// - Set the new schedule for a train, needs additional payload
75 +** **train** - integer train identification
76 +** **currentIndex** - current integer position in the schedule array
77 +** **tracks** - a JSON Array of integer values, representing the station tracks in the normal encoding (Hoermann API)
78 +* //{{status colour="Yellow" title="Need to change this to enable KH-Reverse tracks"/}}SPEED// - Change the speed settings of a train, needs additional payload
79 +** **train** - integer train identification
80 +** **speeds** - JSON Array with three integer values (% class="confluence-link" %)spdSlow, spdCaution, spdNormal
81 +* //TIME// - Change the waiting times for a train
82 +** **train** - integer train identification
83 +** **times** -
84 +
85 +{{status colour="Yellow" title="Define a format for this"/}}
Confluence.Code.ConfluencePageClass[0]
Id
... ... @@ -1,1 +1,1 @@
1 -9471481
1 +9471484
URL
... ... @@ -1,1 +1,1 @@
1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/SS14Railway/pages/9471481/TCP Communication
1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/SS14Railway/pages/9471484/TCP Communication