forked from RonanValadez34/DPI_Computer_UI
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDCScreen.kv
More file actions
219 lines (189 loc) · 5.44 KB
/
DCScreen.kv
File metadata and controls
219 lines (189 loc) · 5.44 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<DCScreen>:
name: 'DC'
FloatLayout:
size_hint: None, None
DPEAButton:
# Quit button
size: 100, 100
center_x: root.width * 0.95
center_y: root.height * 0.95
background_color: 0,0,0,0
color: 0.035, 0.152, 0.725, 1
text: "Quit"
on_press: root.exit_program()
DPEAButton:
#Go back button
size: 100, 100
center_x: root.width * 0.95
center_y: root.height * 0.8
color: 0.035, 0.152, 0.725, 1
text: "Go back"
on_press: root.transition_back()
DPEAButton:
# button to select DC 0
id: DC_0
size: 100, 100
center_x: root.width * 0.35
center_y: root.height * 0.8
color: 0.035, 0.152, 0.725, 1
text: "DC 0"
on_press: root.selectDC0()
DPEAButton:
# button to select DC 1
id: DC_1
size: 100, 100
center_x: root.width * 0.45
center_y: root.height * 0.8
color: 0.035, 0.152, 0.725, 1
text: "DC 1"
on_press: root.selectDC1()
DPEAButton:
# run basic movement button
size: 100, 100
center_x: root.width * 0.85
center_y: root.height * 0.8
color: 0.035, 0.152, 0.725, 1
text: "Run Basic Movement"
on_press: root.rotateDCMotor()
DPEAButton:
# rotates DC motor with input speed button
size: 100, 100
center_x: root.width * 0.65
center_y: root.height * 0.8
color: 0.035, 0.152, 0.725, 1
text: "Rotate DC motors with specific speed"
on_press: root.runDCWithSpecificSpeed()
DPEAButton:
# stops all motors
size: 100, 100
center_x: root.width * 0.15
center_y: root.height * 0.8
color: 0.035, 0.152, 0.725, 1
text: "Stop All Motors"
on_press: root.stopDCMotors()
DPEAButton:
text: '1'
id: one
center_x: root.center_x - 100
center_y: root.center_y + 60
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setSpeed(1)
DPEAButton:
text: '2'
id: two
center_x: root.center_x
center_y: root.center_y + 60
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setSpeed(2)
DPEAButton:
text: '3'
id: three
center_x: root.center_x + 100
center_y: root.center_y + 60
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setSpeed(3)
DPEAButton:
text: '4'
id: four
center_x: root.center_x - 100
center_y: root.center_y - 40
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setSpeed(4)
DPEAButton:
text: '5'
id: five
center_x: root.center_x
center_y: root.center_y - 40
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setSpeed(5)
DPEAButton:
text: '6'
id: six
center_x: root.center_x + 100
center_y: root.center_y - 40
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setSpeed(6)
DPEAButton:
text: '7'
id: seven
center_x: root.center_x - 100
center_y: root.center_y - 140
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setSpeed(7)
DPEAButton:
text: '8'
id: eight
center_x: root.center_x
center_y: root.center_y - 140
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setSpeed(8)
DPEAButton:
text: '9'
id: nine
center_x: root.center_x + 100
center_y: root.center_y - 140
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setSpeed(9)
DPEAButton:
text: '0'
id: zero
center_x: root.center_x
center_y: root.center_y - 240
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setSpeed(0)
DPEAButton:
text: 'Del'
id: backspace
center_x: root.center_x - 100
center_y: root.center_y - 240
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.removeNum()
#label for speed inputted value
Label:
id: speed_value
text: 'Speed: ' + root.speedDC0
font_size: 40
center_x: root.width * 0.20
y: root.height * 0.05
color: 0.0, 0.0, 0.0, 1
Label:
id: speed_info
text: 'Enter Value (0-180)\n0 is 100% CCW, 90 is neutral, 180 is 100% CW '
font_size: 40
center_x: root.width * 0.05
y: root.height * 0.15
color: 0.0, 0.0, 0.0, 1
#instructions label
Label:
id: info_label
text: 'Notes: Select which motor you want to move\nSet speed then press Rotate DC motors with specific speed\nAn * means motor selected\nMust delete data from other DC motor in order to\nset data for different DC motor'
font_size: 25
center_x: root.width * -0.25
y: root.height * 0.03
color: 0.0, 0.0, 0.0, 1
# label for title
Label:
text: 'DC Motor Screen'
font_size: 40
center_x: root.width * 0.0
y: root.height * 0.45
color: 0.0, 0.0, 0.0, 1
# hidden label that appears when an error occurs
Label:
id: error_DC
text: ''
font_size: 40
center_x: root.width * 0.0
y: root.height * -0.45
color: 0.0, 0.0, 0.0, 1