Skip to content

Commit 3920ee5

Browse files
committed
committing initial misc changes
1 parent a488e07 commit 3920ee5

File tree

19 files changed

+1932
-640
lines changed

19 files changed

+1932
-640
lines changed

docs/nirfsg/class.rst

Lines changed: 158 additions & 164 deletions
Large diffs are not rendered by default.

docs/nirfsg/examples.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ Examples
33

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

6+
nirfsg_arb_waveform.py
7+
----------------------
8+
9+
.. literalinclude:: ../../src/nirfsg/examples/nirfsg_arb_waveform.py
10+
:language: python
11+
:linenos:
12+
:encoding: utf8
13+
:caption: `(nirfsg_arb_waveform.py) <https://github.com/ni/nimi-python/blob/nirfsg-0.2.0/src/nirfsg/examples/nirfsg_arb_waveform.py>`_
14+
615
nirfsg_cw.py
716
------------
817

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

24+
nirfsg_script.py
25+
----------------
26+
27+
.. literalinclude:: ../../src/nirfsg/examples/nirfsg_script.py
28+
:language: python
29+
:linenos:
30+
:encoding: utf8
31+
:caption: `(nirfsg_script.py) <https://github.com/ni/nimi-python/blob/nirfsg-0.2.0/src/nirfsg/examples/nirfsg_script.py>`_
32+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# -*- coding: utf-8 -*-
2+
# This file was generated
3+
import ctypes
4+
import nirfsg._visatype as _visatype
5+
6+
7+
class NIComplexNumber(ctypes.Structure):
8+
_fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)]
9+
10+
11+
class NIComplexNumberF32(ctypes.Structure):
12+
_fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)]
13+
14+
15+
class NIComplexI16(ctypes.Structure):
16+
_fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)]

generated/nirfsg/nirfsg/_library.py

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import nirfsg.errors as errors
66
import threading
77

8+
from nirfsg._complextype import * # noqa: F403
89
from nirfsg._visatype import * # noqa: F403,H303
910

1011

@@ -89,7 +90,6 @@ def __init__(self, ctypes_library):
8990
self.niRFSG_PerformThermalCorrection_cfunc = None
9091
self.niRFSG_QueryArbWaveformCapabilities_cfunc = None
9192
self.niRFSG_ReadAndDownloadWaveformFromFileTDMS_cfunc = None
92-
self.niRFSG_Reset_cfunc = None
9393
self.niRFSG_ResetAttribute_cfunc = None
9494
self.niRFSG_ResetDevice_cfunc = None
9595
self.niRFSG_ResetWithDefaults_cfunc = None
@@ -112,9 +112,13 @@ def __init__(self, ctypes_library):
112112
self.niRFSG_SetWaveformMarkerEventLocations_cfunc = None
113113
self.niRFSG_UnlockSession_cfunc = None
114114
self.niRFSG_WaitUntilSettled_cfunc = None
115+
self.niRFSG_WriteArbWaveformComplexF32_cfunc = None
116+
self.niRFSG_WriteArbWaveformComplexF64_cfunc = None
117+
self.niRFSG_WriteArbWaveformComplexI16_cfunc = None
115118
self.niRFSG_WriteP2PEndpointI16_cfunc = None
116119
self.niRFSG_WriteScript_cfunc = None
117120
self.niRFSG_close_cfunc = None
121+
self.niRFSG_reset_cfunc = None
118122

