]> wolfpit.net Git - hardware/fuck_tomatoes/.git/commitdiff
Refactored and removed like one line lol`
authorMichael Reeves <michaelreeves808@gmail.com>
Thu, 14 Feb 2019 08:18:13 +0000 (00:18 -0800)
committerMichael Reeves <michaelreeves808@gmail.com>
Thu, 14 Feb 2019 08:18:13 +0000 (00:18 -0800)
FuckTomato.py
Printer.py
__pycache__/Printer.cpython-37.pyc

index 536cf0e41191cd07b336dfdb201db2223458b9f0..8dbe5130396f3e60d42cb8d1d3a83f9e43885e04 100644 (file)
@@ -4,16 +4,13 @@ from User_Interface import Draw, MouseManager, Buttons
 cap = cv2.VideoCapture(1)
 ret, frame = cap.read()
 cv2.namedWindow('image')
-
 printer = Printer.Printer('COM3')
-printer.begin()
 mouse = MouseManager.MouseManager(printer)
 
 while(True):
        ret, frame = cap.read()
        Draw.drawImage(frame, printer)
        cv2.imshow('image', frame)
-
        if Buttons.checkButtons(printer, printer.settings): break
 
 cap.release()
index 835439584b26a4c3125dc74d101eaf4a104b90e7..54a583efc6f381e1c6ca4ff623cc17d19dec9ead 100644 (file)
@@ -7,18 +7,12 @@ class Printer():
                self.COM = COM
                self.max_X = 250
                self.max_Y = 200
-               self.ser = None
                self.position = (0,0)
                self.sendSerial = False
                self.settings = frameSettings.frameSettings()
                self.coeffs = MatrixConversion.find_coeffs(self.settings.image_frame.corners, self.settings.laser_frame.corners) 
-
-       def begin(self):
-               print("Connecting")
-               try:
-                       self.ser = serial.Serial(self.COM, 115200, timeout = 1)
-               except:
-                       print("Connection Fail")
+               try: self.ser = serial.Serial(self.COM, 115200, timeout = 1)
+               except: print("Connection Failure")
 
        def withinBounds(self, xy):
                x, y = xy
index bdf60913e765420d03da43aa4c04b6c3550c3d7d..a8a4a8316aac6ab20470f9b836db79097d6b9c88 100644 (file)
Binary files a/__pycache__/Printer.cpython-37.pyc and b/__pycache__/Printer.cpython-37.pyc differ