Skip to content

Commit c35ee8e

Browse files
Enabled hightime functions for rfsg
1 parent 5e2456e commit c35ee8e

File tree

2 files changed

+97
-82
lines changed

2 files changed

+97
-82
lines changed

generated/nirfsg/nirfsg/session.py

Lines changed: 32 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6826,8 +6826,8 @@ def export_signal(self, signal, signal_identifier, output_terminal):
68266826
self._interpreter.export_signal(signal, signal_identifier, output_terminal)
68276827

68286828
@ivi_synchronized
6829-
def get_external_calibration_last_date_and_time(self):
6830-
r'''get_external_calibration_last_date_and_time
6829+
def _get_external_calibration_last_date_and_time(self):
6830+
r'''_get_external_calibration_last_date_and_time
68316831
68326832
Returns the date and time of the last successful external calibration. The time returned is 24-hour (military) local time; for example, if the device was calibrated at 2:30PM, this method returns 14 for the hours parameter and 30 for the minutes parameter.
68336833
@@ -6848,6 +6848,32 @@ def get_external_calibration_last_date_and_time(self):
68486848
year, month, day, hour, minute, second = self._interpreter.get_external_calibration_last_date_and_time()
68496849
return year, month, day, hour, minute, second
68506850

6851+
@ivi_synchronized
6852+
def get_external_calibration_last_date_and_time(self):
6853+
'''get_external_calibration_last_date_and_time
6854+
6855+
TBD
6856+
6857+
Returns:
6858+
last_cal_datetime (hightime.datetime):
6859+
6860+
'''
6861+
year, month, day, hour, minute, second = self._get_external_calibration_last_date_and_time()
6862+
return hightime.datetime(year, month, day, hour, minute)
6863+
6864+
@ivi_synchronized
6865+
def get_self_calibration_last_date_and_time(self):
6866+
'''get_self_calibration_last_date_and_time
6867+
6868+
TBD
6869+
6870+
Returns:
6871+
last_cal_datetime (hightime.datetime):
6872+
6873+
'''
6874+
year, month, day, hour, minute, second = self._get_self_calibration_date_and_time()
6875+
return hightime.datetime(year, month, day, hour, minute)
6876+
68516877
@ivi_synchronized
68526878
def get_max_settable_power(self):
68536879
r'''get_max_settable_power
@@ -6862,8 +6888,8 @@ def get_max_settable_power(self):
68626888
return value
68636889

68646890
@ivi_synchronized
6865-
def get_self_calibration_date_and_time(self, module):
6866-
r'''get_self_calibration_date_and_time
6891+
def _get_self_calibration_date_and_time(self, module):
6892+
r'''_get_self_calibration_date_and_time
68676893
68686894
Returns the date and time of the last successful self-calibration. The time returned is 24-hour local time. For example, if the device was calibrated at 2:30PM, this method returns 14 for the hours parameter and 30 for the minutes parameter.
68696895
@@ -7086,8 +7112,8 @@ def self_calibrate_range(self, steps_to_omit, min_frequency, max_frequency, min_
70867112
self._interpreter.self_calibrate_range(steps_to_omit, min_frequency, max_frequency, min_power_level, max_power_level)
70877113

70887114
@ivi_synchronized
7089-
def _self_test(self, self_test_message):
7090-
r'''_self_test
7115+
def self_test(self, self_test_message):
7116+
r'''self_test
70917117
70927118
Performs a self-test on the NI-RFSG device and returns the test results. This method performs a simple series of tests to ensure that the NI-RFSG device is powered up and responding.
70937119
@@ -7179,33 +7205,3 @@ def _close(self):
71797205
One or more of the referenced methods are not in the Python API for this driver.
71807206
'''
71817207
self._interpreter.close()
7182-
7183-
@ivi_synchronized
7184-
def self_test(self):
7185-
'''self_test
7186-
7187-
Runs the instrument self-test routine and returns the test result(s).
7188-
7189-
Raises `SelfTestError` on self test failure. Properties on exception object:
7190-
7191-
- code - failure code from driver
7192-
- message - status message from driver
7193-
7194-
+----------------+------------------+
7195-
| Self-Test Code | Description |
7196-
+================+==================+
7197-
| 0 | Passed self-test |
7198-
+----------------+------------------+
7199-
| 1 | Self-test failed |
7200-
+----------------+------------------+
7201-
7202-
Note:
7203-
When used on some signal generators, the device is reset after the
7204-
niFgen_self_test method runs. If you use the niFgen_self_test
7205-
method, your device may not be in its previously configured state
7206-
after the method runs.
7207-
'''
7208-
code, msg = self._self_test()
7209-
if code:
7210-
raise errors.SelfTestError(code, msg)
7211-
return None

src/nirfsg/metadata/functions.py

Lines changed: 65 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2344,12 +2344,13 @@
23442344
'use_session_lock': False
23452345
},
23462346
'GetExternalCalibrationLastDateAndTime': {
2347-
'codegen_method': 'public',
2347+
'codegen_method': 'private',
23482348
'documentation': {
23492349
'description': 'Returns the date and time of the last successful external calibration. The time returned is 24-hour (military) local time; for example, if the device was calibrated at 2:30PM, this function returns 14 for the hours parameter and 30 for the minutes parameter.'
23502350
},
23512351
'included_in_proto': True,
23522352
'is_error_handling': False,
2353+
'method_name_for_documentation': 'get_external_calibration_last_date_and_time',
23532354
'method_templates': [
23542355
{
23552356
'documentation_filename': 'default_method',
@@ -2433,6 +2434,66 @@
24332434
'returns': 'ViStatus',
24342435
'use_session_lock': True
24352436
},
2437+
'GetLastExtCalLastDateAndTime': {
2438+
'codegen_method': 'python-only',
2439+
'documentation': {
2440+
'description': 'TBD'
2441+
},
2442+
'included_in_proto': True,
2443+
'method_templates': [
2444+
{
2445+
'documentation_filename': 'default_method',
2446+
'library_interpreter_filename': 'none',
2447+
'method_python_name_suffix': '',
2448+
'session_filename': 'datetime_wrappers'
2449+
}
2450+
],
2451+
'parameters': [
2452+
{
2453+
'direction': 'in',
2454+
'name': 'vi',
2455+
'type': 'ViSession'
2456+
},
2457+
{
2458+
'direction': 'out',
2459+
'name': 'lastCalDatetime',
2460+
'type': 'hightime.datetime'
2461+
}
2462+
],
2463+
'python_name': 'get_external_calibration_last_date_and_time',
2464+
'real_datetime_call': 'GetExternalCalibrationLastDateAndTime',
2465+
'returns': 'ViStatus'
2466+
},
2467+
'GetLastSelfCalLastDateAndTime': {
2468+
'codegen_method': 'python-only',
2469+
'documentation': {
2470+
'description': 'TBD'
2471+
},
2472+
'included_in_proto': True,
2473+
'method_templates': [
2474+
{
2475+
'documentation_filename': 'default_method',
2476+
'library_interpreter_filename': 'none',
2477+
'method_python_name_suffix': '',
2478+
'session_filename': 'datetime_wrappers'
2479+
}
2480+
],
2481+
'parameters': [
2482+
{
2483+
'direction': 'in',
2484+
'name': 'vi',
2485+
'type': 'ViSession'
2486+
},
2487+
{
2488+
'direction': 'out',
2489+
'name': 'lastCalDatetime',
2490+
'type': 'hightime.datetime'
2491+
}
2492+
],
2493+
'python_name': 'get_self_calibration_last_date_and_time',
2494+
'real_datetime_call': 'GetSelfCalibrationDateAndTime',
2495+
'returns': 'ViStatus'
2496+
},
24362497
'GetMaxSettablePower': {
24372498
'codegen_method': 'public',
24382499
'documentation': {
@@ -2474,12 +2535,13 @@
24742535
'use_session_lock': True
24752536
},
24762537
'GetSelfCalibrationDateAndTime': {
2477-
'codegen_method': 'public',
2538+
'codegen_method': 'private',
24782539
'documentation': {
24792540
'description': 'Returns the date and time of the last successful self-calibration. The time returned is 24-hour local time. For example, if the device was calibrated at 2:30PM, this function returns 14 for the hours parameter and 30 for the minutes parameter.'
24802541
},
24812542
'included_in_proto': True,
24822543
'is_error_handling': False,
2544+
'method_name_for_documentation': 'get_self_calibration_date_and_time',
24832545
'method_templates': [
24842546
{
24852547
'documentation_filename': 'default_method',
@@ -3605,7 +3667,7 @@
36053667
'use_session_lock': True
36063668
},
36073669
'SelfTest': {
3608-
'codegen_method': 'private',
3670+
'codegen_method': 'public',
36093671
'documentation': {
36103672
'description': 'Performs a self-test on the NI-RFSG device and returns the test results. This function performs a simple series of tests to ensure that the NI-RFSG device is powered up and responding.'
36113673
},
@@ -4509,48 +4571,5 @@
45094571
'python_name': '_close',
45104572
'returns': 'ViStatus',
45114573
'use_session_lock': False
4512-
},
4513-
'fancy_self_test': {
4514-
'codegen_method': 'python-only',
4515-
'documentation': {
4516-
'description': '\nRuns the instrument self-test routine and returns the test result(s).\n\nRaises `SelfTestError` on self test failure. Attributes on exception object:\n\n- code - failure code from driver\n- message - status message from driver\n',
4517-
'note': '\nWhen used on some signal generators, the device is reset after the\nniFgen_self_test function runs. If you use the niFgen_self_test\nfunction, your device may not be in its previously configured state\nafter the function runs.\n',
4518-
'table_body': [
4519-
[
4520-
'0',
4521-
'Passed self-test'
4522-
],
4523-
[
4524-
'1',
4525-
'Self-test failed'
4526-
]
4527-
],
4528-
'table_header': [
4529-
'Self-Test Code',
4530-
'Description'
4531-
]
4532-
},
4533-
'grpc_name': 'FancySelfTest',
4534-
'included_in_proto': False,
4535-
'method_templates': [
4536-
{
4537-
'documentation_filename': 'default_method',
4538-
'library_interpreter_filename': 'none',
4539-
'method_python_name_suffix': '',
4540-
'session_filename': 'fancy_self_test'
4541-
}
4542-
],
4543-
'parameters': [
4544-
{
4545-
'direction': 'in',
4546-
'documentation': {
4547-
'description': 'Identifies your instrument session. **vi** is obtained from the niFgen_init, nifgen_InitWithOptions, or nifgen_InitializeWithChannels functions and identifies a particular instrument session.'
4548-
},
4549-
'name': 'vi',
4550-
'type': 'ViSession'
4551-
}
4552-
],
4553-
'python_name': 'self_test',
4554-
'returns': 'ViStatus'
45554574
}
45564575
}

0 commit comments

Comments
 (0)