Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes in nifgen metadata #1006

Merged
merged 5 commits into from
Jul 24, 2019
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ All notable changes to this project will be documented in this file.
* #### Added
* #### Changed
* #### Removed
* `configure_custom_fir_filter_coefficients()` - [#996](https://github.com/ni/nimi-python/issues/996) - Should have been removed as part of - [#891](https://github.com/ni/nimi-python/issues/891)
* ### NI-SCOPE
* #### Added
* `cable_sense_signal_enable`, `cable_sense_voltage`, `cable_sense_mode` properties and associated enum
Expand Down
9 changes: 0 additions & 9 deletions generated/nifgen/_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def __init__(self, ctypes_library):
self.niFgen_Commit_cfunc = None
self.niFgen_ConfigureArbSequence_cfunc = None
self.niFgen_ConfigureArbWaveform_cfunc = None
self.niFgen_ConfigureCustomFIRFilterCoefficients_cfunc = None
self.niFgen_ConfigureFreqList_cfunc = None
self.niFgen_ConfigureStandardWaveform_cfunc = None
self.niFgen_CreateAdvancedArbSequence_cfunc = None
Expand Down Expand Up @@ -175,14 +174,6 @@ def niFgen_ConfigureArbWaveform(self, vi, channel_name, waveform_handle, gain, o
self.niFgen_ConfigureArbWaveform_cfunc.restype = ViStatus # noqa: F405
return self.niFgen_ConfigureArbWaveform_cfunc(vi, channel_name, waveform_handle, gain, offset)

def niFgen_ConfigureCustomFIRFilterCoefficients(self, vi, channel_name, number_of_coefficients, coefficients_array): # noqa: N802
with self._func_lock:
if self.niFgen_ConfigureCustomFIRFilterCoefficients_cfunc is None:
self.niFgen_ConfigureCustomFIRFilterCoefficients_cfunc = self._library.niFgen_ConfigureCustomFIRFilterCoefficients
self.niFgen_ConfigureCustomFIRFilterCoefficients_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ViReal64)] # noqa: F405
self.niFgen_ConfigureCustomFIRFilterCoefficients_cfunc.restype = ViStatus # noqa: F405
return self.niFgen_ConfigureCustomFIRFilterCoefficients_cfunc(vi, channel_name, number_of_coefficients, coefficients_array)

def niFgen_ConfigureFreqList(self, vi, channel_name, frequency_list_handle, amplitude, dc_offset, start_phase): # noqa: N802
with self._func_lock:
if self.niFgen_ConfigureFreqList_cfunc is None:
Expand Down
41 changes: 0 additions & 41 deletions generated/nifgen/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -1211,47 +1211,6 @@ def configure_arb_waveform(self, waveform_handle, gain, offset):
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return

@ivi_synchronized
def configure_custom_fir_filter_coefficients(self, coefficients_array):
r'''configure_custom_fir_filter_coefficients

Sets the FIR filter coefficients used by the onboard signal processing
block. The values are coerced to the closest settings achievable by the
signal generator.

Refer to the *FIR Filter* topic for your device in the *NI Signal
Generators Help* for more information about FIR filter coefficients.
This method is supported only for the NI 5441.

Note:
The signal generator must not be in the Generating state when you call
this method.

Tip:
This method requires repeated capabilities (channels). If called directly on the
nifgen.Session object, then the method will use all repeated capabilities in the session.
You can specify a subset of repeated capabilities using the Python index notation on an
nifgen.Session repeated capabilities container, and calling this method on the result.:

session.channels[0,1].configure_custom_fir_filter_coefficients(coefficients_array)

Args:
coefficients_array (list of float): Specifies the array of data the onboard signal processor uses for the
FIR filter coefficients. For the NI 5441, provide a symmetric array of
95 coefficients to this parameter. The array must have at least as many
elements as the value that you specify in the **numberOfCoefficients**
parameter in this method.
The coefficients should range between –1.00 and +1.00.

'''
vi_ctype = _visatype.ViSession(self._vi) # case S110
channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010
number_of_coefficients_ctype = _visatype.ViInt32(0 if coefficients_array is None else len(coefficients_array)) # case S160
coefficients_array_ctype = get_ctypes_pointer_for_buffer(value=coefficients_array, library_type=_visatype.ViReal64) # case B550
error_code = self._library.niFgen_ConfigureCustomFIRFilterCoefficients(vi_ctype, channel_name_ctype, number_of_coefficients_ctype, coefficients_array_ctype)
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return

