Class DetectorGroupTemplateConfiguration

java.lang.Object
gda.factory.FindableBase
uk.ac.gda.beans.exafs.DetectorGroupTemplateConfiguration
All Implemented Interfaces:
Findable

public class DetectorGroupTemplateConfiguration extends FindableBase
This class stores configuration of which detectors to use for different experiment types, and which configuration template files to use for each type of detector. This is used in
invalid reference
FluorescenceComposite
(i.e. ' Detector Parameters' view) to set the list of available detectors for transmission, fluorescence, XES etc. experiment types. and to get the config file for each detector.
  • Constructor Details

    • DetectorGroupTemplateConfiguration

      public DetectorGroupTemplateConfiguration()
  • Method Details

    • getDetectorTemplateMap

      public Map<String,String> getDetectorTemplateMap()
      Return map : name of detector scannable object to name of template configuration file that can be used to configure it.
      Returns:
      Map
    • setDetectorTemplateMap

      public void setDetectorTemplateMap(Map<String,String> detectorTemplateMap)
      Set map to configure which configuration file to use.for each detector.
    • key = name of detector object
    • value = full path to template configuration file
    • getDetectorGroupsMap

      public Map<String,List<String>> getDetectorGroupsMap()
      Return map : name of group, to list of detectors to use for group
      Returns:
      Map
    • setDetectorGroupsMap

      public void setDetectorGroupsMap(Map<String,List<String>> detectorGroupsMap)
      Set map from name of experiment type, to list of detectors groups that can be used for that type: addDetectorGroups(String, List). *
      Parameters:
      detectorGroupsMap -
    • addDetectorGroups

      public void addDetectorGroups(String experimentType, List<String> detectorGroups)
      Add list of detector groups to map.
      Parameters:
      experimentType - - one of DetectorParameters.TRANSMISSION_TYPE, DetectorParameters.FLUORESCENCE_TYPE etc.
      detectorGroups - list of names of detector groups for the experiment type (i.e. one of named detector groups in Detector_parameters.xml file)
    • copyConfigFromTemplate

      public String copyConfigFromTemplate(String detectorName, String outputFolder, String fileName) throws IOException
      Copy template XML file for a detector. If destination file already exists, new unique name is generated by appending an integer (using FileUtils.getUnique(File, String, String)).
      Parameters:
      detectorName - name of the detector object (i.e. one of the detectors in the detector template map - set by setDetectorTemplateMap(Map))
      outputFolder - destination folder for the copied file
      fileName - name of new file (if empty, the new name will be same as the template name).
      Returns:
      Full path to the newly created file
      Throws:
      FileNotFoundException
      IOException