import re import json from opentrons.util import log log = log.get_logger(__name__) class VirtualSmoothie(object): def init_coordinates(self): self.coordinates = { 'current': { 'x': 0, 'y': 0, 'z': 0, 'a': 0, 'b': 0 }, 'target': { 'x': 0, 'y': 0, 'z': 0, 'a': 0, 'b': 0 } } for axis in 'xyzab': self.coordinates['current'][axis] = 0.0 self.coordinates['target'][axis] = 0.0
from opentrons import containers from opentrons.drivers import motor as motor_drivers from opentrons.drivers.virtual_smoothie import VirtualSmoothie from opentrons.robot.command import Command from opentrons.util import trace from opentrons.util.vector import Vector from opentrons.util.log import get_logger from opentrons.drivers import virtual_smoothie from opentrons.helpers import helpers from opentrons.util.trace import traceable from opentrons.util.singleton import Singleton from opentrons.util.environment import settings log = get_logger(__name__) class InstrumentMosfet(object): """ Provides access to MagBead's MOSFET. """ def __init__(self, driver, mosfet_index): self.motor_driver = driver self.mosfet_index = mosfet_index def engage(self): """ Engages the MOSFET. """
from opentrons.util import trace DEFAULTS_DIR_PATH = pkg_resources.resource_filename('opentrons.config', 'smoothie') DEFAULTS_FILE_PATH = os.path.join(DEFAULTS_DIR_PATH, 'smoothie-defaults.ini') CONFIG_DIR_PATH = os.environ.get('APP_DATA_DIR', os.getcwd()) CONFIG_DIR_PATH = os.path.join(CONFIG_DIR_PATH, 'smoothie') CONFIG_FILE_PATH = os.path.join(CONFIG_DIR_PATH, 'smoothie-config.ini') JSON_ERROR = None if sys.version_info > (3, 4): JSON_ERROR = ValueError else: JSON_ERROR = json.decoder.JSONDecodeError log = get_logger(__name__) class CNCDriver(object): """ This object outputs raw GCode commands to perform high-level tasks. """ MOVE = 'G0' DWELL = 'G4' HOME = 'G28' SET_POSITION = 'G92' GET_POSITION = 'M114' GET_ENDSTOPS = 'M119' SET_SPEED = 'G0' HALT = 'M112'
import re import json from opentrons.util import log log = log.get_logger(__name__) class VirtualSmoothie(object): def init_coordinates(self): self.coordinates = { 'current': {'x': 0, 'y': 0, 'z': 0, 'a': 0, 'b': 0}, 'target': {'x': 0, 'y': 0, 'z': 0, 'a': 0, 'b': 0} } for axis in 'xyzab': self.coordinates['current'][axis] = 0.0 self.coordinates['target'][axis] = 0.0 def __init__(self, port, options): self.port = port self.limit_switches = options['limit_switches'] self.config = options['config'] self.version = options['firmware'] self.responses = [] self.absolute = True self.is_open = False self.speed = { 'head': 0.0, 'plunger': { 'a': 0.0,