Class DummyMonitor

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

public class DummyMonitor extends MonitorBase
A dummy implementation of the Monitor interface for testing / development.
  • Constructor Details

    • DummyMonitor

      public DummyMonitor()
    • DummyMonitor

      public DummyMonitor(String name)
    • DummyMonitor

      public DummyMonitor(String name, double constantValue)
  • Method Details

    • configure

      public void configure()
      Description copied from class: ConfigurableBase
      Default implementation for classes that do not have to do any specific configuration.
      Classes that do their own configuration should *not* call this superclass function, as it may cause the object to appear configured before it really is.
      Specified by:
      configure in interface Configurable
      Overrides:
      configure in class ConfigurableBase
    • asynchronousMoveTo

      public void asynchronousMoveTo(Object position) throws DeviceException
      Description copied from class: MonitorBase
      If called with a position this triggers a delay. Very useful if the monitor is hooked up to something that calculates a running average, or that is not updated very often. Trigger a move/operation and return immediately. Implementations of this method should be non-blocking to allow concurrent motion; the isBusy method will be used to determine when the move has completed. Converts the external (user) position to an internal position and passes this to rawAsynchronousMoveTo.
      Specified by:
      asynchronousMoveTo in interface Scannable
      Overrides:
      asynchronousMoveTo in class MonitorBase
      Parameters:
      position - Position to move to should have an element for each input field.
      Throws:
      DeviceException
      See Also:
    • getPosition

      public Object getPosition() throws DeviceException
      Description copied from class: ScannableBase
      Returns the current position of the Scannable. Called by ConcurentScan at the end of the point. Reads an internal (hardware) position from rawGetPosition, converts this to an external (user) position and returns it.
      Specified by:
      getPosition in interface Scannable
      Overrides:
      getPosition in class ScannableBase
      Returns:
      Current position with an element for each input and extra field. null if their are no fields.
      Throws:
      DeviceException
    • setValue

      public void setValue(double value)
      Sets the starting value
      Parameters:
      value -
    • getElementCount

      public int getElementCount() throws DeviceException
      Description copied from interface: Monitor
      returns the number of elements in this monitor.
      Specified by:
      getElementCount in interface Monitor
      Overrides:
      getElementCount in class MonitorBase
      Returns:
      int the element count
      Throws:
      DeviceException
    • getUnit

      public String getUnit() throws DeviceException
      Description copied from interface: Monitor
      gets the physical unit of the monitor.
      Specified by:
      getUnit in interface Monitor
      Overrides:
      getUnit in class MonitorBase
      Returns:
      String the physical unit
      Throws:
      DeviceException
    • setUnit

      public void setUnit(String units)
    • getConstantValue

      public Double getConstantValue()
      Returns:
      Returns the constantValue.
    • setConstantValue

      public void setConstantValue(Double constantValue)
      Parameters:
      constantValue - The constantValue to set.
    • setUpdateInterval

      public void setUpdateInterval(int updateInterval)
      Set time between updates
      Parameters:
      updateInterval - in milliseconds
    • toFormattedString

      public String toFormattedString()
      Description copied from interface: Scannable
      Returns a string representation of the Scannable and its current position/value/status

      Typically should return:

      name : position

      or for detectors, name : status

      If the position/status cannot be determined, the function should return Scannable.VALUE_UNAVAILABLE in its place.

      Specified by:
      toFormattedString in interface Scannable
      Overrides:
      toFormattedString in class ScannableBase
      Returns:
      string as defined above
    • isThrowExceptionOnAttemptedMove

      public boolean isThrowExceptionOnAttemptedMove()
    • setThrowExceptionOnAttemptedMove

      public void setThrowExceptionOnAttemptedMove(boolean throwExceptionOnAttemptedMove)