Package gda.px.sampleChanger
Class SampleChangerBase
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.px.sampleChanger.SampleChangerBase
- All Implemented Interfaces:
Device,Stoppable,Configurable,Findable,gda.observable.IObservable,BlockedPositions,SampleChanger
- Direct Known Subclasses:
ActorSampleChanger,DummySampleChanger
Base class for classes implementing the SampleChanger Interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected booleanprotected intprotected Stringprotected booleanprotected intprotected booleanprotected intprotected int[]protected SampleChangerStatusprotected StringFields 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 TypeMethodDescriptionintReturns the number of the holder of the current loaded sample.Returns a string representing the type of puck in useintReturns the number of holders (pucks) over all available dewars to load from.booleanintGet the position in its holder of the currently loaded sample.intgetSamplesInHolder(int holder) Returns the number of samples in the specified holder (puck).Returns a string of the Java class of the type of this sample changer.booleanReturnstrueif the user needs to centre the crystal.booleanReturns true if this sample changer is in use for loading samples.protected booleanisHolderInRange(int holder) protected booleanisSampleInRange(int holder, int sample) booleanReturns 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.voidsetActionApproverName(String actionApproverName) voidsetCentreRequired(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.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 fromvoidsetReadingBarcodes(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.protected voidsetState(SampleChangerStatus state) voidsetTestState(SampleChangerStatus testState) voidvoidstop()Stops the current operation.protected static voidtestLoadSafe(String actionApproverName) Runs a Jython command to see if the given ActionApprover will OK a load or unload operationbooleanReturns when the sample changer has finished its current operation.Methods 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
configure, isConfigured, reconfigure, setConfiguredMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface gda.px.sampleChanger.BlockedPositions
getBlockedPositions, isPositionBlockedMethods inherited from interface gda.factory.Configurable
configure, isConfigureAtStartup, isConfigured, reconfigureMethods inherited from interface gda.device.Device
close, getAttribute, getProtectionLevel, setAttribute, setProtectionLevelMethods inherited from interface gda.observable.IObservable
addIObserver, deleteIObserver, deleteIObserversMethods inherited from interface gda.px.sampleChanger.SampleChanger
getBarcode, load, unload
-
Field Details
-
state
-
type
-
holderType
-
holder
protected volatile int holder -
sample
protected volatile int sample -
numberOfHolders
protected int numberOfHolders -
samplesPerHolder
protected int[] samplesPerHolder -
centreRequired
protected boolean centreRequired -
isEnabled
protected boolean isEnabled -
actionApproverName
-
readingBarcodes
protected boolean readingBarcodes
-
-
Constructor Details
-
SampleChangerBase
public SampleChangerBase()
-
-
Method Details
-
getStatus
- Specified by:
getStatusin interfaceSampleChanger- Returns:
- the current status of the sample changer as a SampleChangerStatus object
-
setType
- Parameters:
type-
-
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
-
stop
public void stop()Description copied from interface:StoppableStops the current operation.- Specified by:
stopin interfaceSampleChanger- Specified by:
stopin interfaceStoppable
-
getHolder
Description copied from interface:SampleChangerReturns the number of the holder of the current loaded sample.- Specified by:
getHolderin interfaceSampleChanger- Returns:
- int
- 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
-
setEnabled
Description copied from interface:SampleChangerSets if the sample changer is currently in use.- Specified by:
setEnabledin interfaceSampleChanger- Parameters:
enabled-- 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
-
isCentreRequired
public boolean isCentreRequired()Description copied from interface:SampleChangerReturnstrueif the user needs to centre the crystal.- Specified by:
isCentreRequiredin interfaceSampleChanger
-
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-
-
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
-
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
-
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
-
setSamplesInEveryHolder
public void setSamplesInEveryHolder(int samplesPerHolder) Sets the number of samples in every holder to the same value. The number of holders must already have been set.- Parameters:
samplesPerHolder- the number of samples in each holder
-
isSampleLoaded
public 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
-
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
-
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
-
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
-
getHolderType
Description copied from interface:SampleChangerReturns a string representing the type of puck in use- Specified by:
getHolderTypein interfaceSampleChanger- Returns:
- string
- 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
-
testLoadSafe
Runs a Jython command to see if the given ActionApprover will OK a load or unload operation- Parameters:
actionApproverName-- Throws:
DeviceException
-
setState
-
setTestState
-
isHolderInRange
protected boolean isHolderInRange(int holder) -
isSampleInRange
protected boolean isSampleInRange(int holder, int sample) -
getActionApproverName
- Specified by:
getActionApproverNamein interfaceSampleChanger- Returns:
- Returns the actionApproverName.
-
setActionApproverName
- Specified by:
setActionApproverNamein interfaceSampleChanger- Parameters:
actionApproverName- The actionApproverName to set.
-
setReadingBarcodes
Description copied from interface:SampleChangerSets whether to read barcodes during each load operation- Specified by:
setReadingBarcodesin interfaceSampleChanger- Parameters:
readDuringLoad-- Throws:
DeviceException
-
getReadingBarcodes
- Specified by:
getReadingBarcodesin interfaceSampleChanger- Returns:
- true if the samplechanger will read barcodes during loading.
- Throws:
DeviceException
-