Package gda.device.motor
Class ThreadlessDummyMotor
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.device.motor.MotorBase
gda.device.motor.ThreadlessDummyMotor
- All Implemented Interfaces:
Device,Motor,Configurable,Findable,gda.observable.IObservable,Serializable
A dummy version of
Motor.
While motor is not moving, no background thread is required.
- See Also:
-
Field Summary
Fields inherited from class gda.device.motor.MotorBase
correctBacklash, isInitialised, maxPosition, minPositionFields inherited from class gda.device.DeviceBase
DEFAULT_PROTECTION_LEVEL_PROPERTYFields inherited from interface gda.device.Motor
FAST, MEDIUM, SLOW, SPEED_LEVELS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDefault 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.doubledoubledoubleGets the current position of the motordoubledoubledoubledoublegetSpeed()Gets the current speed setting of the motorGets the state of the motordoubleGet the tolerance of this motor - two positions within this distance of each other are considered equal.longdoublevoidhome()Moves the motor to a repeatable starting location.booleanChecks if the motor is homeable or not.booleanisHomed()Checks if the motor is homed or not.booleanisMoving()Returns whether or not motor is actually movingbooleanbooleanvoidmoveBy(double increment) Moves the motor by the specified number of stepsvoidmoveContinuously(int direction) Moves the motor in a continuous modevoidmoveTo(double position) Moves the motor to the specified position in stepsvoidBrings the motor to an uncontrolled stop if possiblestatic voidseedRandomVariation(long seed) voidsetHomeable(boolean isHomeable) voidsetLowerHardLimit(double lowerHardLimit) voidsetMaxSpeed(double maxSpeed) voidsetPosition(double steps) Sets the current position of the motorvoidsetRandomExceptionTriggerLevel(double randomExceptionTriggerLevel) voidsetRandomLimitTriggerLevel(double randomLimitTriggerLevel) voidsetRandomlyProduceExceptions(boolean randomlyProduceExceptions) voidsetRandomPositionVariation(boolean randomPositionVariation) voidsetRandomPositionVariationAmount(double randomPositionVariationAmount) voidsetSpeed(double speed) Sets the speed of the motorvoidsetTimeToVelocity(double timeToVelocity) Sets this motor's time to velocity.voidsetTolerance(double tolerance) Set the tolerance of this motor - two positions within this distance of each other are considered equal.voidsetUnitString(String unitString) voidsetUpdateInterval(long updateInterval) Set the time (in ms) between position and status updates.voidsetUpperHardLimit(double upperHardLimit) voidshutdown()Stop all updates for this motor.voidstop()Brings the motor to a controlled stop if possibleMethods inherited from class gda.device.motor.MotorBase
addInBacklash, correctBacklash, getBacklashSteps, getFastSpeed, getMaxPosition, getMediumSpeed, getMinPosition, getMotorResolution, getRetryDeadband, getSlowSpeed, getTimeToVelocity, getUserOffset, isInitialised, isLimitsSettable, setBacklashSteps, setFastSpeed, setInitialised, setLimitsSettable, setMaxPosition, setMediumSpeed, setMinPosition, setMotorResolution, setSlowSpeed, setSoftLimits, setSpeedLevel, waitWhileStatusBusyMethods inherited from class gda.device.DeviceBase
addIObserver, close, deleteIObserver, deleteIObservers, getAttribute, getName, getProtectionLevel, isBeingObserved, isConfigureAtStartup, notifyIObservers, setAttribute, setConfigureAtStartup, setName, setProtectionLevelMethods inherited from class gda.factory.ConfigurableBase
isConfigured, reconfigure, setConfiguredMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface gda.factory.Configurable
isConfigureAtStartup, isConfigured, reconfigureMethods inherited from interface gda.device.Device
close, getAttribute, getProtectionLevel, setAttribute, setProtectionLevelMethods inherited from interface gda.observable.IObservable
addIObserver, deleteIObserver, deleteIObservers
-
Constructor Details
-
ThreadlessDummyMotor
public ThreadlessDummyMotor()
-
-
Method Details
-
configure
Description copied from class:ConfigurableBaseDefault 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:
configurein interfaceConfigurable- Overrides:
configurein classConfigurableBase- 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
Description copied from interface:MotorMoves the motor by the specified number of steps- Parameters:
increment- the number of steps to move by- Throws:
MotorException
-
moveTo
Description copied from interface:MotorMoves the motor to the specified position in steps- Parameters:
position- the number of steps to move to- Throws:
MotorException
-
moveContinuously
Description copied from interface:MotorMoves the motor in a continuous mode- Parameters:
direction- direction to move in- Throws:
MotorException
-
setPosition
public void setPosition(double steps) Description copied from interface:MotorSets the current position of the motor- Parameters:
steps- the position to be set as current
-
getPosition
public double getPosition()Description copied from interface:MotorGets the current position of the motor- Returns:
- the current position
-
setSpeed
public void setSpeed(double speed) Description copied from interface:MotorSets the speed of the motor- Parameters:
speed- the speed
-
getSpeed
public double getSpeed()Description copied from interface:MotorGets the current speed setting of the motor- Returns:
- the speed in steps per second
-
stop
public void stop()Description copied from interface:MotorBrings the motor to a controlled stop if possible -
panicStop
public void panicStop()Description copied from interface:MotorBrings the motor to an uncontrolled stop if possible -
getStatus
Description copied from interface:MotorGets the state of the motor- Returns:
- a value from the MotorStatus enum
-
isMoving
public boolean isMoving()Description copied from interface:MotorReturns 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:MotorBaseChecks if the motor is homeable or not. Motor implementations should overide this method if required.- Specified by:
isHomeablein interfaceMotor- Overrides:
isHomeablein classMotorBase- Returns:
- if the motor is homeable. Returns false!
-
setHomeable
public void setHomeable(boolean isHomeable) -
home
Description copied from class:MotorBaseMoves the motor to a repeatable starting location. Motor implementations should overide this method if required.- Specified by:
homein interfaceMotor- Overrides:
homein classMotorBase- Throws:
MotorException
-
isHomed
public boolean isHomed()Description copied from class:MotorBaseChecks if the motor is homed or not. Motor implementations should overide this method if required. -
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
- Specified by:
getUnitStringin interfaceMotor- Overrides:
getUnitStringin classMotorBase- Returns:
- unit as a String
-
setUnitString
-
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:MotorSets this motor's time to velocity.- Specified by:
setTimeToVelocityin interfaceMotor- Overrides:
setTimeToVelocityin classMotorBase
-
seedRandomVariation
public static void seedRandomVariation(long seed)
-