Interface IPositionListener

All Superinterfaces:
EventListener
All Known Implementing Classes:
ExpressionWatchdog, SolsticeScanMetadataWriter, TopupWatchdog

public interface IPositionListener extends EventListener
A positioner moves the motors, taking into account level and blocks until done. It is posible to get an event for the move, both when each level is complete and at the end of the move, using this listener. This can be useful for designs that to and action which should notify other objects about moves.
  • Method Details

    • positionWillPerform

      default boolean positionWillPerform(PositionEvent event) throws ScanningException
      Called just before the position reaches a given value
      Parameters:
      event -
      Returns:
      false to abort the point but not the overall scan.
      Throws:
      ScanningException - if an exception occurred responding to this event. Note: throwing an exception will stop the scan. If this behaviour is not desirable the exception should be caught and logged instead
    • levelPerformed

      default void levelPerformed(PositionEvent event) throws ScanningException
      Called after a given move level has been reached.
      Parameters:
      event -
      Throws:
      ScanningException - if an exception occurred responding to this event. Note: throwing an exception will stop the scan. If this behaviour is not desirable the exception should be caught and logged instead
    • positionChanged

      default void positionChanged(PositionEvent event) throws ScanningException
      Called when the position of an IScannable changes.
      Parameters:
      event -
      Throws:
      ScanningException - if an exception occurred responding to this event. Note: throwing an exception will stop the scan. If this behaviour is not desirable the exception should be caught and logged instead
    • positionPerformed

      default void positionPerformed(PositionEvent event) throws ScanningException
      Called after a given position in a scan has been performed.
      Parameters:
      event -
      Throws:
      ScanningException - if an exception occurred responding to this event. Note: throwing an exception will stop the scan. If this behaviour is not desirable the exception should be caught and logged instead
    • positionMovePerformed

      default void positionMovePerformed(PositionEvent event) throws ScanningException
      Called after a given position in a scan has been moved to but before detectors are exposed. TODO: is there a better name for this method
      Parameters:
      event -
      Throws:
      ScanningException
    • postionPerformedListener

      static IPositionListener postionPerformedListener(Consumer<PositionEvent> consumer)
    • positionMovePerformed

      static IPositionListener positionMovePerformed(Consumer<PositionEvent> consumer)