Class SampleChangerBase

All Implemented Interfaces:
Device, Stoppable, Configurable, Findable, gda.observable.IObservable, BlockedPositions, SampleChanger
Direct Known Subclasses:
ActorSampleChanger, DummySampleChanger

public abstract class SampleChangerBase extends DeviceBase implements SampleChanger
Base class for classes implementing the SampleChanger Interface
  • Field Details

    • state

      protected SampleChangerStatus state
    • type

      protected String type
    • holderType

      protected String 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

      protected String actionApproverName
    • readingBarcodes

      protected boolean readingBarcodes
  • Constructor Details

    • SampleChangerBase

      public SampleChangerBase()
  • Method Details

    • getStatus

      public SampleChangerStatus getStatus()
      Specified by:
      getStatus in interface SampleChanger
      Returns:
      the current status of the sample changer as a SampleChangerStatus object
    • setType

      public void setType(String type)
      Parameters:
      type -
    • getTypeString

      public String getTypeString()
      Description copied from interface: SampleChanger
      Returns a string of the Java class of the type of this sample changer.
      Specified by:
      getTypeString in interface SampleChanger
      Returns:
      java.lang.String
    • stop

      public void stop()
      Description copied from interface: Stoppable
      Stops the current operation.
      Specified by:
      stop in interface SampleChanger
      Specified by:
      stop in interface Stoppable
    • getHolder

      public int getHolder() throws DeviceException
      Description copied from interface: SampleChanger
      Returns the number of the holder of the current loaded sample.
      Specified by:
      getHolder in interface SampleChanger
      Returns:
      int
      Throws:
      DeviceException
    • getSample

      public int getSample() throws DeviceException
      Description copied from interface: SampleChanger
      Get the position in its holder of the currently loaded sample.
      Specified by:
      getSample in interface SampleChanger
      Returns:
      int
      Throws:
      DeviceException
    • setEnabled

      public void setEnabled(boolean enabled) throws DeviceException
      Description copied from interface: SampleChanger
      Sets if the sample changer is currently in use.
      Specified by:
      setEnabled in interface SampleChanger
      Parameters:
      enabled -
      Throws:
      DeviceException
    • isEnabled

      public boolean isEnabled()
      Description copied from interface: SampleChanger
      Returns true if this sample changer is in use for loading samples.
      Specified by:
      isEnabled in interface SampleChanger
      Returns:
      boolean
    • isCentreRequired

      public boolean isCentreRequired()
      Description copied from interface: SampleChanger
      Returns true if the user needs to centre the crystal.
      Specified by:
      isCentreRequired in interface SampleChanger
    • setLoadedSample

      public void setLoadedSample(int holder, int sample)
      Description copied from interface: SampleChanger
      Sets the holder and sample numbers of the loaded sample. To be used if a sample is manually mounted onto the sample changer.
      Specified by:
      setLoadedSample in interface SampleChanger
      Parameters:
      holder - the holder number
      sample - the sample number
    • setNumberOfHolders

      public void setNumberOfHolders(int numberOfHolders)
      Description copied from interface: SampleChanger
      Sets the number of total holders (pucks/magazines/plates etc.) that the sample changer can load from
      Specified by:
      setNumberOfHolders in interface SampleChanger
      Parameters:
      numberOfHolders -
    • getNumberOfHolders

      public int getNumberOfHolders()
      Description copied from interface: SampleChanger
      Returns the number of holders (pucks) over all available dewars to load from.
      Specified by:
      getNumberOfHolders in interface SampleChanger
      Returns:
      int
    • setSamplesInHolder

      public void setSamplesInHolder(int holder, int samples)
      Description copied from interface: SampleChanger
      Sets the number of samples in the specified holder. Used when changing the puck type mid-experiment.
      Specified by:
      setSamplesInHolder in interface SampleChanger
      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: SampleChanger
      Returns the number of samples in the specified holder (puck).
      Specified by:
      getSamplesInHolder in interface SampleChanger
      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: SampleChanger
      Returns true if a sample is in the sample position on the beamline.
      Specified by:
      isSampleLoaded in interface SampleChanger
      Returns:
      boolean
    • isSampleLoaded

      public boolean isSampleLoaded(int holder, int sample) throws DeviceException
      Description copied from interface: SampleChanger
      Returns true if loaded sample has the specified index.
      Specified by:
      isSampleLoaded in interface SampleChanger
      Parameters:
      holder - the holder index (≥1)
      sample - the sample index (≥1)
      Returns:
      boolean
      Throws:
      DeviceException
    • waitForIdle

      public boolean waitForIdle() throws DeviceException
      Description copied from interface: SampleChanger
      Returns when the sample changer has finished its current operation.
      Specified by:
      waitForIdle in interface SampleChanger
      Returns:
      true if the current operation was successful
      Throws:
      DeviceException
    • setCentreRequired

      public void setCentreRequired(boolean centringRequired) throws DeviceException
      Description copied from interface: SampleChanger
      Sets the centre required flag. This enables the detector to be told when manual centring has been successfully completed.
      Specified by:
      setCentreRequired in interface SampleChanger
      Parameters:
      centringRequired -
      Throws:
      DeviceException
    • getHolderType

      public String getHolderType() throws DeviceException
      Description copied from interface: SampleChanger
      Returns a string representing the type of puck in use
      Specified by:
      getHolderType in interface SampleChanger
      Returns:
      string
      Throws:
      DeviceException
    • setHolderType

      public void setHolderType(String puckType) throws DeviceException
      Description copied from interface: SampleChanger
      Sets a string representing the type of puck in use e.g. "Rigaku"
      Specified by:
      setHolderType in interface SampleChanger
      Parameters:
      puckType -
      Throws:
      DeviceException
    • testLoadSafe

      protected static void testLoadSafe(String actionApproverName) throws DeviceException
      Runs a Jython command to see if the given ActionApprover will OK a load or unload operation
      Parameters:
      actionApproverName -
      Throws:
      DeviceException
    • setState

      protected void setState(SampleChangerStatus state)
    • setTestState

      public void setTestState(SampleChangerStatus testState)
    • isHolderInRange

      protected boolean isHolderInRange(int holder)
    • isSampleInRange

      protected boolean isSampleInRange(int holder, int sample)
    • getActionApproverName

      public String getActionApproverName()
      Specified by:
      getActionApproverName in interface SampleChanger
      Returns:
      Returns the actionApproverName.
    • setActionApproverName

      public void setActionApproverName(String actionApproverName)
      Specified by:
      setActionApproverName in interface SampleChanger
      Parameters:
      actionApproverName - The actionApproverName to set.
    • setReadingBarcodes

      public void setReadingBarcodes(boolean readDuringLoad) throws DeviceException
      Description copied from interface: SampleChanger
      Sets whether to read barcodes during each load operation
      Specified by:
      setReadingBarcodes in interface SampleChanger
      Parameters:
      readDuringLoad -
      Throws:
      DeviceException
    • getReadingBarcodes

      public boolean getReadingBarcodes() throws DeviceException
      Specified by:
      getReadingBarcodes in interface SampleChanger
      Returns:
      true if the samplechanger will read barcodes during loading.
      Throws:
      DeviceException