Open RichardLangFromNZ opened 8 years ago
I made a PR and added a stop_grabbing()
function and infinite grabbing and put a StopGrabbing()
statement into __del__()
. On catching the exception you could try cam.__del__()
and then re-initialize. Maybe that helps. BTW, thanks for the nogil
trick. My threaded PyQt app runs a lot more stable now.
I think it might be a good idea to check if the camera is still grabbing and stop it before restarting it. Also checking while still being in the iterator. I'll try this sooninsh, as I'm not in the lab and with the camera atm.
I've pulled down Zac's PR and had a play and a call to stop_grabbing() inside the exception handler fixes this issue.
Once https://github.com/mabl/PyPylon/pull/17 is merged I'll generate a another PR on top of it that wraps the grab_images() internals with an exception handler that calls stop_grabbing() before re-raising, to relieve clients of burden of knowing that they need to do this.
Fix in PR https://github.com/mabl/PyPylon/pull/22
Running Pylon libraries from within linux Mint 18 VM on Windows 7 VirtualBox host.
Occasionally get
thrown on camera.grab_image() call (due to delays/issues with VM network adapter bridge to host physical adapter I guess) however if the exception is caught, subsequent calls to grab_image() will complete successfully.
However if I try to grab multiple images using the grab_images() method, as follows
once the above mentioned exception has occurred, all further calls to grab_images() fail with an un-commented RuntimeError.