You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Ignore files generated during system test execution
* Add get_channel_names test
* get_channel_names implementation (plus some additional metadata changes that hadn't yet been codegen'd)
* Update changelog
* Address code review feedback (#1578)
* Fix whitespace
* Some additional code review feedback from Marcos
* wait for a different PR to update .gitignore
* Restore blank line
* Take into account python_name parameter overrides when determining repeated capabilities
* Address some additional feedback from Shreyas: 1. always create `python_name_override` and 2. avoid mixing camel-cased and snake-cased parameter names when comparing them
* Add test for python_name override
* Add tests for snake_case / camel_case conversions
* Revert changes to _add_is_repeated_capability() based on code review feedback. I will fix the incorrect repeated capability for the parameter names later, by adding metadata is_repeated_capability tags to the get_channel_names parameters.
Copy file name to clipboardexpand all lines: docs/nidcpower/class.rst
+44
Original file line number
Diff line number
Diff line change
@@ -858,6 +858,50 @@ get_channel_name
858
858
859
859
860
860
861
+
get_channel_names
862
+
-----------------
863
+
864
+
.. py:currentmodule:: nidcpower.Session
865
+
866
+
.. py:method:: get_channel_names(indices)
867
+
868
+
Returns a list of channel names for given channel indices.
869
+
870
+
871
+
872
+
873
+
.. tip:: This method requires repeated capabilities. If called directly on the
874
+
nidcpower.Session object, then the method will use all repeated capabilities in the session.
875
+
You can specify a subset of repeated capabilities using the Python index notation on an
876
+
nidcpower.Session repeated capabilities container, and calling this method on the result.
877
+
878
+
879
+
:param indices:
880
+
881
+
882
+
Index listfor the channels in the session. Valid values are from zero to the total number of channels in the session minus one. The index string can be one of the following formats:
883
+
884
+
- A comma-separated list—for example, "0,2,3,1"
885
+
- A range using a hyphen—for example, "0-3"
886
+
- A range using a colon—for example, "0:3 "
887
+
888
+
You can combine comma-separated lists and ranges that use a hyphen or colon. Both out-of-order and repeated indices are supported ("2,3,0,""1,2,2,3"). White space characters, including spaces, tabs, feeds, and carriage returns, are allowed between characters. Ranges can be incrementing or decrementing.
Returns a list of channel names for given channel indices.
3700
+
3701
+
Tip:
3702
+
This method requires repeated capabilities. If called directly on the
3703
+
nidcpower.Session object, then the method will use all repeated capabilities in the session.
3704
+
You can specify a subset of repeated capabilities using the Python index notation on an
3705
+
nidcpower.Session repeated capabilities container, and calling this method on the result.
3706
+
3707
+
Args:
3708
+
indices (basic sequence types or str or int): Index list for the channels in the session. Valid values are from zero to the total number of channels in the session minus one. The index string can be one of the following formats:
3709
+
3710
+
- A comma-separated list—for example, "0,2,3,1"
3711
+
- A range using a hyphen—for example, "0-3"
3712
+
- A range using a colon—for example, "0:3 "
3713
+
3714
+
You can combine comma-separated lists and ranges that use a hyphen or colon. Both out-of-order and repeated indices are supported ("2,3,0," "1,2,2,3"). White space characters, including spaces, tabs, feeds, and carriage returns, are allowed between characters. Ranges can be incrementing or decrementing.
3715
+
3716
+
3717
+
Returns:
3718
+
names (list of str): The channel name(s) at the specified indices.
3719
+
3720
+
'''
3721
+
vi_ctype=_visatype.ViSession(self._vi) # case S110
3722
+
indices_ctype=ctypes.create_string_buffer(_converters.convert_repeated_capabilities_without_prefix(indices).encode(self._encoding)) # case C040
Copy file name to clipboardexpand all lines: src/nidcpower/metadata/functions.py
+52-1
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
# -*- coding: utf-8 -*-
2
-
# This file is generated from NI-DCPower API metadata version 21.0.0d52
2
+
# This file is generated from NI-DCPower API metadata version 21.0.0d69
3
3
functions= {
4
4
'AbortWithChannels': {
5
5
'documentation': {
@@ -1453,6 +1453,57 @@
1453
1453
],
1454
1454
'returns': 'ViStatus'
1455
1455
},
1456
+
'GetChannelNameFromString': {
1457
+
'documentation': {
1458
+
'description': '\nReturns a list of channel names for given channel indices.'
1459
+
},
1460
+
'parameters': [
1461
+
{
1462
+
'direction': 'in',
1463
+
'documentation': {
1464
+
'description': '\nIdentifies a particular instrument session. **vi** is obtained from the\nniDCPower_InitializeWithChannels function.\n'
1465
+
},
1466
+
'name': 'vi',
1467
+
'type': 'ViSession'
1468
+
},
1469
+
{
1470
+
'direction': 'in',
1471
+
'documentation': {
1472
+
'description': '\nIndex list for the channels in the session. Valid values are from zero to the total number of channels in the session minus one. The index string can be one of the following formats:\n\n- A comma-separated list—for example, "0,2,3,1"\n- A range using a hyphen—for example, "0-3"\n- A range using a colon—for example, "0:3 "\n\nYou can combine comma-separated lists and ranges that use a hyphen or colon. Both out-of-order and repeated indices are supported ("2,3,0," "1,2,2,3"). White space characters, including spaces, tabs, feeds, and carriage returns, are allowed between characters. Ranges can be incrementing or decrementing.\n'
0 commit comments