Class DataSocketDetector

All Implemented Interfaces:
Detector, BufferedDetector, Device, Scannable, Configurable, Findable, gda.observable.IObservable, Serializable

public class DataSocketDetector extends DetectorBase implements BufferedDetector
See Also:
  • Constructor Details

    • DataSocketDetector

      public DataSocketDetector()
  • Method Details

    • configure

      public void configure() throws FactoryException
      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
      Throws:
      FactoryException - if there is an error in configuration e.g. required variable not set or cannot connect to device
    • reconfigure

      public void reconfigure() throws FactoryException
      Description copied from interface: Configurable
      Re-initialisation of values and states.

      Moved from Reconfigurable which has been deleted

      Specified by:
      reconfigure in interface Configurable
      Overrides:
      reconfigure in class ConfigurableBase
      Throws:
      FactoryException
    • getExtraNames

      public String[] getExtraNames()
      Description copied from interface: Scannable
      Additional names for extra values that returned by getPosition().
      Specified by:
      getExtraNames in interface Scannable
      Overrides:
      getExtraNames in class ScannableBase
      Returns:
      array of names of the extra elements if the array returned by getPosition is larger than the array required by moveTo
    • getOutputFormat

      public String[] getOutputFormat()
      Description copied from interface: Scannable
      Returns an array of strings which are the format strings to use when pretty printing parts of the output
      Specified by:
      getOutputFormat in interface Scannable
      Overrides:
      getOutputFormat in class ScannableBase
      Returns:
      string array
    • 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:
    • collectData

      public void collectData() throws DeviceException
      Description copied from interface: Detector
      Tells the detector to begin to collect a set of data, then returns immediately. Should cause the hardware to start collecting immediately: if there is any delay then detectors used in the same scan would collect over different times when beam conditions may differ.
      Specified by:
      collectData in interface Detector
      Throws:
      DeviceException
    • getStatus

      public int getStatus() throws DeviceException
      Description copied from interface: Detector
      Returns the current collecting state of the device.
      Specified by:
      getStatus in interface Detector
      Returns:
      BUSY if the detector has not finished the requested operation(s), IDLE if in an completely idle state and STANDBY if temporarily suspended.
      Throws:
      DeviceException
    • readout

      public Object readout() throws DeviceException
      Description copied from interface: Detector
      Returns the latest data collected. The size of the Object returned must be consistent with the values returned by getDataDimensions and getExtraNames.

      If LocalProperties.GDA_SCAN_CONCURRENTSCAN_READOUT_CONCURRENTLY is true then motors may be moved while the detector readouts. The value returned must not be effected by any concurrent motor or shutter movements. See Detector.waitWhileBusy() and ConcurrentScan. Readout must block until the detector is ready to respond quickly to Detector.collectData() again.

      Specified by:
      readout in interface Detector
      Returns:
      the data collected
      Throws:
      DeviceException
    • createsOwnFiles

      public boolean createsOwnFiles() throws DeviceException
      Description copied from interface: Detector
      Returns a value which indicates whether the detector creates its own files. If it does (return true) the readout() method returns the name of the latest file created as a string. If it does not (return false) the readout() method will return the data directly.
      Specified by:
      createsOwnFiles in interface Detector
      Returns:
      true if readout() returns filenames
      Throws:
      DeviceException
    • getDataFormatString

      public String getDataFormatString()
    • setDataFormatString

      public void setDataFormatString(String dataFormatString)
    • getDataNames

      public List<String> getDataNames()
    • setDataNames

      public void setDataNames(List<String> dataNames)
      Set the names of the data to be read from the stream. These need to match up with the available fields, in the stream or exception will be thrown in readout() and readFrames(int, int)
      Parameters:
      dataNames -
    • getAvailableFieldNames

      public List<String> getAvailableFieldNames()
      Returns:
      List of data field names present in the stream
    • updateDataNamesFromStream

      public void updateDataNamesFromStream()
      Set the dataNames to match all available ones present in the stream e.g. do this after running a scan, so that subsequent scans readout all the data. (Convenience method to avoid doing getAvailableFieldNames() then setDataNames(List))
    • clearMemory

      public void clearMemory() throws DeviceException
      Description copied from interface: BufferedDetector
      Clears the detector memory
      Specified by:
      clearMemory in interface BufferedDetector
      Throws:
      DeviceException
    • setContinuousMode

      public void setContinuousMode(boolean on) throws DeviceException
      Description copied from interface: BufferedDetector
      When in slave mode the detector will be triggered by an external signal to collect each frame of data.
      Specified by:
      setContinuousMode in interface BufferedDetector
      Parameters:
      on -
      Throws:
      DeviceException
    • isContinuousMode

      public boolean isContinuousMode() throws DeviceException
      Specified by:
      isContinuousMode in interface BufferedDetector
      Returns:
      true if the detector is ready to accept trigger pulses
      Throws:
      DeviceException
    • setContinuousParameters

      public void setContinuousParameters(ContinuousParameters parameters) throws DeviceException
      Description copied from interface: BufferedDetector
      Sets the parameters which define the continuous movement to use
      Specified by:
      setContinuousParameters in interface BufferedDetector
      Parameters:
      parameters -
      Throws:
      DeviceException
    • getContinuousParameters

      public ContinuousParameters getContinuousParameters() throws DeviceException
      Specified by:
      getContinuousParameters in interface BufferedDetector
      Returns:
      ContinuousParameters
      Throws:
      DeviceException
    • getNumberFrames

      public int getNumberFrames() throws DeviceException
      Specified by:
      getNumberFrames in interface BufferedDetector
      Returns:
      number of frames of data in memory which have been collected
      Throws:
      DeviceException
    • readFrames

      public Object[] readFrames(int startFrame, int finalFrame) throws DeviceException
      Description copied from interface: BufferedDetector
      An array of the data from the detector. Each element is one frame of data. The first frame is 0.
      Specified by:
      readFrames in interface BufferedDetector
      Parameters:
      startFrame -
      finalFrame -
      Returns:
      Object
      Throws:
      DeviceException
    • readAllFrames

      public Object[] readAllFrames() throws DeviceException
      Description copied from interface: BufferedDetector
      An array of the data from the detector. Each element is one frame of data.
      Specified by:
      readAllFrames in interface BufferedDetector
      Returns:
      Object
      Throws:
      DeviceException
    • maximumReadFrames

      public int maximumReadFrames() throws DeviceException
      Description copied from interface: BufferedDetector
      As certain detectors may cause memory issues if too many frames are attempted to be read in one go, this is the maximum for this detector based on its current configuration (i.e. after setContinuousMode(True) has been called.

      The lowest value returned from any of the detectors in a continuous scan will be the limit set.

      If there is no limit then this method should return Integer.MAX_VALUE.

      Specified by:
      maximumReadFrames in interface BufferedDetector
      Returns:
      int - the maximum number of frames which should be read at any one time from this detector
      Throws:
      DeviceException
    • setMaximumReadFrames

      public void setMaximumReadFrames(int maximumReadFrames)
    • getSocketIpAddress

      public String getSocketIpAddress()
    • setSocketIpAddress

      public void setSocketIpAddress(String socketIpAddress)
    • getSocketPort

      public int getSocketPort()
    • setSocketPort

      public void setSocketPort(int socketPort)