Repository navigation
Visualize alarm limits in data browser - #3949
georgweiss wants to merge 29 commits into
Conversation
…nge (e.g. in alarm limits)
jacomago
left a comment
There was a problem hiding this comment.
I would prefer would big changes like this to have a clear commit structure. 3000 lines changed can be hard to track what's going on over all the code.
| AddPV_PeriodTT, | ||
| AppendSearchResults, | ||
| AppendSearchResultsTT, | ||
| AreaOpacity, |
There was a problem hiding this comment.
Why are we removing all these messages?
There was a problem hiding this comment.
Because the definition (in messages.properties) is referenced only in FXML, not in Java code.
| private final Range controlRange = Range.of(-1000, 1000); | ||
|
|
||
| @Test | ||
| public void testHasAlarmLimits1(){ |
There was a problem hiding this comment.
Can we have more descriptive test names, if these are all the same it would be better to use ParametizedTests for test case variation.
There was a problem hiding this comment.
I'll look into this.
| AlarmLimitItem alarmLimitItem = AlarmLimitItem.createAlarmLimitItem(pvItem, limitType); | ||
| alarmLimitItem.setAxis(pvItem.getAxis()); | ||
| alarmLimitItem.setDisplayName(""); | ||
| alarmLimitItem.setColor(pvItem.getPaintColor()); |
There was a problem hiding this comment.
I really don't like this default. Maybe we can ask Balazs for UI opinion. But I think being the same colour and opacity as the main line is really not a great option. Some options:
- desaturate the colour
- Reduce the opacity (similar to the area colour)
- Saturate
There was a problem hiding this comment.
As pointed out in the PR comment, visualization is not ideal as it stands. Tweaking saturation may be an option, but then again user may choose to give the PV plot a less saturated color. Reduced opacity won't help if the alarm limit trace is painted on top of a very noisy PV plot.
At this point I would like the PR to demonstrate a feature we can improve incrementally.
| public class AlarmLimitItemTest { | ||
|
|
||
| @Test | ||
| public void testConstructor1(){ |
There was a problem hiding this comment.
Again here the test cases are almost identical, better to use parametized tests to make clear the difference between them.
There was a problem hiding this comment.
Will look into this.
| /** | ||
| * Helper enum... | ||
| */ | ||
| public enum LimitType { |
There was a problem hiding this comment.
I think most of this class and AlarmLimits class would be better in the VType module where it can be reused across the other modules.
There was a problem hiding this comment.
Disagree. AlarmLimits is particular to the data browser app. It manages colors, which should be of no concern of the VType module.
| public class AlarmLimitItemTest { | ||
|
|
||
| @Test | ||
| public void testConstructor1(){ |
There was a problem hiding this comment.
These tests are pretty much the same and I think could be improved by using ParametizedTest
There was a problem hiding this comment.
I'll look into that.
| final Range warningRange = Range.of((low != null) ? Double.parseDouble(low) : currentDisplay.getWarningRange().getMinimum(), | ||
| (high != null) ? Double.parseDouble(high) : currentDisplay.getWarningRange().getMaximum()); | ||
|
|
||
| return Display.of(displayRange, |
There was a problem hiding this comment.
I think @abrahamwolk work to create the description provider would help here. Having the alarm information split out from Display I think would improve the code api.
There was a problem hiding this comment.
Can be updated when that change is available.
| * @param value {@link VType} under test. | ||
| * @return <code>true</code> if alarm or warning limits have been set. | ||
| */ | ||
| public final static boolean hasAlarmLimits(final VType value) { |
There was a problem hiding this comment.
I think it would be better this method as part of VType
There was a problem hiding this comment.
But then again... that brings up the question on moving all org.phoebus.archive.vtype.VTypeHelper methods to org.phoebus.core.vtypes.VTypeHelper, which in my view is a different PR.
| } | ||
|
|
||
| @Test | ||
| void testUpdateDisplay1() { |
There was a problem hiding this comment.
Prefer either more descriptive test cases or using ParametizedTest
There was a problem hiding this comment.
I'll look into that.
|



This PR adds support for visualizing alarm limits in data browser plots for PVs stored by the Archiver Appliance. Screen shots attached below.
How this works
In the traces tab, the added
Show Alarm Limitscolumn will render a check box for each trace if the following conditions are met:When the
Show Alarm Limitscheckbox is ticked by the user, additional traces are added to the plot to show the alarm limits defined by that PV. To be noted:Limitations
Aspects on trace rendering
Ideally users should not be bothered with changing the color of alarm limit traces to improve the visual presentation. I leave that as a challenge for future improvements. Ideas are welcome.
Testing:
Documentation: