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")
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")
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))
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))
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))