-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyusbdux.py
326 lines (230 loc) · 11.4 KB
/
pyusbdux.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
raise RuntimeError("Python 2.7 or later required")
# Import the low-level C/C++ module
if __package__ or "." in __name__:
from . import _pyusbdux
else:
import _pyusbdux
try:
import builtins as __builtin__
except ImportError:
import __builtin__
def _swig_repr(self):
try:
strthis = "proxy of " + self.this.__repr__()
except __builtin__.Exception:
strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
def _swig_setattr_nondynamic_instance_variable(set):
def set_instance_attr(self, name, value):
if name == "thisown":
self.this.own(value)
elif name == "this":
set(self, name, value)
elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
set(self, name, value)
else:
raise AttributeError("You cannot add instance attributes to %s" % self)
return set_instance_attr
def _swig_setattr_nondynamic_class_variable(set):
def set_class_attr(cls, name, value):
if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
set(cls, name, value)
else:
raise AttributeError("You cannot add class attributes to %s" % cls)
return set_class_attr
def _swig_add_metaclass(metaclass):
"""Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
def wrapper(cls):
return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
return wrapper
class _SwigNonDynamicMeta(type):
"""Meta class to enforce nondynamic attributes (no new attributes) for a class"""
__setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)
import weakref
class SwigPyIterator(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined - class is abstract")
__repr__ = _swig_repr
__swig_destroy__ = _pyusbdux.delete_SwigPyIterator
def value(self) -> "PyObject *":
return _pyusbdux.SwigPyIterator_value(self)
def incr(self, n: "size_t"=1) -> "swig::SwigPyIterator *":
return _pyusbdux.SwigPyIterator_incr(self, n)
def decr(self, n: "size_t"=1) -> "swig::SwigPyIterator *":
return _pyusbdux.SwigPyIterator_decr(self, n)
def distance(self, x: "SwigPyIterator") -> "ptrdiff_t":
return _pyusbdux.SwigPyIterator_distance(self, x)
def equal(self, x: "SwigPyIterator") -> "bool":
return _pyusbdux.SwigPyIterator_equal(self, x)
def copy(self) -> "swig::SwigPyIterator *":
return _pyusbdux.SwigPyIterator_copy(self)
def next(self) -> "PyObject *":
return _pyusbdux.SwigPyIterator_next(self)
def __next__(self) -> "PyObject *":
return _pyusbdux.SwigPyIterator___next__(self)
def previous(self) -> "PyObject *":
return _pyusbdux.SwigPyIterator_previous(self)
def advance(self, n: "ptrdiff_t") -> "swig::SwigPyIterator *":
return _pyusbdux.SwigPyIterator_advance(self, n)
def __eq__(self, x: "SwigPyIterator") -> "bool":
return _pyusbdux.SwigPyIterator___eq__(self, x)
def __ne__(self, x: "SwigPyIterator") -> "bool":
return _pyusbdux.SwigPyIterator___ne__(self, x)
def __iadd__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator &":
return _pyusbdux.SwigPyIterator___iadd__(self, n)
def __isub__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator &":
return _pyusbdux.SwigPyIterator___isub__(self, n)
def __add__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator *":
return _pyusbdux.SwigPyIterator___add__(self, n)
def __sub__(self, *args) -> "ptrdiff_t":
return _pyusbdux.SwigPyIterator___sub__(self, *args)
def __iter__(self):
return self
# Register SwigPyIterator in _pyusbdux:
_pyusbdux.SwigPyIterator_swigregister(SwigPyIterator)
class FloatArray(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def iterator(self) -> "swig::SwigPyIterator *":
return _pyusbdux.FloatArray_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self) -> "bool":
return _pyusbdux.FloatArray___nonzero__(self)
def __bool__(self) -> "bool":
return _pyusbdux.FloatArray___bool__(self)
def __len__(self) -> "std::array< float,N_CHANS >::size_type":
return _pyusbdux.FloatArray___len__(self)
def __getslice__(self, i: "std::array< float,N_CHANS >::difference_type", j: "std::array< float,N_CHANS >::difference_type") -> "std::array< float,N_CHANS > *":
return _pyusbdux.FloatArray___getslice__(self, i, j)
def __setslice__(self, *args) -> "void":
return _pyusbdux.FloatArray___setslice__(self, *args)
def __delslice__(self, i: "std::array< float,N_CHANS >::difference_type", j: "std::array< float,N_CHANS >::difference_type") -> "void":
return _pyusbdux.FloatArray___delslice__(self, i, j)
def __delitem__(self, *args) -> "void":
return _pyusbdux.FloatArray___delitem__(self, *args)
def __getitem__(self, *args) -> "std::array< float,N_CHANS >::value_type const &":
return _pyusbdux.FloatArray___getitem__(self, *args)
def __setitem__(self, *args) -> "void":
return _pyusbdux.FloatArray___setitem__(self, *args)
def __init__(self, *args):
_pyusbdux.FloatArray_swiginit(self, _pyusbdux.new_FloatArray(*args))
def empty(self) -> "bool":
return _pyusbdux.FloatArray_empty(self)
def size(self) -> "std::array< float,N_CHANS >::size_type":
return _pyusbdux.FloatArray_size(self)
def swap(self, v: "FloatArray") -> "void":
return _pyusbdux.FloatArray_swap(self, v)
def begin(self) -> "std::array< float,N_CHANS >::iterator":
return _pyusbdux.FloatArray_begin(self)
def end(self) -> "std::array< float,N_CHANS >::iterator":
return _pyusbdux.FloatArray_end(self)
def rbegin(self) -> "std::array< float,N_CHANS >::reverse_iterator":
return _pyusbdux.FloatArray_rbegin(self)
def rend(self) -> "std::array< float,N_CHANS >::reverse_iterator":
return _pyusbdux.FloatArray_rend(self)
def front(self) -> "std::array< float,N_CHANS >::value_type const &":
return _pyusbdux.FloatArray_front(self)
def back(self) -> "std::array< float,N_CHANS >::value_type const &":
return _pyusbdux.FloatArray_back(self)
def fill(self, u: "std::array< float,N_CHANS >::value_type const &") -> "void":
return _pyusbdux.FloatArray_fill(self, u)
__swig_destroy__ = _pyusbdux.delete_FloatArray
# Register FloatArray in _pyusbdux:
_pyusbdux.FloatArray_swigregister(FloatArray)
class DoubleArray(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def iterator(self) -> "swig::SwigPyIterator *":
return _pyusbdux.DoubleArray_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self) -> "bool":
return _pyusbdux.DoubleArray___nonzero__(self)
def __bool__(self) -> "bool":
return _pyusbdux.DoubleArray___bool__(self)
def __len__(self) -> "std::array< double,N_CHANS >::size_type":
return _pyusbdux.DoubleArray___len__(self)
def __getslice__(self, i: "std::array< double,N_CHANS >::difference_type", j: "std::array< double,N_CHANS >::difference_type") -> "std::array< double,N_CHANS > *":
return _pyusbdux.DoubleArray___getslice__(self, i, j)
def __setslice__(self, *args) -> "void":
return _pyusbdux.DoubleArray___setslice__(self, *args)
def __delslice__(self, i: "std::array< double,N_CHANS >::difference_type", j: "std::array< double,N_CHANS >::difference_type") -> "void":
return _pyusbdux.DoubleArray___delslice__(self, i, j)
def __delitem__(self, *args) -> "void":
return _pyusbdux.DoubleArray___delitem__(self, *args)
def __getitem__(self, *args) -> "std::array< double,N_CHANS >::value_type const &":
return _pyusbdux.DoubleArray___getitem__(self, *args)
def __setitem__(self, *args) -> "void":
return _pyusbdux.DoubleArray___setitem__(self, *args)
def __init__(self, *args):
_pyusbdux.DoubleArray_swiginit(self, _pyusbdux.new_DoubleArray(*args))
def empty(self) -> "bool":
return _pyusbdux.DoubleArray_empty(self)
def size(self) -> "std::array< double,N_CHANS >::size_type":
return _pyusbdux.DoubleArray_size(self)
def swap(self, v: "DoubleArray") -> "void":
return _pyusbdux.DoubleArray_swap(self, v)
def begin(self) -> "std::array< double,N_CHANS >::iterator":
return _pyusbdux.DoubleArray_begin(self)
def end(self) -> "std::array< double,N_CHANS >::iterator":
return _pyusbdux.DoubleArray_end(self)
def rbegin(self) -> "std::array< double,N_CHANS >::reverse_iterator":
return _pyusbdux.DoubleArray_rbegin(self)
def rend(self) -> "std::array< double,N_CHANS >::reverse_iterator":
return _pyusbdux.DoubleArray_rend(self)
def front(self) -> "std::array< double,N_CHANS >::value_type const &":
return _pyusbdux.DoubleArray_front(self)
def back(self) -> "std::array< double,N_CHANS >::value_type const &":
return _pyusbdux.DoubleArray_back(self)
def fill(self, u: "std::array< double,N_CHANS >::value_type const &") -> "void":
return _pyusbdux.DoubleArray_fill(self, u)
__swig_destroy__ = _pyusbdux.delete_DoubleArray
# Register DoubleArray in _pyusbdux:
_pyusbdux.DoubleArray_swigregister(DoubleArray)
class Callback(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def hasSample(self, data: "FloatArray") -> "void":
return _pyusbdux.Callback_hasSample(self, data)
__swig_destroy__ = _pyusbdux.delete_Callback
def __init__(self):
if self.__class__ == Callback:
_self = None
else:
_self = self
_pyusbdux.Callback_swiginit(self, _pyusbdux.new_Callback(_self, ))
def __disown__(self):
self.this.disown()
_pyusbdux.disown_Callback(self)
return weakref.proxy(self)
# Register Callback in _pyusbdux:
_pyusbdux.Callback_swigregister(Callback)
def open(*args) -> "void":
return _pyusbdux.open(*args)
def start(*args) -> "void":
return _pyusbdux.start(*args)
def getSamplingRate() -> "float":
return _pyusbdux.getSamplingRate()
def stop() -> "void":
return _pyusbdux.stop()
def digital_out(channel: "int", value: "int") -> "void":
return _pyusbdux.digital_out(channel, value)
def digital_in(channel: "int") -> "int":
return _pyusbdux.digital_in(channel)
def analogue_out(channel: "int", value: "int") -> "void":
return _pyusbdux.analogue_out(channel, value)
def get_analogue_out_max_raw_value() -> "int":
return _pyusbdux.get_analogue_out_max_raw_value()
def get_board_name() -> "char const *":
return _pyusbdux.get_board_name()
def close() -> "void":
return _pyusbdux.close()