Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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 .github/workflows/github_actions_aws_rhel_python64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
- nidmm
- nifgen
- nimodinst
- nirfsg
- niscope
- niswitch
- nitclk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
- nifgen
- nidcpower
- nidmm
- nirfsg
- niscope
- nimodinst
- nise
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
- nifgen
- nidcpower
- nidmm
- nirfsg
- niscope
- nimodinst
- nise
Expand Down
7 changes: 7 additions & 0 deletions build/templates/session.py/datetime_wrappers.py.mako
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,18 @@
output_params_list.append(p['python_name'])

output_params = ', '.join(output_params_list)
include_second = False
if "second" in output_params_list:
include_second = True
%>\
def ${f['python_name']}(${helper.get_params_snippet(f, helper.ParameterUsageOptions.SESSION_METHOD_DECLARATION)}):
'''${f['python_name']}

${helper.get_function_docstring(f, False, config, indent=8)}
'''
${output_params} = self.${called_function['python_name']}(${helper.get_params_snippet(f, helper.ParameterUsageOptions.SESSION_METHOD_CALL)})
%if include_second is False:
return hightime.datetime(year, month, day, hour, minute)
%else:
return hightime.datetime(year, month, day, hour, minute, second)
%endif
305 changes: 146 additions & 159 deletions docs/nirfsg/class.rst

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions docs/nirfsg/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ Examples

`You can download all nirfsg examples here <https://github.com/ni/nimi-python/releases/download/nirfsg-0.2.0/nirfsg_examples.zip>`_

nirfsg_arb_waveform.py
----------------------

.. literalinclude:: ../../src/nirfsg/examples/nirfsg_arb_waveform.py
:language: python
:linenos:
:encoding: utf8
:caption: `(nirfsg_arb_waveform.py) <https://github.com/ni/nimi-python/blob/nirfsg-0.2.0/src/nirfsg/examples/nirfsg_arb_waveform.py>`_

nirfsg_cw.py
------------

Expand All @@ -12,3 +21,12 @@ nirfsg_cw.py
:encoding: utf8
:caption: `(nirfsg_cw.py) <https://github.com/ni/nimi-python/blob/nirfsg-0.2.0/src/nirfsg/examples/nirfsg_cw.py>`_

nirfsg_script.py
----------------

.. literalinclude:: ../../src/nirfsg/examples/nirfsg_script.py
:language: python
:linenos:
:encoding: utf8
:caption: `(nirfsg_script.py) <https://github.com/ni/nimi-python/blob/nirfsg-0.2.0/src/nirfsg/examples/nirfsg_script.py>`_

16 changes: 16 additions & 0 deletions generated/nirfsg/nirfsg/_complextype.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# This file was generated
import ctypes
import nirfsg._visatype as _visatype


class NIComplexNumber(ctypes.Structure):
_fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)]


class NIComplexNumberF32(ctypes.Structure):
_fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)]


class NIComplexI16(ctypes.Structure):
_fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)]
46 changes: 37 additions & 9 deletions generated/nirfsg/nirfsg/_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import nirfsg.errors as errors
import threading

from nirfsg._complextype import * # noqa: F403
from nirfsg._visatype import * # noqa: F403,H303


Expand Down Expand Up @@ -89,7 +90,6 @@ def __init__(self, ctypes_library):
self.niRFSG_PerformThermalCorrection_cfunc = None
self.niRFSG_QueryArbWaveformCapabilities_cfunc = None
self.niRFSG_ReadAndDownloadWaveformFromFileTDMS_cfunc = None
self.niRFSG_Reset_cfunc = None
self.niRFSG_ResetAttribute_cfunc = None
self.niRFSG_ResetDevice_cfunc = None
self.niRFSG_ResetWithDefaults_cfunc = None
Expand All @@ -112,9 +112,13 @@ def __init__(self, ctypes_library):
self.niRFSG_SetWaveformMarkerEventLocations_cfunc = None
self.niRFSG_UnlockSession_cfunc = None
self.niRFSG_WaitUntilSettled_cfunc = None
self.niRFSG_WriteArbWaveformComplexF32_cfunc = None
self.niRFSG_WriteArbWaveformComplexF64_cfunc = None
self.niRFSG_WriteArbWaveformComplexI16_cfunc = None
self.niRFSG_WriteP2PEndpointI16_cfunc = None
self.niRFSG_WriteScript_cfunc = None
self.niRFSG_close_cfunc = None
self.niRFSG_reset_cfunc = None

