zaber-motion 7.10.0__py3-none-win32.whl → 7.12.0__py3-none-win32.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 +5 -5
- 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 +43 -2
- zaber_motion/ascii/pvt_io.py +2 -2
- zaber_motion/ascii/pvt_sequence.py +153 -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 +4 -0
- zaber_motion/dto/requests/pvt_buffer_get_sequence_data_request.py +79 -0
- zaber_motion/dto/requests/pvt_generate_velocities_and_times_request.py +96 -0
- zaber_motion/dto/requests/pvt_submit_sequence_data_request.py +93 -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 +3 -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 +74 -24
- 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.10.0.dist-info → zaber_motion-7.12.0.dist-info}/METADATA +1 -1
- {zaber_motion-7.10.0.dist-info → zaber_motion-7.12.0.dist-info}/RECORD +61 -55
- zaber_motion_bindings/zaber-motion-core-windows-386.dll +0 -0
- {zaber_motion-7.10.0.dist-info → zaber_motion-7.12.0.dist-info}/LICENSE.txt +0 -0
- {zaber_motion-7.10.0.dist-info → zaber_motion-7.12.0.dist-info}/WHEEL +0 -0
- {zaber_motion-7.10.0.dist-info → zaber_motion-7.12.0.dist-info}/top_level.txt +0 -0
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()
|
|
@@ -141,16 +141,20 @@ from .oscilloscope_request import OscilloscopeRequest as OscilloscopeRequest
|
|
|
141
141
|
from .oscilloscope_start_request import OscilloscopeStartRequest as OscilloscopeStartRequest
|
|
142
142
|
from .prepare_command_request import PrepareCommandRequest as PrepareCommandRequest
|
|
143
143
|
from .process_on import ProcessOn as ProcessOn
|
|
144
|
+
from .pvt_buffer_get_sequence_data_request import PvtBufferGetSequenceDataRequest as PvtBufferGetSequenceDataRequest
|
|
144
145
|
from .pvt_generate_positions_request import PvtGeneratePositionsRequest as PvtGeneratePositionsRequest
|
|
146
|
+
from .pvt_generate_velocities_and_times_request import PvtGenerateVelocitiesAndTimesRequest as PvtGenerateVelocitiesAndTimesRequest
|
|
145
147
|
from .pvt_generate_velocities_request import PvtGenerateVelocitiesRequest as PvtGenerateVelocitiesRequest
|
|
146
148
|
from .pvt_load_csv_request import PvtLoadCsvRequest as PvtLoadCsvRequest
|
|
147
149
|
from .pvt_point_request import PvtPointRequest as PvtPointRequest
|
|
148
150
|
from .pvt_points_request import PvtPointsRequest as PvtPointsRequest
|
|
149
151
|
from .pvt_save_csv_request import PvtSaveCsvRequest as PvtSaveCsvRequest
|
|
152
|
+
from .pvt_submit_sequence_data_request import PvtSubmitSequenceDataRequest as PvtSubmitSequenceDataRequest
|
|
150
153
|
from .renumber_request import RenumberRequest as RenumberRequest
|
|
151
154
|
from .response_type import ResponseType as ResponseType
|
|
152
155
|
from .servo_tuning_paramset_response import ServoTuningParamsetResponse as ServoTuningParamsetResponse
|
|
153
156
|
from .servo_tuning_request import ServoTuningRequest as ServoTuningRequest
|
|
157
|
+
from .set_device_db_layered_sources_request import SetDeviceDbLayeredSourcesRequest as SetDeviceDbLayeredSourcesRequest
|
|
154
158
|
from .set_device_db_source_request import SetDeviceDbSourceRequest as SetDeviceDbSourceRequest
|
|
155
159
|
from .set_interface_checksum_enabled_request import SetInterfaceChecksumEnabledRequest as SetInterfaceChecksumEnabledRequest
|
|
156
160
|
from .set_interface_timeout_request import SetInterfaceTimeoutRequest as SetInterfaceTimeoutRequest
|
|
@@ -0,0 +1,79 @@
|
|
|
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
|
|
5
|
+
import decimal
|
|
6
|
+
import zaber_bson
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass
|
|
10
|
+
class PvtBufferGetSequenceDataRequest:
|
|
11
|
+
|
|
12
|
+
interface_id: int = 0
|
|
13
|
+
|
|
14
|
+
device: int = 0
|
|
15
|
+
|
|
16
|
+
buffer_id: int = 0
|
|
17
|
+
|
|
18
|
+
@staticmethod
|
|
19
|
+
def zero_values() -> 'PvtBufferGetSequenceDataRequest':
|
|
20
|
+
return PvtBufferGetSequenceDataRequest(
|
|
21
|
+
interface_id=0,
|
|
22
|
+
device=0,
|
|
23
|
+
buffer_id=0,
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
@staticmethod
|
|
27
|
+
def from_binary(data_bytes: bytes) -> 'PvtBufferGetSequenceDataRequest':
|
|
28
|
+
"""" Deserialize a binary representation of this class. """
|
|
29
|
+
data = zaber_bson.loads(data_bytes) # type: Dict[str, Any]
|
|
30
|
+
return PvtBufferGetSequenceDataRequest.from_dict(data)
|
|
31
|
+
|
|
32
|
+
def to_binary(self) -> bytes:
|
|
33
|
+
"""" Serialize this class to a binary representation. """
|
|
34
|
+
self.validate()
|
|
35
|
+
return zaber_bson.dumps(self.to_dict()) # type: ignore
|
|
36
|
+
|
|
37
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
38
|
+
return {
|
|
39
|
+
'interfaceId': int(self.interface_id),
|
|
40
|
+
'device': int(self.device),
|
|
41
|
+
'bufferId': int(self.buffer_id),
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@staticmethod
|
|
45
|
+
def from_dict(data: Dict[str, Any]) -> 'PvtBufferGetSequenceDataRequest':
|
|
46
|
+
return PvtBufferGetSequenceDataRequest(
|
|
47
|
+
interface_id=data.get('interfaceId'), # type: ignore
|
|
48
|
+
device=data.get('device'), # type: ignore
|
|
49
|
+
buffer_id=data.get('bufferId'), # type: ignore
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
def validate(self) -> None:
|
|
53
|
+
"""" Validates the properties of the instance. """
|
|
54
|
+
if self.interface_id is None:
|
|
55
|
+
raise ValueError(f'Property "InterfaceId" of "PvtBufferGetSequenceDataRequest" is None.')
|
|
56
|
+
|
|
57
|
+
if not isinstance(self.interface_id, (int, float, decimal.Decimal)):
|
|
58
|
+
raise ValueError(f'Property "InterfaceId" of "PvtBufferGetSequenceDataRequest" is not a number.')
|
|
59
|
+
|
|
60
|
+
if int(self.interface_id) != self.interface_id:
|
|
61
|
+
raise ValueError(f'Property "InterfaceId" of "PvtBufferGetSequenceDataRequest" is not integer value.')
|
|
62
|
+
|
|
63
|
+
if self.device is None:
|
|
64
|
+
raise ValueError(f'Property "Device" of "PvtBufferGetSequenceDataRequest" is None.')
|
|
65
|
+
|
|
66
|
+
if not isinstance(self.device, (int, float, decimal.Decimal)):
|
|
67
|
+
raise ValueError(f'Property "Device" of "PvtBufferGetSequenceDataRequest" is not a number.')
|
|
68
|
+
|
|
69
|
+
if int(self.device) != self.device:
|
|
70
|
+
raise ValueError(f'Property "Device" of "PvtBufferGetSequenceDataRequest" is not integer value.')
|
|
71
|
+
|
|
72
|
+
if self.buffer_id is None:
|
|
73
|
+
raise ValueError(f'Property "BufferId" of "PvtBufferGetSequenceDataRequest" is None.')
|
|
74
|
+
|
|
75
|
+
if not isinstance(self.buffer_id, (int, float, decimal.Decimal)):
|
|
76
|
+
raise ValueError(f'Property "BufferId" of "PvtBufferGetSequenceDataRequest" is not a number.')
|
|
77
|
+
|
|
78
|
+
if int(self.buffer_id) != self.buffer_id:
|
|
79
|
+
raise ValueError(f'Property "BufferId" of "PvtBufferGetSequenceDataRequest" is not integer value.')
|
|
@@ -0,0 +1,96 @@
|
|
|
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, field
|
|
4
|
+
from typing import Any, Dict, List, Optional
|
|
5
|
+
import decimal
|
|
6
|
+
from collections.abc import Iterable
|
|
7
|
+
import zaber_bson
|
|
8
|
+
from ..ascii.measurement_sequence import MeasurementSequence
|
|
9
|
+
from ..measurement import Measurement
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@dataclass
|
|
13
|
+
class PvtGenerateVelocitiesAndTimesRequest:
|
|
14
|
+
|
|
15
|
+
positions: List[MeasurementSequence] = field(default_factory=list)
|
|
16
|
+
|
|
17
|
+
target_speed: Measurement = field(default_factory=Measurement.zero_values)
|
|
18
|
+
|
|
19
|
+
target_acceleration: Measurement = field(default_factory=Measurement.zero_values)
|
|
20
|
+
|
|
21
|
+
resample_number: Optional[int] = None
|
|
22
|
+
|
|
23
|
+
@staticmethod
|
|
24
|
+
def zero_values() -> 'PvtGenerateVelocitiesAndTimesRequest':
|
|
25
|
+
return PvtGenerateVelocitiesAndTimesRequest(
|
|
26
|
+
positions=[],
|
|
27
|
+
target_speed=Measurement.zero_values(),
|
|
28
|
+
target_acceleration=Measurement.zero_values(),
|
|
29
|
+
resample_number=None,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
@staticmethod
|
|
33
|
+
def from_binary(data_bytes: bytes) -> 'PvtGenerateVelocitiesAndTimesRequest':
|
|
34
|
+
"""" Deserialize a binary representation of this class. """
|
|
35
|
+
data = zaber_bson.loads(data_bytes) # type: Dict[str, Any]
|
|
36
|
+
return PvtGenerateVelocitiesAndTimesRequest.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
|
+
'positions': [item.to_dict() for item in self.positions] if self.positions is not None else [],
|
|
46
|
+
'targetSpeed': self.target_speed.to_dict(),
|
|
47
|
+
'targetAcceleration': self.target_acceleration.to_dict(),
|
|
48
|
+
'resampleNumber': int(self.resample_number) if self.resample_number is not None else None,
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@staticmethod
|
|
52
|
+
def from_dict(data: Dict[str, Any]) -> 'PvtGenerateVelocitiesAndTimesRequest':
|
|
53
|
+
return PvtGenerateVelocitiesAndTimesRequest(
|
|
54
|
+
positions=[MeasurementSequence.from_dict(item) for item in data.get('positions')], # type: ignore
|
|
55
|
+
target_speed=Measurement.from_dict(data.get('targetSpeed')), # type: ignore
|
|
56
|
+
target_acceleration=Measurement.from_dict(data.get('targetAcceleration')), # type: ignore
|
|
57
|
+
resample_number=data.get('resampleNumber'), # type: ignore
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
def validate(self) -> None:
|
|
61
|
+
"""" Validates the properties of the instance. """
|
|
62
|
+
if self.positions is not None:
|
|
63
|
+
if not isinstance(self.positions, Iterable):
|
|
64
|
+
raise ValueError('Property "Positions" of "PvtGenerateVelocitiesAndTimesRequest" is not iterable.')
|
|
65
|
+
|
|
66
|
+
for i, positions_item in enumerate(self.positions):
|
|
67
|
+
if positions_item is None:
|
|
68
|
+
raise ValueError(f'Item {i} in property "Positions" of "PvtGenerateVelocitiesAndTimesRequest" is None.')
|
|
69
|
+
|
|
70
|
+
if not isinstance(positions_item, MeasurementSequence):
|
|
71
|
+
raise ValueError(f'Item {i} in property "Positions" of "PvtGenerateVelocitiesAndTimesRequest" is not an instance of "MeasurementSequence".')
|
|
72
|
+
|
|
73
|
+
positions_item.validate()
|
|
74
|
+
|
|
75
|
+
if self.target_speed is None:
|
|
76
|
+
raise ValueError(f'Property "TargetSpeed" of "PvtGenerateVelocitiesAndTimesRequest" is None.')
|
|
77
|
+
|
|
78
|
+
if not isinstance(self.target_speed, Measurement):
|
|
79
|
+
raise ValueError(f'Property "TargetSpeed" of "PvtGenerateVelocitiesAndTimesRequest" is not an instance of "Measurement".')
|
|
80
|
+
|
|
81
|
+
self.target_speed.validate()
|
|
82
|
+
|
|
83
|
+
if self.target_acceleration is None:
|
|
84
|
+
raise ValueError(f'Property "TargetAcceleration" of "PvtGenerateVelocitiesAndTimesRequest" is None.')
|
|
85
|
+
|
|
86
|
+
if not isinstance(self.target_acceleration, Measurement):
|
|
87
|
+
raise ValueError(f'Property "TargetAcceleration" of "PvtGenerateVelocitiesAndTimesRequest" is not an instance of "Measurement".')
|
|
88
|
+
|
|
89
|
+
self.target_acceleration.validate()
|
|
90
|
+
|
|
91
|
+
if self.resample_number is not None:
|
|
92
|
+
if not isinstance(self.resample_number, (int, float, decimal.Decimal)):
|
|
93
|
+
raise ValueError(f'Property "ResampleNumber" of "PvtGenerateVelocitiesAndTimesRequest" is not a number.')
|
|
94
|
+
|
|
95
|
+
if int(self.resample_number) != self.resample_number:
|
|
96
|
+
raise ValueError(f'Property "ResampleNumber" of "PvtGenerateVelocitiesAndTimesRequest" is not integer value.')
|
|
@@ -0,0 +1,93 @@
|
|
|
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, field
|
|
4
|
+
from typing import Any, Dict
|
|
5
|
+
import decimal
|
|
6
|
+
import zaber_bson
|
|
7
|
+
from ..ascii.pvt_sequence_data import PvtSequenceData
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@dataclass
|
|
11
|
+
class PvtSubmitSequenceDataRequest:
|
|
12
|
+
|
|
13
|
+
interface_id: int = 0
|
|
14
|
+
|
|
15
|
+
device: int = 0
|
|
16
|
+
|
|
17
|
+
stream_id: int = 0
|
|
18
|
+
|
|
19
|
+
sequence_data: PvtSequenceData = field(default_factory=PvtSequenceData.zero_values)
|
|
20
|
+
|
|
21
|
+
@staticmethod
|
|
22
|
+
def zero_values() -> 'PvtSubmitSequenceDataRequest':
|
|
23
|
+
return PvtSubmitSequenceDataRequest(
|
|
24
|
+
interface_id=0,
|
|
25
|
+
device=0,
|
|
26
|
+
stream_id=0,
|
|
27
|
+
sequence_data=PvtSequenceData.zero_values(),
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
@staticmethod
|
|
31
|
+
def from_binary(data_bytes: bytes) -> 'PvtSubmitSequenceDataRequest':
|
|
32
|
+
"""" Deserialize a binary representation of this class. """
|
|
33
|
+
data = zaber_bson.loads(data_bytes) # type: Dict[str, Any]
|
|
34
|
+
return PvtSubmitSequenceDataRequest.from_dict(data)
|
|
35
|
+
|
|
36
|
+
def to_binary(self) -> bytes:
|
|
37
|
+
"""" Serialize this class to a binary representation. """
|
|
38
|
+
self.validate()
|
|
39
|
+
return zaber_bson.dumps(self.to_dict()) # type: ignore
|
|
40
|
+
|
|
41
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
42
|
+
return {
|
|
43
|
+
'interfaceId': int(self.interface_id),
|
|
44
|
+
'device': int(self.device),
|
|
45
|
+
'streamId': int(self.stream_id),
|
|
46
|
+
'sequenceData': self.sequence_data.to_dict(),
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@staticmethod
|
|
50
|
+
def from_dict(data: Dict[str, Any]) -> 'PvtSubmitSequenceDataRequest':
|
|
51
|
+
return PvtSubmitSequenceDataRequest(
|
|
52
|
+
interface_id=data.get('interfaceId'), # type: ignore
|
|
53
|
+
device=data.get('device'), # type: ignore
|
|
54
|
+
stream_id=data.get('streamId'), # type: ignore
|
|
55
|
+
sequence_data=PvtSequenceData.from_dict(data.get('sequenceData')), # type: ignore
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
def validate(self) -> None:
|
|
59
|
+
"""" Validates the properties of the instance. """
|
|
60
|
+
if self.interface_id is None:
|
|
61
|
+
raise ValueError(f'Property "InterfaceId" of "PvtSubmitSequenceDataRequest" is None.')
|
|
62
|
+
|
|
63
|
+
if not isinstance(self.interface_id, (int, float, decimal.Decimal)):
|
|
64
|
+
raise ValueError(f'Property "InterfaceId" of "PvtSubmitSequenceDataRequest" is not a number.')
|
|
65
|
+
|
|
66
|
+
if int(self.interface_id) != self.interface_id:
|
|
67
|
+
raise ValueError(f'Property "InterfaceId" of "PvtSubmitSequenceDataRequest" is not integer value.')
|
|
68
|
+
|
|
69
|
+
if self.device is None:
|
|
70
|
+
raise ValueError(f'Property "Device" of "PvtSubmitSequenceDataRequest" is None.')
|
|
71
|
+
|
|
72
|
+
if not isinstance(self.device, (int, float, decimal.Decimal)):
|
|
73
|
+
raise ValueError(f'Property "Device" of "PvtSubmitSequenceDataRequest" is not a number.')
|
|
74
|
+
|
|
75
|
+
if int(self.device) != self.device:
|
|
76
|
+
raise ValueError(f'Property "Device" of "PvtSubmitSequenceDataRequest" is not integer value.')
|
|
77
|
+
|
|
78
|
+
if self.stream_id is None:
|
|
79
|
+
raise ValueError(f'Property "StreamId" of "PvtSubmitSequenceDataRequest" is None.')
|
|
80
|
+
|
|
81
|
+
if not isinstance(self.stream_id, (int, float, decimal.Decimal)):
|
|
82
|
+
raise ValueError(f'Property "StreamId" of "PvtSubmitSequenceDataRequest" is not a number.')
|
|
83
|
+
|
|
84
|
+
if int(self.stream_id) != self.stream_id:
|
|
85
|
+
raise ValueError(f'Property "StreamId" of "PvtSubmitSequenceDataRequest" is not integer value.')
|
|
86
|
+
|
|
87
|
+
if self.sequence_data is None:
|
|
88
|
+
raise ValueError(f'Property "SequenceData" of "PvtSubmitSequenceDataRequest" is None.')
|
|
89
|
+
|
|
90
|
+
if not isinstance(self.sequence_data, PvtSequenceData):
|
|
91
|
+
raise ValueError(f'Property "SequenceData" of "PvtSubmitSequenceDataRequest" is not an instance of "PvtSequenceData".')
|
|
92
|
+
|
|
93
|
+
self.sequence_data.validate()
|
|
@@ -0,0 +1,56 @@
|
|
|
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, field
|
|
4
|
+
from typing import Any, Dict, List
|
|
5
|
+
from collections.abc import Iterable
|
|
6
|
+
import zaber_bson
|
|
7
|
+
from ..device_db_source import DeviceDbSource
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@dataclass
|
|
11
|
+
class SetDeviceDbLayeredSourcesRequest:
|
|
12
|
+
|
|
13
|
+
sources: List[DeviceDbSource] = field(default_factory=list)
|
|
14
|
+
|
|
15
|
+
@staticmethod
|
|
16
|
+
def zero_values() -> 'SetDeviceDbLayeredSourcesRequest':
|
|
17
|
+
return SetDeviceDbLayeredSourcesRequest(
|
|
18
|
+
sources=[],
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
@staticmethod
|
|
22
|
+
def from_binary(data_bytes: bytes) -> 'SetDeviceDbLayeredSourcesRequest':
|
|
23
|
+
"""" Deserialize a binary representation of this class. """
|
|
24
|
+
data = zaber_bson.loads(data_bytes) # type: Dict[str, Any]
|
|
25
|
+
return SetDeviceDbLayeredSourcesRequest.from_dict(data)
|
|
26
|
+
|
|
27
|
+
def to_binary(self) -> bytes:
|
|
28
|
+
"""" Serialize this class to a binary representation. """
|
|
29
|
+
self.validate()
|
|
30
|
+
return zaber_bson.dumps(self.to_dict()) # type: ignore
|
|
31
|
+
|
|
32
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
33
|
+
return {
|
|
34
|
+
'sources': [item.to_dict() for item in self.sources] if self.sources is not None else [],
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@staticmethod
|
|
38
|
+
def from_dict(data: Dict[str, Any]) -> 'SetDeviceDbLayeredSourcesRequest':
|
|
39
|
+
return SetDeviceDbLayeredSourcesRequest(
|
|
40
|
+
sources=[DeviceDbSource.from_dict(item) for item in data.get('sources')], # type: ignore
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
def validate(self) -> None:
|
|
44
|
+
"""" Validates the properties of the instance. """
|
|
45
|
+
if self.sources is not None:
|
|
46
|
+
if not isinstance(self.sources, Iterable):
|
|
47
|
+
raise ValueError('Property "Sources" of "SetDeviceDbLayeredSourcesRequest" is not iterable.')
|
|
48
|
+
|
|
49
|
+
for i, sources_item in enumerate(self.sources):
|
|
50
|
+
if sources_item is None:
|
|
51
|
+
raise ValueError(f'Item {i} in property "Sources" of "SetDeviceDbLayeredSourcesRequest" is None.')
|
|
52
|
+
|
|
53
|
+
if not isinstance(sources_item, DeviceDbSource):
|
|
54
|
+
raise ValueError(f'Item {i} in property "Sources" of "SetDeviceDbLayeredSourcesRequest" is not an instance of "DeviceDbSource".')
|
|
55
|
+
|
|
56
|
+
sources_item.validate()
|
|
@@ -10,8 +10,14 @@ from ..device_db_source_type import DeviceDbSourceType
|
|
|
10
10
|
class SetDeviceDbSourceRequest:
|
|
11
11
|
|
|
12
12
|
source_type: DeviceDbSourceType = next(first for first in DeviceDbSourceType)
|
|
13
|
+
"""
|
|
14
|
+
Whether the source is a web service or a local DB file.
|
|
15
|
+
"""
|
|
13
16
|
|
|
14
17
|
url_or_file_path: Optional[str] = None
|
|
18
|
+
"""
|
|
19
|
+
The URL of the web service or path to the local DB file.
|
|
20
|
+
"""
|
|
15
21
|
|
|
16
22
|
@staticmethod
|
|
17
23
|
def zero_values() -> 'SetDeviceDbSourceRequest':
|
|
@@ -68,6 +68,7 @@ from ..dto.exceptions.command_failed_exception_data import CommandFailedExceptio
|
|
|
68
68
|
from ..dto.exceptions.command_too_long_exception_data import CommandTooLongExceptionData as CommandTooLongExceptionData
|
|
69
69
|
from ..dto.exceptions.device_address_conflict_exception_data import DeviceAddressConflictExceptionData as DeviceAddressConflictExceptionData
|
|
70
70
|
from ..dto.exceptions.device_db_failed_exception_data import DeviceDbFailedExceptionData as DeviceDbFailedExceptionData
|
|
71
|
+
from ..dto.exceptions.device_db_inner_error import DeviceDbInnerError as DeviceDbInnerError
|
|
71
72
|
from ..dto.exceptions.g_code_execution_exception_data import GCodeExecutionExceptionData as GCodeExecutionExceptionData
|
|
72
73
|
from ..dto.exceptions.g_code_syntax_exception_data import GCodeSyntaxExceptionData as GCodeSyntaxExceptionData
|
|
73
74
|
from ..dto.exceptions.invalid_packet_exception_data import InvalidPacketExceptionData as InvalidPacketExceptionData
|
zaber_motion/gcode/translator.py
CHANGED
zaber_motion/library.py
CHANGED
|
@@ -6,6 +6,7 @@ from .call import call, call_async, call_sync
|
|
|
6
6
|
from .dto import requests as dto
|
|
7
7
|
from .dto.log_output_mode import LogOutputMode
|
|
8
8
|
from .dto.device_db_source_type import DeviceDbSourceType
|
|
9
|
+
from .dto.device_db_source import DeviceDbSource
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class Library:
|
|
@@ -50,6 +51,22 @@ class Library:
|
|
|
50
51
|
)
|
|
51
52
|
call_sync("device_db/set_source", request)
|
|
52
53
|
|
|
54
|
+
@staticmethod
|
|
55
|
+
def set_device_db_sources(
|
|
56
|
+
*sources: DeviceDbSource
|
|
57
|
+
) -> None:
|
|
58
|
+
"""
|
|
59
|
+
Sets a sequence of sources. When the library needs device information,
|
|
60
|
+
it will try each source in the order they are provided.
|
|
61
|
+
|
|
62
|
+
Args:
|
|
63
|
+
sources: The list of sources the library will access data from.
|
|
64
|
+
"""
|
|
65
|
+
request = dto.SetDeviceDbLayeredSourcesRequest(
|
|
66
|
+
sources=list(sources),
|
|
67
|
+
)
|
|
68
|
+
call_sync("device_db/set_sources", request)
|
|
69
|
+
|
|
53
70
|
@staticmethod
|
|
54
71
|
def enable_device_db_store(
|
|
55
72
|
store_location: Optional[str] = None
|
|
@@ -154,7 +171,7 @@ class Library:
|
|
|
154
171
|
"""
|
|
155
172
|
request = dto.CheckVersionRequest(
|
|
156
173
|
host="py",
|
|
157
|
-
version="7.
|
|
174
|
+
version="7.12.0",
|
|
158
175
|
)
|
|
159
176
|
call_sync("library/check_version", request)
|
|
160
177
|
|