-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain1.kv
200 lines (178 loc) · 5.73 KB
/
main1.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
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
#: import smn kivy.uix.screenmanager
#: import math math
<Evidence>:
ScreenManager:
size_hint: 1, 1
id: _screen_manager
transition: smn.NoTransition() #FadeTransition()
Screen:
name: 'clock'
id: clock
on_touch_down: _screen_manager.current = 'people'
BoxLayout:
MyClockWidget:
Screen:
name: 'people'
id: people
on_enter:
root.startScreenTiming()
root.read_server_status()
on_leave:
root.finishScreenTiming()
on_touch_down:
_screen_manager.current = 'clock'
BoxLayout:
orientation: 'vertical'
BoxLayout:
orientation: 'horizontal'
Label:
text: 'Nepritomni'
font_size: self.height/4
color: 0.3,0.6,0.9,0.9
Label:
text: '0'
id: peopleno
font_size: self.height/4
color: 0.3,0.6,0.9,0.9
BoxLayout:
orientation: 'horizontal'
Label:
text: 'Pritomni'
font_size: self.height/4
color: 0.3,0.9,0.6,0.9
Label:
text: '0'
id: peopleya
font_size: self.height/4
color: 0.3,0.9,0.6,0.9
Screen:
name: 'waitscr'
id: waitscr
on_enter:
root.startScreenTiming()
on_leave:
root.finishScreenTiming()
on_touch_down:
_screen_manager.current = 'clock'
BoxLayout:
orientation: 'vertical'
Label:
text: 'Oznam:'
font_size: self.height/5
color: 0.6,0.6,0.6,0.9
Label:
text: ''
id: lblresult
font_size: self.height/3
color: 0.9,0.9,0.9,0.9
Label:
text: ''
font_size: self.height/5
color: 0.6,0.6,0.6,0.9
Screen:
name: 'events'
id: events
on_enter: root.startScreenTiming()
on_leave: root.finishScreenTiming()
BoxLayout:
orientation: 'vertical'
BoxLayout:
DigiClockWidget:
Label:
text: 'Inoteska'
font_size: self.height/3
color: 0.3,0.6,0.9,0.9
BoxLayout:
Button:
text: 'Prichod'
font_size: 24
color: 0,0.9,0,0.9
on_press: root.processEvent('1')
Button:
text: 'Prichod sluzobne'
font_size: 24
color: 0,0.9,0,0.9
on_press: root.processEvent('5')
Button:
text: 'Prichod lekar'
font_size: 24
color: 0,0.9,0,0.9
on_press: root.processEvent('7')
Button:
text: 'Prichod obed'
font_size: 24
color: 0,0.9,0,0.9
on_press: root.processEvent('9')
BoxLayout:
Button:
text: 'Odchod'
font_size: 24
color: 0,0.6,0.9,0.9
on_press: root.processEvent('0')
Button:
text: 'Odchod sluzobne'
font_size: 24
color: 0,0.6,0.9,0.9
on_press: root.processEvent('4')
Button:
text: 'Odchod lekar'
font_size: 24
color: 0,0.6,0.9,0.9
on_press: root.processEvent('6')
Button:
text: 'Odchod obed'
font_size: 24
color: 0,0.6,0.9,0.9
on_press: root.processEvent('8')
BoxLayout:
#CLOCK:
<DigiClockWidget>:
DigiClock:
font_size: self.height/5
color: 0.3,0.6,0.9,0.9
[ClockNumber@Label]:
text: str(ctx.i)
pos_hint: {"center_x": 0.5+0.42*math.sin(math.pi/6*(ctx.i-12)), "center_y": 0.5+0.42*math.cos(math.pi/6*(ctx.i-12))}
font_size: self.height/10
color: 0,0,0.6,0.9
<MyClockWidget>:
face: face
ticks: ticks
FloatLayout:
id: face
size_hint: None, None
pos_hint: {"center_x":0.5, "center_y":0.5}
size: 0.9*min(root.size), 0.9*min(root.size)
canvas:
Color:
rgb: 0.1, 0.1, 0.2
Ellipse:
size: self.size
pos: self.pos
ClockNumber:
i: 1
ClockNumber:
i: 2
ClockNumber:
i: 3
ClockNumber:
i: 4
ClockNumber:
i: 5
ClockNumber:
i: 6
ClockNumber:
i: 7
ClockNumber:
i: 8
ClockNumber:
i: 9
ClockNumber:
i: 10
ClockNumber:
i: 11
ClockNumber:
i: 12
Ticks:
id: ticks
r: min(root.size)*0.9/2