Skip to content

Commit

Permalink
Changed delimiter of aliases in stripchart to < >, so it does not to …
Browse files Browse the repository at this point in the history
…collide with function call parenthesis.
  • Loading branch information
alexgobbo committed Jun 13, 2023
1 parent 7ebb5fd commit d680a80
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/main/java/ch/psi/pshell/ui/StripChart.java
Original file line number Diff line number Diff line change
Expand Up @@ -408,16 +408,16 @@ void updateTooltip(JComponent text, int row) {
Type type = Type.valueOf(modelSeries.getValueAt(row, 2).toString());
switch (type) {
case Channel:
tooltip = "Format: ChannelName [Polling(ms)=-1 Precision=-1] (Alias)";
tooltip = "Format: ChannelName [Polling(ms)=-1 Precision=-1] <Alias>";
break;
case Device:
tooltip = "Format: DeviceName (Alias)";
tooltip = "Format: DeviceName <Alias>";
break;
case Stream:
tooltip = "Format: Identifier [Modulo=" + StreamChannel.DEFAULT_MODULO + " Offset=" + StreamChannel.DEFAULT_OFFSET + " GlobalTime=true] (Alias)";
tooltip = "Format: Identifier [Modulo=" + StreamChannel.DEFAULT_MODULO + " Offset=" + StreamChannel.DEFAULT_OFFSET + " GlobalTime=true] <Alias>";
break;
case CamServer:
tooltip = "Format: URL Identifier (Alias)";
tooltip = "Format: URL Identifier <Alias>";
break;
}
}
Expand Down Expand Up @@ -1032,8 +1032,8 @@ TimePlotSeries getTimePlotSeries(int row) {

String removeAlias(String str){
str=str.trim();
if (str.endsWith(")")) {
int start = str.lastIndexOf('(');
if (str.endsWith(">")) {
int start = str.lastIndexOf('<');
if (start>=0){
str=str.substring(0, start);
}
Expand Down Expand Up @@ -1063,9 +1063,9 @@ String[] getChannelArgs(String str){

String getChannelAlias(String str){
str=str.trim();
if (str.endsWith(")")) {
int end = str.lastIndexOf(')');
int start = str.lastIndexOf('(');
if (str.endsWith(">")) {
int end = str.lastIndexOf('>');
int start = str.lastIndexOf('<');
if (start>=0){
String alias = str.substring(start + 1, end);
if (!alias.isBlank()){
Expand Down

0 comments on commit d680a80

Please sign in to comment.