Skip to content

Conversation

@georgweiss
Copy link
Collaborator

@georgweiss georgweiss commented Dec 8, 2025

A per user request:

Comparisons in the save&restore snapshot view are difficult for arrays with more than a dozen or so elements. This PR adds the possibility to launch a dialog showing saved, delta and live value in a table view, see screenshots. A threshold spinner like the one in the snapshot view can be used to remove highlight of deltas smaller than the user defined level.

The dialog controller will connect to the PV in order to show actual live value.

Differences in array length are treated such that elements missing from either array are simply rendered as "---", see screen shots.

This PR is a first iteration, the idea is to expand this to also support NTTable types.

NOTE "Click to compare" is used only for non-scalar types.

Screenshot 2025-12-08 at 12 50 09 Screenshot 2025-12-08 at 09 16 26

Checklist

  • Testing:

    • The feature has automated tests
    • [ X] Tests were run
  • Documentation:

    • [ X] The feature is documented
    • [ X] The documentation is up to date

@jacomago
Copy link
Contributor

jacomago commented Dec 8, 2025

Maybe there should be a hard max (or configurable) max to what is comparable, or load up to the max. Otherwise someone could compare 700 000 elements perhaps...

@georgweiss
Copy link
Collaborator Author

@jacomago, interesting, but for what reason? Usability? RAM usage? And what value should be considered a sensible default?

* @author Kunal Shroff
*/
public class VDeltaCellEditor<T> extends VTypeCellEditor<T> {
public class VDeltaCellEditor<S, T> extends VTypeCellEditor<S, T> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is the type parameter S added to VTypeCellEditor?

Copy link
Collaborator Author

@georgweiss georgweiss Dec 8, 2025

Choose a reason for hiding this comment

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

In order to be able to use VTypeCellEditor for both TableEntry and ColumnEntry

@jacomago
Copy link
Contributor

jacomago commented Dec 8, 2025

@jacomago, interesting, but for what reason? Usability? RAM usage? And what value should be considered a sensible default?

Usability, otherwise yes you'll max out the ram. I think a human can't really check more than 1000 elements, but it makes sense to be configurable in some way.

But extending the idea. What about you have some summary information:

  1. How many elements are in the threshold?
  2. How many elements are out of the threshold?
    3a. Add in the title of pop out the limit on how many elements are being shown. i.e. Showing the first 1000 elements.
    3b. Only show those elements that are out of the threshold and their index.

@georgweiss
Copy link
Collaborator Author

georgweiss commented Dec 8, 2025

@jacomago, in the main snapshot view there is a checkbox for the purpose of hiding rows where values are equal within threshold, so this could be a useful feature for array elements as well. However, this may not be feasible in the generic case when the table is showing NTTable data. Deltas could be on different row indices, so visualization becomes a challenge.

That said I do not object to a "hide equal items" feature as long as the underlying PV is an array and not a table.

As for limiting the number of elements... I would maybe consider a pagination approach based on a user defined limit of number of rows per page.

@shroffk
Copy link
Member

shroffk commented Dec 8, 2025

hmm...I think comparisons of arrays are not easy and element by element comparisons can get messy very quickly

I am fine with merging this as is

@georgweiss georgweiss changed the title Csstudio 3585 Save&Restore comparison of array data Dec 9, 2025
@georgweiss
Copy link
Collaborator Author

@jacomago, updated such that row where any of the values (base or live) is not available (i.e. array length not equal), sorting on the delta column will order such rows next to rows with non-zero delta. This way user can easily find differences in array length without having to scroll to bottom of the table view.

@jacomago
Copy link
Contributor

jacomago commented Dec 9, 2025

@jacomago, updated such that row where any of the values (base or live) is not available (i.e. array length not equal), sorting on the delta column will order such rows next to rows with non-zero delta. This way user can easily find differences in array length without having to scroll to bottom of the table view.

Looks better, I would still do the summary info. Number of rows different, number of rows matching. Its a tricky feature for UX wise obviously.

@georgweiss
Copy link
Collaborator Author

Yes, why not. And maybe also length of arrays being compared...

@georgweiss
Copy link
Collaborator Author

@jacomago, this is how it turns out:

Screenshot 2025-12-10 at 15 36 31

When user sets a non-zero threshold the non-equal count is updated for rows where delta < threshold.

@jacomago
Copy link
Contributor

@jacomago, this is how it turns out:

Screenshot 2025-12-10 at 15 36 31

When user sets a non-zero threshold the non-equal count is updated for rows where delta < threshold.

Super nice 🙂

@shroffk shroffk merged commit a570d69 into master Dec 11, 2025
3 checks passed
@georgweiss georgweiss deleted the CSSTUDIO-3585 branch December 11, 2025 15:58
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.

5 participants