Package uk.ac.gda.beans.exafs
Class DetectorGroupTemplateConfiguration
java.lang.Object
gda.factory.FindableBase
uk.ac.gda.beans.exafs.DetectorGroupTemplateConfiguration
- All Implemented Interfaces:
Findable
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
(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.
invalid reference
FluorescenceComposite
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDetectorGroups(String experimentType, List<String> detectorGroups) Add list of detector groups to map.copyConfigFromTemplate(String detectorName, String outputFolder, String fileName) Copy template XML file for a detector.Return map : name of group, to list of detectors to use for groupReturn map : name of detector scannable object to name of template configuration file that can be used to configure it.voidsetDetectorGroupsMap(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).voidsetDetectorTemplateMap(Map<String, String> detectorTemplateMap) Set map to configure which configuration file to use.for each detector.Methods inherited from class gda.factory.FindableBase
equals, getName, hashCode, setName
-
Constructor Details
-
DetectorGroupTemplateConfiguration
public DetectorGroupTemplateConfiguration()
-
-
Method Details
-
getDetectorTemplateMap
Return map : name of detector scannable object to name of template configuration file that can be used to configure it.- Returns:
- Map
-
setDetectorTemplateMap
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
Return map : name of group, to list of detectors to use for group- Returns:
- Map
-
setDetectorGroupsMap
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
Add list of detector groups to map.- Parameters:
experimentType- - one ofDetectorParameters.TRANSMISSION_TYPE,DetectorParameters.FLUORESCENCE_TYPEetc.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 (usingFileUtils.getUnique(File, String, String)).- Parameters:
detectorName- name of the detector object (i.e. one of the detectors in the detector template map - set bysetDetectorTemplateMap(Map))outputFolder- destination folder for the copied filefileName- 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:
FileNotFoundExceptionIOException
-