# Path: concert/devices/motors/dummy.py
# class LinearMotor(_PositionMixin, base.LinearMotor):
# 
#     """A linear step motor dummy."""
# 
#     motion_velocity = Quantity(q.mm / q.s)
# 
#     def __init__(self, position=None, upper_hard_limit=None, lower_hard_limit=None):
#         base.LinearMotor.__init__(self)
#         _PositionMixin.__init__(self)
#         self._motion_velocity = 200000 * q.mm / q.s
# 
#         if position:
#             self._position = position
#         if upper_hard_limit:
#             self._upper_hard_limit = upper_hard_limit
#         if lower_hard_limit:
#             self._lower_hard_limit = lower_hard_limit
# 
# class RotationMotor(_PositionMixin, base.RotationMotor):
# 
#     """A rotational step motor dummy."""
# 
#     motion_velocity = Quantity(q.deg / q.s)
# 
#     def __init__(self, upper_hard_limit=None, lower_hard_limit=None):
#         base.RotationMotor.__init__(self)
#         _PositionMixin.__init__(self)
#         self._position = 0 * q.deg
#         self._lower_hard_limit = -np.inf * q.deg
#         self._upper_hard_limit = np.inf * q.deg
#         self._motion_velocity = 50000 * q.deg / q.s
#         if upper_hard_limit:
#             self._upper_hard_limit = upper_hard_limit
#         if lower_hard_limit:
#             self._lower_hard_limit = lower_hard_limit
# 
# Path: concert/devices/detectors/dummy.py
# class Detector(base.Detector):
# 
#     """A dummy detector."""
# 
#     def __init__(self, camera=None, magnification=None):
#         self._camera = Camera() if camera is None else camera
#         self._magnification = 3 if magnification is None else magnification
#         super(Detector, self).__init__()
# 
#     @property
#     def camera(self):
#         return self._camera
# 
#     @property
#     def magnification(self):
#         return self._magnification
# 
# Path: concert/devices/positioners/base.py
# INF_VECTOR = np.array((np.inf, np.inf, np.inf))
# class Axis(object):
# class Positioner(Device):
# class PositionerError(Exception):
#     def __init__(self, coordinate, motor, direction=1, position=None):
#     async def get_position(self):
#     async def set_position(self, position):
#     def __init__(self, axes, position=None):
#     async def move(self, position):
#     async def rotate(self, angles):
#     async def right(self, value):
#     async def left(self, value):
#     async def up(self, value):
#     async def down(self, value):
#     async def forward(self, value):
#     async def back(self, value):
#     async def _get_position(self):
#     async def _set_position(self, position):
#     async def _get_orientation(self):
#     async def _set_orientation(self, angles):
#     async def _get_vector(self, axes):
#     async def _set_vector(self, vector, axes):
# def _vectorize(scalar, coordinate):
# 
# Path: concert/devices/positioners/imaging.py
# class Positioner(base.Positioner):
# 
#     """
#     A positioner which takes into account a detector with some pixel size.
#     This way the user can specify the movement in pixels.
#     """
# 
#     def __init__(self, axes, detector, position=None):
#         super(Positioner, self).__init__(axes, position=position)
#         self.detector = detector
# 
#     @background
#     async def move(self, position):
#         """Move by specified *position* which can be given in meters or pixels."""
#         # Is there a better way to check units?
#         if str(position.units) == 'pixel':
#             mag = position.magnitude
#             if mag[-1] != 0 and not np.isnan(mag[-1]):
#                 raise base.PositionerError('Cannot set \'z\' coordinate position in pixels.')
# 
#             physical_position = [0, 0, 0]
#             width = (await self.detector.get_pixel_width()).to(q.m).magnitude
#             height = (await self.detector.get_pixel_height()).to(q.m).magnitude
#             physical_position[0] = position[0].magnitude * width
#             physical_position[1] = position[1].magnitude * height
#             physical_position *= q.m
#         else:
#             physical_position = position
# 
#         return await super(Positioner, self).move(physical_position)


from concert.devices.motors.dummy import LinearMotor, RotationMotor
from concert.devices.detectors.dummy import Detector
from concert.devices.positioners import base
from concert.devices.positioners.imaging import Positioner as ImagingBasePositioner
"""A Dummy positioner"""


def get_axes():
    """Get all the dummy axes."""
    x_lin = LinearMotor()
    y_lin = LinearMotor()
    z_lin = LinearMotor()
    x_rot = RotationMotor()
    y_rot = RotationMotor()

