示例#1
0
 def __init__(self, serial_device_name=None):
     Grbl.__init__(self, serial_device_name)
     self.jog_direction = None
     self.last_jog_direction = None
     self.margin = 125
     self.x_limit = 700 #700
     self.y_limit = 700 #1500
     self._is_pen_down = False
示例#2
0
 def _status_update(self):
     Grbl._status_update(self)
     if self.jog_direction != self.last_jog_direction:
         # we're changing jog direction, we need to come to a stop first
         if self._state == 'Run':
             self.hold() # start stopping
         elif self._state == 'Queue':
             self.reset() # done stopping, clear the command queue
         elif self._state == 'Idle':
             # ready for a new move command
             if self.jog_direction:
                 # move to the edge of the workspace in the jog direction
                 command = self._gcode_machine_position_move_to(self._jog_target(self.jog_direction))
                 if command:
                     self._execute(command)
             self.last_jog_direction = self.jog_direction
示例#3
0
    def __init__(self, speed=115200, homing=False, dry_run=False):
        port1, port2 = find_ports()

        self.grbls = []
        self.grbls.append(Grbl(port1, speed, homing, dry_run))
        self.grbls.append(Grbl(port2, speed, homing, dry_run))

        # while not self.grbl1.homing_done() or not self.grbl2.homing_done(): pass - FIXME
        self.poss = [0] * N_AXIS  # FIXME

        self.gam = self.GrblAxisMap(N_AXIS)
        self.gam.set_axis_map(0, 0, 'A')
        self.gam.set_axis_map(1, 0, 'Z', -1)
        self.gam.set_axis_map(2, 0, 'Y', -1)
        self.gam.set_axis_map(3, 0, 'X')
        self.gam.set_axis_map(4, 1, 'A')
        self.gam.set_axis_map(5, 1, 'Z', -1)
        self.gam.set_axis_map(6, 1, 'X', -1)
        self.gam.set_axis_map(7, 1, 'Y')
示例#4
0
 def queue(self, script):
     if self.jog_direction:
         raise Exception("can't execute script while jogging")
     Grbl.queue(self, script)