saleae / logic2-automation

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

[Feature request] Close running capture on connect or list/stop running capture #20

Open jlecuyer opened 1 year ago

jlecuyer commented 1 year ago

The context

On automation.Manager.connect(), if a previous capture resulted in a crash or if the python script was halted before the close() method was called, the following capture will result in an saleae.automation.errors.InternalServerError: Cannot switch sessions while recording

The requests

1) Add a method to check if there is a running capture or conversion 2) Add a method to stop a capture or conversion started by another thread / process 3) Add the option to clean_start on the connect() method to automatically stop running capture and have the logic instance ready for capture

Thanks you and nice job !

Jonathan

Marcus10110 commented 1 year ago

Thanks Jonathan, that's great feedback.

In the short term, you might be able to stop the capture using context exit or destructors to try to stop the capture if anything goes wrong.

We do want to expand the API to support reading the application state and modifying more parts of the application. The goal of the first release was to focus on the totally hands-off use case, where 100% of settings were set via API, and the existing state of the application would be ignored.

I'm not sure when we'll get back to this though. We're a tiny team (only 2 software developers at the moment) and we're neck deep in another long term project at the moment. We are working on hiring another SW developer now though!