def move_to(self, location, instrument=None, create_path=True, now=False): placeable, coordinates = containers.unpack_location(location) if instrument: coordinates = instrument.calibrator.convert( placeable, coordinates) else: coordinates += placeable.coordinates(placeable.get_deck()) tallest_z = self._deck.max_dimensions(self._deck)[2][1][2] tallest_z += 10 def _do(): if create_path: self._driver.move_head(z=tallest_z) self._driver.move_head(x=coordinates[0], y=coordinates[1]) self._driver.move_head(z=coordinates[2]) else: self._driver.move_head( x=coordinates[0], y=coordinates[1], z=coordinates[2] ) if now: _do() else: self.add_command(Command(do=_do))
def move_to_bottom(self, location, create_path=True, now=False): placeable, _ = containers.unpack_location(location) bottom_location = (placeable, placeable.from_center(x=0, y=0, z=-1)) return self.move_to(bottom_location, create_path)
def associate_placeable(self, location): placeable, _ = containers.unpack_location(location) if not self.placeables or (placeable != self.placeables[-1]): self.placeables.append(placeable)
def move_to_top(self, location, instrument=None, create_path=True): placeable, coordinates = containers.unpack_location(location) top_location = (placeable, placeable.from_center(x=0, y=0, z=1)) self.move_to(top_location, instrument, create_path)