Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 27 additions & 17 deletions cuvis/AcquisitionContext.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ def _get_gain(self, idref: int) -> float:
if cuvis_il.status_ok != cuvis_il.cuvis_comp_gain_get(self._handle,
idref, val):
raise SDKException()
return cuvis_il.new_p_double(val)
return cuvis_il.p_double_value(val)

# @copydoc cuvis_comp_gain_set
def _set_gain(self, idref: int, val: float) -> None:
"""

"""
if cuvis_il.status_ok != cuvis_il.cuvis_comp_gain_set(self._handle,
idref, val):
idref, float(val)):
raise SDKException()
pass

Expand Down Expand Up @@ -197,7 +197,7 @@ def integration_time(self, val: float) -> None:

"""
if cuvis_il.status_ok != cuvis_il.cuvis_acq_cont_integration_time_set(
self._handle, val):
self._handle, float(val)):
raise SDKException()
pass

Expand All @@ -209,7 +209,7 @@ def set_integration_time_async(self, val: float) -> Async:
_pAsync = cuvis_il.new_p_int()
if cuvis_il.status_ok != \
cuvis_il.cuvis_acq_cont_integration_time_set_async(
self._handle, _pAsync, val):
self._handle, _pAsync, float(val)):
raise SDKException()
return Async(cuvis_il.p_int_value(_pAsync))

Expand All @@ -229,7 +229,7 @@ def _get_integration_time_factor(self, idref: int) -> float:
def _set_integration_time_factor(self, idref: int, val: float) -> None:
if cuvis_il.status_ok != \
cuvis_il.cuvis_comp_integration_time_factor_set(
self._handle, idref, val):
self._handle, idref, float(val)):
raise SDKException()
pass

Expand All @@ -241,7 +241,7 @@ def _set_integration_time_factor_async(self, idref: int, val: float) -> Async:
_pasync = cuvis_il.new_p_int()
if cuvis_il.status_ok != \
cuvis_il.cuvis_comp_integration_time_factor_set_async(
self._handle, idref, _pasync, val):
self._handle, idref, _pasync, float(val)):
raise SDKException()
return Async(cuvis_il.p_int_value(_pasync))

Expand Down Expand Up @@ -286,7 +286,7 @@ def fps(self, val: float) -> None:

"""
if cuvis_il.status_ok != cuvis_il.cuvis_acq_cont_fps_set(
self._handle, val):
self._handle, float(val)):
raise SDKException()
pass

Expand All @@ -297,7 +297,7 @@ def set_fps_async(self, val: float) -> Async:
"""
_pasync = cuvis_il.new_p_int()
if cuvis_il.status_ok != cuvis_il.cuvis_acq_cont_fps_set_async(
self._handle, _pasync, val):
self._handle, _pasync, float(val)):
raise SDKException()
return Async(cuvis_il.p_int_value(_pasync))

Expand Down Expand Up @@ -681,24 +681,34 @@ def temperature(self) -> int:
"""
return self._acq._get_temperature(self._idx)

#@property
#def bandwith(self) -> int:
# """
#
# """
# return self._acq._get_bandwidth(self._idx)

@property
def gain(self) -> int:
def gain(self) -> float:
"""

"""
return self._acq._get_gain(self._idx)


@gain.setter
def gain(self, val: float) -> None:
"""

"""
return self._acq._set_gain(self._idx, val)



@property
def integration_time_factor(self) -> int:
def integration_time_factor(self) -> float:
"""

"""
return self._acq._get_integration_time_factor(self._idx)

@integration_time_factor.setter
def integration_time_factor(self, val: float) -> None:
"""

"""
return self._acq._set_integration_time_factor(self._idx, val)