Package gda.device.motor.simplemotor
Class SimpleMotor
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.motor.simplemotor.SimpleMotor
- All Implemented Interfaces:
Device,Motor,Configurable,Findable,gda.observable.IObservable,org.springframework.beans.factory.InitializingBean
public class SimpleMotor
extends FindableConfigurableBase
implements Motor, org.springframework.beans.factory.InitializingBean
part of
-
Field Summary
Fields inherited from interface gda.device.Motor
FAST, MEDIUM, SLOW, SPEED_LEVELS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIObserver(gda.observable.IObserver observer) voidvoidclose()Close and unconfigure the device.voidDo backlash correctionvoiddeleteIObserver(gda.observable.IObserver observer) voidgetAttribute(String attributeName) Get the value of the specified attributedoubleGets the maximum or upper soft limits of the motor itself (i.e.doubleGets the minimum or lower soft limits of the motor itself (i.e.doubledoubleGets the current position of the motorintdoublereturn the position tolerance or accuracygetSmc()doublegetSpeed()Gets the current speed setting of the motorGets the state of the motordoubleReturns this motor's time to velocity.doublevoidhome()Moves the motor to a repeatable starting locationbooleanReturns whether or not motor can homebooleanisHomed()Returns whether or not motor is already homedbooleanGets initialisition state of the motor with respect to its connection to low level device service e.g.booleanReturns whether or not limits are settable (in the motor itself).booleanisMoving()Returns whether or not motor is actually movingvoidmoveBy(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 possiblevoidRe-initialisation of values and states.voidsetAttribute(String attributeName, Object value) Set any attribute the implementing classes may providevoidsetMaxPosition(double maxPosition) Set the upper soft limit of the motorvoidsetMinPosition(double minPosition) Set the lower soft limit of the motorvoidsetPosition(double steps) Sets the current position of the motorvoidsetProtectionLevel(int newLevel) Sets the permission level for this object.voidvoidsetSoftLimits(double minPosition, double maxPosition) Sets the soft limits of the motor itself (i.e.voidsetSpeed(double speed) Sets the speed of the motorvoidsetSpeedLevel(int level) Sets the speed level of the motorvoidsetTimeToVelocity(double timeToVelocity) Sets this motor's time to velocity.voidstop()Brings the motor to a controlled stop if possibleBlocks while the motors status is BusyMethods inherited from class gda.factory.FindableConfigurableBase
getName, setNameMethods inherited from class gda.factory.ConfigurableBase
configure, isConfigureAtStartup, isConfigured, setConfiguredMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface gda.factory.Configurable
configure, isConfigureAtStartup, isConfigured
-
Constructor Details
-
SimpleMotor
public SimpleMotor()
-
-
Method Details
-
setAttribute
Description copied from interface:DeviceSet any attribute the implementing classes may provide- Specified by:
setAttributein interfaceDevice- Parameters:
attributeName- is the name of the attributevalue- is the value of the attribute- Throws:
DeviceException- if an attribute cannot be set
-
getAttribute
Description copied from interface:DeviceGet the value of the specified attribute- Specified by:
getAttributein interfaceDevice- Parameters:
attributeName- is the name of the attribute- Returns:
- the value of the attribute as an Object type
- Throws:
DeviceException- if an attribute cannot be retrieved
-
close
Description copied from interface:DeviceClose and unconfigure the device.- Specified by:
closein interfaceDevice- Throws:
DeviceException
-
setProtectionLevel
public void setProtectionLevel(int newLevel) Description copied from interface:DeviceSets the permission level for this object. If this is not set then a default value will be applied.- Specified by:
setProtectionLevelin interfaceDevice- Parameters:
newLevel-
-
getProtectionLevel
public int getProtectionLevel()- Specified by:
getProtectionLevelin interfaceDevice- Returns:
- int - the permission level for this object.
-
addIObserver
public void addIObserver(gda.observable.IObserver observer) - Specified by:
addIObserverin interfacegda.observable.IObservable
-
deleteIObserver
public void deleteIObserver(gda.observable.IObserver observer) - Specified by:
deleteIObserverin interfacegda.observable.IObservable
-
deleteIObservers
public void deleteIObservers()- Specified by:
deleteIObserversin interfacegda.observable.IObservable
-
reconfigure
Description copied from interface:ConfigurableRe-initialisation of values and states.Moved from Reconfigurable which has been deleted
- Specified by:
reconfigurein interfaceConfigurable- Overrides:
reconfigurein classConfigurableBase- Throws:
FactoryException
-
moveBy
Description copied from interface:MotorMoves the motor by the specified number of steps- Specified by:
moveByin interfaceMotor- 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- Specified by:
moveToin interfaceMotor- Parameters:
position- the number of steps to move to- Throws:
MotorException
-
moveContinuously
Description copied from interface:MotorMoves the motor in a continuous mode- Specified by:
moveContinuouslyin interfaceMotor- Parameters:
direction- direction to move in- Throws:
MotorException
-
setPosition
Description copied from interface:MotorSets the current position of the motor- Specified by:
setPositionin interfaceMotor- Parameters:
steps- the position to be set as current- Throws:
MotorException
-
getPosition
Description copied from interface:MotorGets the current position of the motor- Specified by:
getPositionin interfaceMotor- Returns:
- the current position
- Throws:
MotorException
-
setSpeed
Description copied from interface:MotorSets the speed of the motor- Specified by:
setSpeedin interfaceMotor- Parameters:
speed- the speed- Throws:
MotorException
-
setSpeedLevel
Description copied from interface:MotorSets the speed level of the motor- Specified by:
setSpeedLevelin interfaceMotor- Parameters:
level- one of a range of possible levels eg slow, medium, fast- Throws:
MotorException
-
getSpeed
Description copied from interface:MotorGets the current speed setting of the motor- Specified by:
getSpeedin interfaceMotor- Returns:
- the speed in steps per second
- Throws:
MotorException
-
getTimeToVelocity
Description copied from interface:MotorReturns this motor's time to velocity.- Specified by:
getTimeToVelocityin interfaceMotor- Throws:
MotorException
-
setTimeToVelocity
Description copied from interface:MotorSets this motor's time to velocity.- Specified by:
setTimeToVelocityin interfaceMotor- Throws:
MotorException
-
stop
Description copied from interface:MotorBrings the motor to a controlled stop if possible- Specified by:
stopin interfaceMotor- Throws:
MotorException
-
panicStop
Description copied from interface:MotorBrings the motor to an uncontrolled stop if possible- Specified by:
panicStopin interfaceMotor- Throws:
MotorException
-
getStatus
Description copied from interface:MotorGets the state of the motor- Specified by:
getStatusin interfaceMotor- Returns:
- a value from the MotorStatus enum
- Throws:
MotorException
-
correctBacklash
Description copied from interface:MotorDo backlash correction- Specified by:
correctBacklashin interfaceMotor- Throws:
MotorException
-
isMoving
Description copied from interface:MotorReturns whether or not motor is actually moving- Specified by:
isMovingin interfaceMotor- Returns:
- true if moving
- Throws:
MotorException
-
isHomeable
Description copied from interface:MotorReturns whether or not motor can home- Specified by:
isHomeablein interfaceMotor- Returns:
- true if homeable
- Throws:
MotorException
-
isHomed
Description copied from interface:MotorReturns whether or not motor is already homed- Specified by:
isHomedin interfaceMotor- Returns:
- true if homed
- Throws:
MotorException
-
home
Description copied from interface:MotorMoves the motor to a repeatable starting location- Specified by:
homein interfaceMotor- Throws:
MotorException
-
setSoftLimits
Description copied from interface:MotorSets the soft limits of the motor itself (i.e. NOT limits in our software)- Specified by:
setSoftLimitsin interfaceMotor- Parameters:
minPosition- minimum software limitmaxPosition- maximum software limit- Throws:
MotorException
-
getMinPosition
Description copied from interface:MotorGets the minimum or lower soft limits of the motor itself (i.e. NOT limits cached in GDA software). By convention return NaN if not set.- Specified by:
getMinPositionin interfaceMotor- Returns:
- the lower soft limit of the motor
- Throws:
MotorException
-
getMaxPosition
Description copied from interface:MotorGets the maximum or upper soft limits of the motor itself (i.e. NOT limits cached in GDA software). By convention return NaN if not set.- Specified by:
getMaxPositionin interfaceMotor- Returns:
- the upper soft limit of the motor
- Throws:
MotorException
-
getSmc
-
setSmc
-
setMinPosition
public void setMinPosition(double minPosition) Description copied from interface:MotorSet the lower soft limit of the motor- Specified by:
setMinPositionin interfaceMotor- Parameters:
minPosition- the lower limit to set
-
setMaxPosition
public void setMaxPosition(double maxPosition) Description copied from interface:MotorSet the upper soft limit of the motor- Specified by:
setMaxPositionin interfaceMotor- Parameters:
maxPosition- upper limit to set
-
isLimitsSettable
Description copied from interface:MotorReturns whether or not limits are settable (in the motor itself).- Specified by:
isLimitsSettablein interfaceMotor- Returns:
- true if the limits are settable.
- Throws:
MotorException
-
isInitialised
Description copied from interface:MotorGets initialisition state of the motor with respect to its connection to low level device service e.g. EPICS server. This value does not imply that the motors initial values are set (or not set).- Specified by:
isInitialisedin interfaceMotor- Returns:
- return true if motor is already initialised.
- Throws:
MotorException
-
getRetryDeadband
Description copied from interface:Motorreturn the position tolerance or accuracy- Specified by:
getRetryDeadbandin interfaceMotor- Returns:
- positioning tolerance
- Throws:
MotorException
-
getMotorResolution
- Specified by:
getMotorResolutionin interfaceMotor- Throws:
MotorException
-
getUserOffset
- Specified by:
getUserOffsetin interfaceMotor- Returns:
- the user offset set on the motor
- Throws:
MotorException
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
waitWhileStatusBusy
Description copied from interface:MotorBlocks while the motors status is Busy- Specified by:
waitWhileStatusBusyin interfaceMotor- Returns:
- status after being busy
- Throws:
InterruptedExceptionDeviceException
-
getUnitString
- Specified by:
getUnitStringin interfaceMotor- Returns:
- unit as a String
- Throws:
MotorException
-