@ivi_synchronized
def configure_freq_list(self, frequency_list_handle, amplitude, dc_offset=0.0, start_phase=0.0):
r'''configure_freq_list
Expand Down
9 changes: 0 additions & 9 deletions generated/nifgen/unit_tests/_mock_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ def __init__(self):
self._defaults['ConfigureArbSequence']['return'] = 0
self._defaults['ConfigureArbWaveform'] = {}
self._defaults['ConfigureArbWaveform']['return'] = 0
self._defaults['ConfigureCustomFIRFilterCoefficients'] = {}
self._defaults['ConfigureCustomFIRFilterCoefficients']['return'] = 0
self._defaults['ConfigureFreqList'] = {}
self._defaults['ConfigureFreqList']['return'] = 0
self._defaults['ConfigureStandardWaveform'] = {}
Expand Down Expand Up @@ -273,11 +271,6 @@ def niFgen_ConfigureArbWaveform(self, vi, channel_name, waveform_handle, gain, o
return self._defaults['ConfigureArbWaveform']['return']
return self._defaults['ConfigureArbWaveform']['return']

def niFgen_ConfigureCustomFIRFilterCoefficients(self, vi, channel_name, number_of_coefficients, coefficients_array): # noqa: N802
if self._defaults['ConfigureCustomFIRFilterCoefficients']['return'] != 0:
return self._defaults['ConfigureCustomFIRFilterCoefficients']['return']
return self._defaults['ConfigureCustomFIRFilterCoefficients']['return']

def niFgen_ConfigureFreqList(self, vi, channel_name, frequency_list_handle, amplitude, dc_offset, start_phase): # noqa: N802
if self._defaults['ConfigureFreqList']['return'] != 0:
return self._defaults['ConfigureFreqList']['return']
Expand Down Expand Up @@ -861,8 +854,6 @@ def set_side_effects_and_return_values(self, mock_library):
mock_library.niFgen_ConfigureArbSequence.return_value = 0
mock_library.niFgen_ConfigureArbWaveform.side_effect = MockFunctionCallError("niFgen_ConfigureArbWaveform")
mock_library.niFgen_ConfigureArbWaveform.return_value = 0
mock_library.niFgen_ConfigureCustomFIRFilterCoefficients.side_effect = MockFunctionCallError("niFgen_ConfigureCustomFIRFilterCoefficients")
mock_library.niFgen_ConfigureCustomFIRFilterCoefficients.return_value = 0
mock_library.niFgen_ConfigureFreqList.side_effect = MockFunctionCallError("niFgen_ConfigureFreqList")
mock_library.niFgen_ConfigureFreqList.return_value = 0
mock_library.niFgen_ConfigureStandardWaveform.side_effect = MockFunctionCallError("niFgen_ConfigureStandardWaveform")
Expand Down
28 changes: 23 additions & 5 deletions src/nifgen/metadata/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@
'returns': 'ViStatus'
},
'ConfigureCustomFIRFilterCoefficients': {
'codegen_method': 'public',
'codegen_method': 'no',
'documentation': {
'description': '\nSets the FIR filter coefficients used by the onboard signal processing\nblock. The values are coerced to the closest settings achievable by the\nsignal generator.\n\nRefer to the *FIR Filter* topic for your device in the *NI Signal\nGenerators Help* for more information about FIR filter coefficients.\nThis function is supported only for the NI 5441.\n',
'note': '\nThe signal generator must not be in the Generating state when you call\nthis function.\n'
Expand Down Expand Up @@ -4821,7 +4821,20 @@
'GetFIRFilterCoefficients': {
'codegen_method': 'no',
'documentation': {
'description': '\n| Returns the FIR filter coefficients used by the onboard signal\n processing block. These coefficients are determined by NI-FGEN and\n based on the FIR filter type and corresponding attribute (Alpha,\n Passband, BT) unless you are using the custom filter. If you are using\n a custom filter, the coefficients returned are those set with the\n nifgen_ConfigureCustomFIRFilterCoefficients function coerced to the\n quantized values used by the device.\n| To use this function, first call an instance of the\n niFgen_GetFIRFilterCoefficients function with the\n **coefficientsArray** parameter set to VI_NULL. Calling the function\n in this state returns the current size of the **coefficientsArray** as\n the value of the **numberOfCoefficientsRead** parameter. Create an\n array of this size, and call the niFgen_GetFIRFilterCoefficients\n function a second time, passing the new array as the\n **coefficientsArray** parameter and the size as the **arraySize**\n parameter. This second function call populates the array with the FIR\n filter coefficients.\n| Refer to the FIR Filter topic for your device in the *NI Signal\n Generators Help* for more information about FIR filter coefficients.\n This function is supported only for the NI 5441.\n| **Default Value**: None\n'
'description': '''
Returns the FIR filter coefficients used by the onboard signal
processing block. These coefficients are determined by NI-FGEN and
based on the FIR filter type and corresponding attribute (Alpha,
Passband, BT) unless you are using the custom filter. If you are using
a custom filter, the coefficients returned are those set with the
configure_custom_fir_filter_coefficients function coerced to the
quantized values used by the device.

Refer to the FIR Filter topic for your device in the *NI Signal Generators Help*
for more information about FIR filter coefficients.

This function is supported only for the NI 5441.
'''
},
'parameters': [
{
Expand Down Expand Up @@ -4849,15 +4862,20 @@
'type': 'ViInt32'
},
{
'direction': 'in',
'direction': 'out',
'documentation': {
'description': '\nSpecifies the array of data the onboard signal processor uses for the\nFIR filter coefficients. For the NI 5441, provide a symmetric array of\n95 coefficients to this parameter. The array must have at least as many\nelements as the value that you specify in the **numberOfCoefficients**\nparameter in this function.\nThe coefficients should range between –1.00 and +1.00.\n'
},
'size': {
'mechanism': 'ivi-dance-with-a-twist',
'value': 'arraySize',
'value_twist': 'numberOfCoefficientsRead'
},
'name': 'coefficientsArray',
'type': 'ViReal64'
'type': 'ViReal64[]'
},
{
'direction': 'in',
'direction': 'out',
'documentation': {
'description': '\nSpecifies the array of data containing the number of coefficients you\nwant to read.\n'
},
Expand Down

This file was deleted.

This file was deleted.