# Path: concert/devices/motors/dummy.py
# class LinearMotor(_PositionMixin, base.LinearMotor):
# 
#     """A linear step motor dummy."""
# 
#     motion_velocity = Quantity(q.mm / q.s)
# 
#     def __init__(self, position=None, upper_hard_limit=None, lower_hard_limit=None):
#         base.LinearMotor.__init__(self)
#         _PositionMixin.__init__(self)
#         self._motion_velocity = 200000 * q.mm / q.s
# 
#         if position:
#             self._position = position
#         if upper_hard_limit:
#             self._upper_hard_limit = upper_hard_limit
#         if lower_hard_limit:
#             self._lower_hard_limit = lower_hard_limit
# 
# class RotationMotor(_PositionMixin, base.RotationMotor):
# 
#     """A rotational step motor dummy."""
# 
#     motion_velocity = Quantity(q.deg / q.s)
# 
#     def __init__(self, upper_hard_limit=None, lower_hard_limit=None):
#         base.RotationMotor.__init__(self)
#         _PositionMixin.__init__(self)
#         self._position = 0 * q.deg
#         self._lower_hard_limit = -np.inf * q.deg
#         self._upper_hard_limit = np.inf * q.deg
#         self._motion_velocity = 50000 * q.deg / q.s
#         if upper_hard_limit:
#             self._upper_hard_limit = upper_hard_limit
#         if lower_hard_limit:
#             self._lower_hard_limit = lower_hard_limit
# 
# Path: concert/devices/detectors/dummy.py
# class Detector(base.Detector):
# 
#     """A dummy detector."""
# 
#     def __init__(self, camera=None, magnification=None):
#         self._camera = Camera() if camera is None else camera
#         self._magnification = 3 if magnification is None else magnification
#         super(Detector, self).__init__()
# 
#     @property
#     def camera(self):
#         return self._camera
# 
#     @property
#     def magnification(self):
#         return self._magnification
# 
# Path: concert/devices/positioners/base.py
# INF_VECTOR = np.array((np.inf, np.inf, np.inf))
# class Axis(object):
# class Positioner(Device):
# class PositionerError(Exception):
#     def __init__(self, coordinate, motor, direction=1, position=None):
#     async def get_position(self):
#     async def set_position(self, position):
#     def __init__(self, axes, position=None):
#     async def move(self, position):
#     async def rotate(self, angles):
#     async def right(self, value):
#     async def left(self, value):
#     async def up(self, value):
#     async def down(self, value):
#     async def forward(self, value):
#     async def back(self, value):
#     async def _get_position(self):
#     async def _set_position(self, position):
#     async def _get_orientation(self):
#     async def _set_orientation(self, angles):
#     async def _get_vector(self, axes):
#     async def _set_vector(self, vector, axes):
# def _vectorize(scalar, coordinate):
# 
# Path: concert/devices/positioners/imaging.py
# class Positioner(base.Positioner):
# 
#     """
#     A positioner which takes into account a detector with some pixel size.
#     This way the user can specify the movement in pixels.
#     """
# 
#     def __init__(self, axes, detector, position=None):
#         super(Positioner, self).__init__(axes, position=position)
#         self.detector = detector
# 
#     @background
#     async def move(self, position):
#         """Move by specified *position* which can be given in meters or pixels."""
#         # Is there a better way to check units?
#         if str(position.units) == 'pixel':
#             mag = position.magnitude
#             if mag[-1] != 0 and not np.isnan(mag[-1]):
#                 raise base.PositionerError('Cannot set \'z\' coordinate position in pixels.')
# 
#             physical_position = [0, 0, 0]
#             width = (await self.detector.get_pixel_width()).to(q.m).magnitude
#             height = (await self.detector.get_pixel_height()).to(q.m).magnitude
#             physical_position[0] = position[0].magnitude * width
#             physical_position[1] = position[1].magnitude * height
#             physical_position *= q.m
#         else:
#             physical_position = position
# 
#         return await super(Positioner, self).move(physical_position)


# Path: concert/devices/positioners/dummy.py
from concert.devices.motors.dummy import LinearMotor, RotationMotor
from concert.devices.detectors.dummy import Detector
from concert.devices.positioners import base
from concert.devices.positioners.imaging import Positioner as ImagingBasePositioner

"""A Dummy positioner"""


def get_axes():
    """Get all the dummy axes."""
    x_lin = LinearMotor()
    y_lin = LinearMotor()
    z_lin = LinearMotor()
    x_rot = RotationMotor()
    y_rot = RotationMotor()

    z_rot = RotationMotor()