Skip to content

Commit

Permalink
reorder functions in DeviceBase
Browse files Browse the repository at this point in the history
  • Loading branch information
toinsson committed Jul 20, 2017
1 parent 6ace544 commit 0878403
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions pyrealsense/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,24 +420,6 @@ def set_device_options(self, options, values):
lrs.rs_set_device_options(self.dev, c_options, count, c_values, ctypes.byref(e))
_check_error(e)

def reset_device_options_to_default(self, options):
"""Reset device options to default.
Args:
option (:obj:`list` of int): taken from :class:`pyrealsense.constants.rs_option`.
"""
e = ctypes.POINTER(rs_error)()
count = len(options)
option_array_type = ctypes.c_int * count
lrs.rs_reset_device_options_to_default.argtypes = [ctypes.POINTER(rs_device),
option_array_type,
ctypes.c_int,
ctypes.POINTER(ctypes.POINTER(rs_error))]
lrs.rs_reset_device_options_to_default.restype = None
c_options = option_array_type(*options)
lrs.rs_reset_device_options_to_default(self.dev, c_options, count, ctypes.byref(e))
_check_error(e)

def get_device_option(self, option):
"""Get device option.
Expand All @@ -451,6 +433,17 @@ def get_device_option(self, option):
e = ctypes.POINTER(rs_error)()
return lrs.rs_get_device_option(self.dev, option, ctypes.byref(e))

def set_device_option(self, option, value):
"""Set device option.
Args:
option (int): taken from :class:`pyrealsense.constants.rs_option`.
value (double): value to be set for the option.
"""
e = ctypes.POINTER(rs_error)()
lrs.rs_set_device_option(self.dev, ctypes.c_uint(option), ctypes.c_double(value), ctypes.byref(e))
_check_error(e)

def get_device_option_range_ex(self, option):
"""Get device option range.
Expand Down Expand Up @@ -483,15 +476,22 @@ def get_device_option_description(self, option):
e = ctypes.POINTER(rs_error)()
return pp(lrs.rs_get_device_option_description, self.dev, ctypes.c_uint(option), ctypes.byref(e))

def set_device_option(self, option, value):
"""Set device option.
def reset_device_options_to_default(self, options):
"""Reset device options to default.
Args:
option (int): taken from :class:`pyrealsense.constants.rs_option`.
value (double): value to be set for the option.
option (:obj:`list` of int): taken from :class:`pyrealsense.constants.rs_option`.
"""
e = ctypes.POINTER(rs_error)()
lrs.rs_set_device_option(self.dev, ctypes.c_uint(option), ctypes.c_double(value), ctypes.byref(e))
count = len(options)
option_array_type = ctypes.c_int * count
lrs.rs_reset_device_options_to_default.argtypes = [ctypes.POINTER(rs_device),
option_array_type,
ctypes.c_int,
ctypes.POINTER(ctypes.POINTER(rs_error))]
lrs.rs_reset_device_options_to_default.restype = None
c_options = option_array_type(*options)
lrs.rs_reset_device_options_to_default(self.dev, c_options, count, ctypes.byref(e))
_check_error(e)

def _get_stream_intrinsics(self, stream):
Expand Down

0 comments on commit 0878403

Please sign in to comment.