forked from svl-rr/svl-signal-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
enums.py
51 lines (42 loc) · 1.77 KB
/
enums.py
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
50
51
TURNOUT_THROWN = 'TURNOUT_THROWN'
TURNOUT_CLOSED = 'TURNOUT_CLOSED'
TURNOUT_UNKNOWN = 'TURNOUT_UNKNOWN'
SENSOR_ACTIVE = 'SENSOR_ACTIVE'
SENSOR_INACTIVE = 'SENSOR_INACTIVE'
SENSOR_UNKNOWN = 'SENSOR_UNKNOWN'
SIGNAL_CLEAR = 'SIGNAL_CLEAR'
SIGNAL_ADVANCE_APPROACH = 'SIGNAL_ADVANCE_APPROACH'
SIGNAL_APPROACH = 'SIGNAL_APPROACH'
# Used to slow a train for an upcoming DIVERGING_CLEAR.
SIGNAL_APPROACH_CLEAR_SIXTY = 'SIGNAL_APPROACH_CLEAR_SIXTY'
SIGNAL_APPROACH_CLEAR_FIFTY = 'SIGNAL_APPROACH_CLEAR_FIFTY'
SIGNAL_APPROACH_DIVERGING = 'SIGNAL_APPROACH_DIVERGING'
SIGNAL_APPROACH_RESTRICTING = 'SIGNAL_APPROACH_RESTRICTING'
SIGNAL_RESTRICTING = 'SIGNAL_RESTRICTING'
SIGNAL_DIVERGING_CLEAR = 'SIGNAL_DIVERGING_CLEAR'
SIGNAL_DIVERGING_CLEAR_LIMITED = 'SIGNAL_DIVERGING_CLEAR_LIMITED'
SIGNAL_DIVERGING_ADVANCE_APPROACH = 'SIGNAL_DIVERGING_ADVANCE_APPROACH'
SIGNAL_DIVERGING_APPROACH = 'SIGNAL_DIVERGING_APPROACH'
SIGNAL_DIVERGING_RESTRICTING = 'SIGNAL_DIVERGING_RESTRICTING'
SIGNAL_STOP = 'SIGNAL_STOP'
SIGNAL_DARK = 'SIGNAL_DARK'
HEAD_GREEN = 'HEAD_GREEN'
HEAD_FLASHING_GREEN = 'HEAD_FLASHING_GREEN'
HEAD_YELLOW = 'HEAD_YELLOW'
HEAD_FLASHING_YELLOW = 'HEAD_FLASHING_YELLOW'
HEAD_RED = 'HEAD_RED'
HEAD_FLASHING_RED = 'HEAD_FLASHING_RED'
HEAD_LUNAR = 'HEAD_LUNAR'
HEAD_DARK = 'HEAD_DARK'
SVL_DISPATCH_SIGNAL_CONTROL_MEMORY_VAR_NAME = 'IMSVL_DISPATCH_SIGNALING'
def ConvertAspectToDivergingAspect(aspect):
if aspect.startswith('SIGNAL_APPROACH_CLEAR_'):
return SIGNAL_DIVERGING_CLEAR_LIMITED
elif aspect.startswith('SIGNAL_APPROACH_'):
return SIGNAL_DIVERGING_APPROACH
return {
SIGNAL_CLEAR: SIGNAL_DIVERGING_CLEAR,
SIGNAL_ADVANCE_APPROACH: SIGNAL_DIVERGING_ADVANCE_APPROACH,
SIGNAL_APPROACH: SIGNAL_DIVERGING_APPROACH,
SIGNAL_RESTRICTING: SIGNAL_DIVERGING_RESTRICTING,
}.get(aspect, SIGNAL_STOP)