]> wolfpit.net Git - hardware/fuck_tomatoes/.git/blob - FuckTomato.py
t
[hardware/fuck_tomatoes/.git] / FuckTomato.py
1 import cv2, sys, Printer, time
2 from User_Interface import Draw, MouseManager, Buttons
3
4 start_time = time.time()
5
6 cap = cv2.VideoCapture(0)
7 ret, frame = cap.read()
8 cv2.namedWindow('image')
9 printer = Printer.Printer('COM4', (200, 200))
10 mouse = MouseManager.MouseManager(printer)
11
12 while 1:
13 ret, frame = cap.read()
14 Draw.drawImage(frame, printer)
15 cv2.imshow('image', frame)
16
17 if time.time() - start_time > 8:
18 res = printer.packageIsExecuting()
19 if not res:
20 print(res)
21 #if not printer.packageIsExecuting():
22 # ...Detection and package send... #
23 #After g-code package send, check for XY reset and update printer execution status
24 #pass
25
26 if Buttons.checkButtons(printer): break
27
28 cap.release()
29 cv2.destroyAllWindows()