Class ThreadlessDummyMotor

All Implemented Interfaces:
Device, Motor, Configurable, Findable, gda.observable.IObservable, Serializable

public class ThreadlessDummyMotor extends MotorBase
A dummy version of Motor.

While motor is not moving, no background thread is required.

See Also:
  • Constructor Details

    • ThreadlessDummyMotor

      public ThreadlessDummyMotor()
  • Method Details

    • configure

      public void configure() throws FactoryException
      Description copied from class: ConfigurableBase
      Default implementation for classes that do not have to do any specific configuration.
      Classes that do their own configuration should *not* call this superclass function, as it may cause the object to appear configured before it really is.
      Specified by:
      configure in interface Configurable
      Overrides:
      configure in class ConfigurableBase
      Throws:
      FactoryException - if there is an error in configuration e.g. required variable not set or cannot connect to device
    • shutdown

      public void shutdown()
      Stop all updates for this motor. This motor will no longer respond to move requests
    • moveBy

      public void moveBy(double increment) throws MotorException
      Description copied from interface: Motor
      Moves the motor by the specified number of steps
      Parameters:
      increment - the number of steps to move by
      Throws:
      MotorException
    • moveTo

      public void moveTo(double position) throws MotorException
      Description copied from interface: Motor
      Moves the motor to the specified position in steps
      Parameters:
      position - the number of steps to move to
      Throws:
      MotorException
    • moveContinuously

      public void moveContinuously(int direction) throws MotorException
      Description copied from interface: Motor
      Moves the motor in a continuous mode
      Parameters:
      direction - direction to move in
      Throws:
      MotorException
    • setPosition

      public void setPosition(double steps)
      Description copied from interface: Motor
      Sets the current position of the motor
      Parameters:
      steps - the position to be set as current
    • getPosition

      public double getPosition()
      Description copied from interface: Motor
      Gets the current position of the motor
      Returns:
      the current position
    • setSpeed

      public void setSpeed(double speed)
      Description copied from interface: Motor
      Sets the speed of the motor
      Parameters:
      speed - the speed
    • getSpeed

      public double getSpeed()
      Description copied from interface: Motor
      Gets the current speed setting of the motor
      Returns:
      the speed in steps per second
    • stop

      public void stop()
      Description copied from interface: Motor
      Brings the motor to a controlled stop if possible
    • panicStop

      public void panicStop()
      Description copied from interface: Motor
      Brings the motor to an uncontrolled stop if possible
    • getStatus

      public MotorStatus getStatus()
      Description copied from interface: Motor
      Gets the state of the motor
      Returns:
      a value from the MotorStatus enum
    • isMoving

      public boolean isMoving()
      Description copied from interface: Motor
      Returns whether or not motor is actually moving
      Returns:
      true if moving
    • getTolerance

      public double getTolerance()
      Get the tolerance of this motor - two positions within this distance of each other are considered equal.
    • setTolerance

      public void setTolerance(double tolerance)
      Set the tolerance of this motor - two positions within this distance of each other are considered equal.

      Tolerance must be > 0;

    • getUpdateInterval

      public long getUpdateInterval()
    • setUpdateInterval

      public void setUpdateInterval(long updateInterval)
      Set the time (in ms) between position and status updates. This cannot be changed while the motor is running.
      Parameters:
      updateInterval - Time between position/status updates (in ms).
    • getMaxSpeed

      public double getMaxSpeed()
    • setMaxSpeed

      public void setMaxSpeed(double maxSpeed)
    • isHomeable

      public boolean isHomeable()
      Description copied from class: MotorBase
      Checks if the motor is homeable or not. Motor implementations should overide this method if required.
      Specified by:
      isHomeable in interface Motor
      Overrides:
      isHomeable in class MotorBase
      Returns:
      if the motor is homeable. Returns false!
    • setHomeable

      public void setHomeable(boolean isHomeable)
    • home

      public void home() throws MotorException
      Description copied from class: MotorBase
      Moves the motor to a repeatable starting location. Motor implementations should overide this method if required.
      Specified by:
      home in interface Motor
      Overrides:
      home in class MotorBase
      Throws:
      MotorException
    • isHomed

      public boolean isHomed()
      Description copied from class: MotorBase
      Checks if the motor is homed or not. Motor implementations should overide this method if required.
      Specified by:
      isHomed in interface Motor
      Overrides:
      isHomed in class MotorBase
      Returns:
      if the motor is homed. Returns false!
    • isRandomlyProduceExceptions

      public boolean isRandomlyProduceExceptions()
    • setRandomlyProduceExceptions

      public void setRandomlyProduceExceptions(boolean randomlyProduceExceptions)
    • getRandomExceptionTriggerLevel

      public double getRandomExceptionTriggerLevel()
    • setRandomExceptionTriggerLevel

      public void setRandomExceptionTriggerLevel(double randomExceptionTriggerLevel)
    • getRandomLimitTriggerLevel

      public double getRandomLimitTriggerLevel()
    • setRandomLimitTriggerLevel

      public void setRandomLimitTriggerLevel(double randomLimitTriggerLevel)
    • isRandomPositionVariation

      public boolean isRandomPositionVariation()
    • setRandomPositionVariation

      public void setRandomPositionVariation(boolean randomPositionVariation)
    • getRandomPositionVariationAmount

      public double getRandomPositionVariationAmount()
    • setRandomPositionVariationAmount

      public void setRandomPositionVariationAmount(double randomPositionVariationAmount)
    • getUnitString

      public String getUnitString()
      Specified by:
      getUnitString in interface Motor
      Overrides:
      getUnitString in class MotorBase
      Returns:
      unit as a String
    • setUnitString

      public void setUnitString(String unitString)
    • getLowerHardLimit

      public double getLowerHardLimit()
    • setLowerHardLimit

      public void setLowerHardLimit(double lowerHardLimit)
    • getUpperHardLimit

      public double getUpperHardLimit()
    • setUpperHardLimit

      public void setUpperHardLimit(double upperHardLimit)
    • setTimeToVelocity

      public void setTimeToVelocity(double timeToVelocity)
      Description copied from interface: Motor
      Sets this motor's time to velocity.
      Specified by:
      setTimeToVelocity in interface Motor
      Overrides:
      setTimeToVelocity in class MotorBase
    • seedRandomVariation

      public static void seedRandomVariation(long seed)