예제 #1
0
def DoPlace(CompPos, CompZ, BoardPos, BoardZ, Rotation, debug=False):
    print "CompPos:", CompPos
    CompPos = (CompPos[0] - conf.TIP_TO_DRAG[0],
               CompPos[1] - conf.TIP_TO_DRAG[1])
    BoardPos = (BoardPos[0] - conf.TIP_TO_DRAG[0],
                BoardPos[1] - conf.TIP_TO_DRAG[1])
    print "DoPlace... {} {} {} {}".format(CompPos, CompZ, BoardPos, BoardZ)
    comm.SendAbsoluteXYMove(CompPos[0], CompPos[1])
    WaitMoveDone("move")
    VacuumPrepare()
    comm.SendAbsoluteZMove(CompZ)
    WaitMoveDone("toolhead")
    VacuumOn()

    comm.SendAbsoluteZMove(0)
    WaitMoveDone("toolhead")
    if debug:
        return
    comm.SendToolheadRotate(Rotation)
    WaitMoveDone("toolhead")

    comm.SendAbsoluteXYMove(BoardPos[0], BoardPos[1])
    WaitMoveDone("move")
    comm.SendAbsoluteZMove(BoardZ)
    WaitMoveDone("toolhead")
    VacuumOff()

    comm.SendAbsoluteZMove(0)
    WaitMoveDone("toolhead")
    if Rotation != 0:
        comm.SendToolheadRotate(360 - Rotation)
        WaitMoveDone("toolhead")
예제 #2
0
def DoTapeMove(start, end, z):
    print "DoTapeMove... {} {} {}".format(start, end, z)
    comm.SendAbsoluteXYMove(start[0], start[1])
    WaitMoveDone("move")
    comm.SendAbsoluteZMove(-z)
    WaitMoveDone("toolhead")
    comm.SendAbsoluteXYMove(end[0], end[1])
    WaitMoveDone("move")
    comm.SendAbsoluteZMove(0)
    WaitMoveDone("toolhead")
예제 #3
0
 def onCoordTextEnter(self, evt):
     c = self.getCurCoord()
     if not c:
         return
     x, y = c
     print "onSliderChange {} {}".format(x, y)
     comm.SendAbsoluteXYMove(int(x), int(y))
예제 #4
0
 def onSliderChangeY(self, evt):
     c = self.getCurCoord()
     if not c:
         return
     x = c[0]
     y = self.slider_y.GetValue()
     y = int(y / float(self.slider_y.GetMax()) * conf.MACH_MAX_Y)
     print "onSliderChange {} {}".format(x, y)
     comm.SendAbsoluteXYMove(int(x), int(y))
예제 #5
0
 def onSliderChangeX(self, evt):
     c = self.getCurCoord()
     if not c:
         return
     x = self.slider_x.GetValue()
     x = int(x / float(self.slider_x.GetMax()) * conf.MACH_MAX_X)
     y = c[1]
     print "onSliderChange {} {}".format(x, y)
     comm.SendAbsoluteXYMove(int(x), int(y))