Package gda.px.sampleChanger
Class JActorSampleChanger
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.px.sampleChanger.JActorSampleChanger
- All Implemented Interfaces:
Device,Stoppable,Configurable,Findable,gda.observable.IObservable,BlockedPositions,IJActorSampleChanger,IJCameramanObserver,SampleChanger
- Direct Known Subclasses:
DummyJCameramanSampleChanger,OscarSampleChanger
public class JActorSampleChanger
extends DeviceBase
implements IJActorSampleChanger, IJCameramanObserver
For ACTOR sample changers. Also acts as a base class for other SampleChanger classes using the JCameraman API.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classObserves the pss and records details of the latest changed -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanflag to say if the camera client has been initialised (camera and sample positioner controls)protected booleanif a sample has been mounted but not centred yetprotected Double[]List of angles to use during auto-centringprotected JCameramanControllerThe JCameramanController object this object is using to communicate with Cameramanprotected Stringhost name of the computer running cameramanprotected booleanFields inherited from class gda.device.DeviceBase
DEFAULT_PROTECTION_LEVEL_PROPERTYFields inherited from interface gda.px.sampleChanger.SampleChanger
APPROVERNAME, ATTRIBUTE_IS_SOAKING, EMPTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void_move(gda.px.sampleChanger.JActorSampleChanger.GdaPosition oldGdaPosition, gda.px.sampleChanger.JActorSampleChanger.GdaPosition newGdaPosition) protected void_unload(boolean dryAtEnd) voidabort()Not a panic stop, but clears the robots error state to allow it to be moved to the wait location.voidanneal(int time) Anneal the currently mounted samplevoidcentrelid(int lidNumber) Calls close lid on the api which automatically centres the lidvoidvoidcommandComplete(rigaku.jcameraman.RobotEvent event) Called when a command has been completed in the Rigaku system.voidDefault 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.voidSets this object to a state where it has to be reconfigured and enabled to work again.voiddispose()Disposes of the currently mounted sample.voiddry()Checks status and performs a dry.booleangetAttribute(String attributeName) Get the value of the specified attributeFor SampleChangers which are set to read barcodes, returns as a string the barcode of the sample mounted during the last load operation.protected StringintReturns the number of the holder of the current loaded sample.int[]Returns a string representing the type of puck in usegetHost()rigaku.jcameraman.RobotClient.RobotLocationintReturns the number of holders (pucks) over all available dewars to load from.intgetPuckName(int position) booleanintGet the position in its holder of the currently loaded sample.intgetSamplesInHolder(int holder) Returns the number of samples in the specified holder (puck).intThis is current progress of the sample changer.Returns a string of the Java class of the type of this sample changer.voidgotoWait()Moves the robot to the wait position.protected voidbooleanReturnstrueif the user needs to centre the crystal.booleanReturns true if this sample changer is in use for loading samples.booleanisPositionBlocked(int holder, int sample) booleanbooleanReturns true if a sample is in the sample position on the beamline.booleanisSampleLoaded(int holder, int sample) Returns true if loaded sample has the specified index.voidload(int holder, int sample) Load a sample.protected voidSets the status to error and changes the errorMessage attribute to a useful message.voidmove(int oldHolder, int oldSample, int newHolder, int newSample) voidIn this class, shutdown means continue no further after current operation.voidRe-initialisation of values and states.voidsetActionApproverName(String actionApproverName) voidsetAttribute(String attributeName, Object value) Set any attribute the implementing classes may providevoidsetCentreRequired(boolean centringRequired) Sets the centre required flag.voidsetEnabled(boolean enabled) Sets if the sample changer is currently in use.voidsetHolderType(String puckType) Sets a string representing the type of puck in use e.g.voidSet the name of the machine running Cameraman2.voidsetLoadedSample(int holder, int sample) Sets the holder and sample numbers of the loaded sample.voidsetNumberOfHolders(int numberOfHolders) Sets the number of total holders (pucks/magazines/plates etc.) that the sample changer can load fromvoidsetNumberOfPlates(int numberOfPlates) voidsetPssPVName(String pssPVName) voidsetReadingBarcodes(boolean readDuringLoad) Sets whether to read barcodes during each load operationvoidsetSamplesInEveryHolder(int samplesPerHolder) Sets the number of samples in every holder to the same value.voidsetSamplesInHolder(int holder, int samples) Sets the number of samples in the specified holder.voidsetSoakAfterOperation(boolean soakAfterOperation) voidsetSpecialPinPuckNumber(int specialPinPuckNumber) protected final voidsetState(SampleChangerStatus status) voidsoak(int dewarNumber) Soaks the end effector.voidstop()Stops the current operation.voidstore(int holder, int sample) Unmounts the current sample and puts it into the given location.voidunload()Unloads the current sample without loading a new one.booleanReturns when the sample changer has finished its current operation.Methods inherited from class gda.device.DeviceBase
addIObserver, close, deleteIObserver, deleteIObservers, getName, getProtectionLevel, isBeingObserved, isConfigureAtStartup, notifyIObservers, setConfigureAtStartup, setName, setProtectionLevelMethods inherited from class gda.factory.ConfigurableBase
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
isConfigureAtStartup, isConfiguredMethods inherited from interface gda.device.Device
close, getProtectionLevel, setProtectionLevelMethods inherited from interface gda.observable.IObservable
addIObserver, deleteIObserver, deleteIObservers
-
Field Details
-
cameraClientInitialised
protected boolean cameraClientInitialisedflag to say if the camera client has been initialised (camera and sample positioner controls) -
centreRequired
protected boolean centreRequiredif a sample has been mounted but not centred yet -
host
host name of the computer running cameraman -
controller
The JCameramanController object this object is using to communicate with Cameraman -
centringAngles
List of angles to use during auto-centring -
readingBarcodes
protected boolean readingBarcodes
-
-
Constructor Details
-
JActorSampleChanger
public JActorSampleChanger()Constructor.
-
-
Method Details
-
getSpecialPinPuckNumber
public int getSpecialPinPuckNumber()- Specified by:
getSpecialPinPuckNumberin interfaceIJActorSampleChanger
-
setSpecialPinPuckNumber
public void setSpecialPinPuckNumber(int specialPinPuckNumber) -
abort
Not a panic stop, but clears the robots error state to allow it to be moved to the wait location.- Throws:
DeviceException- See Also:
-
anneal
Anneal the currently mounted sample- Parameters:
time-- Throws:
DeviceException
-
centrelid
Calls close lid on the api which automatically centres the lid- Specified by:
centrelidin interfaceIJActorSampleChanger- Throws:
DeviceException
-
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
-
firstOperationSinceInterlock
public boolean firstOperationSinceInterlock()- Returns:
- true if this is the first time the robot has been operated since the EH pss was interlocked. If this is true then users should be asked if they are sure the robot has been centred
-
dispose
Disposes of the currently mounted sample.- Throws:
DeviceException
-
dry
Checks status and performs a dry. If an eStop has occurred then reconnect to Cameraman and dry.- Throws:
DeviceException
-
getActionApproverName
- Specified by:
getActionApproverNamein interfaceSampleChanger- Returns:
- Returns the actionApproverName.
-
getAttribute
Description copied from interface:DeviceGet the value of the specified attribute- Specified by:
getAttributein interfaceDevice- Overrides:
getAttributein classDeviceBase- 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
-
getBarcode
Description copied from interface:SampleChangerFor SampleChangers which are set to read barcodes, returns as a string the barcode of the sample mounted during the last load operation.- Specified by:
getBarcodein interfaceSampleChanger- Returns:
- the barcode of the currently mounted sample
- Throws:
DeviceException
-
getHolder
Description copied from interface:SampleChangerReturns the number of the holder of the current loaded sample.- Specified by:
getHolderin interfaceSampleChanger- Returns:
- int
- Throws:
DeviceException
-
getHolderAndSample
- Specified by:
getHolderAndSamplein interfaceIJActorSampleChanger- Throws:
DeviceException
-
getHolderType
Description copied from interface:SampleChangerReturns a string representing the type of puck in use- Specified by:
getHolderTypein interfaceSampleChanger- Returns:
- string
- Throws:
DeviceException
-
getHost
- Returns:
- name of the machine running Cameraman2
-
getPssPVName
- Returns:
- the pssPVName
-
setPssPVName
- Parameters:
pssPVName- the pssPVName to set
-
getImageBySocket
- Returns:
- the latest Image object collected by Cameraman
- Throws:
rigaku.jcameraman.CameraException
-
getNumberOfHolders
public int getNumberOfHolders()Description copied from interface:SampleChangerReturns the number of holders (pucks) over all available dewars to load from.- Specified by:
getNumberOfHoldersin interfaceSampleChanger- Returns:
- int
-
getReadingBarcodes
- Specified by:
getReadingBarcodesin interfaceSampleChanger- Returns:
- true if the samplechanger will read barcodes during loading.
- Throws:
DeviceException
-
getSample
Description copied from interface:SampleChangerGet the position in its holder of the currently loaded sample.- Specified by:
getSamplein interfaceSampleChanger- Returns:
- int
- Throws:
DeviceException
-
getSamplesInHolder
public int getSamplesInHolder(int holder) Description copied from interface:SampleChangerReturns the number of samples in the specified holder (puck).- Specified by:
getSamplesInHolderin interfaceSampleChanger- Parameters:
holder- the holder number (starting from 1)- Returns:
- the number of samples in that holder
-
getStatus
This is current progress of the sample changer. If the status is ERROR then this means that the last command has completed but failed. You should ignore this and try subsequent commands anyway. All failed commands should throw an exception (apart from dry operations at the end of loading/exchanging/unloading).- Specified by:
getStatusin interfaceSampleChanger- Returns:
- the current status of the sample changer as a SampleChangerStatus object
- See Also:
-
getTypeString
Description copied from interface:SampleChangerReturns a string of the Java class of the type of this sample changer.- Specified by:
getTypeStringin interfaceSampleChanger- Returns:
- java.lang.String
- Throws:
DeviceException
-
gotoWait
Moves the robot to the wait position. This can be useful when recovering from an error.- Throws:
DeviceException
-
panicStop
public void panicStop()In this class, shutdown means continue no further after current operation. -
initialise
- Throws:
DeviceException
-
isCentreRequired
Description copied from interface:SampleChangerReturnstrueif the user needs to centre the crystal.- Specified by:
isCentreRequiredin interfaceSampleChanger- Throws:
DeviceException
-
isEnabled
public boolean isEnabled()Description copied from interface:SampleChangerReturns true if this sample changer is in use for loading samples.- Specified by:
isEnabledin interfaceSampleChanger- Returns:
- boolean
-
isSampleLoaded
Description copied from interface:SampleChangerReturns true if a sample is in the sample position on the beamline.- Specified by:
isSampleLoadedin interfaceSampleChanger- Returns:
- boolean
- Throws:
DeviceException
-
isSampleDetected
- Throws:
DeviceException
-
load
Description copied from interface:SampleChangerLoad a sample.- Specified by:
loadin interfaceSampleChanger- Parameters:
holder- the holder number (≥1)sample- the sample number (≥1)- Throws:
DeviceException
-
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
-
setActionApproverName
- Specified by:
setActionApproverNamein interfaceSampleChanger- Parameters:
actionApproverName- The actionApproverName to set.
-
setAttribute
Description copied from interface:DeviceSet any attribute the implementing classes may provide- Specified by:
setAttributein interfaceDevice- Overrides:
setAttributein classDeviceBase- Parameters:
attributeName- is the name of the attributevalue- is the value of the attribute- Throws:
DeviceException- if an attribute cannot be set
-
setCentreRequired
Description copied from interface:SampleChangerSets the centre required flag. This enables the detector to be told when manual centring has been successfully completed.- Specified by:
setCentreRequiredin interfaceSampleChanger- Parameters:
centringRequired-- Throws:
DeviceException
-
setEnabled
Description copied from interface:SampleChangerSets if the sample changer is currently in use.- Specified by:
setEnabledin interfaceSampleChanger- Parameters:
enabled-- Throws:
DeviceException
-
setHolderType
Description copied from interface:SampleChangerSets a string representing the type of puck in use e.g. "Rigaku"- Specified by:
setHolderTypein interfaceSampleChanger- Parameters:
puckType-- Throws:
DeviceException
-
setHost
Set the name of the machine running Cameraman2.- Parameters:
host-
-
clearSample
- Specified by:
clearSamplein interfaceIJActorSampleChanger- Throws:
DeviceException
-
setLoadedSample
public void setLoadedSample(int holder, int sample) Description copied from interface:SampleChangerSets the holder and sample numbers of the loaded sample. To be used if a sample is manually mounted onto the sample changer.- Specified by:
setLoadedSamplein interfaceSampleChanger- Parameters:
holder- the holder numbersample- the sample number
-
setNumberOfHolders
public void setNumberOfHolders(int numberOfHolders) Description copied from interface:SampleChangerSets the number of total holders (pucks/magazines/plates etc.) that the sample changer can load from- Specified by:
setNumberOfHoldersin interfaceSampleChanger- Parameters:
numberOfHolders-
-
setNumberOfPlates
public void setNumberOfPlates(int numberOfPlates) -
getNumberOfPlates
public int getNumberOfPlates() -
setReadingBarcodes
Description copied from interface:SampleChangerSets whether to read barcodes during each load operation- Specified by:
setReadingBarcodesin interfaceSampleChanger- Parameters:
readDuringLoad-- Throws:
DeviceException
-
setSamplesInHolder
public void setSamplesInHolder(int holder, int samples) Description copied from interface:SampleChangerSets the number of samples in the specified holder. Used when changing the puck type mid-experiment.- Specified by:
setSamplesInHolderin interfaceSampleChanger- Parameters:
holder- the holder number (starting from 1)samples- the number of samples in that holder
-
setSamplesInEveryHolder
public void setSamplesInEveryHolder(int samplesPerHolder) Sets the number of samples in every holder to the same value.- Parameters:
samplesPerHolder- the number of samples in each holder
-
setSoakAfterOperation
- Parameters:
soakAfterOperation-- Throws:
DeviceException- See Also:
-
getLocation
- Specified by:
getLocationin interfaceIJActorSampleChanger- Returns:
- The location of the robot e.g. RobotLocation.SOAK
- Throws:
DeviceException
-
soak
Soaks the end effector. This will not do anything if the end effector is already in the fast screen mode location.Note that this returns immediately and leaves the sample changer in a SOAKING status!
Note that this will leave the end effector in the dewar and a mount/unmount or return to safe should be called asap after this function returns.
- Specified by:
soakin interfaceIJActorSampleChanger- Throws:
DeviceException
-
store
Unmounts the current sample and puts it into the given location. Assumes that the sample has been manually mounted and the user has checked that nothing is in the holder at that position.- Parameters:
holder-sample-- Throws:
DeviceException
-
move
- Throws:
DeviceException
-
_move
protected void _move(gda.px.sampleChanger.JActorSampleChanger.GdaPosition oldGdaPosition, gda.px.sampleChanger.JActorSampleChanger.GdaPosition newGdaPosition) throws DeviceException - Throws:
DeviceException
-
unload
Description copied from interface:SampleChangerUnloads the current sample without loading a new one.- Specified by:
unloadin interfaceSampleChanger- Throws:
DeviceException
-
_unload
- Throws:
DeviceException
-
waitForIdle
Description copied from interface:SampleChangerReturns when the sample changer has finished its current operation.- Specified by:
waitForIdlein interfaceSampleChanger- Returns:
- true if the current operation was successful
- Throws:
DeviceException
-
disconnect
public void disconnect()Sets this object to a state where it has to be reconfigured and enabled to work again. -
setState
- Parameters:
status-
-
logActorException
protected void logActorException()Sets the status to error and changes the errorMessage attribute to a useful message.Does not throw an exception: the decision to do this should be made by the calling method.
-
commandComplete
public void commandComplete(rigaku.jcameraman.RobotEvent event) Description copied from interface:IJCameramanObserverCalled when a command has been completed in the Rigaku system.- Specified by:
commandCompletein interfaceIJCameramanObserver- Parameters:
event- - the event that has just been completed.
-
getErrorMessage
-
stop
Description copied from interface:StoppableStops the current operation.- Specified by:
stopin interfaceSampleChanger- Specified by:
stopin interfaceStoppable- Throws:
DeviceException
-
isSampleLoaded
Description copied from interface:SampleChangerReturns true if loaded sample has the specified index.- Specified by:
isSampleLoadedin interfaceSampleChanger- Parameters:
holder- the holder index (≥1)sample- the sample index (≥1)- Returns:
- boolean
- Throws:
DeviceException
-
getPuckName
- Specified by:
getPuckNamein interfaceIJActorSampleChanger
-
isPositionBlocked
public boolean isPositionBlocked(int holder, int sample) - Specified by:
isPositionBlockedin interfaceBlockedPositions
-
getBlockedPositions
- Specified by:
getBlockedPositionsin interfaceBlockedPositions
-