-
Notifications
You must be signed in to change notification settings - Fork 1
/
Arm.kv
432 lines (391 loc) · 9.56 KB
/
Arm.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
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
<Desktop>:
#connection
GridLayout:
orientation: 'horizontal'
rows: 2
cols: 3
row_default_height: 26
size: 480, 55
pos: 0, 530
Label:
text: 'Port :'
font_size: 18
bold: True
size_hint_x: None
Spinner:
id: serialport
height: 32
width: 200
text: 'Select port'
values: app.serial_list()
size_text: 14
multiline: False
Button:
id: connect
height: 33
width: 100
text: 'Connection'
on_press: app.connect()
size_hint_x: None
Label:
pos: 0, 485
text: 'Baud :'
font_size: 18
bold: True
size_hint_x: None
Spinner:
id: baudrate
height: 32
width: 200
pos: 90, 520
text: '115200'
values: ["9600","14400","19200","28800","38400","57600","115200"]
Button:
id: disconnect
height: 33
width: 100
text: 'Disconnect'
on_press: app.disconnect()
size_hint_x: None
#logo
BoxLayout:
size: 138, 158
pos: 645, 480
Image:
source: 'logo_RobotArmCommand.png'
#etat
BoxLayout:
size: 70, 55
pos: 490, 530
ToggleButton:
id: viewconnect
text: 'Connect'
bolt: True
state: 'normal'
#help
BoxLayout:
size: 70, 55
pos: 565, 530
Button:
id: help
text: 'Help'
bolt: True
on_press: app.help()
#ligne1
BoxLayout:
canvas:
Fbo:
size: (200, 200)
Color:
rgba: (1, 1, 1, 1)
Rectangle:
size: (780, 1.5)
pos: (10, 515)
#coordonées des axes
GridLayout:
orientation: 'horizontal'
size: 780, 62
pos: 1, 450
rows: 2
cols: 7
Label:
text: 'Work position:'
font_size: 19
bolt: True
size_hint_x: .7
Label:
text: 'X:'
font_size: 19
size_hint_x: .2
TextInput:
id: wpos_x
text: '0,000'
font_size: 19
readonly: True
multiline: False
size_hint_x: .5
Label:
text: 'Y:'
font_size: 19
size_hint_x: 0.2
TextInput:
id: wpos_y
text: '0,000'
font_size: 19
readonly: True
multiline: False
size_hint_x: .5
Label:
text: 'Z:'
font_size: 19
size_hint_x: 0.2
TextInput:
id: wpos_z
text: '0,000'
font_size: 19
readonly: True
multiline: False
size_hint_x: .5
Label:
text: 'Machine position:'
font_size: 19
bolt: True
size_hint_x: .7
Label:
text: 'X:'
font_size: 19
size_hint_x: .2
TextInput:
id: mpos_x
text: '0,000'
font_size: 19
readonly: True
multiline: False
size_hint_x: .5
Label:
text: 'Y:'
font_size: 19
size_hint_x: 0.2
TextInput:
id: mpos_y
text: '0,000'
font_size: 19
readonly: True
multiline: False
size_hint_x: .5
Label:
text: 'Z:'
font_size: 19
size_hint_x: 0.2
TextInput:
id: mpos_z
text: '0,000'
font_size: 19
readonly: True
multiline: False
size_hint_x: .5
#ligne2
BoxLayout:
canvas:
Fbo:
size: (200, 200)
Color:
rgba: (1, 1, 1, 1)
Rectangle:
size: (780, 1.5)
pos: (10, 445)
#commandes GRBL
GridLayout:
orientation: 'horizontal'
size: 410, 60
pos: 10, 380
rows: 2
cols: 5
spacing: .5
padding: .2
Button:
text: 'Kill Alarm'
on_press: app.alarm()
Button:
text: 'Reset XYZ'
on_press: app.rst_xyz()
Button:
text: 'Reset X'
on_press: app.rst_x()
Button:
text: 'Reset Y'
on_press: app.rst_y()
Button:
text: 'Reset Z'
on_press: app.rst_z()
Button:
text: 'Home'
on_press: app.home()
Button:
text: 'Feed Hold'
on_press: app.feed_hold()
Button:
text: 'Cycle Start'
on_press: app.cycle_start()
Button:
text: 'State'
on_press: app.parser_state()
Button:
text: 'Setting'
on_press: app.infos()
#ligne3 - vertical
BoxLayout:
canvas:
Fbo:
size: (200, 200)
Color:
rgba: (1, 1, 1, 1)
Rectangle:
size: (1.5, 350)
pos: (440, 50)
#boutons Gcode
GridLayout:
orientation: 'horizontal'
size: 410, 45
pos: 10, 325
rows: 2
cols: 4
spacing: .5
padding: .2
Button:
id: save_pos
text: 'Save\nPosition'
halign: 'center'
on_press: app.save_pos()
Button:
id: play
text: 'Start'
on_press: app._send_command(app.root.ids.cmd_send_list.text)
Button:
id: export
text: 'Export'
on_press: app.save(cmd_send_list.text)
Button:
id: clear
text: 'Clear'
on_press: cmd_send_list.select_all(); cmd_send_list.delete_selection(); cmd_results.select_all(); cmd_results.delete_selection();
#Text input Gcode
BoxLayout:
orientation: 'horizontal'
gcode_export: cmd_send_list
size: 410, 250
pos: 10, 72
TextInput:
id: cmd_send_list
text: ''
on_text_validate: app._send_command(self.g_code)
font_size: 14
bolt: True
size_hint_x: .5
multiline: True
use_bubble: True
#text input commande et/ou gcode
GridLayout:
orientation: 'horizontal'
size: 410, 33
pos: 10, 20
rows: 1
cols: 2
spacing: .3
padding: .2
TextInput:
id: cmd_send_alone
on_text_validate: app._send_command(self.g_code)
use_bubble: True
font_size: 16
bold: True
size_hint_x: 3
multiline: True
Button:
id: cmd_send
text: 'Envoyer'
on_press: app._send_command(app.root.ids.cmd_send_alone.text)
#Retour infos GRBL --------------------------
BoxLayout:
orientation: 'horizontal'
size: 335, 140
pos: 447, 301
CodeInput:
id: cmd_results
text: ''
font_size: 10
#Jog
GridLayout:
orientation: 'horizontal'
size: 290, 170
pos: 470, 125
rows: 3
cols: 4
spacing: 3.5
padding: 3.5
Label:
text: ''
Button:
text: 'X+'
font_size: 28
bold: True
on_press: app.x_move_pos()
Label:
text: ''
Button:
text: 'Z+'
font_size: 28
bold: True
on_press: app.z_move_pos()
Button:
text: 'Y-'
font_size: 28
bold: True
on_press: app.y_move_neg()
Label:
text: ''
Button:
text: 'Y+'
font_size: 28
bold: True
on_press: app.y_move_pos()
Label:
text: ''
Label:
text: ''
Button:
text: 'X-'
font_size: 28
bold: True
on_press: app.x_move_neg()
Label:
text: ''
Button:
text: 'Z-'
font_size: 28
bold: True
on_press: app.z_move_neg()
#slider vitesse
BoxLayout:
pos: 453, 40
size: 290, 20
Slider:
id: curseur_vitesse
orientation: 'horizontal'
size_hint_x: 2
min: 50
max: 800
value: 400
background_width: '15sp'
cursor_size: (20, 20)
step: 50
Label:
text: "Speed : " +str(round(root.ids.curseur_vitesse.value,1))
padding: 2, 2
bold: True
#slider pas
BoxLayout:
pos: 453, 90
size: 290, 20
Slider:
id: curseur_pas
orientation: 'horizontal'
size_hint_x: 2
value: 1
min: 0.1
max: 10
background_width: '15sp'
cursor_size: (20, 20)
step: 0.1
Label:
text: "Step : " +str(round(root.ids.curseur_pas.value,1))
padding: 2, 2
bold: True
#version
BoxLayout:
pos: 700, 1
size: 20, 30
Label:
text: 'Robot Arm Command V1.0'
italic: True
font_size: 12