Class EpicsMCA2

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

public class EpicsMCA2 extends DetectorBase implements gda.observable.IObserver
Class to communicate with an epics MCA record. The MCA record controls and acquires data from a multi-channel analyser (MCA).
See Also:
  • Field Details

  • Constructor Details

    • EpicsMCA2

      public EpicsMCA2()
      Constructor
  • 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
    • 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
    • addRegionOfInterest

      public void addRegionOfInterest(int regionIndex, int regionLow, int regionHigh, int regionBackground, int regionPreset, String regionName) throws DeviceException
      adds a region of interest.
      Parameters:
      regionIndex -
      regionLow -
      regionHigh -
      regionBackground -
      regionPreset -
      regionName -
      Throws:
      DeviceException
    • deleteRegionOfInterest

      public void deleteRegionOfInterest(int regionIndex) throws DeviceException
      deletes a region of interest
      Parameters:
      regionIndex -
      Throws:
      DeviceException
    • getCalibrationParameters

      public Object getCalibrationParameters() throws DeviceException
      returns calibration parameters - unit name, offset, slope, quadratic, and two theta angle of the detector
      Returns:
      calibration parameters
      Throws:
      DeviceException
    • getPresets

      public EpicsMCAPresets getPresets() throws DeviceException
      Returns:
      EpicsMCAPresets
      Throws:
      DeviceException
    • clear

      public void clear() throws DeviceException
      Clears the mca, but does not return until the clear has been done.
      Throws:
      DeviceException
    • getElapsedParameters

      public Object getElapsedParameters() throws DeviceException
      gets elapsed parameters
      Returns:
      elapsed parameters
      Throws:
      DeviceException
    • getRegionsOfInterest

      public Object getRegionsOfInterest() throws DeviceException
      gets regions of interest
      Returns:
      region of interest
      Throws:
      DeviceException
    • getRegionsOfInterestCount

      public double[][] getRegionsOfInterestCount() throws DeviceException
      gets the total and net counts for each region of interest
      Returns:
      total and net counts for regions of interest
      Throws:
      DeviceException
    • setCalibration

      public void setCalibration(Object calibrate) throws DeviceException
      sets calibration fields for MCA
      Parameters:
      calibrate -
      Throws:
      DeviceException
    • setPresets

      public void setPresets(Object data) throws DeviceException
      sets the preset parameters for MCA
      Parameters:
      data -
      Throws:
      DeviceException
    • setRegionsOfInterest

      public void setRegionsOfInterest(Object highLow) throws DeviceException
      sets region of interest
      Parameters:
      highLow -
      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
    • getMcaRecordName

      public String getMcaRecordName()
      gets MCA record name - the actual EPICS Record name after remove field name
      Returns:
      MCA record name
    • setMcaRecordName

      public void setMcaRecordName(String mcaRecordName)
      sets MCA record name - the actual EPICS Record name after remove field name
      Parameters:
      mcaRecordName -
    • getAttribute

      public Object getAttribute(String attributeName) throws DeviceException
      Description copied from interface: Device
      Get the value of the specified attribute
      Specified by:
      getAttribute in interface Device
      Overrides:
      getAttribute in class DeviceBase
      Parameters:
      attributeName - is the name of the attribute
      Returns:
      the value of the attribute as an Object type
      Throws:
      DeviceException - if an attribute cannot be retrieved
    • update

      public void update(Object theObserved, Object changeCode)
      Specified by:
      update in interface gda.observable.IObserver
    • 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
    • getDescription

      public String getDescription() throws DeviceException
      Specified by:
      getDescription in interface Detector
      Overrides:
      getDescription in class DetectorBase
      Returns:
      A description of the detector.
      Throws:
      DeviceException
    • getDetectorID

      public String getDetectorID() throws DeviceException
      Specified by:
      getDetectorID in interface Detector
      Overrides:
      getDetectorID in class DetectorBase
      Returns:
      A identifier for this detector.
      Throws:
      DeviceException
    • getDetectorType

      public String getDetectorType() throws DeviceException
      Specified by:
      getDetectorType in interface Detector
      Overrides:
      getDetectorType in class DetectorBase
      Returns:
      The type of detector.
      Throws:
      DeviceException