Class PVNames
java.lang.Object
org.epics.archiverappliance.config.PVNames
Utility class for dealing with various aspects of EPICS PV names and Channel Names.
- Author:
- mshankar
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Patternstatic final Stringstatic final Stringstatic final Stringstatic final StringWhen you intend to connect to the PV's using Channel Access, use this string as a prefix in the UI/archivePV BPL.static final StringWhen you intend to connect to the PV's using PVAccess, use this string as a prefix in the UI/archivePV BPL. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringchannelNamePVName(String channelName) Remove the .VAL, .HIHI etc portion of a channelName and return the plain pvNamestatic PVTypeInfodetermineAppropriatePVTypeInfo(String pvName, ConfigService configService) A standard process for dealing with aliases, standard fields and the like and getting to the PVTypeInfo.static booleandetermineIfPVInWorkflow(String pvName, ConfigService configService) A standard process for dealing with aliases, standard fields and the like and checking to see if the PV is in the archive workflow.static StringgetFieldName(String channelName) static booleanisFieldOrFieldModifier(String channelName) Is this a field or field modifier?static booleanisValidChannelName(String channelName) Check to see if the channelName has valid characters.static StringnormalizeChannelName(String channelName) Remove .VAL from pv names if present.static StringnormalizePVNameWithField(String pvName, String fieldName) Gives you something you can use with caget to get the field associated with a PV even if you have a field already.static PVNames.EPICSVersionpvNameVersion(String pvName) What type of name is the pv.static StringstripPrefixFromName(String pvName) Remove the pva:// or ca:// prefix from the PV name if present.static StringtransferField(String srcName, String destName) Transfer any fields from the source name to the dest name Transferring ABC:123 onto DEF:456 should give DEF:456 Transferring ABC:123.DESC onto DEF:456 should give DEF:456.DESC
-
Field Details
-
V4_PREFIX
When you intend to connect to the PV's using PVAccess, use this string as a prefix in the UI/archivePV BPL. For example, pva://double01 This syntax should be consistent with CSS.- See Also:
-
V3_PREFIX
When you intend to connect to the PV's using Channel Access, use this string as a prefix in the UI/archivePV BPL. For example, ca://double01 This syntax should be consistent with CSS.- See Also:
-
GROUP_PV_NAME
- See Also:
-
GROUP_FIELD_NAME
- See Also:
-
GROUP_FIELD_MODIFIER
- See Also:
-
channelNamePattern
-
-
Constructor Details
-
PVNames
public PVNames()
-
-
Method Details
-
channelNamePVName
Remove the .VAL, .HIHI etc portion of a channelName and return the plain pvName- Parameters:
channelName- The name of the PV channel.- Returns:
- String The plain pvName
-
getFieldName
- Parameters:
channelName- Input full name of the channel- Returns:
- Only the group if exists, "" otherwise.
-
isFieldOrFieldModifier
Is this a field or field modifier?- Parameters:
channelName- The name of PV.- Returns:
- boolean True or False
-
normalizeChannelName
Remove .VAL from pv names if present. Returned value is something that can be used to lookup for PVTypeInfo- Parameters:
channelName- The name of PVs.- Returns:
- String normalizePVName
-
normalizePVNameWithField
Gives you something you can use with caget to get the field associated with a PV even if you have a field already. normalizePVNameWithField("ABC", "NAME") gives "ABC.NAME" normalizePVNameWithField("ABC.HIHI", "NAME") gives "ABC.NAME"- Parameters:
pvName- The name of PV.fieldName-- Returns:
- String normalizePVNameWithField
-
transferField
Transfer any fields from the source name to the dest name Transferring ABC:123 onto DEF:456 should give DEF:456 Transferring ABC:123.DESC onto DEF:456 should give DEF:456.DESC- Parameters:
srcName- The source namedestName- The destination name- Returns:
- String transferField
-
determineAppropriatePVTypeInfo
A standard process for dealing with aliases, standard fields and the like and getting to the PVTypeInfo.- Parameters:
pvName- The name of PV.configService- ConfigService- Returns:
- PVTypeInfo
Places where we look for the typeinfo.
- If the PV is not a field PV
- Typeinfo for full PV name
- Alias for full PV name + Typeinfo for full PV name
- If the PV is a field PV
- Typeinfo for fieldless PVName + archiveFields
- Typeinfo for full PV name
- Alias for fieldless PVName + Typeinfo for fieldless PVName + archiveFields
- Alias for full PV name + Typeinfo for full PV name
- If the PV is not a field PV
-
determineIfPVInWorkflow
A standard process for dealing with aliases, standard fields and the like and checking to see if the PV is in the archive workflow.- Parameters:
pvName-configService-- Returns:
- True if the PV or its avatars are in the archive workflow.
It is not possible to state this accurately for all fields.
For example, for fields that are archived as part of the stream, if the main PV is in the archive workflow, then the field is as well.
But it is impossible to state this before the PVTypeInfo has been computed.
So we resort to being pessimistic.
Places where we look for the typeinfo.
- If the PV is not a field PV
- ArchivePVRequests for full PV name
- Alias for full PV name + ArchivePVRequests for full PV name
- If the PV is a field PV
- ArchivePVRequests for full PVName
- Alias for full PV name + ArchivePVRequests for full PVName
- If the PV is not a field PV
-
isValidChannelName
Check to see if the channelName has valid characters. Uses the regex "(?<PVNAME>[a-zA-Z0-9_\-+:\[\]<>;/,#{}^]+)\.?(?<FIELDNAME>[a-zA-Z0-9_\-+:]+)?\.?(?<FIELDMODIFIER>\{.+})?" For certain characters, EPICS will not throw exceptions but generate spurious traffic which is hard to detect. From the App dev Guide Valid characters are a-z A-Z 0-9 _ - + : [ ] < > ; And we add the '/' character because some folks at FACET use this. And we add the ',' character because some folks at LBL use this. And we add the '#' character because some folks at FRIB use this. And we add the '{' and the '}' character because some folks at BNL use this. And we add the '^' character because some folks at LNL use this.For field names using the filter support: Filter support documentation: filters
- Parameters:
channelName- The name of PV.- Returns:
- boolean True or False
-
pvNameVersion
What type of name is the pv. return EPICSVersion.V3 if starts with ca:// return EPICSVersion.V4 if starts with pva:// returns EPICSVersion.DEFAULT otherwise.- Parameters:
pvName- The name of PV.- Returns:
- EPICSVersion
-
stripPrefixFromName
Remove the pva:// or ca:// prefix from the PV name if present.- Parameters:
pvName- The name of PV.- Returns:
- String
-