scopy icon indicating copy to clipboard operation
scopy copied to clipboard

ADALM2000: Logic analyzer: Show table of decoded messages

Open frmdstryr opened this issue 2 years ago • 17 comments

Is your feature request related to a problem? Please describe.

The logic analyzer decoding works great however I can only see one packet at a time...

Describe the solution you'd like

Show a table of all decoded messages.

Additional context

Zoomed out: image

Zoomed in:

image

frmdstryr avatar Mar 30 '22 15:03 frmdstryr

This would indeed be cool. There currently is an alternative where you could use sigrok-cli in conjunction with the m2k-cli to get a list of decoded messages. You wouldn't be able to visualize the data however. https://wiki.analog.com/university/tools/m2k/libm2k/m2kcli?s[]=m2kcli#m2kcli_and_sigrok-cli

adisuciu avatar Mar 31 '22 09:03 adisuciu

It looks pulseview added something like this recently: https://www.sigrok.org/blog/new-pv-tabular-decoder-output-view

For now I'll see if I can get something using the cli and hopefully view it with that, thank you!

frmdstryr avatar Mar 31 '22 11:03 frmdstryr

I managed to get something working in scopy. It currently only works for usb packets because that's I need it for at the moment.

scopy-decoder-table

I can't figure out how to make it sync with the view. Eg when clicking a packet in the table. I'd like to have the plot zoom into the range of min sample + max sample. Is there a function for that somewhere?

See https://github.com/frmdstryr/scopy/tree/decoder-table

As a side note it would probably be a good idea to run all the code through some kind of style formatter and fix some of the compile warnings. I fixed a couple obvious ones but there is still a lot..

frmdstryr avatar Apr 13 '22 21:04 frmdstryr

Hi,

This is amazing work !

What you are looking for is the zoom function .. I created this commit on a mirror of your fork here - https://github.com/analogdevicesinc/scopy/tree/frmdstryr-decoder-table

The style and warning analysis are implemented in CI in a pull request - we're just waiting to release and then we merge it - https://github.com/analogdevicesinc/scopy/pull/1205

-Adrian

adisuciu avatar Apr 14 '22 08:04 adisuciu

Ah, that's perfect, thanks! After that comment I got it to center and I'm unsure if zooming is the best approach because it hides the packets around. Maybe double click could do center + zoom or just do a zoom + padding or something.

Can you think of a better way to split the capture into table rows? It is currently limited to one decoder row which doesn't work well with certain decoders (eg uart has rx and tx packets). I might change it to take a set of decoder row indexes unless you have any ideas.

Also it would be nice to be able to filter out unwanted stuff (eg usb SOF packets) and optionally certain rows (the bitfields are a bit excessive) but I'm not sure where that should go in the interface.

It'd be nice if the side panel view could be resized but I didn't want to change too much (would need to change the whole layout to use a QSplitter I think).

frmdstryr avatar Apr 14 '22 12:04 frmdstryr

I think zoom + a little padding(5-10%) is better in my opinion. You can use the buffer previewer at the top to move around, or zoom out.

I think the right part should be split into 2. The top part should have the decoder view and the decoder blocks. The bottom part should act like a filter where selecting or deselecting/deselecting decoder rows should filter out the blocks in the top part.

I don't know if it's possible but I'm thinking clicking hte pink part of the block should zoom into only the pink part + padding, while clicking on a larger part (yellow block) should zoom into the yellow block. Alternatively in the bottom section some sort of leader row could be selected in order to specify this zoom behavior.

I think that it would be useful if you could select the decoder on the left and only see the decoded signals for that decoder on the right. I think the global view (all of the decoders) would be nice to have, but at least seeing each of them individually would be great.

image

Let me know what you think ..

Edit: using the filter approach you can even have more specialized tabs such as "search:" to search within the decoder annotations for a specific word which would be useful I think.

Edit2: Yes, I would need to look into it myself on how to use the splitter. None of the right menus are resizable. Alternatively this whole thing could be moved to the bottom, similar to the Marker Table in the spectrum analyzer. However, I think using the right menu is the better choice.

adisuciu avatar Apr 14 '22 13:04 adisuciu

I think that it would be useful if you could select the decoder on the left and only see the decoded signals for that decoder on the right.

Yeah that would be nice. I didn't see any click signals but didn't dig around that much. Worst case it could manually check the click area against painted bounds or something.

frmdstryr avatar Apr 14 '22 14:04 frmdstryr

I like the search idea. It the search could almost be at the top next to the print/group buttons? It wouldn't really need the decode table to search.

