Hi,
I managed to implement the two functions I needed. Sadly, I was unable
to do this in a very elegant way (not due to the lack of trying). I
tried wrapping "typedef struct __dc1394_avt_adv_feature_info_struct"
from avt.h in the _dc1394core.py to make it somehow similar to the
other code, but failed miserably. That's why I didn't attach a code
with which to check for available advanced AVT-features. So anybody
calling the function should know that it is available. If someone
could help out with hints on how to do it, I could try again, but for
now I am satisfied with the working timebase functions.
So there is no support for the other functions, as I don't see the
added value at the moment.
I don't know how to add stuff in launchpad/bazaar so I just attach the
changes to the end of the mail.
Malte
Additions:
In camera.py
in
class Camera(object):
###AVT cameras only
#register settings and the corresponding times
#the corresponding times are from the manual AVT-Stingray, v4.3.0,
p.291
#value 0 | 1 microsecond
#value 1 | 2 microseconds
#value 2 | 5 microseconds
#value 3 | 10 microseconds
#value 4 | 20 microseconds
#value 5 | 50 microseconds
#value 6 | 100 microseconds
#value 7 | 200 microseconds
#value 8 | 500 microseconds
#value 9 | 1000 microseconds
#calculation if the resulting shutter time, see the manual of the
camera
#grab the value for the timebase
def get_avt_timebase( self ):
if not self._cam:
raise RuntimeError, "The camera is not opened!"
val = c_uint32()
_dll.dc1394_avt_get_timebase( self._cam, byref(val))
return val.value
#set the timebase value
def set_avt_timebase( self , value):
if not self._cam:
raise RuntimeError, "The camera is not opened!"
val = c_uint32(value)
if val.value >= 0 and val.value <= 9:
_dll.dc1394_avt_set_timebase( self._cam, val)
else:
print "Timebase value can only be in the range of 0-9"
in _pydc1394core.py:
##################################
#avt-specific functions from avt.h
##################################
_dll.dc1394_avt_get_timebase.argtypes = [ POINTER(camera_t),
POINTER(c_uint32) ]
_dll.dc1394_avt_get_timebase.restype = error_t
_dll.dc1394_avt_get_timebase.errcheck = _errcheck
_dll.dc1394_avt_set_timebase.argtypes = [ POINTER(camera_t),
c_uint32 ]
_dll.dc1394_avt_set_timebase.restype = error_t
_dll.dc1394_avt_set_timebase.errcheck = _errcheck
SirVer schrieb: