Skip to content

Commit 0b5aae4

Browse files
authored
Merge pull request #2272 from ControlSystemStudio/cf_pv_patch
Channel Info: Look for just the channel 'X' in ca://X.VAL$
2 parents c297548 + 8aa5d24 commit 0b5aae4

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

app/channel/views/src/main/java/org/phoebus/channel/views/ChannelInfo.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,21 @@ public void call(Selection selection) throws Exception
8181

8282
// Query channelfinder for selected pvs on a separate thread.
8383
pvs.forEach(pv -> {
84+
// X.DESC, X.VAL$, loc://X(3.14) or pva://X are all valid PV names,
85+
// but the channel finder tends to only know about a record "X",
86+
// so locate that part of the name
87+
String name = pv.getName();
88+
int sep = name.lastIndexOf('(');
89+
if (sep > 0)
90+
name = name.substring(0, sep);
91+
sep = name.lastIndexOf('.');
92+
if (sep > 0)
93+
name = name.substring(0, sep);
94+
sep = name.indexOf("://");
95+
if (sep >= 0)
96+
name = name.substring(sep + 3);
8497
ChannelSearchJob.submit(this.client,
85-
pv.getName(),
98+
name,
8699
result -> Platform.runLater(() -> {
87100
controller.addChannels(result);
88101
}),

0 commit comments

Comments
 (0)