Skip to content

Conversation

@georgweiss
Copy link
Collaborator

This PR is a follow-up on #3135.

My users have expressed dissatisfaction over the changed default behavior. Underlying issue is in my view that IOC developers may or may not consider the DESC field to be something for a high level client. There is also a bug in the current implementation: if DESC is not set, then the description is set to an empty string, not to null.

I have added a preference setting to control the default policy: pv-name or pv-desc where pv-name is the default. To use DESC user will need to add org.csstudio.trends.databrowser3/value_axis_label_policy=pv-desc to the settings file.

final Display display = Display.displayOf(value);
if (display.getDescription() != null && !display.getDescription().isEmpty()){
setDisplayName(display.getDescription());
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to add break; statements in order to prevent fall-through in case more cases are added in the future.

Copy link
Collaborator

@kasemir kasemir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is much better for backwards compatibility because as you noticed DESC tends to not be set

# pv-name: classic policy. Default if this property is not set or set to an unsupported value.

@georgweiss
Copy link
Collaborator Author

Yes, oftenwise DESC is not set, or set to same value across multiple PVs.

@georgweiss georgweiss merged commit 3268683 into master Nov 13, 2024
2 checks passed
@georgweiss georgweiss deleted the CSSTUDIO-2798 branch November 13, 2024 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants