saleae / logic2-automation

Logic2 Automation API
https://saleae.github.io/logic2-automation/
Apache License 2.0
19 stars 8 forks source link

[Request] Add ability to explore existing channel & device configurations #14

Open alexhrao opened 2 years ago

alexhrao commented 2 years ago

Right now, based on the docs, I don't see an easy way to query channel metadata from an existing capture (or a new capture, for that matter). For example, consider the following screenshots:

Screen Shot 2022-10-28 at 1 41 45 PM Screen Shot 2022-10-28 at 1 45 48 PM

There isn't a clean way ask Logic "what's the name of channel D0?", "what channels are enabled?", or "what is the sample rate/voltage level?" (at least as far as I can tell).

The reason this would be nice is that in our use case, we accept SPI captures from a variety of sources, and then would like to automatically export the SPI analyzer results to a CSV. However, we don't control these input SPI captures, so we can't always know that CLK will be the first signal (for example); we'd like to be able to dynamically pick which signals based on their name.

Right now, I have a workaround, which basically involves unzipping the .sal file, parsing the meta.json file inside, and getting this data from there... but I know this isn't guaranteed to be stable between releases, so a way to do this cleanly would be very helpful.