-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.kv
88 lines (88 loc) · 3.09 KB
/
main.kv
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
#: import SlideTransition kivy.uix.screenmanager.SlideTransition
#: import textwrap textwrap
#: import sys sys
<ScreenDisplayController>:
id: controller
Screen:
name: "name_entry"
GridLayout:
id: name_entry_grid
rows: 4
cols: 1
Label:
id: header
size_hint_y: 0.5
font_size: 70
text: "Enter Locker Bluetooth ID"
TextInput:
id: idbox
text: "Locker0"
multiline: False
font_size: 150
padding_x: [self.center[0] - self._get_text_width(max(self._lines, key=len), self.tab_width, self._label_cached) / 2.0,0] if self.text else [self.center[0], 0]
padding_y: [self.height / 2.0 - (self.line_height / 2.0) * len(self._lines), 0]
GridLayout:
rows: 1
cols: 2
size_hint_y: 0.4
Button:
text: "R"
font_size: 200
size_hint_x: 0.2
on_release: app.getBluetoothInfo()
Button:
text: "Continue"
font_size: 100
size_hint_x: 0.8
on_release: root.bluetoothBasedDisplayManager(idbox.text)
Label:
size_hint_y: 1
font_size: 60
text: '\n'.join(textwrap.wrap("You must be paired with the locker before starting the app. Go to settings and do so if you are not paired already. \nPress R button to refresh paired list.", 40))
Screen:
name: "no_paired_devices_failure"
GridLayout:
rows: 2
cols: 1
Label:
text: "\n".join(textwrap.wrap("No paired Bluetooth devices! Please pair with the locker in the settings menu and refresh.", 29))
font_size: 80
Button:
text: "Refresh"
font_size: 80
size_hint_y: .1
on_release: app.getBluetoothInfo()
Screen:
name: "bt_paired"
GridLayout:
rows: 3
cols: 1
Button:
on_release: app.send('o')
text: "Toggle Solenoid"
font_size: 70
Button:
size_hint_y: .3
text: "Off"
font_size: 50
on_release: app.send('L')
GridLayout:
size_hint_y: .4
rows: 2
cols: 2
Button:
text: "White"
on_release: app.send('w')
font_size: 50
Button:
text: "Red"
on_release: app.send('r')
font_size: 50
Button:
text: "Green"
on_release: app.send('g')
font_size: 50
Button:
text: "Blue"
on_release: app.send('b')
font_size: 50