ni.measurementlink.sessionmanagement.v1.client 0.1.0.dev0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ni.measurementlink.sessionmanagement.v1.client might be problematic. Click here for more details.
- ni/measurementlink/sessionmanagement/v1/client/__init__.py +107 -0
- ni/measurementlink/sessionmanagement/v1/client/_client.py +405 -0
- ni/measurementlink/sessionmanagement/v1/client/_constants.py +32 -0
- ni/measurementlink/sessionmanagement/v1/client/_drivers/__init__.py +46 -0
- ni/measurementlink/sessionmanagement/v1/client/_drivers/_configuration.py +111 -0
- ni/measurementlink/sessionmanagement/v1/client/_drivers/_dotenvpath.py +73 -0
- ni/measurementlink/sessionmanagement/v1/client/_drivers/_grpcdevice.py +96 -0
- ni/measurementlink/sessionmanagement/v1/client/_drivers/_nidaqmx.py +54 -0
- ni/measurementlink/sessionmanagement/v1/client/_drivers/_nidcpower.py +63 -0
- ni/measurementlink/sessionmanagement/v1/client/_drivers/_nidigital.py +64 -0
- ni/measurementlink/sessionmanagement/v1/client/_drivers/_nidmm.py +64 -0
- ni/measurementlink/sessionmanagement/v1/client/_drivers/_nifgen.py +63 -0
- ni/measurementlink/sessionmanagement/v1/client/_drivers/_niscope.py +64 -0
- ni/measurementlink/sessionmanagement/v1/client/_drivers/_niswitch.py +82 -0
- ni/measurementlink/sessionmanagement/v1/client/_reservation.py +2769 -0
- ni/measurementlink/sessionmanagement/v1/client/_types.py +507 -0
- ni/measurementlink/sessionmanagement/v1/client/py.typed +0 -0
- ni_measurementlink_sessionmanagement_v1_client-0.1.0.dev0.dist-info/METADATA +80 -0
- ni_measurementlink_sessionmanagement_v1_client-0.1.0.dev0.dist-info/RECORD +20 -0
- ni_measurementlink_sessionmanagement_v1_client-0.1.0.dev0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,507 @@
|
|
|
1
|
+
"""Session management data types."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from collections.abc import Iterable
|
|
6
|
+
from enum import IntEnum
|
|
7
|
+
from typing import Generic, NamedTuple, Protocol, TypeVar
|
|
8
|
+
|
|
9
|
+
import ni.measurementlink.sessionmanagement.v1.session_management_service_pb2 as session_management_service_pb2
|
|
10
|
+
import session_pb2
|
|
11
|
+
from ni.measurementlink import (
|
|
12
|
+
pin_map_context_pb2,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
TSession = TypeVar("TSession")
|
|
16
|
+
TSession_co = TypeVar("TSession_co", covariant=True)
|
|
17
|
+
TMultiplexerSession = TypeVar("TMultiplexerSession")
|
|
18
|
+
TMultiplexerSession_co = TypeVar("TMultiplexerSession_co", covariant=True)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class PinMapContext(NamedTuple):
|
|
22
|
+
"""Container for the pin map and sites."""
|
|
23
|
+
|
|
24
|
+
pin_map_id: str
|
|
25
|
+
"""The resource id of the pin map in the Pin Map service that should be used for the call."""
|
|
26
|
+
|
|
27
|
+
sites: list[int] | None
|
|
28
|
+
"""List of site numbers being used for the call.
|
|
29
|
+
|
|
30
|
+
If None or empty, use all sites in the pin map.
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
@classmethod
|
|
34
|
+
def _from_grpc(
|
|
35
|
+
cls,
|
|
36
|
+
other: pin_map_context_pb2.PinMapContext,
|
|
37
|
+
) -> PinMapContext:
|
|
38
|
+
# The protobuf PinMapContext sites field is a RepeatedScalarContainer, not a list.
|
|
39
|
+
# Constructing a protobuf PinMapContext with sites=None sets sites to an empty
|
|
40
|
+
# RepeatedScalarContainer, not None.
|
|
41
|
+
return PinMapContext(pin_map_id=other.pin_map_id, sites=list(other.sites))
|
|
42
|
+
|
|
43
|
+
def _to_grpc(self) -> pin_map_context_pb2.PinMapContext:
|
|
44
|
+
return pin_map_context_pb2.PinMapContext(pin_map_id=self.pin_map_id, sites=self.sites)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class ChannelMapping(NamedTuple):
|
|
48
|
+
"""Mapping of each channel to the pin and site it is connected to."""
|
|
49
|
+
|
|
50
|
+
pin_or_relay_name: str
|
|
51
|
+
"""The pin or relay that is mapped to a channel."""
|
|
52
|
+
|
|
53
|
+
site: int
|
|
54
|
+
"""The site on which the pin or relay is mapped to a channel.
|
|
55
|
+
|
|
56
|
+
For system pins/relays, the site number is :any:`SITE_SYSTEM_PINS` (-1) as they
|
|
57
|
+
do not belong to a specific site.
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
channel: str
|
|
61
|
+
"""The channel to which the pin or relay is mapped on this site."""
|
|
62
|
+
|
|
63
|
+
multiplexer_resource_name: str
|
|
64
|
+
"""The multiplexer resource name used to open this session in the driver."""
|
|
65
|
+
|
|
66
|
+
multiplexer_route: str
|
|
67
|
+
"""The multiplexer route through which the pin is connected to an instrument's channel."""
|
|
68
|
+
|
|
69
|
+
@classmethod
|
|
70
|
+
def _from_grpc_v1(cls, other: session_management_service_pb2.ChannelMapping) -> ChannelMapping:
|
|
71
|
+
return ChannelMapping(
|
|
72
|
+
pin_or_relay_name=other.pin_or_relay_name,
|
|
73
|
+
site=other.site,
|
|
74
|
+
channel=other.channel,
|
|
75
|
+
multiplexer_resource_name=other.multiplexer_resource_name,
|
|
76
|
+
multiplexer_route=other.multiplexer_route,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
def _to_grpc_v1(self) -> session_management_service_pb2.ChannelMapping:
|
|
80
|
+
return session_management_service_pb2.ChannelMapping(
|
|
81
|
+
pin_or_relay_name=self.pin_or_relay_name,
|
|
82
|
+
site=self.site,
|
|
83
|
+
channel=self.channel,
|
|
84
|
+
multiplexer_resource_name=self.multiplexer_resource_name,
|
|
85
|
+
multiplexer_route=self.multiplexer_route,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class SessionInformation(NamedTuple):
|
|
90
|
+
"""Container for the session information."""
|
|
91
|
+
|
|
92
|
+
session_name: str
|
|
93
|
+
"""Session name used by the session management service and NI gRPC Device Server."""
|
|
94
|
+
|
|
95
|
+
resource_name: str
|
|
96
|
+
"""Resource name used to open this session in the driver."""
|
|
97
|
+
|
|
98
|
+
channel_list: str
|
|
99
|
+
"""Channel list used for driver initialization and measurement methods.
|
|
100
|
+
|
|
101
|
+
This field is empty for any SessionInformation returned from
|
|
102
|
+
Client.reserve_all_registered_sessions.
|
|
103
|
+
"""
|
|
104
|
+
|
|
105
|
+
instrument_type_id: str
|
|
106
|
+
"""Indicates the instrument type for this session.
|
|
107
|
+
|
|
108
|
+
Pin maps have built in instrument definitions using the instrument
|
|
109
|
+
type id constants such as `INSTRUMENT_TYPE_NI_DCPOWER`. For custom instruments, the
|
|
110
|
+
user defined instrument type id is defined in the pin map file.
|
|
111
|
+
"""
|
|
112
|
+
|
|
113
|
+
session_exists: bool
|
|
114
|
+
"""Indicates whether the session is registered with the session management service.
|
|
115
|
+
|
|
116
|
+
When calling measurements from TestStand, the test sequence's ``ProcessSetup`` callback
|
|
117
|
+
creates instrument sessions and registers them with the session management service so that
|
|
118
|
+
they can be shared between multiple measurement steps. In this case, the `session_exists`
|
|
119
|
+
attribute is ``True``, indicating that the instrument sessions were already created and any
|
|
120
|
+
one-time setup (such as creating NI-DAQmx channels or loading NI-Digital files) has been
|
|
121
|
+
performed.
|
|
122
|
+
|
|
123
|
+
When calling measurements outside of TestStand, the `session_exists` attribute is ``False``,
|
|
124
|
+
indicating that the measurement is responsible for creating the instrument sessions and
|
|
125
|
+
performing any one-time setup.
|
|
126
|
+
"""
|
|
127
|
+
|
|
128
|
+
channel_mappings: Iterable[ChannelMapping]
|
|
129
|
+
"""List of mappings from channels to pins and sites.
|
|
130
|
+
|
|
131
|
+
Each item contains a mapping for a channel in this instrument resource, in the order of the
|
|
132
|
+
channel_list. This field is empty for any SessionInformation returned from
|
|
133
|
+
Client.reserve_all_registered_sessions.
|
|
134
|
+
"""
|
|
135
|
+
|
|
136
|
+
session: object = None
|
|
137
|
+
"""The driver session object.
|
|
138
|
+
|
|
139
|
+
This field is None until the appropriate initialize_session(s) method is called.
|
|
140
|
+
"""
|
|
141
|
+
|
|
142
|
+
def _check_runtime_type(self, session_type: type) -> None:
|
|
143
|
+
if not isinstance(self.session, session_type):
|
|
144
|
+
raise TypeError(
|
|
145
|
+
f"Incorrect type for session '{self.session_name}'. "
|
|
146
|
+
f"Expected {session_type}, got {type(self.session)}."
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
def _with_session(self, session: object) -> SessionInformation:
|
|
150
|
+
if self.session is session:
|
|
151
|
+
return self
|
|
152
|
+
return self._replace(session=session)
|
|
153
|
+
|
|
154
|
+
@classmethod
|
|
155
|
+
def _from_grpc_v1(
|
|
156
|
+
cls, other: session_management_service_pb2.SessionInformation
|
|
157
|
+
) -> SessionInformation:
|
|
158
|
+
return SessionInformation(
|
|
159
|
+
session_name=other.session.name,
|
|
160
|
+
resource_name=other.resource_name,
|
|
161
|
+
channel_list=other.channel_list,
|
|
162
|
+
instrument_type_id=other.instrument_type_id,
|
|
163
|
+
session_exists=other.session_exists,
|
|
164
|
+
channel_mappings=[ChannelMapping._from_grpc_v1(m) for m in other.channel_mappings],
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
def _to_grpc_v1(
|
|
168
|
+
self,
|
|
169
|
+
) -> session_management_service_pb2.SessionInformation:
|
|
170
|
+
return session_management_service_pb2.SessionInformation(
|
|
171
|
+
session=session_pb2.Session(name=self.session_name),
|
|
172
|
+
resource_name=self.resource_name,
|
|
173
|
+
channel_list=self.channel_list,
|
|
174
|
+
instrument_type_id=self.instrument_type_id,
|
|
175
|
+
session_exists=self.session_exists,
|
|
176
|
+
channel_mappings=[m._to_grpc_v1() for m in self.channel_mappings],
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
# Python versions <3.11 do not support generic named tuples, so we use a generic
|
|
181
|
+
# protocol to return typed session information.
|
|
182
|
+
class TypedSessionInformation(Protocol, Generic[TSession_co]):
|
|
183
|
+
"""Generic version of :any:`SessionInformation` that preserves the session type.
|
|
184
|
+
|
|
185
|
+
For more details, see the corresponding documentation for :any:`SessionInformation`.
|
|
186
|
+
"""
|
|
187
|
+
|
|
188
|
+
@property
|
|
189
|
+
def session_name(self) -> str:
|
|
190
|
+
"""Session name used by the session management service and NI gRPC Device Server."""
|
|
191
|
+
...
|
|
192
|
+
|
|
193
|
+
@property
|
|
194
|
+
def resource_name(self) -> str:
|
|
195
|
+
"""Resource name used to open this session in the driver."""
|
|
196
|
+
...
|
|
197
|
+
|
|
198
|
+
@property
|
|
199
|
+
def channel_list(self) -> str:
|
|
200
|
+
"""Channel list used for driver initialization and measurement methods."""
|
|
201
|
+
...
|
|
202
|
+
|
|
203
|
+
@property
|
|
204
|
+
def instrument_type_id(self) -> str:
|
|
205
|
+
"""Indicates the instrument type for this session."""
|
|
206
|
+
...
|
|
207
|
+
|
|
208
|
+
@property
|
|
209
|
+
def session_exists(self) -> bool:
|
|
210
|
+
"""Indicates whether the session is registered with the session management service."""
|
|
211
|
+
...
|
|
212
|
+
|
|
213
|
+
@property
|
|
214
|
+
def channel_mappings(self) -> Iterable[ChannelMapping]:
|
|
215
|
+
"""List of mappings from channels to pins and sites."""
|
|
216
|
+
...
|
|
217
|
+
|
|
218
|
+
@property
|
|
219
|
+
def session(self) -> TSession_co:
|
|
220
|
+
"""The driver session object."""
|
|
221
|
+
...
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
class MultiplexerSessionInformation(NamedTuple):
|
|
225
|
+
"""Container for the multiplexer session information."""
|
|
226
|
+
|
|
227
|
+
session_name: str
|
|
228
|
+
"""Session name used by the session management service and NI gRPC Device Server."""
|
|
229
|
+
|
|
230
|
+
resource_name: str
|
|
231
|
+
"""Resource name used to open this session in the driver."""
|
|
232
|
+
|
|
233
|
+
multiplexer_type_id: str
|
|
234
|
+
"""User-defined identifier for the multiplexer type in the pin map editor."""
|
|
235
|
+
|
|
236
|
+
session_exists: bool
|
|
237
|
+
"""Indicates whether the session is registered with the session management service.
|
|
238
|
+
|
|
239
|
+
When calling measurements from TestStand, the test sequence's ``ProcessSetup`` callback
|
|
240
|
+
creates instrument sessions and registers them with the session management service so that
|
|
241
|
+
they can be shared between multiple measurement steps. In this case, the `session_exists`
|
|
242
|
+
attribute is ``True``, indicating that the instrument sessions were already created and any
|
|
243
|
+
one-time setup has been performed.
|
|
244
|
+
|
|
245
|
+
When calling measurements outside of TestStand, the `session_exists` attribute is ``False``,
|
|
246
|
+
indicating that the measurement is responsible for creating the instrument sessions and
|
|
247
|
+
performing any one-time setup.
|
|
248
|
+
"""
|
|
249
|
+
|
|
250
|
+
session: object = None
|
|
251
|
+
"""The driver session object.
|
|
252
|
+
|
|
253
|
+
This field is None until the appropriate initialize_multiplexer_session(s) method is called.
|
|
254
|
+
"""
|
|
255
|
+
|
|
256
|
+
def _check_runtime_type(self, multiplexer_session_type: type) -> None:
|
|
257
|
+
if not isinstance(self.session, multiplexer_session_type):
|
|
258
|
+
raise TypeError(
|
|
259
|
+
f"Incorrect type for multiplexer session '{self.session_name}'. "
|
|
260
|
+
f"Expected {multiplexer_session_type}, got {type(self.session)}."
|
|
261
|
+
)
|
|
262
|
+
|
|
263
|
+
def _with_session(self, session: object) -> MultiplexerSessionInformation:
|
|
264
|
+
if self.session is session:
|
|
265
|
+
return self
|
|
266
|
+
return self._replace(session=session)
|
|
267
|
+
|
|
268
|
+
@classmethod
|
|
269
|
+
def _from_grpc_v1(
|
|
270
|
+
cls, other: session_management_service_pb2.MultiplexerSessionInformation
|
|
271
|
+
) -> MultiplexerSessionInformation:
|
|
272
|
+
return MultiplexerSessionInformation(
|
|
273
|
+
session_name=other.session.name,
|
|
274
|
+
resource_name=other.resource_name,
|
|
275
|
+
multiplexer_type_id=other.multiplexer_type_id,
|
|
276
|
+
session_exists=other.session_exists,
|
|
277
|
+
)
|
|
278
|
+
|
|
279
|
+
def _to_grpc_v1(self) -> session_management_service_pb2.MultiplexerSessionInformation:
|
|
280
|
+
return session_management_service_pb2.MultiplexerSessionInformation(
|
|
281
|
+
session=session_pb2.Session(name=self.session_name),
|
|
282
|
+
resource_name=self.resource_name,
|
|
283
|
+
multiplexer_type_id=self.multiplexer_type_id,
|
|
284
|
+
session_exists=self.session_exists,
|
|
285
|
+
)
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
class TypedMultiplexerSessionInformation(Protocol, Generic[TMultiplexerSession_co]):
|
|
289
|
+
"""Generic version of :any:`MultiplexerSessionInformation` that preserves the session type.
|
|
290
|
+
|
|
291
|
+
For more details, see the corresponding documentation of :any:`MultiplexerSessionInformation`.
|
|
292
|
+
"""
|
|
293
|
+
|
|
294
|
+
@property
|
|
295
|
+
def session_name(self) -> str:
|
|
296
|
+
"""Session name used by the session management service and NI gRPC Device Server."""
|
|
297
|
+
...
|
|
298
|
+
|
|
299
|
+
@property
|
|
300
|
+
def resource_name(self) -> str:
|
|
301
|
+
"""Resource name used to open this session in the driver."""
|
|
302
|
+
...
|
|
303
|
+
|
|
304
|
+
@property
|
|
305
|
+
def multiplexer_type_id(self) -> str:
|
|
306
|
+
"""User-defined identifier for the multiplexer type in the pin map editor."""
|
|
307
|
+
...
|
|
308
|
+
|
|
309
|
+
@property
|
|
310
|
+
def session_exists(self) -> bool:
|
|
311
|
+
"""Indicates whether the session is registered with the session management service."""
|
|
312
|
+
...
|
|
313
|
+
|
|
314
|
+
@property
|
|
315
|
+
def session(self) -> TMultiplexerSession_co:
|
|
316
|
+
"""The driver session object."""
|
|
317
|
+
...
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
class Connection(NamedTuple):
|
|
321
|
+
"""Describes the connection between an instance of a pin and an instrument channel.
|
|
322
|
+
|
|
323
|
+
This object maps a pin or relay on a specific site to the corresponding
|
|
324
|
+
instrument session and channel name.
|
|
325
|
+
"""
|
|
326
|
+
|
|
327
|
+
pin_or_relay_name: str
|
|
328
|
+
"""The pin or relay name."""
|
|
329
|
+
|
|
330
|
+
site: int
|
|
331
|
+
"""The site number.
|
|
332
|
+
|
|
333
|
+
For system pins/relays, the site number is :any:`SITE_SYSTEM_PINS` (-1) as they
|
|
334
|
+
do not belong to a specific site.
|
|
335
|
+
"""
|
|
336
|
+
|
|
337
|
+
channel_name: str
|
|
338
|
+
"""The instrument channel name."""
|
|
339
|
+
|
|
340
|
+
session_info: SessionInformation
|
|
341
|
+
"""The instrument session information."""
|
|
342
|
+
|
|
343
|
+
multiplexer_resource_name: str
|
|
344
|
+
"""Resource name used to open this session in the driver."""
|
|
345
|
+
|
|
346
|
+
multiplexer_route: str
|
|
347
|
+
"""The multiplexer route through which the pin is connected to an instrument's channel."""
|
|
348
|
+
|
|
349
|
+
multiplexer_session_info: MultiplexerSessionInformation | None
|
|
350
|
+
"""The multiplexer session information."""
|
|
351
|
+
|
|
352
|
+
@property
|
|
353
|
+
def session(self) -> object:
|
|
354
|
+
"""The instrument session."""
|
|
355
|
+
return self.session_info.session
|
|
356
|
+
|
|
357
|
+
@property
|
|
358
|
+
def multiplexer_session(self) -> object:
|
|
359
|
+
"""The multiplexer session."""
|
|
360
|
+
if self.multiplexer_session_info:
|
|
361
|
+
return self.multiplexer_session_info.session
|
|
362
|
+
return None
|
|
363
|
+
|
|
364
|
+
def _check_runtime_type(self, session_type: type) -> None:
|
|
365
|
+
self.session_info._check_runtime_type(session_type)
|
|
366
|
+
|
|
367
|
+
def _check_runtime_multiplexer_type(self, multiplexer_session_type: type) -> None:
|
|
368
|
+
if self.multiplexer_session_info is not None:
|
|
369
|
+
self.multiplexer_session_info._check_runtime_type(multiplexer_session_type)
|
|
370
|
+
|
|
371
|
+
def _with_session(self, session: object) -> Connection:
|
|
372
|
+
if self.session is session:
|
|
373
|
+
return self
|
|
374
|
+
return self._replace(session_info=self.session_info._with_session(session))
|
|
375
|
+
|
|
376
|
+
def _with_multiplexer_session(self, session: object) -> Connection:
|
|
377
|
+
if self.multiplexer_session_info is None or self.multiplexer_session is session:
|
|
378
|
+
return self
|
|
379
|
+
return self._replace(
|
|
380
|
+
multiplexer_session_info=self.multiplexer_session_info._with_session(session)
|
|
381
|
+
)
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
class TypedConnection(Protocol, Generic[TSession_co]):
|
|
385
|
+
"""Generic version of :any:`Connection` that preserves the session type.
|
|
386
|
+
|
|
387
|
+
For more details, see the corresponding documentation for :any:`Connection`.
|
|
388
|
+
"""
|
|
389
|
+
|
|
390
|
+
@property
|
|
391
|
+
def pin_or_relay_name(self) -> str:
|
|
392
|
+
"""The pin or relay name."""
|
|
393
|
+
...
|
|
394
|
+
|
|
395
|
+
@property
|
|
396
|
+
def site(self) -> int:
|
|
397
|
+
"""The site number.
|
|
398
|
+
|
|
399
|
+
For system pins/relays, the site number is :any:`SITE_SYSTEM_PINS` (-1) as they
|
|
400
|
+
do not belong to a specific site.
|
|
401
|
+
"""
|
|
402
|
+
...
|
|
403
|
+
|
|
404
|
+
@property
|
|
405
|
+
def channel_name(self) -> str:
|
|
406
|
+
"""The instrument channel name."""
|
|
407
|
+
...
|
|
408
|
+
|
|
409
|
+
@property
|
|
410
|
+
def session_info(self) -> TypedSessionInformation[TSession_co]:
|
|
411
|
+
"""The instrument session information."""
|
|
412
|
+
...
|
|
413
|
+
|
|
414
|
+
@property
|
|
415
|
+
def session(self) -> TSession_co:
|
|
416
|
+
"""The instrument session."""
|
|
417
|
+
...
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
class TypedConnectionWithMultiplexer(
|
|
421
|
+
TypedConnection[TSession_co], Protocol, Generic[TSession_co, TMultiplexerSession_co]
|
|
422
|
+
):
|
|
423
|
+
"""Generic version of `Connection` that preserves the instrument and multiplexer session type.
|
|
424
|
+
|
|
425
|
+
For more details, see the corresponding documentation for `Connection`.
|
|
426
|
+
"""
|
|
427
|
+
|
|
428
|
+
@property
|
|
429
|
+
def multiplexer_resource_name(self) -> str:
|
|
430
|
+
"""Resource name used to open this session in the driver."""
|
|
431
|
+
...
|
|
432
|
+
|
|
433
|
+
@property
|
|
434
|
+
def multiplexer_type_id(self) -> str:
|
|
435
|
+
"""User-defined identifier for the multiplexer type in the pin map editor."""
|
|
436
|
+
...
|
|
437
|
+
|
|
438
|
+
@property
|
|
439
|
+
def multiplexer_route(self) -> str:
|
|
440
|
+
"""The multiplexer route through which the pin is connected to an instrument's channel."""
|
|
441
|
+
...
|
|
442
|
+
|
|
443
|
+
@property
|
|
444
|
+
def multiplexer_session_info(
|
|
445
|
+
self,
|
|
446
|
+
) -> TypedMultiplexerSessionInformation[TMultiplexerSession_co]:
|
|
447
|
+
"""The multiplexer session information."""
|
|
448
|
+
...
|
|
449
|
+
|
|
450
|
+
@property
|
|
451
|
+
def multiplexer_session(self) -> TMultiplexerSession_co:
|
|
452
|
+
"""The multiplexer session."""
|
|
453
|
+
...
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
class SessionInitializationBehavior(IntEnum):
|
|
457
|
+
"""Specifies whether to initialize a new session or attach to an existing session."""
|
|
458
|
+
|
|
459
|
+
AUTO = 0
|
|
460
|
+
"""
|
|
461
|
+
The NI gRPC Device Server will attach to an existing session with the
|
|
462
|
+
specified name if it exists, otherwise the server will initialize a new
|
|
463
|
+
session.
|
|
464
|
+
|
|
465
|
+
Note: When using the Session as a context manager and the context exits, the
|
|
466
|
+
behavior depends on what happened when the constructor was called. If it
|
|
467
|
+
resulted in a new session being initialized on the NI gRPC Device Server,
|
|
468
|
+
then it will automatically close the server session. If it instead attached
|
|
469
|
+
to an existing session, then it will detach from the server session and
|
|
470
|
+
leave it open.
|
|
471
|
+
"""
|
|
472
|
+
|
|
473
|
+
INITIALIZE_SERVER_SESSION = 1
|
|
474
|
+
"""
|
|
475
|
+
Initialize a new session with the specified name.
|
|
476
|
+
|
|
477
|
+
Note: When using the Session as a context manager and the context exits, it
|
|
478
|
+
will automatically close the server session.
|
|
479
|
+
"""
|
|
480
|
+
|
|
481
|
+
ATTACH_TO_SERVER_SESSION = 2
|
|
482
|
+
"""
|
|
483
|
+
Attach to an existing session with the specified name.
|
|
484
|
+
|
|
485
|
+
Note: When using the Session as a context manager and the context exits, it
|
|
486
|
+
will detach from the server session and leave it open.
|
|
487
|
+
"""
|
|
488
|
+
|
|
489
|
+
INITIALIZE_SESSION_THEN_DETACH = 3
|
|
490
|
+
"""
|
|
491
|
+
Initialize a new session.
|
|
492
|
+
|
|
493
|
+
When exiting the context manager, detach instead of closing.
|
|
494
|
+
|
|
495
|
+
Note: This initialization behavior is intended for TestStand code modules used in
|
|
496
|
+
``Setup`` steps or ``ProcessSetup`` callback sequences.
|
|
497
|
+
"""
|
|
498
|
+
|
|
499
|
+
ATTACH_TO_SESSION_THEN_CLOSE = 4
|
|
500
|
+
"""
|
|
501
|
+
Attach to an existing session.
|
|
502
|
+
|
|
503
|
+
When exiting the context manager, automatically close the server session.
|
|
504
|
+
|
|
505
|
+
Note: This initialization behavior is intended for TestStand code modules used in
|
|
506
|
+
``Cleanup`` steps or ``ProcessCleanup`` callback sequences.
|
|
507
|
+
"""
|
|
File without changes
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: ni.measurementlink.sessionmanagement.v1.client
|
|
3
|
+
Version: 0.1.0.dev0
|
|
4
|
+
Summary: Client gRPC APIs for the session management service
|
|
5
|
+
License: MIT
|
|
6
|
+
Keywords: ni-apis,sessionmanagement
|
|
7
|
+
Author: NI
|
|
8
|
+
Author-email: opensource@ni.com
|
|
9
|
+
Maintainer: Brad Keryan
|
|
10
|
+
Maintainer-email: brad.keryan@emerson.com
|
|
11
|
+
Requires-Python: >=3.9,<4.0
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Manufacturing
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
18
|
+
Classifier: Operating System :: POSIX
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
25
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
26
|
+
Provides-Extra: drivers
|
|
27
|
+
Provides-Extra: nidaqmx
|
|
28
|
+
Provides-Extra: nidcpower
|
|
29
|
+
Provides-Extra: nidigital
|
|
30
|
+
Provides-Extra: nidmm
|
|
31
|
+
Provides-Extra: nifgen
|
|
32
|
+
Provides-Extra: niscope
|
|
33
|
+
Provides-Extra: niswitch
|
|
34
|
+
Requires-Dist: deprecation (>=2.1)
|
|
35
|
+
Requires-Dist: ni-grpc-extensions (>=0.1.0.dev0)
|
|
36
|
+
Requires-Dist: ni-grpcdevice-v1-proto (>=0.1.0.dev0)
|
|
37
|
+
Requires-Dist: ni-measurementlink-discovery-v1-client (>=0.1.0.dev0)
|
|
38
|
+
Requires-Dist: ni-measurementlink-pinmap-v1-proto (>=0.1.0.dev0)
|
|
39
|
+
Requires-Dist: ni-measurementlink-proto (>=0.1.0.dev0)
|
|
40
|
+
Requires-Dist: ni-measurementlink-sessionmanagement-v1-proto (>=0.1.0.dev0)
|
|
41
|
+
Requires-Dist: nidaqmx[grpc] (>=0.8.0) ; extra == "drivers" or extra == "nidaqmx"
|
|
42
|
+
Requires-Dist: nidcpower[grpc] (>=1.4.4) ; extra == "drivers" or extra == "nidcpower"
|
|
43
|
+
Requires-Dist: nidigital[grpc] (>=1.4.4) ; extra == "drivers" or extra == "nidigital"
|
|
44
|
+
Requires-Dist: nidmm[grpc] (>=1.4.4) ; extra == "drivers" or extra == "nidmm"
|
|
45
|
+
Requires-Dist: nifgen[grpc] (>=1.4.4) ; extra == "drivers" or extra == "nifgen"
|
|
46
|
+
Requires-Dist: niscope[grpc] (>=1.4.4) ; extra == "drivers" or extra == "niscope"
|
|
47
|
+
Requires-Dist: niswitch[grpc] (>=1.4.4) ; extra == "drivers" or extra == "niswitch"
|
|
48
|
+
Requires-Dist: protobuf (>=4.21)
|
|
49
|
+
Requires-Dist: python-decouple (>=3.8)
|
|
50
|
+
Requires-Dist: pywin32 (>=303) ; sys_platform == "win32"
|
|
51
|
+
Requires-Dist: traceloggingdynamic (>=1.0) ; sys_platform == "win32"
|
|
52
|
+
Project-URL: Repository, https://github.com/ni/ni-apis-python
|
|
53
|
+
Description-Content-Type: text/markdown
|
|
54
|
+
|
|
55
|
+
# Table of Contents
|
|
56
|
+
|
|
57
|
+
- [Table of Contents](#table-of-contents)
|
|
58
|
+
- [About](#about)
|
|
59
|
+
- [Operating System Support](#operating-system-support)
|
|
60
|
+
- [Python Version Support](#python-version-support)
|
|
61
|
+
|
|
62
|
+
# About
|
|
63
|
+
|
|
64
|
+
`ni.measurementlink.sessionmanagement.v1.client` is a Python package that provides a client API for
|
|
65
|
+
the [ni.measurementlink.sessionmanagement.v1 package](https://github.com/ni/ni-apis/tree/main/ni/measurementlink/sessionmanagement/v1).
|
|
66
|
+
|
|
67
|
+
NI created and supports this package.
|
|
68
|
+
|
|
69
|
+
## Operating System Support
|
|
70
|
+
|
|
71
|
+
`ni.measurementlink.sessionmanagement.v1.client` supports Windows and Linux operating systems.
|
|
72
|
+
|
|
73
|
+
## Python Version Support
|
|
74
|
+
|
|
75
|
+
`ni.measurementlink.sessionmanagement.v1.client` supports CPython 3.9+.
|
|
76
|
+
|
|
77
|
+
## Installation
|
|
78
|
+
|
|
79
|
+
You can directly install the `ni.measurementlink.sessionmanagement.v1.client` package using `pip` or by listing it as a
|
|
80
|
+
dependency in your project's `pyproject.toml` file.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
ni/measurementlink/sessionmanagement/v1/client/__init__.py,sha256=cUrRh3Be6kKh9KVZ5xeZgxzR-dMcJvIc5Xgq5tf3Xwg,3141
|
|
2
|
+
ni/measurementlink/sessionmanagement/v1/client/_client.py,sha256=dG3eTIo8CKOWz_LgxhYZD1rIbhFH1YKfOSXBcJX883A,17420
|
|
3
|
+
ni/measurementlink/sessionmanagement/v1/client/_constants.py,sha256=rGRguoyy-ovtkP4jMtVoab4WFdj5WOWn65rkV-1DqkM,1243
|
|
4
|
+
ni/measurementlink/sessionmanagement/v1/client/_drivers/__init__.py,sha256=7p6Ap81Hyfg_qIMZPPeKuQXf3eMhgpKHBwsFbjWZvXc,1707
|
|
5
|
+
ni/measurementlink/sessionmanagement/v1/client/_drivers/_configuration.py,sha256=ZROS5pKaqyDKf_tTlyxcb6MM2tACxmcUBqp-tTI74u4,3863
|
|
6
|
+
ni/measurementlink/sessionmanagement/v1/client/_drivers/_dotenvpath.py,sha256=dKGHIb_M60z8FkNN0_3Gl2Xk_GoufnXZy3McmjU8d_c,2347
|
|
7
|
+
ni/measurementlink/sessionmanagement/v1/client/_drivers/_grpcdevice.py,sha256=zMcUJe1WHSqNd09BIkNj6pcdC5jRdRYA-4fo4jmvq5k,3798
|
|
8
|
+
ni/measurementlink/sessionmanagement/v1/client/_drivers/_nidaqmx.py,sha256=Q1U-yYvc8bSh4EKZUvVqqXi4qgja6lACgcYqWGY-aeg,2230
|
|
9
|
+
ni/measurementlink/sessionmanagement/v1/client/_drivers/_nidcpower.py,sha256=VmyqPfViOxereTxkTNc25ZwLxgxJflDTY08AZfrIXEw,2606
|
|
10
|
+
ni/measurementlink/sessionmanagement/v1/client/_drivers/_nidigital.py,sha256=6rM__OqxF-y4KBFT2W8hSLSfzIJ3vnTqwprscB15HWY,2691
|
|
11
|
+
ni/measurementlink/sessionmanagement/v1/client/_drivers/_nidmm.py,sha256=wJJzIZB2Xx6QdQlkRj3ZyLdHCWC1DDlG379674cv3io,2643
|
|
12
|
+
ni/measurementlink/sessionmanagement/v1/client/_drivers/_nifgen.py,sha256=zauQkkgTur8Ww0vhWPvwEi2zC9kTcmu-wqlh-DMAP2s,2605
|
|
13
|
+
ni/measurementlink/sessionmanagement/v1/client/_drivers/_niscope.py,sha256=V0EVuSj08DaeUAQ3uB7GEAWZM19Si49wuPA-PW6pKDQ,2667
|
|
14
|
+
ni/measurementlink/sessionmanagement/v1/client/_drivers/_niswitch.py,sha256=TXE--U5xIlyumBMkqRx8S6qDu6OI1-BH8gRosVgT7t0,3394
|
|
15
|
+
ni/measurementlink/sessionmanagement/v1/client/_reservation.py,sha256=vb4hvuclxNacS9u7zrT-zNf4_8NtZp7DE0x80O2ulMM,110007
|
|
16
|
+
ni/measurementlink/sessionmanagement/v1/client/_types.py,sha256=Cg2TUtipPWujxGJn5dlewxUsWs0kiavEELpxtis7Ol0,17892
|
|
17
|
+
ni/measurementlink/sessionmanagement/v1/client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
+
ni_measurementlink_sessionmanagement_v1_client-0.1.0.dev0.dist-info/METADATA,sha256=KsPHM9cCpowF_yxaII2C9I78IgB4pHTIDNf6pBa6JoU,3411
|
|
19
|
+
ni_measurementlink_sessionmanagement_v1_client-0.1.0.dev0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
20
|
+
ni_measurementlink_sessionmanagement_v1_client-0.1.0.dev0.dist-info/RECORD,,
|