Class TwoDScanPlotter

All Implemented Interfaces:
Device, Scannable, Configurable, Findable, IScanDataPointObserver, gda.observable.IObservable, gda.observable.IObserver

public class TwoDScanPlotter extends ScannableBase implements IScanDataPointObserver
Plots a 2D graph of the current scan into an RCP plot window as the scan progresses.

To use this scannable, give it the names of the x,y and z columns and the plot view to send the plot to ("Plot 1" by default. Then simply include in the scan command you wish to plot.

  • Field Details

    • x

      protected org.eclipse.january.dataset.DoubleDataset x
    • y

      protected org.eclipse.january.dataset.DoubleDataset y
    • intensity

      protected org.eclipse.january.dataset.DoubleDataset intensity
  • Constructor Details

    • TwoDScanPlotter

      public TwoDScanPlotter()
  • Method Details

    • atScanStart

      public void atScanStart() throws DeviceException
      Description copied from class: ScannableBase
      Called for every Scannable at the start of a group of nested scans (or a single scan if that is the case) Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.
      Specified by:
      atScanStart in interface Scannable
      Overrides:
      atScanStart in class ScannableBase
      Throws:
      DeviceException
      See Also:
    • atScanEnd

      public void atScanEnd() throws DeviceException
      Description copied from class: ScannableBase
      Called for every Scannable at the end of a group of nested scans (or a single scan if that is the case).

      Note that this is only called if the Scan finishes normally, or has been requested to finish early. This will not be called if the scan finishes due to an exception of any kind. See Scannable.atCommandFailure() Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.

      Specified by:
      atScanEnd in interface Scannable
      Overrides:
      atScanEnd in class ScannableBase
      Throws:
      DeviceException
      See Also:
    • atCommandFailure

      public void atCommandFailure()
      Description copied from class: ScannableBase
      Hook to be used by Scan and pos commands to inform the Scannable that an exception, such as a DeviceExcpetion, has occurred. However not called when the command is aborted using an InterruptionException. If a Scan is aborted then only Scannable.stop() will be called by the Scan or pos command.

      Useful for telling Scannables which hold state during a scan for example, to reset themselves. Used for example by CoordinatedMotionScannables. This hook should be used not in the same way as the stop hook. Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.

      Specified by:
      atCommandFailure in interface Scannable
      Overrides:
      atCommandFailure in class ScannableBase
      See Also:
    • stop

      public void stop() throws DeviceException
      Description copied from class: ScannableBase
      Stop the current move/operation. Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.
      Specified by:
      stop in interface Scannable
      Overrides:
      stop in class ScannableBase
      Throws:
      DeviceException
      See Also:
    • update

      public void update(Object source, Object arg)
      Specified by:
      update in interface gda.observable.IObserver
    • plot

      public void plot() throws Exception
      Throws:
      Exception
    • openPlotView

      public void openPlotView()
      Use RCPController to try and open the plot view
    • setXArgs

      public void setXArgs(Double xStart, Double xStop, Double xStep)
      Call this before the scan if you want to plot actual motor positions, not just indexes
      Parameters:
      xStart -
      xStop -
      xStep -
    • setYArgs

      public void setYArgs(Double yStart, Double yStop, Double yStep)
      Call this before the scan if you want to plot actual motor positions, not just indexes
      Parameters:
      yStart -
      yStop -
      yStep -
    • clearArgs

      public void clearArgs()
    • rawAsynchronousMoveTo

      public void rawAsynchronousMoveTo(Object position) throws DeviceException
      Description copied from class: ScannableBase
      [Consider abstract] Trigger a move/operation to an internal/hardware position and return immediately.
      Overrides:
      rawAsynchronousMoveTo in class ScannableBase
      Parameters:
      position - Position in its internal/hardware representation. e.g. with units and offsets removed
      Throws:
      DeviceException
      See Also:
    • rawGetPosition

      public Object rawGetPosition() throws DeviceException
      Description copied from class: ScannableBase
      [Consider abstract] Read the position in its internal (user) representation.
      Overrides:
      rawGetPosition in class ScannableBase
      Returns:
      the value represented by this Scannable
      Throws:
      DeviceException
      See Also:
    • isBusy

      public boolean isBusy() throws DeviceException
      Description copied from interface: Scannable
      Check if the Scannable is moving/operating.
      Specified by:
      isBusy in interface Scannable
      Returns:
      true - if operation carried out by moveTo has not completed yet
      Throws:
      DeviceException
    • getZ_colName

      public String getZ_colName()
    • setZ_colName

      public void setZ_colName(String zColName)
    • setPlotViewname

      public void setPlotViewname(String plotViewname)
    • getPlotViewname

      public String getPlotViewname()
    • getRate

      public Long getRate()
    • setRate

      public void setRate(Long rate)
    • getXAxisName

      public String getXAxisName()
    • setXAxisName

      public void setXAxisName(String xAxisName)
    • getYAxisName

      public String getYAxisName()
    • setYAxisName

      public void setYAxisName(String yAxisName)
    • getRcpController

      public RCPController getRcpController()
    • setRcpController

      public void setRcpController(RCPController rcpController)
      Parameters:
      rcpController - RCPController object used for opening plot view
    • isOpenPlotViewAtScanStart

      public boolean isOpenPlotViewAtScanStart()
    • setOpenPlotViewAtScanStart

      public void setOpenPlotViewAtScanStart(boolean openPlotViewAtScanStart)
      Parameters:
      openPlotViewAtScanStart - Set to 'true' to make the plot view open at the start of the scan