Package gda.scan

Class PassthroughScanAdapter

java.lang.Object
gda.scan.PassthroughScanAdapter
All Implemented Interfaces:
NestableScan, Scan, ScanChild, Serializable
Direct Known Subclasses:
PointsScan

public class PassthroughScanAdapter extends Object implements NestableScan
See Also:
  • Constructor Details

    • PassthroughScanAdapter

      public PassthroughScanAdapter(NestableScan delegate)
  • Method Details

    • pause

      public void pause()
      Description copied from interface: Scan
      pause the scans progress
      Specified by:
      pause in interface Scan
    • resume

      public void resume()
      Description copied from interface: Scan
      resume the scans progress after a pause has been called
      Specified by:
      resume in interface Scan
    • run

      public void run() throws Exception
      Description copied from interface: Scan
      allows the scan in its own thread. This should NOT be called directly otherwise this may cause thread handling issues and instability in the command server. runScan() should be called instead.
      Specified by:
      run in interface Scan
      Throws:
      Exception
    • runScan

      public void runScan() throws InterruptedException, Exception
      Description copied from interface: Scan
      Does the work of creating a new thread and calling the run() method. Inheriting classes may also declare a runScan method with arguments identical to their constructor. The convention would be to create a new scan object, and then call this runScan method.
      Specified by:
      runScan in interface Scan
      Throws:
      InterruptedException
      Exception
    • doCollection

      public void doCollection() throws Exception
      Description copied from interface: Scan
      The method in which the work of the scan is performed. This method assumes that the data handler has already been created and the baton claimed.
      Specified by:
      doCollection in interface Scan
      Throws:
      Exception
    • prepareForCollection

      public void prepareForCollection() throws Exception
      Description copied from interface: Scan
      Creates a dataHandler, waits until the baton is free and then claims it. This should be performed once in a collection of scans, before any calls to doCollection().
      Specified by:
      prepareForCollection in interface Scan
      Throws:
      Exception
    • getScannables

      public List<Scannable> getScannables()
      Description copied from interface: Scan
      Returns the list of all the Scannable objects which are part of this scan
      Specified by:
      getScannables in interface Scan
      Returns:
      Vector of Scannables
    • setScannables

      public void setScannables(List<Scannable> allScannables)
      Description copied from interface: Scan
      Sets the list of all the Scannable objects. This should only be used for a parent scan giving its list to a child scan and not for setting up a scan (that work is done by ScanBase.setUp).
      Specified by:
      setScannables in interface Scan
      Parameters:
      allScannables -
    • getDetectors

      public List<Detector> getDetectors()
      Description copied from interface: Scan
      Returns the list of Detector objects which form part of the scan.
      Specified by:
      getDetectors in interface Scan
      Returns:
      Vector of Detectors
    • setDetectors

      public void setDetectors(List<Detector> allDetectors)
      Description copied from interface: Scan
      Sets the list of Detectors for this scan.
      Specified by:
      setDetectors in interface Scan
      Parameters:
      allDetectors -
      See Also:
    • isChild

      public boolean isChild()
      Description copied from interface: Scan
      Returns true if this scan is nested inside another scan.
      Specified by:
      isChild in interface Scan
      Returns:
      if this scan is a child
    • setIsChild

      public void setIsChild(boolean child)
      Description copied from interface: Scan
      Tells the scan if it is a child.
      Specified by:
      setIsChild in interface Scan
      Parameters:
      child -
    • getDataWriter

      public DataWriter getDataWriter()
      Description copied from interface: Scan
      Returns the reference to the DataWriter that this scan is using.
      Specified by:
      getDataWriter in interface Scan
      Returns:
      the DataWriter
    • setDataWriter

      public void setDataWriter(DataWriter dh)
      Description copied from interface: Scan
      Gives the scan a reference to the DataWriter it should use to record data. This will create a new ScanDataPointPipeline appropriate for the Scannables to be scanned.
      Specified by:
      setDataWriter in interface Scan
      Parameters:
      dh -
    • setScanDataPointPipeline

      public void setScanDataPointPipeline(ScanDataPointPipeline scanDataPointPipeline)
      Description copied from interface: Scan
      Sets the scan data point pipeline used to populate, write and broadcast ScanDataPoints. Should not normally be set directly except on a child (or sub) scan.
      Specified by:
      setScanDataPointPipeline in interface Scan
      Parameters:
      scanDataPointPipeline -
    • getScanDataPointPipeline

      public ScanDataPointPipeline getScanDataPointPipeline()
      Description copied from interface: Scan
      Returns the ScanDataPoint pipeline.
      Specified by:
      getScanDataPointPipeline in interface Scan
    • getName

      public String getName()
      Description copied from interface: Scan
      Return a unique identifier for this scan. This is useful for plotting etc. The same id will be included in every ScanDataPoint sent out by the scan and will be the same for all the scans in a multiregion or mulit-dimensional scan.
      Specified by:
      getName in interface Scan
      Returns:
      String
    • getParent

      public NestableScan getParent()
      Specified by:
      getParent in interface ScanChild
      Returns:
      The parent scan if this scan is nested
    • setParent

      public void setParent(NestableScan parent)
      Specified by:
      setParent in interface ScanChild
      Parameters:
      parent - The parent of this scan if this scan is nested
    • getChild

      public Scan getChild()
      Specified by:
      getChild in interface Scan
      Returns:
      The child scan if this scan is nested
    • setChild

      public void setChild(Scan child)
      Specified by:
      setChild in interface Scan
      Parameters:
      child - The child of this scan if this scan is nested
    • getStepId

      public IScanStepId getStepId()
      Specified by:
      getStepId in interface Scan
      Returns:
      The identifier of the current step. This is scan dependent and maybe null
    • setStepId

      public void setStepId(IScanStepId scanStepId)
      Specified by:
      setStepId in interface Scan
      Parameters:
      scanStepId - The identifier of the current step. This is scan dependent and maybe null
    • setScanPlotSettings

      public void setScanPlotSettings(ScanPlotSettings scanPlotSettings)
      Specified by:
      setScanPlotSettings in interface Scan
    • getScanPlotSettings

      public ScanPlotSettings getScanPlotSettings()
      Specified by:
      getScanPlotSettings in interface Scan
      Returns:
      Settings for plotting
    • getDimension

      public int getDimension()
      Specified by:
      getDimension in interface Scan
      Returns:
      the number of points of this scan object - the whole scan execution can be a hierarchy of parent scan objects and layers of child scan objects
    • getTotalNumberOfPoints

      public int getTotalNumberOfPoints()
      Specified by:
      getTotalNumberOfPoints in interface Scan
      Returns:
      the total number of nodes at which data will be collected in this scan. This includes all the dimensions in a multi-dimensional scan.
    • getScanNumber

      public int getScanNumber()
      Specified by:
      getScanNumber in interface Scan
      Returns:
      The unique id of the scan. Null if not set
    • getStatus

      public Scan.ScanStatus getStatus()
      Specified by:
      getStatus in interface Scan
      Returns:
      The Scan.ScanStatus
    • requestFinishEarly

      public void requestFinishEarly()
      Description copied from interface: Scan
      Set this scan to complete current scan data point and complete normally without doing any further data points.
      Specified by:
      requestFinishEarly in interface Scan
    • isFinishEarlyRequested

      public boolean isFinishEarlyRequested()
      Specified by:
      isFinishEarlyRequested in interface Scan
    • setStatus

      public void setStatus(Scan.ScanStatus status)
    • getScanInformation

      public ScanInformation getScanInformation()
      Specified by:
      getScanInformation in interface Scan