Ejemplo n.º 1
0
def G1(X, Y, A, B):
    b2, b3, b4, b5, b6, b7, b8 = i.MVP(mode, 0, X)
    b1, b2, b3, b4, b5, b6, b7, b8, b9 = par(1, b2, b3, b4, b5, b6, b7, b8)
    x = bytearray([b1, b2, b3, b4, b5, b6, b7, b8, b9])
    b2, b3, b4, b5, b6, b7, b8 = i.MVP(mode, 1, Y)
    b1, b2, b3, b4, b5, b6, b7, b8, b9 = par(1, b2, b3, b4, b5, b6, b7, b8)
    y = bytearray([b1, b2, b3, b4, b5, b6, b7, b8, b9])
    b2, b3, b4, b5, b6, b7, b8 = i.MVP(mode, 2, A)
    b1, b2, b3, b4, b5, b6, b7, b8, b9 = par(1, b2, b3, b4, b5, b6, b7, b8)
    a = bytearray([b1, b2, b3, b4, b5, b6, b7, b8, b9])
    b2, b3, b4, b5, b6, b7, b8 = i.MVP(mode, 3, B)
    b1, b2, b3, b4, b5, b6, b7, b8, b9 = par(1, b2, b3, b4, b5, b6, b7, b8)
    b = bytearray([b1, b2, b3, b4, b5, b6, b7, b8, b9])
    return (x, y, a, b)
Ejemplo n.º 2
0
 def Bd(instance):
     global bb1, bb2
     b2, b3, b4, b5, b6, b7, b8 = i.MVP("REL", 3, negtravel)
     b1, b2, b3, b4, b5, b6, b7, b8, b9 = par(1, b2, b3, b4, b5, b6, b7,
                                              b8)
     x = bytearray([b1, b2, b3, b4, b5, b6, b7, b8, b9])
     if (bb1 == 0) and (bb2 > 0):
         bb1 = 1
         bb2 = bb2 - travel
         ser.write(bytearray([1, 138, 0, 0, 0, 0, 0, 8, 147]))
         ser.write(x)
         Thread(target=wait_until_reached).start()
         self.bTravel.text = str(bb2)
         self.terminal.text += "axis B descend: " + str(travel) + "mm\n"
     else:
         self.terminal.text += "axis B already moving or can't travel to negative\n"
Ejemplo n.º 3
0
 def Ad(instance):
     global a1, a2
     b2, b3, b4, b5, b6, b7, b8 = i.MVP("REL", 2, negtravel)
     b1, b2, b3, b4, b5, b6, b7, b8, b9 = par(1, b2, b3, b4, b5, b6, b7,
                                              b8)
     x = bytearray([b1, b2, b3, b4, b5, b6, b7, b8, b9])
     if (a1 == 0) and (a2 > 0):
         a1 = 1
         a2 = a2 - travel
         ser.write(bytearray([1, 138, 0, 0, 0, 0, 0, 4, 143]))
         ser.write(x)
         Thread(target=wait_until_reached).start()
         self.aTravel.text = str(a2)
         self.terminal.text += "axis A descend: " + str(travel) + "mm\n"
     else:
         self.terminal.text += "axis A already moving or can't travel to negative\n"
Ejemplo n.º 4
0
 def Yd(instance):
     global y1, y2
     b2, b3, b4, b5, b6, b7, b8 = i.MVP("REL", 1, negtravel)
     b1, b2, b3, b4, b5, b6, b7, b8, b9 = par(1, b2, b3, b4, b5, b6, b7,
                                              b8)
     x = bytearray([b1, b2, b3, b4, b5, b6, b7, b8, b9])
     if (y1 == 0) and (y2 > 0):
         y1 = 1
         y2 = y2 - travel
         ser.write(bytearray([1, 138, 0, 0, 0, 0, 0, 2, 141]))
         ser.write(x)
         Thread(target=wait_until_reached).start()
         self.yTravel.text = str(y2)
         self.terminal.text += "axis Y descend: " + str(travel) + "mm\n"
     else:
         self.terminal.text += "axis Y already moving or can't travel to negative\n"
Ejemplo n.º 5
0
 def Xd(instance):
     global x1, x2
     b2, b3, b4, b5, b6, b7, b8 = i.MVP("REL", 0, negtravel)
     b1, b2, b3, b4, b5, b6, b7, b8, b9 = par(1, b2, b3, b4, b5, b6, b7,
                                              b8)
     x = bytearray([b1, b2, b3, b4, b5, b6, b7, b8, b9])
     if (x1 == 0) and (x2 > 0):
         x1 = 1
         x2 = x2 - travel
         ser.write(bytearray([1, 138, 0, 0, 0, 0, 0, 1, 140]))
         ser.write(x)
         Thread(target=wait_until_reached).start()
         self.xTravel.text = str(x2)
         self.terminal.text += "axis X descend: " + str(travel) + "mm\n"
     else:
         self.terminal.text += "axis X already moving or can't travel to negative\n"
Ejemplo n.º 6
0
 def Xa(instance):
     global x1, x2
     b2, b3, b4, b5, b6, b7, b8 = i.MVP("REL", 0, travel)
     b1, b2, b3, b4, b5, b6, b7, b8, b9 = par(1, b2, b3, b4, b5, b6, b7,
                                              b8)
     x = bytearray([b1, b2, b3, b4, b5, b6, b7, b8, b9])
     x2 = x2 + travel
     if (x1 == 0) and (x2 <= 900):
         x1 = 1
         ser.write(bytearray([1, 138, 0, 0, 0, 0, 0, 1, 140]))
         ser.write(x)
         Thread(target=wait_until_reached).start()
         self.terminal.text += "axis X ascend: " + str(travel) + "mm\n"
         self.xTravel.text = str(x2)
     else:
         self.terminal.text += "axis X already moving or can't travel more\n"