-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathjogrose.kv
311 lines (284 loc) · 9.28 KB
/
jogrose.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
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
<CircularButton>:
canvas:
Color:
rgba: [0.75,0.75,0.75,1] if root.state == 'normal' else [0,1,1,1]
Ellipse:
pos: self.pos
size: self.size
Label:
pos: root.pos
size: root.size
font_size: root.font_size
halign: 'center'
color: [1,0,0,1]
text: root.text
<CircularToggleButton>:
allow_no_selection: False
canvas:
Color:
rgba: [0.75,0.75,0.75,1] if root.state == 'normal' else [0,1,1,1]
Ellipse:
pos: self.pos
size: self.size
Label:
pos: root.pos
size: root.size
color: [1,0,0,1]
text: root.text
<ArrowButton>:
canvas:
Color:
rgba: [0.75,0.75,0.75, 1] if root.state == 'normal' else [0,1,1,1]
PushMatrix
Translate:
x: self.pos[0]
y: self.pos[1]
Rotate:
angle: root.angle
origin: dp(25), dp(25)
Mesh:
mode: 'triangle_fan'
vertices: dp(0),dp(0),dp(0),dp(0), dp(0),dp(25),dp(0),dp(0), dp(25),dp(50),dp(0),dp(0), dp(50),dp(25),dp(0),dp(0), dp(50),dp(0),dp(0),dp(0)
indices: 0,1,2,3,4
PopMatrix
Label:
size_hint: None, None
pos: root.pos
size: root.size
color: 1,1,1,1
text: root.text
<LPArrowButton>:
Label:
size_hint: None, None
pos: root.pos
size: root.size
color: 1,1,0,1
text: root.text
<MyGridV@GridLayout>:
size_hint: None, None
size: dp(50), dp(150)
#spacing: 4
rows: 3
col_force_default: True
col_default_width: dp(50)
row_force_default: True
row_default_height: dp(50)
<MyGridH@GridLayout>:
size_hint: None, None
size: dp(150), dp(50)
#spacing: 4
cols: 3
col_force_default: True
col_default_width: dp(50)
row_force_default: True
row_default_height: dp(50)
<JogRoseWidget>:
id: jogrose
jogrosemain: jogrosemain
abc_panel: abc_panel
hat: hat
padding: dp(5), dp(5)
canvas.before:
Color:
rgba: 0.5, 0.5, 0.5, 1
Rectangle:
pos: self.pos
size: self.size
RelativeLayout:
id: jogrosemain
MyGridV:
pos_hint: {'right': 1.0, 'top': 1.0}
LPArrowButton:
size_hint: None, None
size: dp(50), dp(50)
text: '{}+1'.format(root.abc_sel)
angle: 0
on_press: root.handle_action(root.abc_sel, 1)
on_long_press: root.handle_long_press(root.abc_sel, 1)
on_long_release: root.handle_long_release()
Button:
size_hint: None, None
size: dp(50), dp(50)
text: '{}+0.1'.format(root.abc_sel)
on_press: root.handle_action(root.abc_sel, 0.1)
Button:
size_hint: None, None
size: dp(50), dp(50)
text: '{}+0.01'.format(root.abc_sel)
on_press: root.handle_action(root.abc_sel, 0.01)
MyGridV:
pos_hint: {'right': 1.0, 'center_y': 0.27}
size: dp(50), dp(100)
Button:
size_hint: None, None
size: dp(50), dp(50)
text: '{}-0.01'.format(root.abc_sel)
on_press: root.handle_action(root.abc_sel, -0.01)
Button:
size_hint: None, None
size: dp(50), dp(50)
text: '{}-0.1'.format(root.abc_sel)
on_press: root.handle_action(root.abc_sel, -0.1)
LPArrowButton:
size_hint: None, None
size: dp(50), dp(50)
text: '{}-1'.format(root.abc_sel)
angle: 180
on_press: root.handle_action(root.abc_sel, -1)
on_long_press: root.handle_long_press(root.abc_sel, -1)
on_long_release: root.handle_long_release()
MyGridV:
pos_hint: {'center_x': 0.5, 'top': 1.0}
ArrowButton:
size_hint: None, None
size: dp(50), dp(50)
text: 'Y+10'
angle: 0
on_press: root.handle_action('Y', 10)
Button:
size_hint: None, None
size: dp(50), dp(50)
text: 'Y+1'
on_press: root.handle_action('Y', 1)
Button:
size_hint: None, None
size: dp(50), dp(50)
text: 'Y+0.1'
on_press: root.handle_action('Y', 0.1)
MyGridV:
pos_hint: {'center_x': 0.5, 'y': 0.0}
Button:
size_hint: None, None
size: dp(50), dp(50)
text: 'Y-0.1'
on_press: root.handle_action('Y', -0.1)
Button:
size_hint: None, None
size: dp(50), dp(50)
text: 'Y-1'
on_press: root.handle_action('Y', -1)
ArrowButton:
size_hint: None, None
size: dp(50), dp(50)
text: 'Y-10'
angle: 180
on_press: root.handle_action('Y', -10)
MyGridH:
pos_hint: {'x': 0.0, 'center_y': 0.5}
ArrowButton:
size_hint: None, None
size: dp(50), dp(50)
text: 'X-10'
angle: 90
on_press: root.handle_action('X', -10)
Button:
size_hint: None, None
size: dp(50), dp(50)
text: 'X-1'
on_press: root.handle_action('X', -1)
Button:
size_hint: None, None
size: dp(50), dp(50)
text: 'X-0.1'
on_press: root.handle_action('X', -0.1)
MyGridH:
pos_hint: {'right': 1, 'center_y': 0.5}
Button:
size_hint: None, None
size: dp(50), dp(50)
text: 'X+0.1'
on_press: root.handle_action('X', 0.1)
Button:
size_hint: None, None
size: dp(50), dp(50)
text: 'X+1'
on_press: root.handle_action('X', 1)
ArrowButton:
size_hint: None, None
size: dp(50), dp(50)
text: 'X+10'
angle: -90
on_press: root.handle_action('X', 10)
Hat:
id: hat
pos_hint: {'center_x': 0.5, 'center_y': 0.5}
size_hint: None, None
size: dp(64), dp(64)
on_release: root.hat_released()
CircularButton:
pos_hint: {'center_x': 0.1, 'center_y': 0.28}
size_hint: None, None
size: dp(50), dp(50)
text: 'Origin'
on_press: root.handle_action('O', 0)
CircularButton:
pos_hint: {'center_x': 0.1, 'center_y': 0.1}
size_hint: None, None
size: dp(50), dp(50)
text: 'Home'
on_press: root.handle_action('H', 0)
CircularButton:
pos_hint: {'center_x': 0.72, 'center_y': 0.1}
text: 'Motors\nOff'
font_size: '14sp'
size_hint: None, None
size: dp(55), dp(55)
on_press: root.motors_off()
CircularButton:
pos_hint: {'center_x': 0.72, 'center_y': 0.28}
text: 'Safe Z'
size_hint: None, None
size: dp(55), dp(55)
on_press: root.safe_z()
BoxLayout:
id: abc_panel
orientation: 'vertical'
pos_hint: {'x': 0.75, 'y': 0.8}
size_hint: 0.1, 0.2
ToggleButton:
text: 'Z'
group: 'zabc_group'
state: 'down'
on_press: root.abc_sel= 'Z'
ToggleButton:
text: 'A'
group: 'zabc_group'
on_press: root.abc_sel= 'A'
BoxLayout:
orientation: 'vertical'
pos_hint: {'x': 0, 'top': 1}
size_hint: 0.4, 0.4
Label:
text: 'Jog Speed'
size_hint: None, None
size: self.texture_size
pos_hint: {'center_x': 0.4}
GridLayout:
cols: 2
spacing: 10
padding: 8
CircularToggleButton:
id: js100
text: '100%'
size_hint: None, None
size: dp(50), dp(50)
group: 'speed_group'
CircularToggleButton:
id: js50
text: '50%'
size_hint: None, None
size: dp(50), dp(50)
group: 'speed_group'
state: 'down'
CircularToggleButton:
id: js25
text: '25%'
size_hint: None, None
size: dp(50), dp(50)
group: 'speed_group'
CircularToggleButton:
id: js10
text: '10%'
size_hint: None, None
size: dp(50), dp(50)
group: 'speed_group'