Since space is limited I don't like splitting up the table area that much... I think it would make more sense to go somewhere in the channel settings somewhere with the decoder configuration or have a dropdown somewhere in the decode side panel.

frmdstryr avatar Apr 14 '22 14:04 frmdstryr

Yeah that would be nice. I didn't see any click signals but didn't dig around that much. Worst case it could manually check the click area against painted bounds or something.

Selecting the channel/decoder(by double clicking the handle) already updates channel settings. It's a question of also updating the decoder tab. I think this method is called when a channel handle is selected on the left. https://github.com/analogdevicesinc/scopy/blob/master/src/logicanalyzer/logic_analyzer.cpp#L1205. The signal is sent from the plot.

I like the search idea. It the search could almost be at the top next to the print/group buttons? It wouldn't really need the decode table to search.

Since we can only really search for decoded annotations, I think it makes sense having it in the menus. Maybe the string should read "Filter " instead of search.

Since space is limited I don't like splitting up the table area that much... I think it would make more sense to go somewhere in the channel settings somewhere with the decoder configuration or have a dropdown somewhere in the decode side panel.

It makes sense in the decoder configuration only if it filters out the rows on the plot as well (which is not necessarily bad). If not it should be in the decoder tab imo. If it's an issue of space, tabs or collapsible widgets can be created such as the ones in the signal generator.

image

image

I think this could turn into a really useful feature !

adisuciu avatar Apr 14 '22 15:04 adisuciu

I pushed few more commits that scrolls the table to the decoded message when clicking the "primary" decoder row on the plot. Also adds a way to toggle which decoder rows are displayed but is not hooked up to any interface. (Edit: seems to be some issues with toggling). It should highlight what's selected but it's better than before.

The zoom method seemed to flicker and messed up the zoom stack (when right clicking) so I made it go back to centering for now.

The collapsible widget seems like a good way too do it.

frmdstryr avatar Apr 15 '22 19:04 frmdstryr

What do you mean by flicker/messed up the zoom stack ? z->zoom(0) should go back to the zoom base, and z->zoom(r) should create a new level in the stack. Therefore, when clicking on a decoder, the stack should have 2 levels (base + decoder level). Rightclicking should simply return to the base. Isn't this the behavior you were seeing ?

-Adrian

adisuciu avatar Apr 20 '22 11:04 adisuciu

Yes that's what it was doing. By the flicker I mean if you click one packet in the table, then click another another right next to it the plot zooms out then back in when it could just move over.

This program https://www.youtube.com/watch?v=Ak9R4yxQPhs supports both methods (scrolling the horizontal position and scroll+zoom to packet). So that would be an option. I also like the text view in that program and the hovering to show timing is neat.

Rendering the decoder rows in the table might not be the best approach, not sure what you're thoughts are on that?

frmdstryr avatar Apr 20 '22 12:04 frmdstryr

The flickering of the zoom could probably be implemented using some logic like if zoomed to packet, do not reset the stack but rather overwrite this zoom level.

I think that scrolling the horizontal position could be implemented by doing a middle mouse button to click and drag the plot ( by doing this action you essentially do the same thing as dragging the buffer previewer at the top).

The hover to show timings is neat indeed. In terms of implementation it requires setting a tracker mode to the zoomer and overriding the QwtPicker implementation attached to the zoomer to show the correct timings when hovering. It would also need a way to plot the "pulse delimiters". This may prove to be quite challenging and I think it would be the subject of a different PR.

The text mode table could be useful for people that want to export decoder data and want to do some parsing programatically. sigrok-cli is very flexible in this regard, but i guess it would be a nice-to-have feature to do something like this out of the box. In terms of rendering decoder rows looks nice, but having some additional metadata such as start-offset and decoded message width would be even more useful in my opinion. I don't know if there's a way to show both decoder rows and the metadata ...

-Adrian

adisuciu avatar Apr 20 '22 14:04 adisuciu

We will continue working on this code and implement the features we discussed here if that's okay with you. -Adrian

adisuciu avatar Jul 04 '22 08:07 adisuciu

That would be great! I appreciate all of your help.

frmdstryr avatar Jul 04 '22 12:07 frmdstryr

https://github.com/analogdevicesinc/scopy/pull/1370

adisuciu avatar Sep 02 '22 14:09 adisuciu

Wow that looks great! Awesome work! I should be able to give it a try next week.

I was using the original table a last week and one other thing I thought would be helpful (at least for usb) would be the ability to copy the decoded message to the clipboard.

frmdstryr avatar Sep 02 '22 19:09 frmdstryr