Closed duncanmcbryde closed 8 years ago
Could this be due to the macros in hacks.h
?
# EVIL HACK: We cannot dereference officially with the -> operator. So we use ugly macros...
cdef extern from 'hacks.h':
bool ACCESS_CGrabResultPtr_GrabSucceeded(CGrabResultPtr ptr)
String_t ACCESS_CGrabResultPtr_GetErrorDescription(CGrabResultPtr ptr)
uint32_t ACCESS_CGrabResultPtr_GetErrorCode(CGrabResultPtr ptr)
Fixed in master. The hacks you found is caused by Basler requiring -> dereferencing of smart pointers, and Cython not having a syntax for this... At least last I looked.
Thanks for the fixes, they work nicely.
cam.open()
cam.properties['ExposureTime']
>>>10000.0
cam.properties['ExposureTime'] = 100
>>> 100.0
cam.properties['ExposureTime'] = 100
cam.properties['ExposureTime'] = 58
Traceback (most recent call last):
File "<ipython-input-23-5117c8c5935e>", line 1, in <module>
cam.properties['ExposureTime'] = 58
File "PyPylon\cython\factory.pyx", line 143, in pypylon.cython.factory._PropertyMap.__setitem__ (cython\factory.cpp:3588)
ValueError: Parameter value for ExposureTime not inside valid range [59.0, 1000000.0], was 58```
Pylon Library version: 5.0.0.build_6150 OS: Windows 7 64 bit Python: 3.5 Camera: Basler acA640-750um
PyPylon does not check to see if the parameters passed to pylon are within acceptable bounds, causing Python to crash rather than throwing an exception.
Quick example, start by opening the camera:
This works correctly:
However, if we set the exposure time to something beyond the range of values that can be provided with Pylon:
Python crashes rather than returning an exception. Crashes occur for setting other variables below or above other camera properties.