Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/issue 20 add grab strategies #23

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

RichardLangFromNZ
Copy link

  • Expose capability to specify different grab strategies in grab_image()/grab_images() calls
  • Expose a couple of related camera configuration fields

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

ZacDiggum and others added 12 commits October 10, 2016 14:08
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
* 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
@RichardLangFromNZ
Copy link
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
@RichardLangFromNZ
Copy link
Author

OK, put in place a slightly hacky workaround for earlier python versions that don't export the EGrabStrategy enum. properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants