Skip to content

Commit

Permalink
move SelfCal to functions_addon ---- doesn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
Arsh Sharma committed Dec 11, 2023
1 parent c216e1c commit 6576102
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 37 deletions.
11 changes: 1 addition & 10 deletions generated/nidaqmx/_library_interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4633,16 +4633,7 @@ def save_task(self, task, save_as, author, options):
self.check_for_error(error_code)

def self_cal(self, device_name):
cfunc = lib_importer.windll.DAQmxSelfCal
if cfunc.argtypes is None:
with cfunc.arglock:
if cfunc.argtypes is None:
cfunc.argtypes = [
ctypes_byte_str]

error_code = cfunc(
device_name)
self.check_for_error(error_code)
raise NotImplementedError

def self_test_device(self, device_name):
cfunc = lib_importer.windll.DAQmxSelfTestDevice
Expand Down
12 changes: 0 additions & 12 deletions generated/nidaqmx/system/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -1069,18 +1069,6 @@ def reset_device(self):
self._interpreter.reset_device(
self._name)

def self_cal(self):
"""
Measures the onboard reference voltage of the device and adjusts
the self-calibration constants to account for any errors caused
by short-term fluctuations in the operating environment. When
you self-calibrate a device, no external signal connections are
necessary.
"""

self._interpreter.self_cal(
self._name)

def self_test_device(self):
"""
Performs a brief test of device resources. If a failure occurs,
Expand Down
18 changes: 3 additions & 15 deletions src/codegen/metadata/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -20069,26 +20069,14 @@
},
'SelfCal': {
'calling_convention': 'StdCall',
'handle_parameter': {
'ctypes_data_type': 'ctypes.c_char_p',
'cvi_name': 'deviceName',
'python_accessor': 'self._name'
},
'parameters': [
{
'ctypes_data_type': 'ctypes.c_char_p',
'direction': 'in',
'is_optional_in_python': False,
'name': 'deviceName',
'python_data_type': 'str',
'python_description': '',
'python_type_annotation': 'str',
'type': 'const char[]',
'use_in_python_api': False
'type': 'const char[]'
}
],
'python_class_name': 'Device',
'python_description': 'Measures the onboard reference voltage of the device and adjusts the self-calibration constants to account for any errors caused by short-term fluctuations in the operating environment. When you self-calibrate a device, no external signal connections are necessary.',
'python_codegen_method': 'no',
'returns': 'int32'
},
'SelfTestDevice': {
Expand Down Expand Up @@ -25013,4 +25001,4 @@
'python_description': 'Writes data from a virtual TEDS file to the TEDS sensor.',
'returns': 'int32'
}
}
}
24 changes: 24 additions & 0 deletions src/codegen/metadata/functions_addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,29 @@
},
'WriteRaw':{
'python_codegen_method': 'CustomCode_Write',
},
'SelfCal': {
'calling_convention': 'StdCall',
'handle_parameter': {
'ctypes_data_type': 'ctypes.c_char_p',
'cvi_name': 'deviceName',
'python_accessor': 'self._name'
},
'parameters': [
{
'ctypes_data_type': 'ctypes.c_char_p',
'direction': 'in',
'is_optional_in_python': False,
'name': 'deviceName',
'python_data_type': 'str',
'python_description': '',
'python_type_annotation': 'str',
'type': 'const char[]',
'use_in_python_api': False
}
],
'python_class_name': 'Device',
'python_description': 'Measures the onboard reference voltage of the device and adjusts the self-calibration constants to account for any errors caused by short-term fluctuations in the operating environment. When you self-calibrate a device, no external signal connections are necessary.',
'returns': 'int32'
}
}

0 comments on commit 6576102

Please sign in to comment.