def _get_library_function(self, name):
try:
Expand Down Expand Up @@ -683,14 +687,6 @@ def niRFSG_ReadAndDownloadWaveformFromFileTDMS(self, vi, waveform_name, file_pat
self.niRFSG_ReadAndDownloadWaveformFromFileTDMS_cfunc.restype = ViStatus # noqa: F405
return self.niRFSG_ReadAndDownloadWaveformFromFileTDMS_cfunc(vi, waveform_name, file_path, waveform_index)

def niRFSG_Reset(self, vi): # noqa: N802
with self._func_lock:
if self.niRFSG_Reset_cfunc is None:
self.niRFSG_Reset_cfunc = self._get_library_function('niRFSG_Reset')
self.niRFSG_Reset_cfunc.argtypes = [ViSession] # noqa: F405
self.niRFSG_Reset_cfunc.restype = ViStatus # noqa: F405
return self.niRFSG_Reset_cfunc(vi)

def niRFSG_ResetAttribute(self, vi, channel_name, attribute_id): # noqa: N802
with self._func_lock:
if self.niRFSG_ResetAttribute_cfunc is None:
Expand Down Expand Up @@ -867,6 +863,30 @@ def niRFSG_WaitUntilSettled(self, vi, max_time_milliseconds): # noqa: N802
self.niRFSG_WaitUntilSettled_cfunc.restype = ViStatus # noqa: F405
return self.niRFSG_WaitUntilSettled_cfunc(vi, max_time_milliseconds)

def niRFSG_WriteArbWaveformComplexF32(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802
with self._func_lock:
if self.niRFSG_WriteArbWaveformComplexF32_cfunc is None:
self.niRFSG_WriteArbWaveformComplexF32_cfunc = self._get_library_function('niRFSG_WriteArbWaveformComplexF32')
self.niRFSG_WriteArbWaveformComplexF32_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(NIComplexNumberF32), ViBoolean] # noqa: F405
self.niRFSG_WriteArbWaveformComplexF32_cfunc.restype = ViStatus # noqa: F405
return self.niRFSG_WriteArbWaveformComplexF32_cfunc(vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending)

def niRFSG_WriteArbWaveformComplexF64(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802
with self._func_lock:
if self.niRFSG_WriteArbWaveformComplexF64_cfunc is None:
self.niRFSG_WriteArbWaveformComplexF64_cfunc = self._get_library_function('niRFSG_WriteArbWaveformComplexF64')
self.niRFSG_WriteArbWaveformComplexF64_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(NIComplexNumber), ViBoolean] # noqa: F405
self.niRFSG_WriteArbWaveformComplexF64_cfunc.restype = ViStatus # noqa: F405
return self.niRFSG_WriteArbWaveformComplexF64_cfunc(vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending)

def niRFSG_WriteArbWaveformComplexI16(self, vi, waveform_name, number_of_samples, waveform_data_array): # noqa: N802
with self._func_lock:
if self.niRFSG_WriteArbWaveformComplexI16_cfunc is None:
self.niRFSG_WriteArbWaveformComplexI16_cfunc = self._get_library_function('niRFSG_WriteArbWaveformComplexI16')
self.niRFSG_WriteArbWaveformComplexI16_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(NIComplexI16)] # noqa: F405
self.niRFSG_WriteArbWaveformComplexI16_cfunc.restype = ViStatus # noqa: F405
return self.niRFSG_WriteArbWaveformComplexI16_cfunc(vi, waveform_name, number_of_samples, waveform_data_array)

def niRFSG_WriteP2PEndpointI16(self, vi, stream_endpoint, number_of_samples, endpoint_data): # noqa: N802
with self._func_lock:
if self.niRFSG_WriteP2PEndpointI16_cfunc is None:
Expand All @@ -890,3 +910,11 @@ def niRFSG_close(self, vi): # noqa: N802
self.niRFSG_close_cfunc.argtypes = [ViSession] # noqa: F405
self.niRFSG_close_cfunc.restype = ViStatus # noqa: F405
return self.niRFSG_close_cfunc(vi)

def niRFSG_reset(self, vi): # noqa: N802
with self._func_lock:
if self.niRFSG_reset_cfunc is None:
self.niRFSG_reset_cfunc = self._get_library_function('niRFSG_reset')
self.niRFSG_reset_cfunc.argtypes = [ViSession] # noqa: F405
self.niRFSG_reset_cfunc.restype = ViStatus # noqa: F405
return self.niRFSG_reset_cfunc(vi)
Loading