forked from RonanValadez34/DPI_Computer_UI
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathStepperScreen.kv
More file actions
697 lines (612 loc) · 17.5 KB
/
StepperScreen.kv
File metadata and controls
697 lines (612 loc) · 17.5 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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
<StepperScreen>:
name: 'stepper'
FloatLayout:
size_hint: None, None
# top row of buttons from left to right:
DPEAButton:
# Millimeters Button
id: milli
size: 100, 100
center_x: root.width * 0.05
center_y: root.height * 0.95
background_color: 0,0,0,0
color: 0.035, 0.152, 0.725, 1
text: "Millimeters"
on_press: root.setUnitsToMillimeters()
DPEAButton:
# Revolutions button
id: revolution
size: 100, 100
center_x: root.width * 0.15
center_y: root.height * 0.95
background_color: 0,0,0,0
color: 0.035, 0.152, 0.725, 1
text: "Revolutions"
on_press: root.setUnitsToRevolutions()
DPEAButton:
# Steps button
id: steps
size: 100, 100
center_x: root.width * 0.25
center_y: root.height * 0.95
background_color: 0,0,0,0
color: 0.035, 0.152, 0.725, 1
text: "Steps"
on_press: root.setUnitsToSteps()
DPEAButton:
# Get Position button
size: 100, 100
center_x: root.width * 0.65
center_y: root.height * 0.95
background_color: 0,0,0,0
color: 0.035, 0.152, 0.725, 1
text: "Get Position"
on_press: root.getPosition()
DPEAButton:
# Set CCW Direction
id: CCW_movement
size: 100, 100
center_x: root.width * 0.75
center_y: root.height * 0.95
background_color: 0,0,0,0
color: 0.035, 0.152, 0.725, 1
text: "CCW Direction"
on_press: root.CCWMovement()
DPEAButton:
# Set CW Direction
id: CW_Movement
size: 100, 100
center_x: root.width * 0.85
center_y: root.height * 0.95
background_color: 0,0,0,0
color: 0.035, 0.152, 0.725, 1
text: "CW Direction"
on_press: root.CWMovement()
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()
# Bottow Row of Buttons Left to Right:
DPEAButton:
id: enable_motor
size: 100, 100
center_x: root.width * 0.15
center_y: root.height * 0.8
color: 0.035, 0.152, 0.725, 1
text: "Enable all motors"
on_press: root.enableMotors()
DPEAButton:
#Button to change stepper_number to 0
id: motor_0
size: 100, 100
center_x: root.width * 0.25
center_y: root.height * 0.8
color: 0.035, 0.152, 0.725, 1
text: "Motor 0"
on_press: root.selectStepper0()
DPEAButton:
#Button to change stepper_number to 1
id: motor_1
size: 100, 100
center_x: root.width * 0.35
center_y: root.height * 0.8
color: 0.035, 0.152, 0.725, 1
text: "Motor 1"
on_press: root.selectStepper1()
DPEAButton:
#Button to change stepper_number to 2
id: motor_2
size: 100, 100
center_x: root.width * 0.45
center_y: root.height * 0.8
color: 0.035, 0.152, 0.725, 1
text: "Motor 2"
on_press: root.selectStepper2()
DPEAButton:
#Button to get status
size: 100, 100
center_x: root.width * 0.55
center_y: root.height * 0.8
color: 0.035, 0.152, 0.725, 1
text: "Get Status"
on_press: root.getStatus()
DPEAButton:
#Button to rotate stepper CCW once
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 Stepper\nOnce CCW"
on_press: root.runBasicMotionCCW()
DPEAButton:
# button to rotate steppers once with their given input
size: 100, 100
center_x: root.width * 0.75
center_y: root.height * 0.8
color: 0.035, 0.152, 0.725, 1
text: "Rotate all Steppers\nWith Input"
on_press: root.runInput()
DPEAButton:
#Button to rotate stepper CW once
size: 100, 100
center_x: root.width * 0.85
center_y: root.height * 0.8
color: 0.035, 0.152, 0.725, 1
text: "Rotate Stepper\nOnce CW"
on_press: root.runBasicMotionCW()
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()
#labels for guide, position, status, velocity, and title
Label:
id: page_info
text: 'STEPS: An * means button is selected\n1. Enable Motors\n2. Select Motor\n 3. Select Direction to Move\n4. Select Units\n5. Enter values\n6. Click Rotate All Steppers With Input\n\nNOTE: Rotate Stepper Once CCW/CW\n is used to check if stepper\nworks.'
font_size: 25
center_x: root.width * 0.03
y: root.height * -0.04
color: 0.0, 0.0, 0.0, 1
Label:
id: position
text: 'Position: '
font_size: 25
center_x: root.width * 0.0
y: root.height * 0.2
color: 0.0, 0.0, 0.0, 1
Label:
id: velocity
text: 'Velocity: '
font_size: 25
center_x: root.width * 0.0
y: root.height * 0.15
color: 0.0, 0.0, 0.0, 1
Label:
text: 'Stepper Movement Screen'
font_size: 40
center_x: root.width * 0.0
y: root.height * 0.45
color: 0.0, 0.0, 0.0, 1
Label:
id: status
text: 'Status'
font_size: 25
center_x: root.width * 0.0
y: root.height * -0.3
color: 0.0, 0.0, 0.0, 1
Label:
# hidden label, appears when an error occurs
id: error_stepper
text: ''
font_size: 40
center_x: root.width * 0.0
y: root.height * -0.45
color: 0.0, 0.0, 0.0, 1
# Keyboard and labels for microstepping
DPEAButton:
text: '1'
id: one
center_x: root.center_x - 850
center_y: root.center_y + 60
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.readMicroStepping(1)
DPEAButton:
text: '2'
id: two
center_x: root.center_x -750
center_y: root.center_y + 60
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.readMicroStepping(2)
DPEAButton:
text: '3'
id: three
center_x: root.center_x - 650
center_y: root.center_y + 60
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.readMicroStepping(3)
DPEAButton:
text: '4'
id: four
center_x: root.center_x - 850
center_y: root.center_y - 40
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.readMicroStepping(4)
DPEAButton:
text: '5'
id: five
center_x: root.center_x -750
center_y: root.center_y - 40
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.readMicroStepping(5)
DPEAButton:
text: '6'
id: six
center_x: root.center_x -650
center_y: root.center_y - 40
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.readMicroStepping(6)
DPEAButton:
text: '7'
id: seven
center_x: root.center_x - 850
center_y: root.center_y - 140
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.readMicroStepping(7)
DPEAButton:
text: '8'
id: eight
center_x: root.center_x -750
center_y: root.center_y - 140
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.readMicroStepping(8)
DPEAButton:
text: '9'
id: nine
center_x: root.center_x -650
center_y: root.center_y - 140
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.readMicroStepping(9)
DPEAButton:
text: '0'
id: zero
center_x: root.center_x -750
center_y: root.center_y - 240
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.readMicroStepping(0)
DPEAButton:
text: 'Del'
id: backspace
center_x: root.center_x - 850
center_y: root.center_y - 240
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.removeNumMicrostepping()
Label:
# Label for inputted microstepping value
id: micro_value
text: 'Microstepping: ' + root.microStepping
font_size: 25
center_x: root.width * -0.38
y: root.height * -0.30
color: 0.0, 0.0, 0.0, 1
Label:
# label for microstepping keyboard
id: micro_info
text: 'Enter Microstepping\n(1,2,4,8,16,32)'
font_size: 25
center_x: root.width * -0.35
y: root.height * 0.15
color: 0.0, 0.0, 0.0, 1
#Keyboard and labels for acceleration
DPEAButton:
text: '1'
id: one
center_x: root.center_x + 650
center_y: root.center_y + 60
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setAcceleration(1)
DPEAButton:
text: '2'
id: two
center_x: root.center_x +750
center_y: root.center_y + 60
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setAcceleration(2)
DPEAButton:
text: '3'
id: three
center_x: root.center_x + 850
center_y: root.center_y + 60
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setAcceleration(3)
DPEAButton:
text: '4'
id: four
center_x: root.center_x + 650
center_y: root.center_y - 40
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setAcceleration(4)
DPEAButton:
text: '5'
id: five
center_x: root.center_x +750
center_y: root.center_y - 40
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setAcceleration(5)
DPEAButton:
text: '6'
id: six
center_x: root.center_x +850
center_y: root.center_y - 40
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setAcceleration(6)
DPEAButton:
text: '7'
id: seven
center_x: root.center_x + 650
center_y: root.center_y - 140
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setAcceleration(7)
DPEAButton:
text: '8'
id: eight
center_x: root.center_x +750
center_y: root.center_y - 140
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setAcceleration(8)
DPEAButton:
text: '9'
id: nine
center_x: root.center_x +850
center_y: root.center_y - 140
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setAcceleration(9)
DPEAButton:
text: '0'
id: zero
center_x: root.center_x +750
center_y: root.center_y - 240
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setAcceleration(0)
DPEAButton:
text: 'Del'
id: backspace
center_x: root.center_x + 650
center_y: root.center_y - 240
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.removeNumAcceleration()
Label:
# label for inputted acceleration value
id: acceleration_value
text: 'Accel: ' + root.stepperAcceleration
font_size: 25
center_x: root.width * 0.38
y: root.height * -0.30
color: 0.0, 0.0, 0.0, 1
Label:
# label for acceleration keyboard
id: acceleration_info
text: 'Enter Acceleration'
font_size: 25
center_x: root.width * 0.42
y: root.height * 0.15
color: 0.0, 0.0, 0.0, 1
#Keyboard and labels for speed
DPEAButton:
text: '1'
id: one
center_x: root.center_x + 300
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 + 400
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 + 500
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 + 300
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 + 400
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 + 500
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 + 300
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 +400
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 + 500
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 +400
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 + 300
center_y: root.center_y - 240
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.removeNumSpeed()
Label:
# label for inputted speed value
id: speed_value
text: 'Speed: ' + root.stepperSpeed
font_size: 25
center_x: root.width * 0.18
y: root.height * -0.30
color: 0.0, 0.0, 0.0, 1
Label:
# label for speed keyboard
id: speed_info
text: 'Enter speed'
font_size: 25
center_x: root.width * 0.24
y: root.height * 0.15
color: 0.0, 0.0, 0.0, 1
#Kyboard and labels for distance
DPEAButton:
text: '1'
id: one
center_x: root.center_x - 500
center_y: root.center_y + 60
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setDistance(1)
DPEAButton:
text: '2'
id: two
center_x: root.center_x -400
center_y: root.center_y + 60
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setDistance(2)
DPEAButton:
text: '3'
id: three
center_x: root.center_x - 300
center_y: root.center_y + 60
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setDistance(3)
DPEAButton:
text: '4'
id: four
center_x: root.center_x - 500
center_y: root.center_y - 40
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setDistance(4)
DPEAButton:
text: '5'
id: five
center_x: root.center_x -400
center_y: root.center_y - 40
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setDistance(5)
DPEAButton:
text: '6'
id: six
center_x: root.center_x -300
center_y: root.center_y - 40
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setDistance(6)
DPEAButton:
text: '7'
id: seven
center_x: root.center_x - 500
center_y: root.center_y - 140
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setDistance(7)
DPEAButton:
text: '8'
id: eight
center_x: root.center_x -400
center_y: root.center_y - 140
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setDistance(8)
DPEAButton:
text: '9'
id: nine
center_x: root.center_x -300
center_y: root.center_y - 140
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setDistance(9)
DPEAButton:
text: '0'
id: zero
center_x: root.center_x -400
center_y: root.center_y - 240
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.setDistance(0)
DPEAButton:
text: 'Del'
id: backspace
center_x: root.center_x - 500
center_y: root.center_y - 240
color: 0.019, 0.337, 1, 1
size: 80, 80
on_press: root.removeDistance()
Label:
# label for inputted distance value
id: distance_value
text: 'Distance: ' + root.stepper0Distance
font_size: 25
center_x: root.width * -0.22
y: root.height * -0.30
color: 0.0, 0.0, 0.0, 1
Label:
# label for distance keyboard
id: distance_info
text: 'Enter Distance to Travel'
font_size: 25
center_x: root.width * -0.175
y: root.height * 0.15
color: 0.0, 0.0, 0.0, 1