Class VGScientaAnalyserCamOnly

All Implemented Interfaces:
Detector, NexusDetector, Device, Scannable, PositionCallableProvider<NexusTreeProvider>, Configurable, Findable, gda.observable.IObservable, gov.aps.jca.event.MonitorListener, Serializable, EventListener, org.springframework.beans.factory.InitializingBean, IElectronAnalyser, IVGScientaAnalyserRMI

@ServiceInterface(IVGScientaAnalyserRMI.class) public class VGScientaAnalyserCamOnly extends ADDetector implements gov.aps.jca.event.MonitorListener, IVGScientaAnalyserRMI
See Also:
  • Field Details

    • inScan

      protected boolean inScan
    • centre_energy

      public final Scannable centre_energy
  • Constructor Details

    • VGScientaAnalyserCamOnly

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

      public VGScientaController getController()
    • setController

      public void setController(VGScientaController controller)
    • 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 ADDetector
      Throws:
      DeviceException
      See Also:
    • atScanEnd

      public void atScanEnd() throws DeviceException
      Description copied from class: ScannableBase
      Called for every Scannable at the end of a group of nested scans (or a single scan if that is the case).

      Note that this is only called if the Scan finishes normally, or has been requested to finish early. This will not be called if the scan finishes due to an exception of any kind. See Scannable.atCommandFailure() Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.

      Specified by:
      atScanEnd in interface Scannable
      Overrides:
      atScanEnd in class ADDetector
      Throws:
      DeviceException
      See Also:
    • getNumberOfSweeptSteps

      public int getNumberOfSweeptSteps() throws Exception
      Throws:
      Exception
    • getEnergyAxis

      public double[] getEnergyAxis() throws Exception
      Description copied from interface: IElectronAnalyser
      Get the energy axis for the current acquisition
      Specified by:
      getEnergyAxis in interface IElectronAnalyser
      Returns:
      The energy axis
      Throws:
      Exception - If there is a problem with the EPICS communication
    • getAngleAxis

      public double[] getAngleAxis() throws Exception
      Description copied from interface: IElectronAnalyser
      Gets the Y axis (usually angle) for the current acquisition
      Specified by:
      getAngleAxis in interface IElectronAnalyser
      Returns:
      The angle axis
      Throws:
      Exception - If there is a problem with the EPICS communication
    • appendDataAxes

      protected void appendDataAxes(NXDetectorData data) throws Exception
      Description copied from class: ADDetector
      This stub adds rather stupid axes. Overriding classes are highly encouraged to do better.
      Overrides:
      appendDataAxes in class ADDetector
      Parameters:
      data -
      Throws:
      Exception
    • toBindingEnergy

      public double[] toBindingEnergy(double[] kineticEnergy)
    • toBindingEnergy

      public double toBindingEnergy(double kineticEnergy)
    • appendNXDetectorDataFromCollectionStrategy

      protected void appendNXDetectorDataFromCollectionStrategy(NXDetectorData data) throws Exception
      Overrides:
      appendNXDetectorDataFromCollectionStrategy in class ADDetector
      Throws:
      Exception
    • addDoubleItem

      protected void addDoubleItem(NXDetectorData data, String name, double d, String units)
    • isFixedMode

      public boolean isFixedMode() throws Exception
      Throws:
      Exception
    • setupAcquisitionMode

      public void setupAcquisitionMode(AcquisitionMode acquisitionMode) throws Exception
      Description copied from interface: IElectronAnalyser
      Sets the acquisition mode to the one specified and performs any configuration necessary for the chosen mode, such as setting up ROIs
      Specified by:
      setupAcquisitionMode in interface IElectronAnalyser
      Parameters:
      acquisitionMode - The requested acquisition mode
      Throws:
      Exception - If there is a problem setting up the acquisition mode
    • getSweptModeConfiguration

      public DetectorConfiguration getSweptModeConfiguration()
    • setSweptModeConfiguration

      public void setSweptModeConfiguration(DetectorConfiguration sweptModeConfiguration)
    • getFixedModeConfiguration

      public DetectorConfiguration getFixedModeConfiguration()
    • setFixedModeConfiguration

      public void setFixedModeConfiguration(DetectorConfiguration fixedModeConfiguration)
    • getSweptModeRegion

      public int[] getSweptModeRegion()
      Returns an int array describing the swept mode region.
      Returns:
      sweptModeRegion An int array [StartX, StartY, SizeX, SizeY]
    • setSweptModeRegion

      public void setSweptModeRegion(int[] sweptModeRegion)
      Sets a swept mode region from an int array.
      Parameters:
      sweptModeRegion - An int array [StartX, StartY, SizeX, SizeY]
    • getFixedModeRegion

      public int[] getFixedModeRegion()
      Returns an int array describing the fixed mode region.
      Returns:
      fixedModeRegion An int array [StartX, StartY, SizeX, SizeY]
    • setFixedModeRegion

      public void setFixedModeRegion(int[] fixedModeRegion)
      Sets a fixed mode region from an int array.
      Parameters:
      fixedModeRegion - An int array [StartX, StartY, SizeX, SizeY]
    • getCollectionTime

      public double getCollectionTime() throws DeviceException
      Description copied from interface: Detector
      Returns the time, in seconds, the detector collects for during the next call to collectData()
      Specified by:
      getCollectionTime in interface Detector
      Specified by:
      getCollectionTime in interface IElectronAnalyser
      Overrides:
      getCollectionTime in class DetectorBase
      Returns:
      double
      Throws:
      DeviceException - If there is a problem with the EPICS communication
    • setCollectionTime

      public void setCollectionTime(double collectionTime) throws DeviceException
      Description copied from interface: Detector
      Sets the collection time, in seconds, to be used during the next call of collectData.
      Specified by:
      setCollectionTime in interface Detector
      Specified by:
      setCollectionTime in interface IElectronAnalyser
      Overrides:
      setCollectionTime in class DetectorBase
      Parameters:
      collectionTime - the collection time in seconds
      Throws:
      DeviceException
    • setLensMode

      public void setLensMode(String value) throws Exception
      Description copied from interface: IElectronAnalyser
      Sets the lens mode
      Specified by:
      setLensMode in interface IElectronAnalyser
      Parameters:
      value - The lens mode to set
      Throws:
      Exception - If there is a problem with the EPICS communication
    • getLensMode

      public String getLensMode() throws Exception
      Description copied from interface: IElectronAnalyser
      Gets the current lens mode.
      Specified by:
      getLensMode in interface IElectronAnalyser
      Returns:
      The current lens mode
      Throws:
      Exception - If there is a problem with the EPICS communication
    • getLensModes

      public List<String> getLensModes()
      Description copied from interface: IElectronAnalyser
      Gets the list of available lens modes
      Specified by:
      getLensModes in interface IElectronAnalyser
    • getPsuMode

      public String getPsuMode() throws Exception
      Description copied from interface: IElectronAnalyser
      Gets the current PSU mode. (Also known as element set)
      Specified by:
      getPsuMode in interface IElectronAnalyser
      Returns:
      The current power supply mode
      Throws:
      Exception - If there is a problem with the EPICS communication
    • getPsuModes

      public List<String> getPsuModes()
      Description copied from interface: IElectronAnalyser
      Gets the available PSU modes (also known as element set)
      Specified by:
      getPsuModes in interface IElectronAnalyser
      Returns:
      The list of available PSU modes
    • setPsuMode

      public void setPsuMode(String value) throws Exception
      Description copied from interface: IElectronAnalyser
      Sets the PSU mode (aka element set)
      Specified by:
      setPsuMode in interface IElectronAnalyser
      Throws:
      Exception - If there is a problem with the EPICS communication
    • setPassEnergy

      public void setPassEnergy(Integer value) throws Exception
      Description copied from interface: IElectronAnalyser
      Sets the pass energy
      Specified by:
      setPassEnergy in interface IElectronAnalyser
      Parameters:
      value - The requested pass energy
      Throws:
      Exception - If the pass energy is invalid or if there is a problem with the EPICS communication
    • getPassEnergy

      public Integer getPassEnergy() throws Exception
      Description copied from interface: IElectronAnalyser
      Get the current pass energy
      Specified by:
      getPassEnergy in interface IElectronAnalyser
      Returns:
      The current pass energy
      Throws:
      Exception - If there is a problem with the EPICS communication
    • getPassEnergies

      public List<String> getPassEnergies()
      Description copied from interface: IElectronAnalyser
      Gets the available pass energies
      Specified by:
      getPassEnergies in interface IElectronAnalyser
    • setStartEnergy

      public void setStartEnergy(Double value) throws Exception
      Throws:
      Exception
    • getStartEnergy

      public Double getStartEnergy() throws Exception
      Throws:
      Exception
    • setCentreEnergy

      public void setCentreEnergy(Double value) throws Exception
      Description copied from interface: IElectronAnalyser
      Sets the centre energy
      Specified by:
      setCentreEnergy in interface IElectronAnalyser
      Parameters:
      value - The requested centre energy
      Throws:
      Exception - If there is a problem with the EPICS communication
    • getCentreEnergy

      public Double getCentreEnergy() throws Exception
      Description copied from interface: IElectronAnalyser
      Gets the current centre energy
      Specified by:
      getCentreEnergy in interface IElectronAnalyser
      Returns:
      The current centre energy
      Throws:
      Exception - If there is a problem with the EPICS communication
    • setEndEnergy

      public void setEndEnergy(Double value) throws Exception
      Throws:
      Exception
    • getEndEnergy

      public Double getEndEnergy() throws Exception
      Throws:
      Exception
    • setEnergyStep

      public void setEnergyStep(double value) throws Exception
      Description copied from interface: IElectronAnalyser
      Sets the step size
      Specified by:
      setEnergyStep in interface IElectronAnalyser
      Parameters:
      value - The step size
      Throws:
      Exception
    • getEnergyStep

      public double getEnergyStep() throws Exception
      Description copied from interface: IElectronAnalyser
      Gets the step size
      Specified by:
      getEnergyStep in interface IElectronAnalyser
      Returns:
      step size
      Throws:
      Exception
    • zeroSupplies

      public void zeroSupplies() throws Exception
      Description copied from interface: IElectronAnalyser
      Stops the analyser and zeros the HV supplies. This puts the analyser into a safe state.
      Specified by:
      zeroSupplies in interface IElectronAnalyser
      Throws:
      Exception - If there is a problem with the EPICS communication
      See Also:
    • stopAfterCurrentIteration

      public void stopAfterCurrentIteration() throws Exception
      Description copied from interface: IElectronAnalyser
      Stops the analyser after the current iteration and saves the data.
      Specified by:
      stopAfterCurrentIteration in interface IElectronAnalyser
      Throws:
      Exception - If there is a problem with the EPICS communication
      See Also:
    • zeroSuppliesIgnoreErrors

      public void zeroSuppliesIgnoreErrors()
    • monitorChanged

      public void monitorChanged(gov.aps.jca.event.MonitorEvent arg0)
      Specified by:
      monitorChanged in interface gov.aps.jca.event.MonitorListener
    • getEntranceSlitInformationProvider

      public EntranceSlitInformationProvider getEntranceSlitInformationProvider()
    • setEntranceSlitInformationProvider

      public void setEntranceSlitInformationProvider(EntranceSlitInformationProvider entranceSlitInformationProvider)
    • atCommandFailure

      public void atCommandFailure() throws DeviceException
      Description copied from class: ScannableBase
      Hook to be used by Scan and pos commands to inform the Scannable that an exception, such as a DeviceExcpetion, has occurred. However not called when the command is aborted using an InterruptionException. If a Scan is aborted then only Scannable.stop() will be called by the Scan or pos command.

      Useful for telling Scannables which hold state during a scan for example, to reset themselves. Used for example by CoordinatedMotionScannables. This hook should be used not in the same way as the stop hook. Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.

      Specified by:
      atCommandFailure in interface Scannable
      Overrides:
      atCommandFailure in class ADDetector
      Throws:
      DeviceException
      See Also:
    • stop

      public void stop() throws DeviceException
      Description copied from class: ScannableBase
      Stop the current move/operation. Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.
      Specified by:
      stop in interface IElectronAnalyser
      Specified by:
      stop in interface Scannable
      Overrides:
      stop in class ADDetector
      Throws:
      DeviceException
      See Also:
    • getCpsRoiProvider

      public PlotServerROISelectionProvider getCpsRoiProvider()
    • setCpsRoiProvider

      public void setCpsRoiProvider(PlotServerROISelectionProvider cpsRoiProvider)
    • getCentreEnergyScannable

      public Scannable getCentreEnergyScannable()
    • createNXDetectorData

      protected NXDetectorData createNXDetectorData() throws Exception, DeviceException
      Overrides:
      createNXDetectorData in class ADDetector
      Throws:
      Exception
      DeviceException
    • 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
      Overrides:
      collectData in class ADDetector
      Throws:
      DeviceException
    • waitWhileBusy

      public void waitWhileBusy() throws InterruptedException, DeviceException
      Description copied from class: ScannableBase
      Returns when operation carried out by moveTo has completed If this is to be overriden, isBusy must also be valid. Although the pos and scan command currently use this method to determine if the Scannable is busy, this must not be relied upon.
      Specified by:
      waitWhileBusy in interface Detector
      Specified by:
      waitWhileBusy in interface Scannable
      Overrides:
      waitWhileBusy in class ADDetector
      Throws:
      InterruptedException
      DeviceException
    • getEnergyRange

      public AnalyserEnergyRangeConfiguration getEnergyRange()
      Specified by:
      getEnergyRange in interface IElectronAnalyser
    • setEnergyRange

      public void setEnergyRange(AnalyserEnergyRangeConfiguration energyRange)
    • getEnergyStepPerPixel

      public double getEnergyStepPerPixel()
      Description copied from interface: IElectronAnalyser
      This is the energy covered by one pixel in pass energy = 1 in meV

      To find the energy step per pixel this value should be multiplied by the pass energy. To find the fixed mode energy width this value should be multiplied by the pass energy and the number of energy channels.

      This value should not be used to calculate energy scales.

      Specified by:
      getEnergyStepPerPixel in interface IElectronAnalyser
    • setEnergyStepPerPixel

      public void setEnergyStepPerPixel(double energyStepPerPixel)
    • getMaxKE

      public double getMaxKE()
      Description copied from interface: IElectronAnalyser
      This is the fall-back maximum kinetic energy (KE) if the energyRange object can't provide a correct energy range
      Specified by:
      getMaxKE in interface IElectronAnalyser
    • setMaxKE

      public void setMaxKE(double maxKE)
    • getFixedModeEnergyChannels

      public int getFixedModeEnergyChannels()
      Description copied from interface: IElectronAnalyser
      This gets the number of energy channels in the fixed mode region, to allow the fixed mode energy width to be calculated.
      Specified by:
      getFixedModeEnergyChannels in interface IElectronAnalyser
      Returns:
      The number of energy channels in fixed mode
    • getSweptModeEnergyChannels

      public int getSweptModeEnergyChannels()
      Description copied from interface: IElectronAnalyser
      This gets the number of energy channels in the swept mode region, to allow the swept mode energy steps including pre-scan to be calculated
      Specified by:
      getSweptModeEnergyChannels in interface IElectronAnalyser
      Returns:
      The number of energy channels in swept mode
    • changeRequestedIterations

      public void changeRequestedIterations(int max)
      Description copied from interface: IElectronAnalyser
      This can be called to change the number of iterations scheduled during a scan.
      Specified by:
      changeRequestedIterations in interface IElectronAnalyser
      Parameters:
      max -
    • startContinuous

      public void startContinuous() throws Exception
      Description copied from interface: IElectronAnalyser
      Starts the analyser acquiring in continuous mode, this is intended for use in alignment. This is non blocking
      Specified by:
      startContinuous in interface IElectronAnalyser
      Throws:
      Exception - If there is a problem with the EPICS communication
    • getIterations

      public int getIterations() throws Exception
      Description copied from interface: IElectronAnalyser
      Gets the currently set number of iterations
      Specified by:
      getIterations in interface IElectronAnalyser
      Returns:
      The current number of iterations
      Throws:
      Exception - If there is a problem with the EPICS communication
    • getCompletedIterations

      public int getCompletedIterations() throws Exception
      Description copied from interface: IElectronAnalyser
      Gets the completed number of iterations from the most recent scan
      Specified by:
      getCompletedIterations in interface IElectronAnalyser
      Returns:
      The number of complete iterations from previous scan
      Throws:
      Exception - If there is a problem with the EPICS communication
    • getCurrentIteration

      public int getCurrentIteration() throws Exception
      Description copied from interface: IElectronAnalyser
      Gets the current iteration number in the scan
      Specified by:
      getCurrentIteration in interface IElectronAnalyser
      Returns:
      The current iteration number in the scan
      Throws:
      Exception - If there is a problem with the EPICS communication
    • setIterations

      public void setIterations(int iterations) throws Exception
      Description copied from interface: IElectronAnalyser
      Sets the number of iterations requested, not for use while in a scan
      Specified by:
      setIterations in interface IElectronAnalyser
      Parameters:
      iterations - The requested number of iterations
      Throws:
      Exception - If there is a problem with the EPICS communication
      See Also:
    • getSlices

      public int getSlices() throws Exception
      Gets the number of slices. i.e the number of non-energy (Y channels) that will be recorded. The data is binned in the Y direction.
      Specified by:
      getSlices in interface IElectronAnalyser
      Returns:
      Current number of slices
      Throws:
      Exception - If there is a problem at the EPICS level
    • setSlices

      public void setSlices(int slices) throws Exception
      Sets the number of slices to record i.e the number of non-energy (Y channels) that will be recorded. The data is binned in the Y direction.
      Parameters:
      slices - The requested number of slices
      Throws:
      Exception - If there is a problem at the EPICS level
    • getWorkFunctionProvider

      public WorkFunctionProvider getWorkFunctionProvider()
    • setWorkFunctionProvider

      public void setWorkFunctionProvider(WorkFunctionProvider workFunctionProvider)
    • getWorkFunction

      public double getWorkFunction(double photonEnergy)
    • getPgmEnergyScannable

      public Scannable getPgmEnergyScannable()
    • setPgmEnergyScannable

      public void setPgmEnergyScannable(Scannable pgmEnergyScannable)
    • getSpectrum

      public double[] getSpectrum() throws Exception
      Description copied from interface: IElectronAnalyser
      Gets the spectrum data acquired from the most recent acquisition
      Specified by:
      getSpectrum in interface IElectronAnalyser
      Returns:
      The spectrum data
      Throws:
      Exception - If there is a problem getting the spectrum
    • getImage

      public double[] getImage() throws Exception
      Description copied from interface: IElectronAnalyser
      Gets the image acquired during the most recent acquisition
      Specified by:
      getImage in interface IElectronAnalyser
      Returns:
      The image data
      Throws:
      Exception - If there is a problem getting the image
    • getExcitationEnergy

      @Deprecated(since="9.20") public double getExcitationEnergy() throws Exception
      Deprecated.
      Description copied from interface: IElectronAnalyser
      Gets the excitation energy
      Specified by:
      getExcitationEnergy in interface IElectronAnalyser
      Returns:
      The excitation energy
      Throws:
      Exception - If there is a problem getting the value
    • getExtIO

      public double[] getExtIO(int length) throws Exception
      Description copied from interface: IElectronAnalyser
      Gets data from an external I/O device
      Specified by:
      getExtIO in interface IElectronAnalyser
      Parameters:
      length - The number of data elements to return
      Returns:
      The data
      Throws:
      Exception - If there is a problem getting the data
    • getFrames

      public int getFrames() throws Exception
      Description copied from interface: IElectronAnalyser
      Gets the value of the frames parameter
      Specified by:
      getFrames in interface IElectronAnalyser
      Returns:
      The number of slices
      Throws:
      Exception - If there is a problem getting the frames
    • getSupportedAcquisitionModes

      public List<AcquisitionMode> getSupportedAcquisitionModes()
      Description copied from interface: IElectronAnalyser
      Gets the list of supported acquisition mode, using AcquisitionMode enum. Allows UIs to support different models of electron analyser which may name their modes differently
      Specified by:
      getSupportedAcquisitionModes in interface IElectronAnalyser
      Returns:
      The list of supported acquisition modes
    • setAcquisitionMode

      public void setAcquisitionMode(String value) throws Exception
      Description copied from interface: IElectronAnalyser
      Sets the acquisition mode
      Specified by:
      setAcquisitionMode in interface IElectronAnalyser
      Parameters:
      value - The name of the acquisition mode
      Throws:
      Exception - If there is a problem setting acquisition mode
    • startAcquiring

      public void startAcquiring() throws Exception
      Description copied from interface: IElectronAnalyser
      Starts the analyser acquiring data with the current parameters
      Specified by:
      startAcquiring in interface IElectronAnalyser
      Throws:
      Exception
    • getDetectorState

      public short getDetectorState() throws Exception
      Description copied from interface: IElectronAnalyser
      Gets the current state of the analyser
      Specified by:
      getDetectorState in interface IElectronAnalyser
      Returns:
      The current analyser state
      Throws:
      Exception - If there is a problem getting the current state
    • setSingleImageMode

      public void setSingleImageMode() throws Exception
      Description copied from interface: IElectronAnalyser
      Sets the analyser to single image mode
      Specified by:
      setSingleImageMode in interface IElectronAnalyser
      Throws:
      Exception - If there is a problem setting single image mode
    • getMaximumNumberOfSteps

      public int getMaximumNumberOfSteps()
      Description copied from interface: IElectronAnalyser
      Returns the maximum number of steps the analyser can perform in a swept scan. Suggest returning Integer.MAX_VALUE if your analyser doesn't have a limit.
      Specified by:
      getMaximumNumberOfSteps in interface IElectronAnalyser
      Returns:
      The maximum number of steps
    • getSensorSizeX

      public int getSensorSizeX()
      Description copied from interface: IElectronAnalyser
      Returns sensor size along X direction. Declared as default to not change all implementations.
      Specified by:
      getSensorSizeX in interface IElectronAnalyser
      Returns:
      Sensor size along X direction
    • getSensorSizeY

      public int getSensorSizeY()
      Description copied from interface: IElectronAnalyser
      Returns sensor size along Y direction. Declared as default to not change all implementations.
      Specified by:
      getSensorSizeY in interface IElectronAnalyser
      Returns:
      Sensor size along Y direction
    • getRegionSizeX

      public int getRegionSizeX()
      Description copied from interface: IElectronAnalyser
      Returns region size along X direction. Declared as default to not change all implementations.
      Specified by:
      getRegionSizeX in interface IElectronAnalyser
      Returns:
      Region size along X direction
    • getRegionSizeY

      public int getRegionSizeY()
      Description copied from interface: IElectronAnalyser
      Returns region size along Y direction. Declared as default to not change all implementations.
      Specified by:
      getRegionSizeY in interface IElectronAnalyser
      Returns:
      Region size along Y direction