klonyyy / STMViewer

Real-time STM32 variable & trace viewer
GNU General Public License v3.0
536 stars 59 forks source link

Display (parts of) arrays #40

Open wimalopaan opened 4 months ago

wimalopaan commented 4 months ago

It would be convenient to have an option to display the contents of an array (e.g. like the output of a fft) and update that continously. Sometimes it would also be good to only display a part of that array e.g. an index-range.

klonyyy commented 4 months ago

Do you mean it would be nice to have a way of quickly importing an array, or rather displaying a range of an array as a table view?

wimalopaan commented 4 months ago

A table-view would be good, but I had an updating graphical view (e.g. a bar-graph) in mind. And it would be very nice if it would be possible to import the whole array at once.

wimalopaan commented 4 months ago

Another option would be so save the array-data in a trace-file periodically triggered by some event / variable-change.

klonyyy commented 4 months ago

So considering options that are available right now, the main problem is that the import and placing the variables on the plot takes very long to set up, am I right?

wimalopaan commented 4 months ago

Not only that, but I'm looking for a way to plot an array as a whole: e.g. the array contains some fft-values (or the amplitudes of the frequencies), I want to see the spektrum.

klonyyy commented 4 months ago

I'm thinking if the problem is not too specific. Are there any obstacles in using bar graph for that? Apart from a lengthy process of manually adding the coefficients to the list and then to the plot?

wimalopaan commented 4 months ago

Yes, a bar graph is an option but specifying the indixes is tedious (e.g. a 512 element array).

Maybe a another option would be to write the whole array to a file (together with some other variable that represents to time).

klonyyy commented 4 months ago

Thanks for clarification. The functionality you're porposing seems to be connected to #34. I'll think about the optimal way to implement it.

wimalopaan commented 4 months ago

Yes, I overlooked #34 . Thank you!

wimalopaan commented 1 month ago

For the bar-graph of arrays: do you see any change to implement this?

klonyyy commented 1 month ago

Unfortunately my current priority is to merge the devel branch with J-Link HSS feature to main. After that I plan on adding less anticipated features. If you're not able to help directly by implementing the feature, It would be great if you could provide a detailed description of how you'd see this feature. I wouldn't like to implement FFT-type plots using bargraphs if they are not designed for such usecases. You could check out ImPlot for the type of plot that would suit this best.