Interface IRunnableEventDevice<T>

Type Parameters:
T -
All Superinterfaces:
IConfigurable<T>, IDeviceRoleActor, ILevel, IModelProvider<T>, INameable, IPausableDevice<T>, IResettableDevice, IRunnableDevice<T>, IValidator<T>
All Known Subinterfaces:
IMalcolmDevice, IScanDevice, IWritableDetector<T>
All Known Implementing Classes:
AbstractAreaDetectorRunnableDevice, AbstractMalcolmDevice, AbstractRunnableDevice, AreaDetectorRunnableDevice, AreaDetectorRunnableDeviceProxy, AreaDetectorRunnableDeviceWaitForArray, AreaDetectorWritingFilesRunnableDevice, ConstantVelocityDevice, DarkImageDetector, DummyMalcolmDevice, DummyMalcolmTriggeredDetector, ElectronAnalyserRunnableDevice, MalcolmDevice, MalcolmDeviceProxy, MandelbrotDetector, PosDetector, ProcessingMalcolmDevice, RandomIntDetector, RandomLineDevice, RunnableDeviceProxy, XmapRunnableDevice, XmapRunnableDeviceBase, XmapWritingFilesRunnableDevice, ZebraRunnableDevice

public interface IRunnableEventDevice<T> extends IPausableDevice<T>
A runnable device which also allows the ability to listen to when it will run and after it has run. This allows for instance for a given runnable device to configure it before the run method is called based on the position that the device will be run at. For instance for a device writing different scan files depending on an outer scan, it can know the position of the outer scan to generate the output file name and then call configure(...) to ensure that the detector will write to the new location.
  • Method Details

    • addRunListener

      void addRunListener(IRunListener l) throws ScanningException
      A listener which notifies when a run of the device will occur and after it has occurred. This can be used to modify the model before the next run.
      Throws:
      ScanningException
    • removeRunListener

      void removeRunListener(IRunListener l) throws ScanningException
      A listener which notifies when a run of the device will occur and after it has occurred. This can be used to modify the model before the next run.
      Throws:
      ScanningException
    • fireRunWillPerform

      void fireRunWillPerform(IPosition position) throws ScanningException
      Called during the scanning to notify the device that the run method will be called at a given position. This method is called on the same thread that the run() method is called on, e.g. parallel execution by level in the case of AcquisitionDevice.
      Parameters:
      position -
      Throws:
      ScanningException
    • fireRunPerformed

      void fireRunPerformed(IPosition position) throws ScanningException
      Called during the scanning to notify the device that the run method has been called at a given position. This method is called on the same thread that the run() method is called on, e.g. parallel execution by level in the case of AcquisitionDevice.
      Parameters:
      position -
      Throws:
      ScanningException
    • fireWriteWillPerform

      void fireWriteWillPerform(IPosition position) throws ScanningException
      Called during the scanning to notify the device that the write method will be called at a given position, if the device implements one. This method is called on the same thread that the write() method is called on, e.g. parallel execution by level in the case of AcquisitionDevice. NOTE: If the write method returns false, fireWritePerformed is not called. However fireWriteWillPerform will still be called. This is because until the device attempts to write we do not know if is has written.
      Parameters:
      position -
      Throws:
      ScanningException
    • fireWritePerformed

      void fireWritePerformed(IPosition position) throws ScanningException
      Called during the scanning to notify the device that the write method has been called at a given position, if the device implements one. This method is called on the same thread that the write() method is called on, e.g. parallel execution by level in the case of AcquisitionDevice. NOTE: If the write method returns false, fireWritePerformed is not called. However fireWriteWillPerform will still be called. This is because until the device attempts to write we do not know if is has written.
      Parameters:
      position -
      Throws:
      ScanningException