aboutsummaryrefslogtreecommitdiffstats
path: root/users/dennytom/chording_engine/state_machine.dot
blob: 431e6f69b6b37bbffa2066a525fec9d91a339ddf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
digraph {
	IDLE
	READY
	ACTIVATED
	DEACTIVATED
	PRESS_FROM_ACTIVE
	FINISHED_FROM_ACTIVE
	IDLE_IN_DANCE
	READY_IN_DANCE
	FINISHED
	LOCKED
	READY_LOCKED
	RESTART
	IN_ONE_SHOT

	// common
	FINISHED -> RESTART;
	RESTART -> IDLE;
	DEACTIVATED -> IDLE_IN_DANCE;

	// kill_one_shots()
	IN_ONE_SHOT -> RESTART [label="non-one-shot key went through", color="blue"];
	
	// process_finished_dances()
	ACTIVATED -> PRESS_FROM_ACTIVE [label="dance timer", color="green"];
	IDLE_IN_DANCE -> FINISHED [label="dance timer", color="green"];
	PRESS_FROM_ACTIVE -> FINISHED_FROM_ACTIVE [label="dance timer", color="green"];

	// remove_subchords()
	READY -> IDLE [label="superchord active", color="red"];
	READY_IN_DANCE -> IDLE_IN_DANCE [label="superchord active", color="red"];
	READY_LOCKED -> LOCKED [label="superchord active", color="red"];

	// process_ready_chords()
	LOCKED -> READY_LOCKED [label="all keys pressed", color="orange"];
	IDLE -> READY [label="all keys pressed", color="orange"];
	IDLE_IN_DANCE -> READY_IN_DANCE [label="all keys pressed", color="orange"];

	READY_LOCKED -> RESTART [label="chord timer", color="orange"];
	READY -> ACTIVATED [label="chord timer", color="orange"];
	READY_IN_DANCE -> ACTIVATED [label="chord timer", color="orange"];
	ACTIVATED -> PRESS_FROM_ACTIVE [label="lock next", color="orange"];
	PRESS_FROM_ACTIVE -> LOCKED [label="lock next", color="orange"];

	// deactivate_active_chords()
	ACTIVATED -> DEACTIVATED [label="a key lifted", color="purple"];
	PRESS_FROM_ACTIVE -> RESTART [label="a key lifted", color="orange"];
	FINISHED_FROM_ACTIVE -> DEACTIVATED [label="a key lifted", color="orange"];
}