Feature: Added option to merge identically named timeseries across files #996
+113
−17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: If any part of this pull-request is not up to the expected standards, preventing it from being merged, I would appreciate any feedback so that I can iterate on it until it is!
Background
Depending on the software used to collect data during experiments, the resulting logs can be fragmented. If that is the case, one can, currently, visualize them all at the same time in PlotJuggler by just giving them different prefixed.
This approach has one main drawback, however: Every timeseries is present as often as the number of log fragments one is dealing with. As a result, layouts don't work and custom series are cumbersome (need to be created for every /timeseries).
Changes
This pull request adds an option in the 'multifile prefix' dialog, that, when ticked, merges timeseries of the same name of all files loaded. In the use-case described before, this can be used in two ways: (1) By setting all prefixes to empty strings, the resulting timeseries in PlotJuggler behave as if coming from one individual file. (2) By grouping the timeseries into different prefixes, multiple fragmented datasets can be visualized simultaneously.
Additionally, this pull requests adds a 'clear already present data' checkbox, that is only active when 'merge identically named timeseries' is, too, and does as the name suggests. When not ticked, newly loaded timeseries are merged with the ones already present in PlotJuggler. When ticked, all points in existing timeseries are clearer before importing the new data.
Examples and Screenshots
For example, this configuration:
where the files all contain overlapping timeseries would merge the content of those.
Unchecking the box results in the current behaviour, where the last file loaded is the one whose timeseries with clashing names survive.