Debian Codegraph @

client/client.dot

raw
1 digraph g {
2 // both "neato" and "dot" produce reasonable & interesting outputs
3 graph [rankdir=LR size="20,15" overlap="scale" splines="true"]
4 node [fontname="Mono" fontsize=12 margin=0]
5 edge [fontname="Mono" fontsize=10 decorate=true]
6
7 // states
8 node []
9 "INIT" [shape=doublecircle]
10 "Error" [shape=doublecircle color="#990000"]
11 "Configured"
12 "Identified"
13 "SysBusOK" [label="System\nBus\nGO"]
14 "Waiting4Conn" [label="Waiting\nfor\nConnectivity"]
15 "Connected" [label="Network\nConnected"]
16 "SesBusOK" [label="Session\nBus\nGO"]
17 "Running"
18 "Notified"
19 "Shown" [label="Notification\nShown"]
20 "Clicked"
21
22 // auto-transitions
23 node [shape=triangle]
24 "read config" [label="read\nconfig"]
25 "get system id" [label="get\nsystem\nid"]
26 "conn sys bus" [label="connect\nsystem\nbus"]
27 "watch conn" [label="watch\nconnectivity"]
28 "conn ses bus" [label="connect\nsession\nbus"]
29 "start session" [label="start\npush\nsession"]
30 "show notification" [label="show\nnotification"]
31 "dispatch URL" [label="dispatch\nURL"]
32
33 //
34 "INIT" -> "read config"
35 "Configured" -> "get system id"
36 "Identified" -> { "conn sys bus" "conn ses bus" }
37 "SysBusOK" -> "watch conn"
38 "Connected" -> "start session"
39 "Notified" -> "show notification"
40 "Clicked" -> "dispatch URL" -> "SesBusOK"
41 "Shown" -> "SesBusOK" // XXX state:state auto-transition?
42
43 // events
44 edge [color="#000099"]
45 "Waiting4Conn" -> "Connected" [label="connected"]
46 "Waiting4Conn" -> "Waiting4Conn" [label="disconnected"]
47 "SesBusOK" -> "Notified" [label="notification\narrived"]
48 "SesBusOK" -> "Clicked" [label="user\nclicked\nnotification"]
49
50 { "Connected" "Running" } -> "Waiting4Conn" [constraint=false label="disconnected"]
51 "Running" -> "SesBusOK" [constraint=false style=dotted label=notification]
52 "Shown" -> "Running" [constraint=false style=dotted label=shown]
53
54 // OKs
55 edge [color="#009900" label="OK"]
56 "read config" -> "Configured"
57 "get system id" -> "Identified"
58 "conn sys bus" -> "SysBusOK"
59 "conn ses bus" -> "SesBusOK"
60 "watch conn" -> "Waiting4Conn"
61 "start session" -> "Running"
62 "show notification" -> "Shown"
63
64 //err
65 edge [color="#990000" label="err" constraint=false]
66 { "read config"
67 "get system id"
68 } -> Error
69 "conn ses bus" -> "conn ses bus"
70 "conn sys bus" -> "conn sys bus"
71 "watch conn" -> "conn sys bus"
72 "start session" -> "start session"
73 }