Class EpicsProcessVariableCollection
- All Implemented Interfaces:
Findable
setName2PVNestedMap(Map)- this supports nested map in which data from PVs are further grouped into children nodes under this group before adding into containing node.setName2PVSimpleMap(Map)- this supports simple map in which data from all PVs are grouped together in this group before adding into containing node.setFieldsToAppend(Map)- this supports a multiple valued map in which data from different type items are added directly to the containing node.setName2PairMap(Map)- this supports a simple map in which data from different type items are grouped together before adding into containing node.
For the last 2 methods, there are 4 different EpicsProcessVariableCollection.InputType of items can be specified in Spring beans - (EpicsProcessVariableCollection.InputType.CONSTANT, EpicsProcessVariableCollection.InputType.PV, EpicsProcessVariableCollection.InputType.LINK, EpicsProcessVariableCollection.InputType.EXPRESSION).
Important to know:
Objects of this class tolerant with any PV access failure so it will not block data collection from others. Instead of throwing exception when PV access fails, it returns the error message of the PV access problem as well as makes ERROR log entry in the log file.
Usage:
Instance of this class can be injected into file writer MultipleImagesPerHDF5FileWriter or MultipleHDF5PluginsPerDetectorFileWriter to
contribute to the data collection. The original requirements are to capture active detector setting parameters during data collection with the detector.
- Since:
- 23 March 2021
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddField(String name, EpicsProcessVariableCollection.InputType type, String value) add specified filed with specifiedEpicsProcessVariableCollection.InputTypeand String valuevoidaddToNestedMap(String group, String name, String pvName) add a key value pair to a specified group in the nested mapvoidaddToSimpleMap(String name, String pvName) add a Key value pair to the simple mapreturn anOptionalof anINexusTreewhich can be added to other Nexus node.create anGroupNodeas NXcollection from PV map specified insetName2PVNestedMap(Map)orsetName2PVSimpleMap(Map).return anOptionalof anINexusTreewhich can be added to other Nexus node.create an of anINexusTreenode as NXcollection from PV map specified insetName2PVNestedMap(Map)create an of anINexusTreenode as NXcollection from PV map specified insetName2PVSimpleMap(Map)voiddisplay fields to append on Jython Terminal.voiddisplay nested map content on Jython Terminal.voiddisplay simple map content on Jython Terminal.booleaninthashCode()voidremoveElementFromNamedField(String name, EpicsProcessVariableCollection.InputType type, String value) remove a specificEpicsProcessVariableCollection.InputTypeand String value pair from the specified name fieldList<org.apache.commons.lang3.tuple.ImmutablePair<EpicsProcessVariableCollection.InputType, String>> removeField(String name) remove a specified field from the mapremoveFromNestedMap(String group, String name) remove an item from the specified group of the nested mapremoveFromSimpleMap(String name) remove an item from the simple mapremoveGroupFromNestedMap(String group) remove a whole group from the nested mapvoidsetFieldsToAppend(Map<String, List<org.apache.commons.lang3.tuple.ImmutablePair<EpicsProcessVariableCollection.InputType, String>>> fieldsToAppend) set a multi-valued mapvoidsetHDF5Filename(String expectedFullFileName) voidsetName2PairMap(Map<String, org.apache.commons.lang3.tuple.ImmutablePair<EpicsProcessVariableCollection.InputType, String>> name2PairMap) voidset a nested mapvoidsetName2PVSimpleMap(Map<String, String> name2pvSimpleMap) set simple mapMethods inherited from class gda.factory.FindableBase
getName, setName
-
Constructor Details
-
EpicsProcessVariableCollection
public EpicsProcessVariableCollection()
-
-
Method Details
-
addField
add specified filed with specifiedEpicsProcessVariableCollection.InputTypeand String value- Parameters:
name- - field name, i.e. map keytype- -EpicsProcessVariableCollection.InputTypeof corresponding valuevalue- - the String of correspondingEpicsProcessVariableCollection.InputType
-
removeField
public List<org.apache.commons.lang3.tuple.ImmutablePair<EpicsProcessVariableCollection.InputType,String>> removeField(String name) remove a specified field from the map- Parameters:
name- - field name- Returns:
- the value of the field being removed
-
removeElementFromNamedField
public void removeElementFromNamedField(String name, EpicsProcessVariableCollection.InputType type, String value) remove a specificEpicsProcessVariableCollection.InputTypeand String value pair from the specified name field- Parameters:
name- - field name, i.e. map keytype- -EpicsProcessVariableCollection.InputTypeof corresponding valuevalue- - the String of correspondingEpicsProcessVariableCollection.InputType
-
addToSimpleMap
add a Key value pair to the simple map- Parameters:
name- - GDA name as keypvName- - PV name from which to get the value
-
removeFromSimpleMap
remove an item from the simple map- Parameters:
name- - GDA name as key removed from map- Returns:
- - the PV name removed from map
-
addToNestedMap
add a key value pair to a specified group in the nested map- Parameters:
group- - the key to the inner mapname- - the GDA name as key of the inner mappvName- - the PV name as value of the inner map
-
removeFromNestedMap
remove an item from the specified group of the nested map- Parameters:
group- - key to the inner mapname- - key of the inner map to be removed- Returns:
- - the PB name removed from the inner map
-
removeGroupFromNestedMap
remove a whole group from the nested map- Parameters:
group- - group to be removed- Returns:
- - the map of the removed group
-
displaySimpleMap
public void displaySimpleMap()display simple map content on Jython Terminal. -
displayNestedMap
public void displayNestedMap()display nested map content on Jython Terminal. -
displayFieldsToAppend
public void displayFieldsToAppend()display fields to append on Jython Terminal. -
createFieldsToAppend
return anOptionalof aMapcontaining name-value maps which can be added to other Nexus node directly.- Returns:
- a map of name , value
-
createDataNodeToAppend
-
createNexusTreeFromName2PairMap
return anOptionalof anINexusTreewhich can be added to other Nexus node.- Returns:
- a map of name , value
-
createNexusTreeFromName2PVNestedMap
create an of anINexusTreenode as NXcollection from PV map specified insetName2PVNestedMap(Map)- Parameters:
name- the name of the tree node- Returns:
- an
Optionalof anINexusTreenode
-
createNexusTreeFromName2PVSimpleMap
create an of anINexusTreenode as NXcollection from PV map specified insetName2PVSimpleMap(Map)- Parameters:
name- the name of the tree node- Returns:
- an
Optionalof anINexusTreenode
-
createGroupNodeFromName2PairMap
return anOptionalof anINexusTreewhich can be added to other Nexus node. The data source comes fromsetName2PairMap(Map)which can be set withsetName2PairMap(Map)- Returns:
- a map of name , value
-
createGroupNodeFromName2PVNestedMap
create anGroupNodeas NXcollection from PV map specified insetName2PVNestedMap(Map)orsetName2PVSimpleMap(Map). This is used by new NexusScanDataWriter.- Returns:
- a group node
-
createGroupNodeFromName2PVSimpleMap
-
setName2PVNestedMap
set a nested map- Parameters:
name2pvNestedMap- - map of maps
-
setName2PVSimpleMap
set simple map- Parameters:
name2pvSimpleMap- - map of GDA name to PV
-
setFieldsToAppend
public void setFieldsToAppend(Map<String, List<org.apache.commons.lang3.tuple.ImmutablePair<EpicsProcessVariableCollection.InputType, String>>> fieldsToAppend) set a multi-valued map- Parameters:
fieldsToAppend-
-
setName2PairMap
public void setName2PairMap(Map<String, org.apache.commons.lang3.tuple.ImmutablePair<EpicsProcessVariableCollection.InputType, String>> name2PairMap) -
hashCode
public int hashCode()- Overrides:
hashCodein classFindableBase
-
equals
- Overrides:
equalsin classFindableBase
-
setHDF5Filename
-