blackbox-log-viewer
blackbox-log-viewer copied to clipboard
Suggestion : min and max values instead of % in the 'Graph setup' dialog box
At the moment, if we wish to change the 'vertical scaling' of a waveform box, we use the 'Zoom' value, which is a percentage.
If the data is a value either side of centre value, like gyro, a zoom of 200% will let us see a zoomed in 'centre' range, ie the data that would normally occupy the middle 50% will be stretched vertically to fill the entire space.
Unfortunately, if the value has a hard 'zero' and a max, eg motors, with range 0-100%, zooming in will give us a zoom on the centre percentage, and values below 25% and above 75% cannot be seen. It isn't possible, for example, to zoom in on the lowest 50% of the range, or the upper 50% of the range.
There is an even greater problem with debugs that are either being used for code development or for which the scaling in betaflight is 'automatic'. In most of these cases, the highest value and the lowest value in the log set the min and max of the range to be displayed. Zooming in then looks at the centre area. In some debugs you might only want to look at some particular range of numbers, consistently, log after log, in a custom debug - but this is presently impossible, with somewhat arbitrary scaling depending on the range of values within a given log.
I have thought about this, and noted that in the code there is effectively a minimum and a maximum value.
So I wondered if, instead of the familiar percentage, we could remove that, and put two input fields, one to directly set the minimum, and the other the maximum. A bit like in spreadsheet graphs.
So, for example, for motors, we would have, by default, min = 0 max =100. But if we wanted to look closely at the lowest 20% we could enter min = 0, max = 20.
And for a debug, if we were really interested in the range -1000 to -200, we could do that also. If we saved that into a preset, we could directly compare the debug traces from one log to the next in an exact and repeatable manner.
I think this would greatly improve our ability to develop the code and create graphs that look at the exact range we really have a special interest in. I know I would personally find it very useful, and I know many other developers who feel the same way.
I'll take a shot on that one after easter. I am not sure where to put that in the GUI and how to keep the min-max values persistent but I'm slowly getting confortable with the overall codebase.
possibly easier to adjust each graph's Y-axis to a new "center", but such is just a thought, i did not investigate codebase.