Skip to content

Commit 46fbad7

Browse files
committed
fixed the self test method name to match the driver method
1 parent ae85538 commit 46fbad7

File tree

5 files changed

+78
-78
lines changed

5 files changed

+78
-78
lines changed

generated/nirfsg/nirfsg/_library.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ def __init__(self, ctypes_library):
8181
self.niRFSG_SelectArbWaveform_cfunc = None
8282
self.niRFSG_SelfCal_cfunc = None
8383
self.niRFSG_SelfCalibrateRange_cfunc = None
84-
self.niRFSG_SelfTest_cfunc = None
8584
self.niRFSG_SendSoftwareEdgeTrigger_cfunc = None
8685
self.niRFSG_SetArbWaveformNextWritePosition_cfunc = None
8786
self.niRFSG_SetAttributeViBoolean_cfunc = None
@@ -101,6 +100,7 @@ def __init__(self, ctypes_library):
101100
self.niRFSG_WriteScript_cfunc = None
102101
self.niRFSG_close_cfunc = None
103102
self.niRFSG_reset_cfunc = None
103+
self.niRFSG_self_test_cfunc = None
104104

105105
def _get_library_function(self, name):
106106
try:
@@ -597,14 +597,6 @@ def niRFSG_SelfCalibrateRange(self, vi, steps_to_omit, min_frequency, max_freque
597597
self.niRFSG_SelfCalibrateRange_cfunc.restype = ViStatus # noqa: F405
598598
return self.niRFSG_SelfCalibrateRange_cfunc(vi, steps_to_omit, min_frequency, max_frequency, min_power_level, max_power_level)
599599

600-
def niRFSG_SelfTest(self, vi, self_test_result, self_test_message): # noqa: N802
601-
with self._func_lock:
602-
if self.niRFSG_SelfTest_cfunc is None:
603-
self.niRFSG_SelfTest_cfunc = self._get_library_function('niRFSG_SelfTest')
604-
self.niRFSG_SelfTest_cfunc.argtypes = [ViSession, ctypes.POINTER(ViInt16), ctypes.POINTER(ViChar)] # noqa: F405
605-
self.niRFSG_SelfTest_cfunc.restype = ViStatus # noqa: F405
606-
return self.niRFSG_SelfTest_cfunc(vi, self_test_result, self_test_message)
607-
608600
def niRFSG_SendSoftwareEdgeTrigger(self, vi, trigger, trigger_identifier): # noqa: N802
609601
with self._func_lock:
610602
if self.niRFSG_SendSoftwareEdgeTrigger_cfunc is None:
@@ -756,3 +748,11 @@ def niRFSG_reset(self, vi): # noqa: N802
756748
self.niRFSG_reset_cfunc.argtypes = [ViSession] # noqa: F405
757749
self.niRFSG_reset_cfunc.restype = ViStatus # noqa: F405
758750
return self.niRFSG_reset_cfunc(vi)
751+
752+
def niRFSG_self_test(self, vi, self_test_result, self_test_message): # noqa: N802
753+
with self._func_lock:
754+
if self.niRFSG_self_test_cfunc is None:
755+
self.niRFSG_self_test_cfunc = self._get_library_function('niRFSG_self_test')
756+
self.niRFSG_self_test_cfunc.argtypes = [ViSession, ctypes.POINTER(ViInt16), ctypes.POINTER(ViChar)] # noqa: F405
757+
self.niRFSG_self_test_cfunc.restype = ViStatus # noqa: F405
758+
return self.niRFSG_self_test_cfunc(vi, self_test_result, self_test_message)

generated/nirfsg/nirfsg/_library_interpreter.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -625,14 +625,6 @@ def self_calibrate_range(self, steps_to_omit, min_frequency, max_frequency, min_
625625
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
626626
return
627627

628-
def self_test(self): # noqa: N802
629-
vi_ctype = _visatype.ViSession(self._vi) # case S110
630-
self_test_result_ctype = _visatype.ViInt16() # case S220
631-
self_test_message_ctype = (_visatype.ViChar * 256)() # case C070
632-
error_code = self._library.niRFSG_SelfTest(vi_ctype, None if self_test_result_ctype is None else (ctypes.pointer(self_test_result_ctype)), self_test_message_ctype)
633-
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
634-
return int(self_test_result_ctype.value), self_test_message_ctype.value.decode(self._encoding)
635-
636628
def send_software_edge_trigger(self, trigger, trigger_identifier): # noqa: N802
637629
vi_ctype = _visatype.ViSession(self._vi) # case S110
638630
trigger_ctype = _visatype.ViInt32(trigger.value) # case S130
@@ -791,3 +783,11 @@ def reset(self): # noqa: N802
791783
error_code = self._library.niRFSG_reset(vi_ctype)
792784
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
793785
return
786+
787+
def self_test(self): # noqa: N802
788+
vi_ctype = _visatype.ViSession(self._vi) # case S110
789+
self_test_result_ctype = _visatype.ViInt16() # case S220
790+
self_test_message_ctype = (_visatype.ViChar * 256)() # case C070
791+
error_code = self._library.niRFSG_self_test(vi_ctype, None if self_test_result_ctype is None else (ctypes.pointer(self_test_result_ctype)), self_test_message_ctype)
792+
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
793+
return int(self_test_result_ctype.value), self_test_message_ctype.value.decode(self._encoding)

generated/nirfsg/nirfsg/session.py

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7087,41 +7087,6 @@ def self_calibrate_range(self, steps_to_omit, min_frequency, max_frequency, min_
70877087
raise TypeError('Parameter steps_to_omit must be of type ' + str(enums.SelfCalibrateRangeStepsToOmit))
70887088
self._interpreter.self_calibrate_range(steps_to_omit, min_frequency, max_frequency, min_power_level, max_power_level)
70897089

7090-
@ivi_synchronized
7091-
def _self_test(self):
7092-
r'''_self_test
7093-
7094-
Performs a self-test on the NI-RFSG device and returns the test results.
7095-
7096-
This method performs a simple series of tests to ensure that the NI-RFSG device is powered up and responding.
7097-
7098-
This method does not affect external I/O connections or connections between devices. Complete functional testing and calibration are not performed by this method. The NI-RFSG device must be in the Configuration state before you call this method.
7099-
7100-
**Supported Devices** : PXI-5610, PXIe-5611, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860
7101-
7102-
**Related Topics**
7103-
7104-
`Device Warm-Up <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/warmup.html>`_
7105-
7106-
Returns:
7107-
self_test_result (int): This parameter contains the value returned from the NI-RFSG device self test.
7108-
7109-
+----------------+------------------+
7110-
| Self-Test Code | Description |
7111-
+================+==================+
7112-
| 0 | Self test passed |
7113-
+----------------+------------------+
7114-
| 1 | Self test failed |
7115-
+----------------+------------------+
7116-
7117-
self_test_message (str): Returns the self-test response string from the NI-RFSG device. For an explanation of the string contents, refer to the **status** parameter of this method.
7118-
7119-
You must pass a ViChar array with at least 256 bytes.
7120-
7121-
'''
7122-
self_test_result, self_test_message = self._interpreter.self_test()
7123-
return self_test_result, self_test_message
7124-
71257090
@ivi_synchronized
71267091
def set_arb_waveform_next_write_position(self, waveform_name, relative_to, offset):
71277092
r'''set_arb_waveform_next_write_position
@@ -7418,3 +7383,38 @@ def reset(self):
74187383
Note: This method resets all configured routes for the PXIe-5644/5645/5646 and PXIe-5820/5830/5831/5832/5840/5841/5842/5860 in NI-RFSA and NI-RFSG.
74197384
'''
74207385
self._interpreter.reset()
7386+
7387+
@ivi_synchronized
7388+
def _self_test(self):
7389+
r'''_self_test
7390+
7391+
Performs a self-test on the NI-RFSG device and returns the test results.
7392+
7393+
This method performs a simple series of tests to ensure that the NI-RFSG device is powered up and responding.
7394+
7395+
This method does not affect external I/O connections or connections between devices. Complete functional testing and calibration are not performed by this method. The NI-RFSG device must be in the Configuration state before you call this method.
7396+
7397+
**Supported Devices** : PXI-5610, PXIe-5611, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860
7398+
7399+
**Related Topics**
7400+
7401+
`Device Warm-Up <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/warmup.html>`_
7402+
7403+
Returns:
7404+
self_test_result (int): This parameter contains the value returned from the NI-RFSG device self test.
7405+
7406+
+----------------+------------------+
7407+
| Self-Test Code | Description |
7408+
+================+==================+
7409+
| 0 | Self test passed |
7410+
+----------------+------------------+
7411+
| 1 | Self test failed |
7412+
+----------------+------------------+
7413+
7414+
self_test_message (str): Returns the self-test response string from the NI-RFSG device. For an explanation of the string contents, refer to the **status** parameter of this method.
7415+
7416+
You must pass a ViChar array with at least 256 bytes.
7417+
7418+
'''
7419+
self_test_result, self_test_message = self._interpreter.self_test()
7420+
return self_test_result, self_test_message

generated/nirfsg/nirfsg/unit_tests/_mock_helper.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,6 @@ def __init__(self):
184184
self._defaults['SelfCal']['return'] = 0
185185
self._defaults['SelfCalibrateRange'] = {}
186186
self._defaults['SelfCalibrateRange']['return'] = 0
187-
self._defaults['SelfTest'] = {}
188-
self._defaults['SelfTest']['return'] = 0
189-
self._defaults['SelfTest']['selfTestResult'] = None
190-
self._defaults['SelfTest']['selfTestMessage'] = None
191187
self._defaults['SendSoftwareEdgeTrigger'] = {}
192188
self._defaults['SendSoftwareEdgeTrigger']['return'] = 0
193189
self._defaults['SetArbWaveformNextWritePosition'] = {}
@@ -227,6 +223,10 @@ def __init__(self):
227223
self._defaults['close']['return'] = 0
228224
self._defaults['reset'] = {}
229225
self._defaults['reset']['return'] = 0
226+
self._defaults['self_test'] = {}
227+
self._defaults['self_test']['return'] = 0
228+
self._defaults['self_test']['selfTestResult'] = None
229+
self._defaults['self_test']['selfTestMessage'] = None
230230

231231
def __getitem__(self, func):
232232
return self._defaults[func]
@@ -798,25 +798,6 @@ def niRFSG_SelfCalibrateRange(self, vi, steps_to_omit, min_frequency, max_freque
798798
return self._defaults['SelfCalibrateRange']['return']
799799
return self._defaults['SelfCalibrateRange']['return']
800800

801-
def niRFSG_SelfTest(self, vi, self_test_result, self_test_message): # noqa: N802
802-
if self._defaults['SelfTest']['return'] != 0:
803-
return self._defaults['SelfTest']['return']
804-
# self_test_result
805-
if self._defaults['SelfTest']['selfTestResult'] is None:
806-
raise MockFunctionCallError("niRFSG_SelfTest", param='selfTestResult')
807-
if self_test_result is not None:
808-
self_test_result.contents.value = self._defaults['SelfTest']['selfTestResult']
809-
# self_test_message
810-
if self._defaults['SelfTest']['selfTestMessage'] is None:
811-
raise MockFunctionCallError("niRFSG_SelfTest", param='selfTestMessage')
812-
test_value = self._defaults['SelfTest']['selfTestMessage']
813-
if type(test_value) is str:
814-
test_value = test_value.encode('ascii')
815-
assert len(self_test_message) >= len(test_value)
816-
for i in range(len(test_value)):
817-
self_test_message[i] = test_value[i]
818-
return self._defaults['SelfTest']['return']
819-
820801
def niRFSG_SendSoftwareEdgeTrigger(self, vi, trigger, trigger_identifier): # noqa: N802
821802
if self._defaults['SendSoftwareEdgeTrigger']['return'] != 0:
822803
return self._defaults['SendSoftwareEdgeTrigger']['return']
@@ -917,6 +898,25 @@ def niRFSG_reset(self, vi): # noqa: N802
917898
return self._defaults['reset']['return']
918899
return self._defaults['reset']['return']
919900

901+
def niRFSG_self_test(self, vi, self_test_result, self_test_message): # noqa: N802
902+
if self._defaults['self_test']['return'] != 0:
903+
return self._defaults['self_test']['return']
904+
# self_test_result
905+
if self._defaults['self_test']['selfTestResult'] is None:
906+
raise MockFunctionCallError("niRFSG_self_test", param='selfTestResult')
907+
if self_test_result is not None:
908+
self_test_result.contents.value = self._defaults['self_test']['selfTestResult']
909+
# self_test_message
910+
if self._defaults['self_test']['selfTestMessage'] is None:
911+
raise MockFunctionCallError("niRFSG_self_test", param='selfTestMessage')
912+
test_value = self._defaults['self_test']['selfTestMessage']
913+
if type(test_value) is str:
914+
test_value = test_value.encode('ascii')
915+
assert len(self_test_message) >= len(test_value)
916+
for i in range(len(test_value)):
917+
self_test_message[i] = test_value[i]
918+
return self._defaults['self_test']['return']
919+
920920
# Helper function to setup Mock object with default side effects and return values
921921
def set_side_effects_and_return_values(self, mock_library):
922922
mock_library.niRFSG_Abort.side_effect = MockFunctionCallError("niRFSG_Abort")
@@ -1041,8 +1041,6 @@ def set_side_effects_and_return_values(self, mock_library):
10411041
mock_library.niRFSG_SelfCal.return_value = 0
10421042
mock_library.niRFSG_SelfCalibrateRange.side_effect = MockFunctionCallError("niRFSG_SelfCalibrateRange")
10431043
mock_library.niRFSG_SelfCalibrateRange.return_value = 0
1044-
mock_library.niRFSG_SelfTest.side_effect = MockFunctionCallError("niRFSG_SelfTest")
1045-
mock_library.niRFSG_SelfTest.return_value = 0
10461044
mock_library.niRFSG_SendSoftwareEdgeTrigger.side_effect = MockFunctionCallError("niRFSG_SendSoftwareEdgeTrigger")
10471045
mock_library.niRFSG_SendSoftwareEdgeTrigger.return_value = 0
10481046
mock_library.niRFSG_SetArbWaveformNextWritePosition.side_effect = MockFunctionCallError("niRFSG_SetArbWaveformNextWritePosition")
@@ -1081,3 +1079,5 @@ def set_side_effects_and_return_values(self, mock_library):
10811079
mock_library.niRFSG_close.return_value = 0
10821080
mock_library.niRFSG_reset.side_effect = MockFunctionCallError("niRFSG_reset")
10831081
mock_library.niRFSG_reset.return_value = 0
1082+
mock_library.niRFSG_self_test.side_effect = MockFunctionCallError("niRFSG_self_test")
1083+
mock_library.niRFSG_self_test.return_value = 0

src/nirfsg/metadata/functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3702,7 +3702,7 @@
37023702
],
37033703
'returns': 'ViStatus'
37043704
},
3705-
'SelfTest': {
3705+
'self_test': {
37063706
'codegen_method': 'private',
37073707
'documentation': {
37083708
'description': '\nPerforms a self-test on the NI-RFSG device and returns the test results.\n\nThis function performs a simple series of tests to ensure that the NI-RFSG device is powered up and responding.\n\nThis function does not affect external I/O connections or connections between devices. Complete functional testing and calibration are not performed by this function. The NI-RFSG device must be in the Configuration state before you call this function.\n\n**Supported Devices** : PXI-5610, PXIe-5611, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Device Warm-Up <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/warmup.html>`_'

0 commit comments

Comments
 (0)