Feat/issue 20 add grab strategies#23
Open
RichardLangFromNZ wants to merge 13 commits intomabl:masterfrom
Open
Conversation
added function cam.stop_grabbing() added property cam.is_grabbing changed cam.grab_images(int) to infinite grabbing when int<1
changed cam.grab_images(nr_images) so that nr_images<1 -> infinite grabbing added function cam.stop_grabbing() added property cam.is_grabbing
check if camera.IsGrabbing() before calling camera.StopGrabbing()
…nd on any exception being caught stop grabbing before rethrowing
…ith no arguments it grabs continuously
* commit '00ae6ae11e7fddedeb1e4778e4906f15736dff17': Default value for grab_images() nr_images parameter, so when called with no arguments it grabs continuously Wrap image grabbing from underlying c++ object in exception handler and on any exception being caught stop grabbing before rethrowing Update factory.pyx added infinite grabbing and helpers Delete pylon_def.pxd Delete factory.pyx added infinite grabbing and related
…d grab_image/grab_images python wrapper
…sue_20_add_grab_strategies
Author
|
So this worked OK with python 2.7.12, and I'd be surprised if it wasn't good on recent 3 versions as well, however fell over on a Ubuntu 14 box running 2.7.6. Looks like cython is exporting the C++ EGrabStrategy enum. as a PEP 435 enum, which is a fairly recent python edition, but silently dropping it for earlier versions. will take another look. |
…ython/cython versions that dont handle exporting it properly
Author
|
OK, put in place a slightly hacky workaround for earlier python versions that don't export the EGrabStrategy enum. properly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Seems to work as advertised. EGrabStrategy enum. values end up deeply nested pypylon.cython.factory namespace which is a bit painful... but presume that this is just a consequence of the project structure (I'm not a cython expert...) Could perhaps alias them in top level _init.py, but seems a bit ugly