Class MotorOffsetStore

java.lang.Object
gda.factory.FindableBase
gda.device.scannable.MotorOffsetStore
All Implemented Interfaces:
Findable

public class MotorOffsetStore extends FindableBase
Class used to manipulate Epics motor record offsets for XES spectrometer. The current set of motor offsets for all motors in an XESEnergyScannable object along with additional information can be saved and loaded from XML file (using Apache Common(XMLConfiguration).

  • The current set of motor records offsets can be retrieved using getEpicsOffsets()
  • The latest offsets values can be saved to an XML file using saveOffsets(String, String);
  • A previously saved XML file can be reloaded and the the offsets applied to the motor records using loadOffsets(String, String).
    • Constructor Details

      • MotorOffsetStore

        public MotorOffsetStore()
    • Method Details

      • saveOffsets

        public void saveOffsets(String directory, String fileName) throws org.apache.commons.configuration.ConfigurationException, IOException, DeviceException
        Save the current Epics motor records offsets and metadata to an XML file
        Parameters:
        directory - where the file should be saved
        fileName - name of the file to save to (without .xml suffix)
        Throws:
        org.apache.commons.configuration.ConfigurationException
        IOException
        DeviceException
      • loadOffsets

        public void loadOffsets(String directory, String fileName) throws Exception
        Load a previously saved XML and apply the offsets to the Epics motor records.
        Parameters:
        directory - containing the file
        fileName - of the file to be loaded
        Throws:
        Exception
      • createExtraProperties

        public Map<String,Object> createExtraProperties() throws DeviceException
        Create mao containing additional information (key = information type) e.g. name of spectrometer scannable, crystal type and cut etc.
        Returns:
        map
        Throws:
        DeviceException
      • getEpicsOffsets

        public Map<Scannable,Double> getEpicsOffsets() throws MotorException
        Throws:
        MotorException
      • getEpicsOffsets

        public Map<Scannable,Double> getEpicsOffsets(List<Scannable> scannables) throws MotorException
        Throws:
        MotorException
      • getXesEnergyScannable

        public XESEnergyScannable getXesEnergyScannable()
      • setXesEnergyScannable

        public void setXesEnergyScannable(XESEnergyScannable xesEnergyScannable)
      • getExtraInformation

        public String getExtraInformation()
      • setExtraInformation

        public void setExtraInformation(String extraInformation)