zaber-motion 7.9.1__py3-none-win_amd64.whl → 7.11.0__py3-none-win_amd64.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.
- zaber_motion/__init__.py +2 -0
- zaber_motion/ascii/all_axes.py +1 -1
- zaber_motion/ascii/axis.py +5 -5
- zaber_motion/ascii/axis_group.py +1 -1
- zaber_motion/ascii/axis_settings.py +1 -1
- zaber_motion/ascii/connection.py +1 -1
- zaber_motion/ascii/device.py +11 -11
- zaber_motion/ascii/device_io.py +1 -1
- zaber_motion/ascii/device_settings.py +1 -1
- zaber_motion/ascii/lockstep.py +2 -2
- zaber_motion/ascii/oscilloscope.py +1 -1
- zaber_motion/ascii/oscilloscope_data.py +1 -1
- zaber_motion/ascii/pvt.py +1 -1
- zaber_motion/ascii/pvt_buffer.py +2 -2
- zaber_motion/ascii/pvt_io.py +2 -2
- zaber_motion/ascii/pvt_sequence.py +7 -5
- zaber_motion/ascii/servo_tuner.py +1 -1
- zaber_motion/ascii/storage.py +2 -2
- zaber_motion/ascii/stream.py +3 -3
- zaber_motion/ascii/stream_buffer.py +2 -2
- zaber_motion/ascii/stream_io.py +2 -2
- zaber_motion/ascii/streams.py +1 -1
- zaber_motion/ascii/transport.py +1 -1
- zaber_motion/ascii/trigger.py +2 -2
- zaber_motion/ascii/triggers.py +1 -1
- zaber_motion/ascii/warnings.py +2 -2
- zaber_motion/binary/connection.py +1 -1
- zaber_motion/binary/device.py +3 -3
- zaber_motion/binary/device_settings.py +1 -1
- zaber_motion/dto/__init__.py +1 -0
- zaber_motion/dto/device_db_source.py +66 -0
- zaber_motion/dto/exceptions/__init__.py +1 -0
- zaber_motion/dto/exceptions/device_db_failed_exception_data.py +24 -1
- zaber_motion/dto/exceptions/device_db_inner_error.py +85 -0
- zaber_motion/dto/requests/__init__.py +1 -0
- zaber_motion/dto/requests/set_device_db_layered_sources_request.py +56 -0
- zaber_motion/dto/requests/set_device_db_source_request.py +6 -0
- zaber_motion/exceptions/__init__.py +1 -0
- zaber_motion/gcode/offline_translator.py +1 -1
- zaber_motion/gcode/translator.py +1 -1
- zaber_motion/library.py +18 -1
- zaber_motion/microscopy/autofocus.py +47 -3
- zaber_motion/microscopy/camera_trigger.py +2 -2
- zaber_motion/microscopy/filter_changer.py +1 -1
- zaber_motion/microscopy/illuminator.py +2 -2
- zaber_motion/microscopy/illuminator_channel.py +6 -6
- zaber_motion/microscopy/microscope.py +14 -11
- zaber_motion/microscopy/objective_changer.py +2 -2
- zaber_motion/microscopy/wdi_autofocus_provider.py +1 -1
- zaber_motion/product/process.py +6 -6
- zaber_motion/product/process_controller.py +1 -1
- zaber_motion/version.py +1 -1
- {zaber_motion-7.9.1.dist-info → zaber_motion-7.11.0.dist-info}/METADATA +1 -1
- {zaber_motion-7.9.1.dist-info → zaber_motion-7.11.0.dist-info}/RECORD +58 -55
- zaber_motion_bindings/zaber-motion-core-windows-amd64.dll +0 -0
- {zaber_motion-7.9.1.dist-info → zaber_motion-7.11.0.dist-info}/LICENSE.txt +0 -0
- {zaber_motion-7.9.1.dist-info → zaber_motion-7.11.0.dist-info}/WHEEL +0 -0
- {zaber_motion-7.9.1.dist-info → zaber_motion-7.11.0.dist-info}/top_level.txt +0 -0
zaber_motion/__init__.py
CHANGED
|
@@ -9,6 +9,7 @@ from .tools import Tools as Tools
|
|
|
9
9
|
from .unit_table import UnitTable as UnitTable
|
|
10
10
|
from .dto.axis_address import AxisAddress as AxisAddress
|
|
11
11
|
from .dto.channel_address import ChannelAddress as ChannelAddress
|
|
12
|
+
from .dto.device_db_source import DeviceDbSource as DeviceDbSource
|
|
12
13
|
from .dto.device_db_source_type import DeviceDbSourceType as DeviceDbSourceType
|
|
13
14
|
from .dto.firmware_version import FirmwareVersion as FirmwareVersion
|
|
14
15
|
from .dto.log_output_mode import LogOutputMode as LogOutputMode
|
|
@@ -83,6 +84,7 @@ from .dto.exceptions.command_failed_exception_data import CommandFailedException
|
|
|
83
84
|
from .dto.exceptions.command_too_long_exception_data import CommandTooLongExceptionData as CommandTooLongExceptionData
|
|
84
85
|
from .dto.exceptions.device_address_conflict_exception_data import DeviceAddressConflictExceptionData as DeviceAddressConflictExceptionData
|
|
85
86
|
from .dto.exceptions.device_db_failed_exception_data import DeviceDbFailedExceptionData as DeviceDbFailedExceptionData
|
|
87
|
+
from .dto.exceptions.device_db_inner_error import DeviceDbInnerError as DeviceDbInnerError
|
|
86
88
|
from .dto.exceptions.g_code_execution_exception_data import GCodeExecutionExceptionData as GCodeExecutionExceptionData
|
|
87
89
|
from .dto.exceptions.g_code_syntax_exception_data import GCodeSyntaxExceptionData as GCodeSyntaxExceptionData
|
|
88
90
|
from .dto.exceptions.invalid_packet_exception_data import InvalidPacketExceptionData as InvalidPacketExceptionData
|
zaber_motion/ascii/all_axes.py
CHANGED
zaber_motion/ascii/axis.py
CHANGED
|
@@ -112,11 +112,11 @@ class Axis:
|
|
|
112
112
|
return self.__retrieve_label()
|
|
113
113
|
|
|
114
114
|
def __init__(self, device: 'Device', axis_number: int):
|
|
115
|
-
self._device = device
|
|
116
|
-
self._axis_number = axis_number
|
|
117
|
-
self._settings = AxisSettings(self)
|
|
118
|
-
self._storage = AxisStorage(self)
|
|
119
|
-
self._warnings = Warnings(device, axis_number)
|
|
115
|
+
self._device: 'Device' = device
|
|
116
|
+
self._axis_number: int = axis_number
|
|
117
|
+
self._settings: AxisSettings = AxisSettings(self)
|
|
118
|
+
self._storage: AxisStorage = AxisStorage(self)
|
|
119
|
+
self._warnings: Warnings = Warnings(device, axis_number)
|
|
120
120
|
|
|
121
121
|
def home(
|
|
122
122
|
self,
|
zaber_motion/ascii/axis_group.py
CHANGED
zaber_motion/ascii/connection.py
CHANGED
zaber_motion/ascii/device.py
CHANGED
|
@@ -180,17 +180,17 @@ class Device:
|
|
|
180
180
|
return self._pvt
|
|
181
181
|
|
|
182
182
|
def __init__(self, connection: 'Connection', device_address: int):
|
|
183
|
-
self._connection = connection
|
|
184
|
-
self._device_address = device_address
|
|
185
|
-
self._settings = DeviceSettings(self)
|
|
186
|
-
self._storage = DeviceStorage(self)
|
|
187
|
-
self._io = DeviceIO(self)
|
|
188
|
-
self._all_axes = AllAxes(self)
|
|
189
|
-
self._warnings = Warnings(self, 0)
|
|
190
|
-
self._oscilloscope = Oscilloscope(self)
|
|
191
|
-
self._triggers = Triggers(self)
|
|
192
|
-
self._streams = Streams(self)
|
|
193
|
-
self._pvt = Pvt(self)
|
|
183
|
+
self._connection: 'Connection' = connection
|
|
184
|
+
self._device_address: int = device_address
|
|
185
|
+
self._settings: DeviceSettings = DeviceSettings(self)
|
|
186
|
+
self._storage: DeviceStorage = DeviceStorage(self)
|
|
187
|
+
self._io: DeviceIO = DeviceIO(self)
|
|
188
|
+
self._all_axes: AllAxes = AllAxes(self)
|
|
189
|
+
self._warnings: Warnings = Warnings(self, 0)
|
|
190
|
+
self._oscilloscope: Oscilloscope = Oscilloscope(self)
|
|
191
|
+
self._triggers: Triggers = Triggers(self)
|
|
192
|
+
self._streams: Streams = Streams(self)
|
|
193
|
+
self._pvt: Pvt = Pvt(self)
|
|
194
194
|
|
|
195
195
|
def identify(
|
|
196
196
|
self,
|
zaber_motion/ascii/device_io.py
CHANGED
zaber_motion/ascii/lockstep.py
CHANGED
|
@@ -32,8 +32,8 @@ class Lockstep:
|
|
|
32
32
|
return self._lockstep_group_id
|
|
33
33
|
|
|
34
34
|
def __init__(self, device: 'Device', lockstep_group_id: int):
|
|
35
|
-
self._device = device
|
|
36
|
-
self._lockstep_group_id = lockstep_group_id
|
|
35
|
+
self._device: 'Device' = device
|
|
36
|
+
self._lockstep_group_id: int = lockstep_group_id
|
|
37
37
|
|
|
38
38
|
def enable(
|
|
39
39
|
self,
|
zaber_motion/ascii/pvt.py
CHANGED
zaber_motion/ascii/pvt_buffer.py
CHANGED
|
@@ -29,8 +29,8 @@ class PvtBuffer:
|
|
|
29
29
|
return self._buffer_id
|
|
30
30
|
|
|
31
31
|
def __init__(self, device: 'Device', buffer_id: int):
|
|
32
|
-
self._device = device
|
|
33
|
-
self._buffer_id = buffer_id
|
|
32
|
+
self._device: 'Device' = device
|
|
33
|
+
self._buffer_id: int = buffer_id
|
|
34
34
|
|
|
35
35
|
def get_content(
|
|
36
36
|
self
|
zaber_motion/ascii/pvt_io.py
CHANGED
|
@@ -66,9 +66,9 @@ class PvtSequence:
|
|
|
66
66
|
return self._io
|
|
67
67
|
|
|
68
68
|
def __init__(self, device: 'Device', pvt_id: int):
|
|
69
|
-
self._device = device
|
|
70
|
-
self._pvt_id = pvt_id
|
|
71
|
-
self._io = PvtIo(device, pvt_id)
|
|
69
|
+
self._device: 'Device' = device
|
|
70
|
+
self._pvt_id: int = pvt_id
|
|
71
|
+
self._io: PvtIo = PvtIo(device, pvt_id)
|
|
72
72
|
|
|
73
73
|
def setup_live_composite(
|
|
74
74
|
self,
|
|
@@ -1144,11 +1144,12 @@ class PvtSequence:
|
|
|
1144
1144
|
|
|
1145
1145
|
Units must be wrapped in parens or square braces: ie. (µm/s), [µm/s].
|
|
1146
1146
|
Additionally, native units are the default if no units are specified.
|
|
1147
|
+
Time values default to milliseconds if no units are provided.
|
|
1147
1148
|
If no header is included, then column order is assumed to be "T,P1,V1,P2,V2,...".
|
|
1148
1149
|
In this case the number of columns must be odd.
|
|
1149
1150
|
|
|
1150
1151
|
Args:
|
|
1151
|
-
path: The path
|
|
1152
|
+
path: The path to the csv file to load.
|
|
1152
1153
|
|
|
1153
1154
|
Returns:
|
|
1154
1155
|
The PVT csv data loaded from the file.
|
|
@@ -1183,11 +1184,12 @@ class PvtSequence:
|
|
|
1183
1184
|
|
|
1184
1185
|
Units must be wrapped in parens or square braces: ie. (µm/s), [µm/s].
|
|
1185
1186
|
Additionally, native units are the default if no units are specified.
|
|
1187
|
+
Time values default to milliseconds if no units are provided.
|
|
1186
1188
|
If no header is included, then column order is assumed to be "T,P1,V1,P2,V2,...".
|
|
1187
1189
|
In this case the number of columns must be odd.
|
|
1188
1190
|
|
|
1189
1191
|
Args:
|
|
1190
|
-
path: The path
|
|
1192
|
+
path: The path to the csv file to load.
|
|
1191
1193
|
|
|
1192
1194
|
Returns:
|
|
1193
1195
|
The PVT csv data loaded from the file.
|
zaber_motion/ascii/storage.py
CHANGED
|
@@ -18,7 +18,7 @@ class AxisStorage:
|
|
|
18
18
|
"""
|
|
19
19
|
|
|
20
20
|
def __init__(self, axis: 'Axis'):
|
|
21
|
-
self._axis = axis
|
|
21
|
+
self._axis: 'Axis' = axis
|
|
22
22
|
|
|
23
23
|
def set_string(
|
|
24
24
|
self,
|
|
@@ -474,7 +474,7 @@ class DeviceStorage:
|
|
|
474
474
|
"""
|
|
475
475
|
|
|
476
476
|
def __init__(self, device: 'Device'):
|
|
477
|
-
self._device = device
|
|
477
|
+
self._device: 'Device' = device
|
|
478
478
|
|
|
479
479
|
def set_string(
|
|
480
480
|
self,
|
zaber_motion/ascii/stream.py
CHANGED
|
@@ -61,9 +61,9 @@ class Stream:
|
|
|
61
61
|
return self._io
|
|
62
62
|
|
|
63
63
|
def __init__(self, device: 'Device', stream_id: int):
|
|
64
|
-
self._device = device
|
|
65
|
-
self._stream_id = stream_id
|
|
66
|
-
self._io = StreamIo(device, stream_id)
|
|
64
|
+
self._device: 'Device' = device
|
|
65
|
+
self._stream_id: int = stream_id
|
|
66
|
+
self._io: StreamIo = StreamIo(device, stream_id)
|
|
67
67
|
|
|
68
68
|
def setup_live_composite(
|
|
69
69
|
self,
|
|
@@ -29,8 +29,8 @@ class StreamBuffer:
|
|
|
29
29
|
return self._buffer_id
|
|
30
30
|
|
|
31
31
|
def __init__(self, device: 'Device', buffer_id: int):
|
|
32
|
-
self._device = device
|
|
33
|
-
self._buffer_id = buffer_id
|
|
32
|
+
self._device: 'Device' = device
|
|
33
|
+
self._buffer_id: int = buffer_id
|
|
34
34
|
|
|
35
35
|
def get_content(
|
|
36
36
|
self
|
zaber_motion/ascii/stream_io.py
CHANGED
zaber_motion/ascii/streams.py
CHANGED
zaber_motion/ascii/transport.py
CHANGED
zaber_motion/ascii/trigger.py
CHANGED
|
@@ -38,8 +38,8 @@ class Trigger:
|
|
|
38
38
|
return self._trigger_number
|
|
39
39
|
|
|
40
40
|
def __init__(self, device: 'Device', trigger_number: int):
|
|
41
|
-
self._device = device
|
|
42
|
-
self._trigger_number = trigger_number
|
|
41
|
+
self._device: 'Device' = device
|
|
42
|
+
self._trigger_number: int = trigger_number
|
|
43
43
|
|
|
44
44
|
def enable(
|
|
45
45
|
self,
|
zaber_motion/ascii/triggers.py
CHANGED
zaber_motion/ascii/warnings.py
CHANGED
zaber_motion/binary/device.py
CHANGED
|
@@ -124,9 +124,9 @@ class Device:
|
|
|
124
124
|
return self.identity.device_type
|
|
125
125
|
|
|
126
126
|
def __init__(self, connection: 'Connection', device_address: int):
|
|
127
|
-
self._connection = connection
|
|
128
|
-
self._settings = DeviceSettings(self)
|
|
129
|
-
self._device_address = device_address
|
|
127
|
+
self._connection: 'Connection' = connection
|
|
128
|
+
self._settings: DeviceSettings = DeviceSettings(self)
|
|
129
|
+
self._device_address: int = device_address
|
|
130
130
|
|
|
131
131
|
def generic_command(
|
|
132
132
|
self,
|
zaber_motion/dto/__init__.py
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
# pylint: disable=line-too-long
|
|
3
3
|
from .axis_address import AxisAddress as AxisAddress
|
|
4
4
|
from .channel_address import ChannelAddress as ChannelAddress
|
|
5
|
+
from .device_db_source import DeviceDbSource as DeviceDbSource
|
|
5
6
|
from .device_db_source_type import DeviceDbSourceType as DeviceDbSourceType
|
|
6
7
|
from .firmware_version import FirmwareVersion as FirmwareVersion
|
|
7
8
|
from .log_output_mode import LogOutputMode as LogOutputMode
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# This file is generated. Do not modify by hand.
|
|
2
|
+
# pylint: disable=line-too-long, unused-argument, f-string-without-interpolation, too-many-branches, too-many-statements, unnecessary-pass
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import Any, Dict, Optional
|
|
5
|
+
import zaber_bson
|
|
6
|
+
from .device_db_source_type import DeviceDbSourceType
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass
|
|
10
|
+
class DeviceDbSource:
|
|
11
|
+
"""
|
|
12
|
+
A source that device information can be retrieved from.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
source_type: DeviceDbSourceType
|
|
16
|
+
"""
|
|
17
|
+
Whether the source is a web service or a local DB file.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
url_or_file_path: Optional[str] = None
|
|
21
|
+
"""
|
|
22
|
+
The URL of the web service or path to the local DB file.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
@staticmethod
|
|
26
|
+
def zero_values() -> 'DeviceDbSource':
|
|
27
|
+
return DeviceDbSource(
|
|
28
|
+
source_type=next(first for first in DeviceDbSourceType),
|
|
29
|
+
url_or_file_path=None,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
@staticmethod
|
|
33
|
+
def from_binary(data_bytes: bytes) -> 'DeviceDbSource':
|
|
34
|
+
"""" Deserialize a binary representation of this class. """
|
|
35
|
+
data = zaber_bson.loads(data_bytes) # type: Dict[str, Any]
|
|
36
|
+
return DeviceDbSource.from_dict(data)
|
|
37
|
+
|
|
38
|
+
def to_binary(self) -> bytes:
|
|
39
|
+
"""" Serialize this class to a binary representation. """
|
|
40
|
+
self.validate()
|
|
41
|
+
return zaber_bson.dumps(self.to_dict()) # type: ignore
|
|
42
|
+
|
|
43
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
44
|
+
return {
|
|
45
|
+
'sourceType': self.source_type.value,
|
|
46
|
+
'urlOrFilePath': str(self.url_or_file_path) if self.url_or_file_path is not None else None,
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@staticmethod
|
|
50
|
+
def from_dict(data: Dict[str, Any]) -> 'DeviceDbSource':
|
|
51
|
+
return DeviceDbSource(
|
|
52
|
+
source_type=DeviceDbSourceType(data.get('sourceType')), # type: ignore
|
|
53
|
+
url_or_file_path=data.get('urlOrFilePath'), # type: ignore
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
def validate(self) -> None:
|
|
57
|
+
"""" Validates the properties of the instance. """
|
|
58
|
+
if self.source_type is None:
|
|
59
|
+
raise ValueError(f'Property "SourceType" of "DeviceDbSource" is None.')
|
|
60
|
+
|
|
61
|
+
if not isinstance(self.source_type, DeviceDbSourceType):
|
|
62
|
+
raise ValueError(f'Property "SourceType" of "DeviceDbSource" is not an instance of "DeviceDbSourceType".')
|
|
63
|
+
|
|
64
|
+
if self.url_or_file_path is not None:
|
|
65
|
+
if not isinstance(self.url_or_file_path, str):
|
|
66
|
+
raise ValueError(f'Property "UrlOrFilePath" of "DeviceDbSource" is not a string.')
|
|
@@ -5,6 +5,7 @@ from .command_failed_exception_data import CommandFailedExceptionData as Command
|
|
|
5
5
|
from .command_too_long_exception_data import CommandTooLongExceptionData as CommandTooLongExceptionData
|
|
6
6
|
from .device_address_conflict_exception_data import DeviceAddressConflictExceptionData as DeviceAddressConflictExceptionData
|
|
7
7
|
from .device_db_failed_exception_data import DeviceDbFailedExceptionData as DeviceDbFailedExceptionData
|
|
8
|
+
from .device_db_inner_error import DeviceDbInnerError as DeviceDbInnerError
|
|
8
9
|
from .g_code_execution_exception_data import GCodeExecutionExceptionData as GCodeExecutionExceptionData
|
|
9
10
|
from .g_code_syntax_exception_data import GCodeSyntaxExceptionData as GCodeSyntaxExceptionData
|
|
10
11
|
from .invalid_packet_exception_data import InvalidPacketExceptionData as InvalidPacketExceptionData
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# This file is generated. Do not modify by hand.
|
|
2
2
|
# pylint: disable=line-too-long, unused-argument, f-string-without-interpolation, too-many-branches, too-many-statements, unnecessary-pass
|
|
3
3
|
from dataclasses import dataclass
|
|
4
|
-
from typing import Any, Dict
|
|
4
|
+
from typing import Any, Dict, List
|
|
5
|
+
from collections.abc import Iterable
|
|
5
6
|
import zaber_bson
|
|
7
|
+
from .device_db_inner_error import DeviceDbInnerError
|
|
6
8
|
|
|
7
9
|
|
|
8
10
|
@dataclass
|
|
@@ -16,10 +18,16 @@ class DeviceDbFailedExceptionData:
|
|
|
16
18
|
Code describing type of the error.
|
|
17
19
|
"""
|
|
18
20
|
|
|
21
|
+
inner_errors: List[DeviceDbInnerError]
|
|
22
|
+
"""
|
|
23
|
+
A list of errors that occurred while trying to access information from the device database.
|
|
24
|
+
"""
|
|
25
|
+
|
|
19
26
|
@staticmethod
|
|
20
27
|
def zero_values() -> 'DeviceDbFailedExceptionData':
|
|
21
28
|
return DeviceDbFailedExceptionData(
|
|
22
29
|
code="",
|
|
30
|
+
inner_errors=[],
|
|
23
31
|
)
|
|
24
32
|
|
|
25
33
|
@staticmethod
|
|
@@ -36,12 +44,14 @@ class DeviceDbFailedExceptionData:
|
|
|
36
44
|
def to_dict(self) -> Dict[str, Any]:
|
|
37
45
|
return {
|
|
38
46
|
'code': str(self.code or ''),
|
|
47
|
+
'innerErrors': [item.to_dict() for item in self.inner_errors] if self.inner_errors is not None else [],
|
|
39
48
|
}
|
|
40
49
|
|
|
41
50
|
@staticmethod
|
|
42
51
|
def from_dict(data: Dict[str, Any]) -> 'DeviceDbFailedExceptionData':
|
|
43
52
|
return DeviceDbFailedExceptionData(
|
|
44
53
|
code=data.get('code'), # type: ignore
|
|
54
|
+
inner_errors=[DeviceDbInnerError.from_dict(item) for item in data.get('innerErrors')], # type: ignore
|
|
45
55
|
)
|
|
46
56
|
|
|
47
57
|
def validate(self) -> None:
|
|
@@ -49,3 +59,16 @@ class DeviceDbFailedExceptionData:
|
|
|
49
59
|
if self.code is not None:
|
|
50
60
|
if not isinstance(self.code, str):
|
|
51
61
|
raise ValueError(f'Property "Code" of "DeviceDbFailedExceptionData" is not a string.')
|
|
62
|
+
|
|
63
|
+
if self.inner_errors is not None:
|
|
64
|
+
if not isinstance(self.inner_errors, Iterable):
|
|
65
|
+
raise ValueError('Property "InnerErrors" of "DeviceDbFailedExceptionData" is not iterable.')
|
|
66
|
+
|
|
67
|
+
for i, inner_errors_item in enumerate(self.inner_errors):
|
|
68
|
+
if inner_errors_item is None:
|
|
69
|
+
raise ValueError(f'Item {i} in property "InnerErrors" of "DeviceDbFailedExceptionData" is None.')
|
|
70
|
+
|
|
71
|
+
if not isinstance(inner_errors_item, DeviceDbInnerError):
|
|
72
|
+
raise ValueError(f'Item {i} in property "InnerErrors" of "DeviceDbFailedExceptionData" is not an instance of "DeviceDbInnerError".')
|
|
73
|
+
|
|
74
|
+
inner_errors_item.validate()
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# This file is generated. Do not modify by hand.
|
|
2
|
+
# pylint: disable=line-too-long, unused-argument, f-string-without-interpolation, too-many-branches, too-many-statements, unnecessary-pass
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import Any, Dict, List
|
|
5
|
+
from collections.abc import Iterable
|
|
6
|
+
import zaber_bson
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass
|
|
10
|
+
class DeviceDbInnerError:
|
|
11
|
+
"""
|
|
12
|
+
One of the errors that occurred while trying to access information from the device database.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
code: str
|
|
16
|
+
"""
|
|
17
|
+
Code describing type of the error.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
message: str
|
|
21
|
+
"""
|
|
22
|
+
Description of the error.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
inner_errors: List['DeviceDbInnerError']
|
|
26
|
+
"""
|
|
27
|
+
A list of errors that occurred while trying to access information from the device database.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
@staticmethod
|
|
31
|
+
def zero_values() -> 'DeviceDbInnerError':
|
|
32
|
+
return DeviceDbInnerError(
|
|
33
|
+
code="",
|
|
34
|
+
message="",
|
|
35
|
+
inner_errors=[],
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
@staticmethod
|
|
39
|
+
def from_binary(data_bytes: bytes) -> 'DeviceDbInnerError':
|
|
40
|
+
"""" Deserialize a binary representation of this class. """
|
|
41
|
+
data = zaber_bson.loads(data_bytes) # type: Dict[str, Any]
|
|
42
|
+
return DeviceDbInnerError.from_dict(data)
|
|
43
|
+
|
|
44
|
+
def to_binary(self) -> bytes:
|
|
45
|
+
"""" Serialize this class to a binary representation. """
|
|
46
|
+
self.validate()
|
|
47
|
+
return zaber_bson.dumps(self.to_dict()) # type: ignore
|
|
48
|
+
|
|
49
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
50
|
+
return {
|
|
51
|
+
'code': str(self.code or ''),
|
|
52
|
+
'message': str(self.message or ''),
|
|
53
|
+
'innerErrors': [item.to_dict() for item in self.inner_errors] if self.inner_errors is not None else [],
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@staticmethod
|
|
57
|
+
def from_dict(data: Dict[str, Any]) -> 'DeviceDbInnerError':
|
|
58
|
+
return DeviceDbInnerError(
|
|
59
|
+
code=data.get('code'), # type: ignore
|
|
60
|
+
message=data.get('message'), # type: ignore
|
|
61
|
+
inner_errors=[DeviceDbInnerError.from_dict(item) for item in data.get('innerErrors')], # type: ignore
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
def validate(self) -> None:
|
|
65
|
+
"""" Validates the properties of the instance. """
|
|
66
|
+
if self.code is not None:
|
|
67
|
+
if not isinstance(self.code, str):
|
|
68
|
+
raise ValueError(f'Property "Code" of "DeviceDbInnerError" is not a string.')
|
|
69
|
+
|
|
70
|
+
if self.message is not None:
|
|
71
|
+
if not isinstance(self.message, str):
|
|
72
|
+
raise ValueError(f'Property "Message" of "DeviceDbInnerError" is not a string.')
|
|
73
|
+
|
|
74
|
+
if self.inner_errors is not None:
|
|
75
|
+
if not isinstance(self.inner_errors, Iterable):
|
|
76
|
+
raise ValueError('Property "InnerErrors" of "DeviceDbInnerError" is not iterable.')
|
|
77
|
+
|
|
78
|
+
for i, inner_errors_item in enumerate(self.inner_errors):
|
|
79
|
+
if inner_errors_item is None:
|
|
80
|
+
raise ValueError(f'Item {i} in property "InnerErrors" of "DeviceDbInnerError" is None.')
|
|
81
|
+
|
|
82
|
+
if not isinstance(inner_errors_item, DeviceDbInnerError):
|
|
83
|
+
raise ValueError(f'Item {i} in property "InnerErrors" of "DeviceDbInnerError" is not an instance of "DeviceDbInnerError".')
|
|
84
|
+
|
|
85
|
+
inner_errors_item.validate()
|
|
@@ -151,6 +151,7 @@ from .renumber_request import RenumberRequest as RenumberRequest
|
|
|
151
151
|
from .response_type import ResponseType as ResponseType
|
|
152
152
|
from .servo_tuning_paramset_response import ServoTuningParamsetResponse as ServoTuningParamsetResponse
|
|
153
153
|
from .servo_tuning_request import ServoTuningRequest as ServoTuningRequest
|
|
154
|
+
from .set_device_db_layered_sources_request import SetDeviceDbLayeredSourcesRequest as SetDeviceDbLayeredSourcesRequest
|
|
154
155
|
from .set_device_db_source_request import SetDeviceDbSourceRequest as SetDeviceDbSourceRequest
|
|
155
156
|
from .set_interface_checksum_enabled_request import SetInterfaceChecksumEnabledRequest as SetInterfaceChecksumEnabledRequest
|
|
156
157
|
from .set_interface_timeout_request import SetInterfaceTimeoutRequest as SetInterfaceTimeoutRequest
|