119123
def _get_library_function(self, name):
120124
try:
@@ -683,14 +687,6 @@ def niRFSG_ReadAndDownloadWaveformFromFileTDMS(self, vi, waveform_name, file_pat
683687
self.niRFSG_ReadAndDownloadWaveformFromFileTDMS_cfunc.restype = ViStatus # noqa: F405
684688
return self.niRFSG_ReadAndDownloadWaveformFromFileTDMS_cfunc(vi, waveform_name, file_path, waveform_index)
685689

686-
def niRFSG_Reset(self, vi): # noqa: N802
687-
with self._func_lock:
688-
if self.niRFSG_Reset_cfunc is None:
689-
self.niRFSG_Reset_cfunc = self._get_library_function('niRFSG_Reset')
690-
self.niRFSG_Reset_cfunc.argtypes = [ViSession] # noqa: F405
691-
self.niRFSG_Reset_cfunc.restype = ViStatus # noqa: F405
692-
return self.niRFSG_Reset_cfunc(vi)
693-
694690
def niRFSG_ResetAttribute(self, vi, channel_name, attribute_id): # noqa: N802
695691
with self._func_lock:
696692
if self.niRFSG_ResetAttribute_cfunc is None:
@@ -867,6 +863,30 @@ def niRFSG_WaitUntilSettled(self, vi, max_time_milliseconds): # noqa: N802
867863
self.niRFSG_WaitUntilSettled_cfunc.restype = ViStatus # noqa: F405
868864
return self.niRFSG_WaitUntilSettled_cfunc(vi, max_time_milliseconds)
869865

866+
def niRFSG_WriteArbWaveformComplexF32(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802
867+
with self._func_lock:
868+
if self.niRFSG_WriteArbWaveformComplexF32_cfunc is None:
869+
self.niRFSG_WriteArbWaveformComplexF32_cfunc = self._get_library_function('niRFSG_WriteArbWaveformComplexF32')
870+
self.niRFSG_WriteArbWaveformComplexF32_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(NIComplexNumberF32), ViBoolean] # noqa: F405
871+
self.niRFSG_WriteArbWaveformComplexF32_cfunc.restype = ViStatus # noqa: F405
872+
return self.niRFSG_WriteArbWaveformComplexF32_cfunc(vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending)
873+
874+
def niRFSG_WriteArbWaveformComplexF64(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802
875+
with self._func_lock:
876+
if self.niRFSG_WriteArbWaveformComplexF64_cfunc is None:
877+
self.niRFSG_WriteArbWaveformComplexF64_cfunc = self._get_library_function('niRFSG_WriteArbWaveformComplexF64')
878+
self.niRFSG_WriteArbWaveformComplexF64_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(NIComplexNumber), ViBoolean] # noqa: F405
879+
self.niRFSG_WriteArbWaveformComplexF64_cfunc.restype = ViStatus # noqa: F405
880+
return self.niRFSG_WriteArbWaveformComplexF64_cfunc(vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending)
881+
882+
def niRFSG_WriteArbWaveformComplexI16(self, vi, waveform_name, number_of_samples, waveform_data_array): # noqa: N802
883+
with self._func_lock:
884+
if self.niRFSG_WriteArbWaveformComplexI16_cfunc is None:
885+
self.niRFSG_WriteArbWaveformComplexI16_cfunc = self._get_library_function('niRFSG_WriteArbWaveformComplexI16')
886+
self.niRFSG_WriteArbWaveformComplexI16_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(NIComplexI16)] # noqa: F405
887+
self.niRFSG_WriteArbWaveformComplexI16_cfunc.restype = ViStatus # noqa: F405
888+
return self.niRFSG_WriteArbWaveformComplexI16_cfunc(vi, waveform_name, number_of_samples, waveform_data_array)
889+
870890
def niRFSG_WriteP2PEndpointI16(self, vi, stream_endpoint, number_of_samples, endpoint_data): # noqa: N802
871891
with self._func_lock:
872892
if self.niRFSG_WriteP2PEndpointI16_cfunc is None:
@@ -890,3 +910,11 @@ def niRFSG_close(self, vi): # noqa: N802
890910
self.niRFSG_close_cfunc.argtypes = [ViSession] # noqa: F405
891911
self.niRFSG_close_cfunc.restype = ViStatus # noqa: F405
892912
return self.niRFSG_close_cfunc(vi)
913+
914+
def niRFSG_reset(self, vi): # noqa: N802
915+
with self._func_lock:
916+
if self.niRFSG_reset_cfunc is None:
917+
self.niRFSG_reset_cfunc = self._get_library_function('niRFSG_reset')
918+
self.niRFSG_reset_cfunc.argtypes = [ViSession] # noqa: F405
919+
self.niRFSG_reset_cfunc.restype = ViStatus # noqa: F405
920+
return self.niRFSG_reset_cfunc(vi)

0 commit comments

Comments
 (0)