-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathStateLabels.py
More file actions
68 lines (65 loc) · 3.79 KB
/
StateLabels.py
File metadata and controls
68 lines (65 loc) · 3.79 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
class StateLabels():
def __init__(self):
#updates label colors if state is not equal to current_state
def updateCurrentState(state):
current_state = "fault"
if state== current_state:
True
elif state!= current_state:
current_state=state
if state== 'fault':
self.label12.setStylesheet("background-color: red")
self.label11.setStylesheet("background-color: gray")
self.label10.setStylesheet("background-color: gray")
self.label9.setStylesheet("background-color: gray")
self.label8.setStylesheet("background-color: gray")
self.label7.setStylesheet("background-color: gray")
self.label6.setStylesheet("background-color: gray")
if state== 'safe':
self.label12.setStylesheet("background-color: gray")
self.label11.setStylesheet("background-color: #89CFF0")
self.label10.setStylesheet("background-color: gray")
self.label9.setStylesheet("background-color: gray")
self.label8.setStylesheet("background-color: gray")
self.label7.setStylesheet("background-color: gray")
self.label6.setStylesheet("background-color: gray")
if state== 'ready':
self.label12.setStylesheet("background-color: gray")
self.label11.setStylesheet("background-color: gray")
self.label10.setStylesheet("background-color: green")
self.label9.setStylesheet("background-color: gray")
self.label8.setStylesheet("background-color: gray")
self.label7.setStylesheet("background-color: gray")
self.label6.setStylesheet("background-color: gray")
if state== 'launch':
self.label12.setStylesheet("background-color: #89CFF0")
self.label11.setStylesheet("background-color: gray")
self.label10.setStylesheet("background-color: gray")
self.label9.setStylesheet("background-color: green")
self.label8.setStylesheet("background-color: gray")
self.label7.setStylesheet("background-color: gray")
self.label6.setStylesheet("background-color: gray")
if state== 'coast':
self.label12.setStylesheet("background-color: gray")
self.label11.setStylesheet("background-color: gray")
self.label10.setStylesheet("background-color: gray")
self.label9.setStylesheet("background-color: gray")
self.label8.setStylesheet("background-color: green")
self.label7.setStylesheet("background-color: gray")
self.label6.setStylesheet("background-color: gray")
if state== 'break':
self.label12.setStylesheet("background-color: gray")
self.label11.setStylesheet("background-color: gray")
self.label10.setStylesheet("background-color: gray")
self.label9.setStylesheet("background-color: gray")
self.label8.setStylesheet("background-color: gray")
self.label7.setStylesheet("background-color: yellow")
self.label6.setStylesheet("background-color: gray")
if state== 'crawl':
self.label12.setStylesheet("background-color: gray")
self.label11.setStylesheet("background-color: gray")
self.label10.setStylesheet("background-color: gray")
self.label9.setStylesheet("background-color: gray")
self.label8.setStylesheet("background-color: gray")
self.label7.setStylesheet("background-color: gray")
self.label6.setStylesheet("background-color: yellow")