@zaber/motion 2.5.1 → 2.7.0-save-load
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.
- package/binding.gyp +2 -3
- package/dist/binding/wasm/zaber-motion-lib.wasm +0 -0
- package/dist/{node → lib}/ascii/alert_event.d.ts +0 -0
- package/dist/{node → lib}/ascii/alert_event.js +0 -0
- package/dist/{node → lib}/ascii/alert_event.js.map +0 -0
- package/dist/{node → lib}/ascii/all_axes.d.ts +0 -0
- package/dist/{node → lib}/ascii/all_axes.js +0 -0
- package/dist/{node → lib}/ascii/all_axes.js.map +0 -0
- package/dist/{web → lib}/ascii/axis.d.ts +18 -0
- package/dist/{node → lib}/ascii/axis.js +40 -0
- package/dist/lib/ascii/axis.js.map +1 -0
- package/dist/{node → lib}/ascii/axis_identity.d.ts +0 -0
- package/dist/{node → lib}/ascii/axis_identity.js +0 -0
- package/dist/{node → lib}/ascii/axis_identity.js.map +0 -0
- package/dist/{node → lib}/ascii/axis_settings.d.ts +14 -0
- package/dist/{web → lib}/ascii/axis_settings.js +30 -0
- package/dist/lib/ascii/axis_settings.js.map +1 -0
- package/dist/{node → lib}/ascii/axis_type.d.ts +0 -0
- package/dist/{node → lib}/ascii/axis_type.js +0 -0
- package/dist/{node → lib}/ascii/axis_type.js.map +0 -0
- package/dist/{web → lib}/ascii/connection.d.ts +14 -2
- package/dist/{web → lib}/ascii/connection.js +22 -2
- package/dist/lib/ascii/connection.js.map +1 -0
- package/dist/{web → lib}/ascii/device.d.ts +20 -0
- package/dist/{node → lib}/ascii/device.js +40 -0
- package/dist/lib/ascii/device.js.map +1 -0
- package/dist/{node → lib}/ascii/device_identity.d.ts +0 -0
- package/dist/{node → lib}/ascii/device_identity.js +0 -0
- package/dist/{node → lib}/ascii/device_identity.js.map +0 -0
- package/dist/{node → lib}/ascii/device_io.d.ts +0 -0
- package/dist/{node → lib}/ascii/device_io.js +0 -0
- package/dist/{node → lib}/ascii/device_io.js.map +0 -0
- package/dist/{node → lib}/ascii/device_io_info.d.ts +0 -0
- package/dist/{node → lib}/ascii/device_io_info.js +0 -0
- package/dist/{node → lib}/ascii/device_io_info.js.map +0 -0
- package/dist/{web → lib}/ascii/device_settings.d.ts +14 -0
- package/dist/{web → lib}/ascii/device_settings.js +28 -0
- package/dist/lib/ascii/device_settings.js.map +1 -0
- package/dist/{node → lib}/ascii/index.d.ts +0 -0
- package/dist/{node → lib}/ascii/index.js +0 -0
- package/dist/{node → lib}/ascii/index.js.map +0 -0
- package/dist/{node → lib}/ascii/lockstep.d.ts +0 -0
- package/dist/{node → lib}/ascii/lockstep.js +0 -0
- package/dist/{node → lib}/ascii/lockstep.js.map +0 -0
- package/dist/{node → lib}/ascii/lockstep_axes.d.ts +0 -0
- package/dist/{node → lib}/ascii/lockstep_axes.js +0 -0
- package/dist/{node → lib}/ascii/lockstep_axes.js.map +0 -0
- package/dist/{node → lib}/ascii/message_type.d.ts +0 -0
- package/dist/{node → lib}/ascii/message_type.js +0 -0
- package/dist/{node → lib}/ascii/message_type.js.map +0 -0
- package/dist/{node → lib}/ascii/response.d.ts +0 -0
- package/dist/{node → lib}/ascii/response.js +0 -0
- package/dist/{node → lib}/ascii/response.js.map +0 -0
- package/dist/{web → lib}/ascii/setting_constants.d.ts +360 -0
- package/dist/{node → lib}/ascii/setting_constants.js +360 -0
- package/dist/lib/ascii/setting_constants.js.map +1 -0
- package/dist/{web → lib}/ascii/stream.d.ts +6 -0
- package/dist/{web → lib}/ascii/stream.js +13 -0
- package/dist/lib/ascii/stream.js.map +1 -0
- package/dist/{web → lib}/ascii/stream_axis_definition.d.ts +1 -1
- package/dist/{node → lib}/ascii/stream_axis_definition.js +0 -0
- package/dist/{node → lib}/ascii/stream_axis_definition.js.map +1 -1
- package/dist/{node → lib}/ascii/stream_axis_type.d.ts +0 -0
- package/dist/{node → lib}/ascii/stream_axis_type.js +0 -0
- package/dist/{node → lib}/ascii/stream_axis_type.js.map +0 -0
- package/dist/{node → lib}/ascii/stream_buffer.d.ts +1 -0
- package/dist/{node → lib}/ascii/stream_buffer.js +1 -0
- package/dist/lib/ascii/stream_buffer.js.map +1 -0
- package/dist/{node → lib}/ascii/stream_mode.d.ts +0 -0
- package/dist/{node → lib}/ascii/stream_mode.js +0 -0
- package/dist/{node → lib}/ascii/stream_mode.js.map +0 -0
- package/dist/{node → lib}/ascii/transport.d.ts +0 -0
- package/dist/{node → lib}/ascii/transport.js +0 -0
- package/dist/{node → lib}/ascii/transport.js.map +0 -0
- package/dist/{node → lib}/ascii/unknown_response_event.d.ts +0 -0
- package/dist/{node → lib}/ascii/unknown_response_event.js +0 -0
- package/dist/{node → lib}/ascii/unknown_response_event.js.map +0 -0
- package/dist/{node → lib}/ascii/warning_flags.d.ts +0 -0
- package/dist/{node → lib}/ascii/warning_flags.js +0 -0
- package/dist/{node → lib}/ascii/warning_flags.js.map +0 -0
- package/dist/{node → lib}/ascii/warnings.d.ts +0 -0
- package/dist/{node → lib}/ascii/warnings.js +0 -0
- package/dist/{node → lib}/ascii/warnings.js.map +0 -0
- package/dist/{node → lib}/ascii_ns.d.ts +0 -0
- package/dist/{node → lib}/ascii_ns.js +0 -0
- package/dist/{node → lib}/ascii_ns.js.map +0 -0
- package/dist/{node → lib}/binary/binary_settings.d.ts +0 -0
- package/dist/{node → lib}/binary/binary_settings.js +0 -0
- package/dist/{node → lib}/binary/binary_settings.js.map +0 -0
- package/dist/{node → lib}/binary/command_code.d.ts +0 -0
- package/dist/{node → lib}/binary/command_code.js +0 -0
- package/dist/{node → lib}/binary/command_code.js.map +0 -0
- package/dist/{node → lib}/binary/connection.d.ts +0 -1
- package/dist/{web → lib}/binary/connection.js +0 -1
- package/dist/lib/binary/connection.js.map +1 -0
- package/dist/{node → lib}/binary/device.d.ts +0 -0
- package/dist/{node → lib}/binary/device.js +0 -0
- package/dist/{node → lib}/binary/device.js.map +0 -0
- package/dist/{node → lib}/binary/device_identity.d.ts +0 -0
- package/dist/{node → lib}/binary/device_identity.js +0 -0
- package/dist/{node → lib}/binary/device_identity.js.map +0 -0
- package/dist/{node → lib}/binary/device_settings.d.ts +0 -0
- package/dist/{node → lib}/binary/device_settings.js +0 -0
- package/dist/{node → lib}/binary/device_settings.js.map +0 -0
- package/dist/{node → lib}/binary/device_type.d.ts +0 -0
- package/dist/{node → lib}/binary/device_type.js +0 -0
- package/dist/{node → lib}/binary/device_type.js.map +0 -0
- package/dist/{node → lib}/binary/error_code.d.ts +0 -0
- package/dist/{node → lib}/binary/error_code.js +0 -0
- package/dist/{node → lib}/binary/error_code.js.map +0 -0
- package/dist/{node → lib}/binary/index.d.ts +0 -0
- package/dist/{node → lib}/binary/index.js +0 -0
- package/dist/{node → lib}/binary/index.js.map +0 -0
- package/dist/{node → lib}/binary/message.d.ts +0 -0
- package/dist/{node → lib}/binary/message.js +0 -0
- package/dist/{node → lib}/binary/message.js.map +0 -0
- package/dist/{node → lib}/binary/reply_code.d.ts +0 -0
- package/dist/{node → lib}/binary/reply_code.js +0 -0
- package/dist/{node → lib}/binary/reply_code.js.map +0 -0
- package/dist/{node → lib}/binary/reply_only_event.d.ts +0 -0
- package/dist/{node → lib}/binary/reply_only_event.js +0 -0
- package/dist/{node → lib}/binary/reply_only_event.js.map +0 -0
- package/dist/{node → lib}/binary/unknown_response_event.d.ts +0 -0
- package/dist/{node → lib}/binary/unknown_response_event.js +0 -0
- package/dist/{node → lib}/binary/unknown_response_event.js.map +0 -0
- package/dist/{node → lib}/binary_ns.d.ts +0 -0
- package/dist/{node → lib}/binary_ns.js +0 -0
- package/dist/{node → lib}/binary_ns.js.map +0 -0
- package/dist/lib/can_set_state_axis_response.d.ts +16 -0
- package/dist/lib/can_set_state_axis_response.js +18 -0
- package/dist/lib/can_set_state_axis_response.js.map +1 -0
- package/dist/lib/can_set_state_device_response.d.ts +17 -0
- package/dist/lib/can_set_state_device_response.js +19 -0
- package/dist/lib/can_set_state_device_response.js.map +1 -0
- package/dist/{node → lib}/device_db_source_type.d.ts +0 -0
- package/dist/{node → lib}/device_db_source_type.js +0 -0
- package/dist/{node → lib}/device_db_source_type.js.map +0 -0
- package/dist/{node → lib}/exceptions/binary_command_failed_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/binary_command_failed_exception.js +0 -0
- package/dist/{node → lib}/exceptions/binary_command_failed_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/binary_command_failed_exception_data.d.ts +0 -0
- package/dist/{node → lib}/exceptions/binary_command_failed_exception_data.js +0 -0
- package/dist/{node → lib}/exceptions/binary_command_failed_exception_data.js.map +0 -0
- package/dist/{node → lib}/exceptions/command_failed_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/command_failed_exception.js +0 -0
- package/dist/{node → lib}/exceptions/command_failed_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/command_failed_exception_data.d.ts +0 -0
- package/dist/{node → lib}/exceptions/command_failed_exception_data.js +0 -0
- package/dist/{node → lib}/exceptions/command_failed_exception_data.js.map +0 -0
- package/dist/{node → lib}/exceptions/command_preempted_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/command_preempted_exception.js +0 -0
- package/dist/{node → lib}/exceptions/command_preempted_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/connection_closed_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/connection_closed_exception.js +0 -0
- package/dist/{node → lib}/exceptions/connection_closed_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/connection_failed_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/connection_failed_exception.js +0 -0
- package/dist/{node → lib}/exceptions/connection_failed_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/conversion_failed_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/conversion_failed_exception.js +0 -0
- package/dist/{node → lib}/exceptions/conversion_failed_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/device_address_conflict_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/device_address_conflict_exception.js +0 -0
- package/dist/{node → lib}/exceptions/device_address_conflict_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/device_address_conflict_exception_data.d.ts +0 -0
- package/dist/{node → lib}/exceptions/device_address_conflict_exception_data.js +0 -0
- package/dist/{node → lib}/exceptions/device_address_conflict_exception_data.js.map +0 -0
- package/dist/{node → lib}/exceptions/device_busy_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/device_busy_exception.js +0 -0
- package/dist/{node → lib}/exceptions/device_busy_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/device_db_failed_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/device_db_failed_exception.js +0 -0
- package/dist/{node → lib}/exceptions/device_db_failed_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/device_failed_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/device_failed_exception.js +0 -0
- package/dist/{node → lib}/exceptions/device_failed_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/device_not_identified_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/device_not_identified_exception.js +0 -0
- package/dist/{node → lib}/exceptions/device_not_identified_exception.js.map +0 -0
- package/dist/lib/exceptions/g_code_execution_exception.d.ts +14 -0
- package/dist/lib/exceptions/g_code_execution_exception.js +32 -0
- package/dist/lib/exceptions/g_code_execution_exception.js.map +1 -0
- package/dist/lib/exceptions/g_code_execution_exception_data.d.ts +17 -0
- package/dist/lib/exceptions/g_code_execution_exception_data.js +18 -0
- package/dist/lib/exceptions/g_code_execution_exception_data.js.map +1 -0
- package/dist/lib/exceptions/g_code_syntax_exception.d.ts +14 -0
- package/dist/lib/exceptions/g_code_syntax_exception.js +32 -0
- package/dist/lib/exceptions/g_code_syntax_exception.js.map +1 -0
- package/dist/lib/exceptions/g_code_syntax_exception_data.d.ts +17 -0
- package/dist/lib/exceptions/g_code_syntax_exception_data.js +18 -0
- package/dist/lib/exceptions/g_code_syntax_exception_data.js.map +1 -0
- package/dist/{web → lib}/exceptions/index.d.ts +8 -0
- package/dist/{node → lib}/exceptions/index.js +18 -1
- package/dist/lib/exceptions/index.js.map +1 -0
- package/dist/{node → lib}/exceptions/internal_error_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/internal_error_exception.js +0 -0
- package/dist/{node → lib}/exceptions/internal_error_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/invalid_argument_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/invalid_argument_exception.js +0 -0
- package/dist/{node → lib}/exceptions/invalid_argument_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/invalid_data_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/invalid_data_exception.js +0 -0
- package/dist/{node → lib}/exceptions/invalid_data_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/invalid_packet_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/invalid_packet_exception.js +0 -0
- package/dist/{node → lib}/exceptions/invalid_packet_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/invalid_packet_exception_data.d.ts +0 -0
- package/dist/{node → lib}/exceptions/invalid_packet_exception_data.js +0 -0
- package/dist/{node → lib}/exceptions/invalid_packet_exception_data.js.map +0 -0
- package/dist/{node → lib}/exceptions/invalid_park_state_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/invalid_park_state_exception.js +0 -0
- package/dist/{node → lib}/exceptions/invalid_park_state_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/invalid_response_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/invalid_response_exception.js +0 -0
- package/dist/{node → lib}/exceptions/invalid_response_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/invalid_response_exception_data.d.ts +0 -0
- package/dist/{node → lib}/exceptions/invalid_response_exception_data.js +0 -0
- package/dist/{node → lib}/exceptions/invalid_response_exception_data.js.map +0 -0
- package/dist/{node → lib}/exceptions/io_channel_out_of_range_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/io_channel_out_of_range_exception.js +0 -0
- package/dist/{node → lib}/exceptions/io_channel_out_of_range_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/io_failed_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/io_failed_exception.js +0 -0
- package/dist/{node → lib}/exceptions/io_failed_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/lockstep_enabled_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/lockstep_enabled_exception.js +0 -0
- package/dist/{node → lib}/exceptions/lockstep_enabled_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/lockstep_not_enabled_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/lockstep_not_enabled_exception.js +0 -0
- package/dist/{node → lib}/exceptions/lockstep_not_enabled_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/motion_lib_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/motion_lib_exception.js +0 -0
- package/dist/{node → lib}/exceptions/motion_lib_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/movement_failed_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/movement_failed_exception.js +0 -0
- package/dist/{node → lib}/exceptions/movement_failed_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/movement_failed_exception_data.d.ts +0 -0
- package/dist/{node → lib}/exceptions/movement_failed_exception_data.js +0 -0
- package/dist/{node → lib}/exceptions/movement_failed_exception_data.js.map +0 -0
- package/dist/{node → lib}/exceptions/movement_interrupted_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/movement_interrupted_exception.js +0 -0
- package/dist/{node → lib}/exceptions/movement_interrupted_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/movement_interrupted_exception_data.d.ts +0 -0
- package/dist/{node → lib}/exceptions/movement_interrupted_exception_data.js +0 -0
- package/dist/{node → lib}/exceptions/movement_interrupted_exception_data.js.map +0 -0
- package/dist/{node → lib}/exceptions/no_device_found_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/no_device_found_exception.js +0 -0
- package/dist/{node → lib}/exceptions/no_device_found_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/not_supported_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/not_supported_exception.js +0 -0
- package/dist/{node → lib}/exceptions/not_supported_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/os_failed_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/os_failed_exception.js +0 -0
- package/dist/{node → lib}/exceptions/os_failed_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/out_of_request_ids_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/out_of_request_ids_exception.js +0 -0
- package/dist/{node → lib}/exceptions/out_of_request_ids_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/request_timeout_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/request_timeout_exception.js +0 -0
- package/dist/{node → lib}/exceptions/request_timeout_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/serial_port_busy_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/serial_port_busy_exception.js +0 -0
- package/dist/{node → lib}/exceptions/serial_port_busy_exception.js.map +0 -0
- package/dist/lib/exceptions/set_device_state_exception_data.d.ts +25 -0
- package/dist/lib/exceptions/set_device_state_exception_data.js +21 -0
- package/dist/lib/exceptions/set_device_state_exception_data.js.map +1 -0
- package/dist/lib/exceptions/set_device_state_failed_exception.d.ts +14 -0
- package/dist/lib/exceptions/set_device_state_failed_exception.js +32 -0
- package/dist/lib/exceptions/set_device_state_failed_exception.js.map +1 -0
- package/dist/lib/exceptions/set_peripheral_state_exception_data.d.ts +20 -0
- package/dist/lib/exceptions/set_peripheral_state_exception_data.js +19 -0
- package/dist/lib/exceptions/set_peripheral_state_exception_data.js.map +1 -0
- package/dist/lib/exceptions/set_peripheral_state_failed_exception.d.ts +14 -0
- package/dist/lib/exceptions/set_peripheral_state_failed_exception.js +32 -0
- package/dist/lib/exceptions/set_peripheral_state_failed_exception.js.map +1 -0
- package/dist/{node → lib}/exceptions/setting_not_found_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/setting_not_found_exception.js +0 -0
- package/dist/{node → lib}/exceptions/setting_not_found_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/stream_execution_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/stream_execution_exception.js +0 -0
- package/dist/{node → lib}/exceptions/stream_execution_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/stream_execution_exception_data.d.ts +0 -0
- package/dist/{node → lib}/exceptions/stream_execution_exception_data.js +0 -0
- package/dist/{node → lib}/exceptions/stream_execution_exception_data.js.map +0 -0
- package/dist/{node → lib}/exceptions/stream_mode_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/stream_mode_exception.js +0 -0
- package/dist/{node → lib}/exceptions/stream_mode_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/stream_movement_failed_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/stream_movement_failed_exception.js +0 -0
- package/dist/{node → lib}/exceptions/stream_movement_failed_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/stream_movement_failed_exception_data.d.ts +0 -0
- package/dist/{node → lib}/exceptions/stream_movement_failed_exception_data.js +0 -0
- package/dist/{node → lib}/exceptions/stream_movement_failed_exception_data.js.map +0 -0
- package/dist/{node → lib}/exceptions/stream_movement_interrupted_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/stream_movement_interrupted_exception.js +0 -0
- package/dist/{node → lib}/exceptions/stream_movement_interrupted_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/stream_movement_interrupted_exception_data.d.ts +0 -0
- package/dist/{node → lib}/exceptions/stream_movement_interrupted_exception_data.js +0 -0
- package/dist/{node → lib}/exceptions/stream_movement_interrupted_exception_data.js.map +0 -0
- package/dist/{node → lib}/exceptions/stream_setup_failed_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/stream_setup_failed_exception.js +0 -0
- package/dist/{node → lib}/exceptions/stream_setup_failed_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/transport_already_used_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/transport_already_used_exception.js +0 -0
- package/dist/{node → lib}/exceptions/transport_already_used_exception.js.map +0 -0
- package/dist/{node → lib}/exceptions/unknown_request_exception.d.ts +0 -0
- package/dist/{node → lib}/exceptions/unknown_request_exception.js +0 -0
- package/dist/{node → lib}/exceptions/unknown_request_exception.js.map +0 -0
- package/dist/lib/finalizer.d.ts +5 -0
- package/dist/lib/finalizer.js +21 -0
- package/dist/lib/finalizer.js.map +1 -0
- package/dist/{node → lib}/firmware_version.d.ts +0 -0
- package/dist/{node → lib}/firmware_version.js +0 -0
- package/dist/{node → lib}/firmware_version.js.map +0 -0
- package/dist/lib/gateway/bindings.d.ts +5 -0
- package/dist/lib/gateway/bindings.js +35 -0
- package/dist/lib/gateway/bindings.js.map +1 -0
- package/dist/{node/gateway/bindings.d.ts → lib/gateway/bindings.node.d.ts} +0 -0
- package/dist/{node/gateway/bindings.js → lib/gateway/bindings.node.js} +1 -1
- package/dist/lib/gateway/bindings.node.js.map +1 -0
- package/dist/{web/gateway/bindings.d.ts → lib/gateway/bindings.wasm.d.ts} +0 -0
- package/dist/{web/gateway/bindings.js → lib/gateway/bindings.wasm.js} +2 -1
- package/dist/lib/gateway/bindings.wasm.js.map +1 -0
- package/dist/{node → lib}/gateway/call.d.ts +0 -0
- package/dist/{web → lib}/gateway/call.js +2 -2
- package/dist/lib/gateway/call.js.map +1 -0
- package/dist/{node → lib}/gateway/convert_exceptions.d.ts +0 -0
- package/dist/{node → lib}/gateway/convert_exceptions.js +4 -0
- package/dist/lib/gateway/convert_exceptions.js.map +1 -0
- package/dist/{node → lib}/gateway/events.d.ts +0 -1
- package/dist/{node → lib}/gateway/events.js +4 -7
- package/dist/lib/gateway/events.js.map +1 -0
- package/dist/{node → lib}/gateway/index.d.ts +0 -0
- package/dist/{node → lib}/gateway/index.js +0 -0
- package/dist/{node → lib}/gateway/index.js.map +0 -0
- package/dist/{node → lib}/gateway/serialization.d.ts +0 -0
- package/dist/{node → lib}/gateway/serialization.js +0 -0
- package/dist/{node → lib}/gateway/serialization.js.map +0 -0
- package/dist/lib/gateway/wasm-exec.d.ts +1 -0
- package/dist/{web/wasm → lib/gateway}/wasm-exec.js +13 -54
- package/dist/lib/gateway/wasm-exec.js.map +1 -0
- package/dist/lib/gateway/wasm.d.ts +4 -0
- package/dist/{web/wasm → lib/gateway}/wasm.js +1 -3
- package/dist/lib/gateway/wasm.js.map +1 -0
- package/dist/lib/gcode/axis_mapping.d.ts +16 -0
- package/dist/{web/measurement.js → lib/gcode/axis_mapping.js} +11 -11
- package/dist/lib/gcode/axis_mapping.js.map +1 -0
- package/dist/lib/gcode/index.d.ts +8 -0
- package/dist/lib/gcode/index.js +20 -0
- package/dist/lib/gcode/index.js.map +1 -0
- package/dist/lib/gcode/translate_message.d.ts +21 -0
- package/dist/lib/gcode/translate_message.js +19 -0
- package/dist/lib/gcode/translate_message.js.map +1 -0
- package/dist/lib/gcode/translate_result.d.ts +17 -0
- package/dist/lib/gcode/translate_result.js +19 -0
- package/dist/lib/gcode/translate_result.js.map +1 -0
- package/dist/lib/gcode/translator.d.ts +68 -0
- package/dist/lib/gcode/translator.js +144 -0
- package/dist/lib/gcode/translator.js.map +1 -0
- package/dist/lib/gcode/translator_axis_definition.d.ts +20 -0
- package/dist/lib/gcode/translator_axis_definition.js +48 -0
- package/dist/lib/gcode/translator_axis_definition.js.map +1 -0
- package/dist/lib/gcode/translator_config.d.ts +18 -0
- package/dist/lib/gcode/translator_config.js +41 -0
- package/dist/lib/gcode/translator_config.js.map +1 -0
- package/dist/lib/gcode/translator_definition.d.ts +18 -0
- package/dist/{web/ascii/stream_axis_definition.js → lib/gcode/translator_definition.js} +11 -18
- package/dist/lib/gcode/translator_definition.js.map +1 -0
- package/dist/lib/gcode/translator_live.d.ts +70 -0
- package/dist/lib/gcode/translator_live.js +147 -0
- package/dist/lib/gcode/translator_live.js.map +1 -0
- package/dist/lib/gcode_ns.d.ts +19 -0
- package/dist/{web/tools.js → lib/gcode_ns.js} +14 -20
- package/dist/lib/gcode_ns.js.map +1 -0
- package/dist/{node → lib}/index.d.ts +3 -1
- package/dist/{node → lib}/index.js +6 -2
- package/dist/lib/index.js.map +1 -0
- package/dist/{node → lib}/library.d.ts +0 -0
- package/dist/{node → lib}/library.js +0 -0
- package/dist/{node → lib}/library.js.map +0 -0
- package/dist/{node → lib}/log_output_mode.d.ts +0 -0
- package/dist/{node → lib}/log_output_mode.js +0 -0
- package/dist/{node → lib}/log_output_mode.js.map +0 -0
- package/dist/{web → lib}/measurement.d.ts +1 -1
- package/dist/{node → lib}/measurement.js +0 -0
- package/dist/{node → lib}/measurement.js.map +1 -1
- package/dist/{node → lib}/protobufs/main_pb.d.ts +785 -0
- package/dist/{node → lib}/protobufs/main_pb.js +6039 -2
- package/dist/lib/protobufs/main_pb.js.map +1 -0
- package/dist/{node → lib}/rotation_direction.d.ts +0 -0
- package/dist/{node → lib}/rotation_direction.js +0 -0
- package/dist/{node → lib}/rotation_direction.js.map +0 -0
- package/dist/{node → lib}/tools.d.ts +0 -0
- package/dist/{node → lib}/tools.js +0 -0
- package/dist/{node → lib}/tools.js.map +0 -0
- package/dist/{node → lib}/units.d.ts +0 -0
- package/dist/{node → lib}/units.js +0 -0
- package/dist/{node → lib}/units.js.map +0 -0
- package/dist/lib/wasm.d.ts +4 -0
- package/dist/{web/init.js → lib/wasm.js} +5 -4
- package/dist/lib/wasm.js.map +1 -0
- package/package.json +9 -16
- package/dist/node/ascii/axis.d.ts +0 -172
- package/dist/node/ascii/axis.js.map +0 -1
- package/dist/node/ascii/axis_settings.js +0 -107
- package/dist/node/ascii/axis_settings.js.map +0 -1
- package/dist/node/ascii/connection.d.ts +0 -203
- package/dist/node/ascii/connection.js +0 -380
- package/dist/node/ascii/connection.js.map +0 -1
- package/dist/node/ascii/device.d.ts +0 -165
- package/dist/node/ascii/device.js.map +0 -1
- package/dist/node/ascii/device_settings.d.ts +0 -41
- package/dist/node/ascii/device_settings.js +0 -103
- package/dist/node/ascii/device_settings.js.map +0 -1
- package/dist/node/ascii/setting_constants.d.ts +0 -563
- package/dist/node/ascii/setting_constants.js.map +0 -1
- package/dist/node/ascii/stream.d.ts +0 -307
- package/dist/node/ascii/stream.js +0 -659
- package/dist/node/ascii/stream.js.map +0 -1
- package/dist/node/ascii/stream_axis_definition.d.ts +0 -17
- package/dist/node/ascii/stream_buffer.js.map +0 -1
- package/dist/node/binary/connection.js +0 -211
- package/dist/node/binary/connection.js.map +0 -1
- package/dist/node/exceptions/index.d.ts +0 -48
- package/dist/node/exceptions/index.js.map +0 -1
- package/dist/node/gateway/bindings.js.map +0 -1
- package/dist/node/gateway/call.js +0 -46
- package/dist/node/gateway/call.js.map +0 -1
- package/dist/node/gateway/convert_exceptions.js.map +0 -1
- package/dist/node/gateway/events.js.map +0 -1
- package/dist/node/index.js.map +0 -1
- package/dist/node/init.d.ts +0 -1
- package/dist/node/init.js +0 -8
- package/dist/node/init.js.map +0 -1
- package/dist/node/measurement.d.ts +0 -17
- package/dist/web/ascii/alert_event.d.ts +0 -28
- package/dist/web/ascii/alert_event.js +0 -21
- package/dist/web/ascii/alert_event.js.map +0 -1
- package/dist/web/ascii/all_axes.d.ts +0 -46
- package/dist/web/ascii/all_axes.js +0 -122
- package/dist/web/ascii/all_axes.js.map +0 -1
- package/dist/web/ascii/axis.js +0 -367
- package/dist/web/ascii/axis.js.map +0 -1
- package/dist/web/ascii/axis_identity.d.ts +0 -29
- package/dist/web/ascii/axis_identity.js +0 -21
- package/dist/web/ascii/axis_identity.js.map +0 -1
- package/dist/web/ascii/axis_settings.d.ts +0 -41
- package/dist/web/ascii/axis_settings.js.map +0 -1
- package/dist/web/ascii/axis_type.d.ts +0 -8
- package/dist/web/ascii/axis_type.js +0 -15
- package/dist/web/ascii/axis_type.js.map +0 -1
- package/dist/web/ascii/connection.js.map +0 -1
- package/dist/web/ascii/device.js +0 -296
- package/dist/web/ascii/device.js.map +0 -1
- package/dist/web/ascii/device_identity.d.ts +0 -33
- package/dist/web/ascii/device_identity.js +0 -23
- package/dist/web/ascii/device_identity.js.map +0 -1
- package/dist/web/ascii/device_io.d.ts +0 -80
- package/dist/web/ascii/device_io.js +0 -199
- package/dist/web/ascii/device_io.js.map +0 -1
- package/dist/web/ascii/device_io_info.d.ts +0 -24
- package/dist/web/ascii/device_io_info.js +0 -20
- package/dist/web/ascii/device_io_info.js.map +0 -1
- package/dist/web/ascii/device_settings.js.map +0 -1
- package/dist/web/ascii/index.d.ts +0 -26
- package/dist/web/ascii/index.js +0 -56
- package/dist/web/ascii/index.js.map +0 -1
- package/dist/web/ascii/lockstep.d.ts +0 -120
- package/dist/web/ascii/lockstep.js +0 -281
- package/dist/web/ascii/lockstep.js.map +0 -1
- package/dist/web/ascii/lockstep_axes.d.ts +0 -24
- package/dist/web/ascii/lockstep_axes.js +0 -20
- package/dist/web/ascii/lockstep_axes.js.map +0 -1
- package/dist/web/ascii/message_type.d.ts +0 -10
- package/dist/web/ascii/message_type.js +0 -17
- package/dist/web/ascii/message_type.js.map +0 -1
- package/dist/web/ascii/response.d.ts +0 -37
- package/dist/web/ascii/response.js +0 -23
- package/dist/web/ascii/response.js.map +0 -1
- package/dist/web/ascii/setting_constants.js +0 -570
- package/dist/web/ascii/setting_constants.js.map +0 -1
- package/dist/web/ascii/stream.js.map +0 -1
- package/dist/web/ascii/stream_axis_definition.js.map +0 -1
- package/dist/web/ascii/stream_axis_type.d.ts +0 -7
- package/dist/web/ascii/stream_axis_type.js +0 -14
- package/dist/web/ascii/stream_axis_type.js.map +0 -1
- package/dist/web/ascii/stream_buffer.d.ts +0 -27
- package/dist/web/ascii/stream_buffer.js +0 -71
- package/dist/web/ascii/stream_buffer.js.map +0 -1
- package/dist/web/ascii/stream_mode.d.ts +0 -9
- package/dist/web/ascii/stream_mode.js +0 -16
- package/dist/web/ascii/stream_mode.js.map +0 -1
- package/dist/web/ascii/transport.d.ts +0 -38
- package/dist/web/ascii/transport.js +0 -91
- package/dist/web/ascii/transport.js.map +0 -1
- package/dist/web/ascii/unknown_response_event.d.ts +0 -37
- package/dist/web/ascii/unknown_response_event.js +0 -23
- package/dist/web/ascii/unknown_response_event.js.map +0 -1
- package/dist/web/ascii/warning_flags.d.ts +0 -137
- package/dist/web/ascii/warning_flags.js +0 -144
- package/dist/web/ascii/warning_flags.js.map +0 -1
- package/dist/web/ascii/warnings.d.ts +0 -19
- package/dist/web/ascii/warnings.js +0 -62
- package/dist/web/ascii/warnings.js.map +0 -1
- package/dist/web/ascii_ns.d.ts +0 -55
- package/dist/web/ascii_ns.js +0 -53
- package/dist/web/ascii_ns.js.map +0 -1
- package/dist/web/binary/binary_settings.d.ts +0 -70
- package/dist/web/binary/binary_settings.js +0 -77
- package/dist/web/binary/binary_settings.js.map +0 -1
- package/dist/web/binary/command_code.d.ts +0 -102
- package/dist/web/binary/command_code.js +0 -109
- package/dist/web/binary/command_code.js.map +0 -1
- package/dist/web/binary/connection.d.ts +0 -115
- package/dist/web/binary/connection.js.map +0 -1
- package/dist/web/binary/device.d.ts +0 -192
- package/dist/web/binary/device.js +0 -375
- package/dist/web/binary/device.js.map +0 -1
- package/dist/web/binary/device_identity.d.ts +0 -42
- package/dist/web/binary/device_identity.js +0 -25
- package/dist/web/binary/device_identity.js.map +0 -1
- package/dist/web/binary/device_settings.d.ts +0 -24
- package/dist/web/binary/device_settings.js +0 -66
- package/dist/web/binary/device_settings.js.map +0 -1
- package/dist/web/binary/device_type.d.ts +0 -8
- package/dist/web/binary/device_type.js +0 -15
- package/dist/web/binary/device_type.js.map +0 -1
- package/dist/web/binary/error_code.d.ts +0 -97
- package/dist/web/binary/error_code.js +0 -104
- package/dist/web/binary/error_code.js.map +0 -1
- package/dist/web/binary/index.d.ts +0 -12
- package/dist/web/binary/index.js +0 -28
- package/dist/web/binary/index.js.map +0 -1
- package/dist/web/binary/message.d.ts +0 -20
- package/dist/web/binary/message.js +0 -19
- package/dist/web/binary/message.js.map +0 -1
- package/dist/web/binary/reply_code.d.ts +0 -12
- package/dist/web/binary/reply_code.js +0 -19
- package/dist/web/binary/reply_code.js.map +0 -1
- package/dist/web/binary/reply_only_event.d.ts +0 -20
- package/dist/web/binary/reply_only_event.js +0 -19
- package/dist/web/binary/reply_only_event.js.map +0 -1
- package/dist/web/binary/unknown_response_event.d.ts +0 -20
- package/dist/web/binary/unknown_response_event.js +0 -19
- package/dist/web/binary/unknown_response_event.js.map +0 -1
- package/dist/web/binary_ns.d.ts +0 -27
- package/dist/web/binary_ns.js +0 -39
- package/dist/web/binary_ns.js.map +0 -1
- package/dist/web/device_db_source_type.d.ts +0 -7
- package/dist/web/device_db_source_type.js +0 -14
- package/dist/web/device_db_source_type.js.map +0 -1
- package/dist/web/exceptions/binary_command_failed_exception.d.ts +0 -14
- package/dist/web/exceptions/binary_command_failed_exception.js +0 -32
- package/dist/web/exceptions/binary_command_failed_exception.js.map +0 -1
- package/dist/web/exceptions/binary_command_failed_exception_data.d.ts +0 -12
- package/dist/web/exceptions/binary_command_failed_exception_data.js +0 -17
- package/dist/web/exceptions/binary_command_failed_exception_data.js.map +0 -1
- package/dist/web/exceptions/command_failed_exception.d.ts +0 -14
- package/dist/web/exceptions/command_failed_exception.js +0 -32
- package/dist/web/exceptions/command_failed_exception.js.map +0 -1
- package/dist/web/exceptions/command_failed_exception_data.d.ts +0 -24
- package/dist/web/exceptions/command_failed_exception_data.js +0 -20
- package/dist/web/exceptions/command_failed_exception_data.js.map +0 -1
- package/dist/web/exceptions/command_preempted_exception.d.ts +0 -7
- package/dist/web/exceptions/command_preempted_exception.js +0 -17
- package/dist/web/exceptions/command_preempted_exception.js.map +0 -1
- package/dist/web/exceptions/connection_closed_exception.d.ts +0 -7
- package/dist/web/exceptions/connection_closed_exception.js +0 -17
- package/dist/web/exceptions/connection_closed_exception.js.map +0 -1
- package/dist/web/exceptions/connection_failed_exception.d.ts +0 -7
- package/dist/web/exceptions/connection_failed_exception.js +0 -17
- package/dist/web/exceptions/connection_failed_exception.js.map +0 -1
- package/dist/web/exceptions/conversion_failed_exception.d.ts +0 -7
- package/dist/web/exceptions/conversion_failed_exception.js +0 -17
- package/dist/web/exceptions/conversion_failed_exception.js.map +0 -1
- package/dist/web/exceptions/device_address_conflict_exception.d.ts +0 -14
- package/dist/web/exceptions/device_address_conflict_exception.js +0 -32
- package/dist/web/exceptions/device_address_conflict_exception.js.map +0 -1
- package/dist/web/exceptions/device_address_conflict_exception_data.d.ts +0 -12
- package/dist/web/exceptions/device_address_conflict_exception_data.js +0 -17
- package/dist/web/exceptions/device_address_conflict_exception_data.js.map +0 -1
- package/dist/web/exceptions/device_busy_exception.d.ts +0 -7
- package/dist/web/exceptions/device_busy_exception.js +0 -17
- package/dist/web/exceptions/device_busy_exception.js.map +0 -1
- package/dist/web/exceptions/device_db_failed_exception.d.ts +0 -7
- package/dist/web/exceptions/device_db_failed_exception.js +0 -17
- package/dist/web/exceptions/device_db_failed_exception.js.map +0 -1
- package/dist/web/exceptions/device_failed_exception.d.ts +0 -8
- package/dist/web/exceptions/device_failed_exception.js +0 -18
- package/dist/web/exceptions/device_failed_exception.js.map +0 -1
- package/dist/web/exceptions/device_not_identified_exception.d.ts +0 -7
- package/dist/web/exceptions/device_not_identified_exception.js +0 -17
- package/dist/web/exceptions/device_not_identified_exception.js.map +0 -1
- package/dist/web/exceptions/index.js +0 -102
- package/dist/web/exceptions/index.js.map +0 -1
- package/dist/web/exceptions/internal_error_exception.d.ts +0 -7
- package/dist/web/exceptions/internal_error_exception.js +0 -17
- package/dist/web/exceptions/internal_error_exception.js.map +0 -1
- package/dist/web/exceptions/invalid_argument_exception.d.ts +0 -7
- package/dist/web/exceptions/invalid_argument_exception.js +0 -17
- package/dist/web/exceptions/invalid_argument_exception.js.map +0 -1
- package/dist/web/exceptions/invalid_data_exception.d.ts +0 -7
- package/dist/web/exceptions/invalid_data_exception.js +0 -17
- package/dist/web/exceptions/invalid_data_exception.js.map +0 -1
- package/dist/web/exceptions/invalid_packet_exception.d.ts +0 -14
- package/dist/web/exceptions/invalid_packet_exception.js +0 -32
- package/dist/web/exceptions/invalid_packet_exception.js.map +0 -1
- package/dist/web/exceptions/invalid_packet_exception_data.d.ts +0 -16
- package/dist/web/exceptions/invalid_packet_exception_data.js +0 -18
- package/dist/web/exceptions/invalid_packet_exception_data.js.map +0 -1
- package/dist/web/exceptions/invalid_park_state_exception.d.ts +0 -7
- package/dist/web/exceptions/invalid_park_state_exception.js +0 -17
- package/dist/web/exceptions/invalid_park_state_exception.js.map +0 -1
- package/dist/web/exceptions/invalid_response_exception.d.ts +0 -14
- package/dist/web/exceptions/invalid_response_exception.js +0 -32
- package/dist/web/exceptions/invalid_response_exception.js.map +0 -1
- package/dist/web/exceptions/invalid_response_exception_data.d.ts +0 -12
- package/dist/web/exceptions/invalid_response_exception_data.js +0 -17
- package/dist/web/exceptions/invalid_response_exception_data.js.map +0 -1
- package/dist/web/exceptions/io_channel_out_of_range_exception.d.ts +0 -7
- package/dist/web/exceptions/io_channel_out_of_range_exception.js +0 -17
- package/dist/web/exceptions/io_channel_out_of_range_exception.js.map +0 -1
- package/dist/web/exceptions/io_failed_exception.d.ts +0 -7
- package/dist/web/exceptions/io_failed_exception.js +0 -17
- package/dist/web/exceptions/io_failed_exception.js.map +0 -1
- package/dist/web/exceptions/lockstep_enabled_exception.d.ts +0 -7
- package/dist/web/exceptions/lockstep_enabled_exception.js +0 -17
- package/dist/web/exceptions/lockstep_enabled_exception.js.map +0 -1
- package/dist/web/exceptions/lockstep_not_enabled_exception.d.ts +0 -7
- package/dist/web/exceptions/lockstep_not_enabled_exception.js +0 -17
- package/dist/web/exceptions/lockstep_not_enabled_exception.js.map +0 -1
- package/dist/web/exceptions/motion_lib_exception.d.ts +0 -8
- package/dist/web/exceptions/motion_lib_exception.js +0 -15
- package/dist/web/exceptions/motion_lib_exception.js.map +0 -1
- package/dist/web/exceptions/movement_failed_exception.d.ts +0 -14
- package/dist/web/exceptions/movement_failed_exception.js +0 -32
- package/dist/web/exceptions/movement_failed_exception.js.map +0 -1
- package/dist/web/exceptions/movement_failed_exception_data.d.ts +0 -16
- package/dist/web/exceptions/movement_failed_exception_data.js +0 -18
- package/dist/web/exceptions/movement_failed_exception_data.js.map +0 -1
- package/dist/web/exceptions/movement_interrupted_exception.d.ts +0 -14
- package/dist/web/exceptions/movement_interrupted_exception.js +0 -32
- package/dist/web/exceptions/movement_interrupted_exception.js.map +0 -1
- package/dist/web/exceptions/movement_interrupted_exception_data.d.ts +0 -16
- package/dist/web/exceptions/movement_interrupted_exception_data.js +0 -18
- package/dist/web/exceptions/movement_interrupted_exception_data.js.map +0 -1
- package/dist/web/exceptions/no_device_found_exception.d.ts +0 -7
- package/dist/web/exceptions/no_device_found_exception.js +0 -17
- package/dist/web/exceptions/no_device_found_exception.js.map +0 -1
- package/dist/web/exceptions/not_supported_exception.d.ts +0 -7
- package/dist/web/exceptions/not_supported_exception.js +0 -17
- package/dist/web/exceptions/not_supported_exception.js.map +0 -1
- package/dist/web/exceptions/os_failed_exception.d.ts +0 -7
- package/dist/web/exceptions/os_failed_exception.js +0 -17
- package/dist/web/exceptions/os_failed_exception.js.map +0 -1
- package/dist/web/exceptions/out_of_request_ids_exception.d.ts +0 -7
- package/dist/web/exceptions/out_of_request_ids_exception.js +0 -17
- package/dist/web/exceptions/out_of_request_ids_exception.js.map +0 -1
- package/dist/web/exceptions/request_timeout_exception.d.ts +0 -7
- package/dist/web/exceptions/request_timeout_exception.js +0 -17
- package/dist/web/exceptions/request_timeout_exception.js.map +0 -1
- package/dist/web/exceptions/serial_port_busy_exception.d.ts +0 -7
- package/dist/web/exceptions/serial_port_busy_exception.js +0 -17
- package/dist/web/exceptions/serial_port_busy_exception.js.map +0 -1
- package/dist/web/exceptions/setting_not_found_exception.d.ts +0 -7
- package/dist/web/exceptions/setting_not_found_exception.js +0 -17
- package/dist/web/exceptions/setting_not_found_exception.js.map +0 -1
- package/dist/web/exceptions/stream_execution_exception.d.ts +0 -14
- package/dist/web/exceptions/stream_execution_exception.js +0 -32
- package/dist/web/exceptions/stream_execution_exception.js.map +0 -1
- package/dist/web/exceptions/stream_execution_exception_data.d.ts +0 -16
- package/dist/web/exceptions/stream_execution_exception_data.js +0 -18
- package/dist/web/exceptions/stream_execution_exception_data.js.map +0 -1
- package/dist/web/exceptions/stream_mode_exception.d.ts +0 -7
- package/dist/web/exceptions/stream_mode_exception.js +0 -17
- package/dist/web/exceptions/stream_mode_exception.js.map +0 -1
- package/dist/web/exceptions/stream_movement_failed_exception.d.ts +0 -14
- package/dist/web/exceptions/stream_movement_failed_exception.js +0 -32
- package/dist/web/exceptions/stream_movement_failed_exception.js.map +0 -1
- package/dist/web/exceptions/stream_movement_failed_exception_data.d.ts +0 -16
- package/dist/web/exceptions/stream_movement_failed_exception_data.js +0 -18
- package/dist/web/exceptions/stream_movement_failed_exception_data.js.map +0 -1
- package/dist/web/exceptions/stream_movement_interrupted_exception.d.ts +0 -14
- package/dist/web/exceptions/stream_movement_interrupted_exception.js +0 -32
- package/dist/web/exceptions/stream_movement_interrupted_exception.js.map +0 -1
- package/dist/web/exceptions/stream_movement_interrupted_exception_data.d.ts +0 -16
- package/dist/web/exceptions/stream_movement_interrupted_exception_data.js +0 -18
- package/dist/web/exceptions/stream_movement_interrupted_exception_data.js.map +0 -1
- package/dist/web/exceptions/stream_setup_failed_exception.d.ts +0 -7
- package/dist/web/exceptions/stream_setup_failed_exception.js +0 -17
- package/dist/web/exceptions/stream_setup_failed_exception.js.map +0 -1
- package/dist/web/exceptions/transport_already_used_exception.d.ts +0 -7
- package/dist/web/exceptions/transport_already_used_exception.js +0 -17
- package/dist/web/exceptions/transport_already_used_exception.js.map +0 -1
- package/dist/web/exceptions/unknown_request_exception.d.ts +0 -7
- package/dist/web/exceptions/unknown_request_exception.js +0 -17
- package/dist/web/exceptions/unknown_request_exception.js.map +0 -1
- package/dist/web/firmware_version.d.ts +0 -20
- package/dist/web/firmware_version.js +0 -19
- package/dist/web/firmware_version.js.map +0 -1
- package/dist/web/gateway/bindings.js.map +0 -1
- package/dist/web/gateway/call.d.ts +0 -6
- package/dist/web/gateway/call.js.map +0 -1
- package/dist/web/gateway/convert_exceptions.d.ts +0 -4
- package/dist/web/gateway/convert_exceptions.js +0 -74
- package/dist/web/gateway/convert_exceptions.js.map +0 -1
- package/dist/web/gateway/events.d.ts +0 -9
- package/dist/web/gateway/events.js +0 -60
- package/dist/web/gateway/events.js.map +0 -1
- package/dist/web/gateway/index.d.ts +0 -4
- package/dist/web/gateway/index.js +0 -23
- package/dist/web/gateway/index.js.map +0 -1
- package/dist/web/gateway/serialization.d.ts +0 -6
- package/dist/web/gateway/serialization.js +0 -39
- package/dist/web/gateway/serialization.js.map +0 -1
- package/dist/web/index.d.ts +0 -12
- package/dist/web/index.js +0 -33
- package/dist/web/index.js.map +0 -1
- package/dist/web/init.d.ts +0 -5
- package/dist/web/init.js.map +0 -1
- package/dist/web/library.d.ts +0 -30
- package/dist/web/library.js +0 -73
- package/dist/web/library.js.map +0 -1
- package/dist/web/log_output_mode.d.ts +0 -9
- package/dist/web/log_output_mode.js +0 -16
- package/dist/web/log_output_mode.js.map +0 -1
- package/dist/web/measurement.js.map +0 -1
- package/dist/web/protobufs/main_pb.d.ts +0 -5228
- package/dist/web/protobufs/main_pb.js +0 -39387
- package/dist/web/rotation_direction.d.ts +0 -9
- package/dist/web/rotation_direction.js +0 -16
- package/dist/web/rotation_direction.js.map +0 -1
- package/dist/web/tools.d.ts +0 -10
- package/dist/web/tools.js.map +0 -1
- package/dist/web/units.d.ts +0 -147
- package/dist/web/units.js +0 -167
- package/dist/web/units.js.map +0 -1
- package/dist/web/wasm/wasm-exec.d.ts +0 -1
- package/dist/web/wasm/wasm-exec.js.map +0 -1
- package/dist/web/wasm/wasm.d.ts +0 -14
- package/dist/web/wasm/wasm.js.map +0 -1
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import '../init';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { Transport } from './transport';
|
|
4
|
-
import { Device } from './device';
|
|
5
|
-
import { Response } from './response';
|
|
6
|
-
import { UnknownResponseEvent } from './unknown_response_event';
|
|
7
|
-
import { AlertEvent } from './alert_event';
|
|
8
|
-
import { MotionLibException } from '../exceptions';
|
|
9
|
-
/**
|
|
10
|
-
* Class representing access to particular connection (serial port, TCP connection).
|
|
11
|
-
*/
|
|
12
|
-
export declare class Connection {
|
|
13
|
-
/**
|
|
14
|
-
* Event invoked when a response from a device cannot be matched to any known request.
|
|
15
|
-
*/
|
|
16
|
-
unknownResponse: Observable<UnknownResponseEvent>;
|
|
17
|
-
/**
|
|
18
|
-
* Event invoked when an alert is received from a device.
|
|
19
|
-
*/
|
|
20
|
-
alert: Observable<AlertEvent>;
|
|
21
|
-
/**
|
|
22
|
-
* Default baud rate for serial connections.
|
|
23
|
-
*/
|
|
24
|
-
static readonly DEFAULT_BAUD_RATE: number;
|
|
25
|
-
/**
|
|
26
|
-
* The interface ID identifies this Connection instance with the underlying library.
|
|
27
|
-
*/
|
|
28
|
-
get interfaceId(): number;
|
|
29
|
-
private _interfaceId;
|
|
30
|
-
/**
|
|
31
|
-
* The default timeout, in milliseconds, for a device to respond to a request.
|
|
32
|
-
* Setting the timeout to a too low value may cause request timeout exceptions.
|
|
33
|
-
*/
|
|
34
|
-
get defaultRequestTimeout(): number;
|
|
35
|
-
set defaultRequestTimeout(value: number);
|
|
36
|
-
/**
|
|
37
|
-
* Controls whether outgoing messages contain checksum.
|
|
38
|
-
*/
|
|
39
|
-
get checksumEnabled(): boolean;
|
|
40
|
-
set checksumEnabled(value: boolean);
|
|
41
|
-
constructor(interfaceId: number);
|
|
42
|
-
/**
|
|
43
|
-
* Opens a serial port, if Zaber Launcher controls the port, the port will be opened through Zaber Launcher.
|
|
44
|
-
* Zaber Launcher allows sharing of the port between multiple applications.
|
|
45
|
-
* Use openSerialPortDirectly if sharing is not desirable.
|
|
46
|
-
* @param portName Name of the port to open.
|
|
47
|
-
* @param baudRate Optional baud rate (defaults to 115200).
|
|
48
|
-
* @return An object representing the port.
|
|
49
|
-
*/
|
|
50
|
-
static openSerialPort(portName: string, baudRate?: number): Promise<Connection>;
|
|
51
|
-
/**
|
|
52
|
-
* Opens a serial port, bypassing Zaber Launcher.
|
|
53
|
-
* If the port is already opened by Zaber Launcher, this will fail.
|
|
54
|
-
* @param portName Name of the port to open.
|
|
55
|
-
* @param baudRate Optional baud rate (defaults to 115200).
|
|
56
|
-
* @return An object representing the port.
|
|
57
|
-
*/
|
|
58
|
-
static openSerialPortDirectly(portName: string, baudRate?: number): Promise<Connection>;
|
|
59
|
-
/**
|
|
60
|
-
* Opens a TCP connection.
|
|
61
|
-
* @param hostName Hostname or IP address.
|
|
62
|
-
* @param port Port number.
|
|
63
|
-
* @return An object representing the connection.
|
|
64
|
-
*/
|
|
65
|
-
static openTcp(hostName: string, port: number): Promise<Connection>;
|
|
66
|
-
/**
|
|
67
|
-
* Opens a connection using a custom transport.
|
|
68
|
-
* @param transport The custom connection transport.
|
|
69
|
-
* @return An object representing the connection.
|
|
70
|
-
*/
|
|
71
|
-
static openCustom(transport: Transport): Promise<Connection>;
|
|
72
|
-
/**
|
|
73
|
-
* Opens a unauthenticated connection to a cloud connected device chain.
|
|
74
|
-
* Use this method to connect to Virtual Device Demo instance.
|
|
75
|
-
* @param cloudId The cloud ID to connect to.
|
|
76
|
-
* @param connectionName The name of the connection to open.
|
|
77
|
-
* Can be left empty to default to the only connection present.
|
|
78
|
-
* Otherwise, use serial port name for serial port connection or hostname:port for TCP connection.
|
|
79
|
-
* @param api The URL of the API to receive connection info from.
|
|
80
|
-
* @return An object representing the connection.
|
|
81
|
-
*/
|
|
82
|
-
static openIotUnauthenticated(cloudId: string, connectionName?: string, api?: string): Promise<Connection>;
|
|
83
|
-
/**
|
|
84
|
-
* Opens a secured connection to a cloud connected device chain.
|
|
85
|
-
* Use this method to connect to devices on your account.
|
|
86
|
-
* @param cloudId The cloud ID to connect to.
|
|
87
|
-
* @param token The token to authenticate with.
|
|
88
|
-
* @param connectionName The name of the connection to open.
|
|
89
|
-
* Can be left empty to default to the only connection present.
|
|
90
|
-
* Otherwise, use serial port name for serial port connection or hostname:port for TCP connection.
|
|
91
|
-
* @param realm The realm to connect to.
|
|
92
|
-
* @param api The URL of the API to receive connection info from.
|
|
93
|
-
* @return An object representing the connection.
|
|
94
|
-
*/
|
|
95
|
-
static openIotAuthenticated(cloudId: string, token: string, connectionName?: string, realm?: string, api?: string): Promise<Connection>;
|
|
96
|
-
/**
|
|
97
|
-
* Sends a generic ASCII command to this connection.
|
|
98
|
-
* For more information refer to the [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).
|
|
99
|
-
* @param command Command and its parameters.
|
|
100
|
-
* @param device Optional device address to send the command to.
|
|
101
|
-
* @param axis Optional axis number to send the command to.
|
|
102
|
-
* @param checkErrors Controls whether to throw an exception when the device rejects the command.
|
|
103
|
-
* @param timeout The timeout, in milliseconds, for a device to respond to the command.
|
|
104
|
-
* Overrides the connection default request timeout.
|
|
105
|
-
* @return A response to the command.
|
|
106
|
-
*/
|
|
107
|
-
genericCommand(command: string, device?: number, axis?: number, checkErrors?: boolean, timeout?: number): Promise<Response>;
|
|
108
|
-
/**
|
|
109
|
-
* Sends a generic ASCII command to this connection without expecting a response and without adding a message ID.
|
|
110
|
-
* For more information refer to the [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).
|
|
111
|
-
* @param command Command and its parameters.
|
|
112
|
-
* @param device Optional device address to send the command to.
|
|
113
|
-
* @param axis Optional axis number to send the command to.
|
|
114
|
-
*/
|
|
115
|
-
genericCommandNoResponse(command: string, device?: number, axis?: number): Promise<void>;
|
|
116
|
-
/**
|
|
117
|
-
* Sends a generic ASCII command to this connection and expect multiple responses,
|
|
118
|
-
* either from one device or from many devices.
|
|
119
|
-
* Responses are returned in order of arrival.
|
|
120
|
-
* For more information refer to the [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).
|
|
121
|
-
* @param command Command and its parameters.
|
|
122
|
-
* @param device Optional device address to send the command to.
|
|
123
|
-
* @param axis Optional axis number to send the command to.
|
|
124
|
-
* @param checkErrors Controls whether to throw an exception when a device rejects the command.
|
|
125
|
-
* @param timeout The timeout, in milliseconds, for a device to respond to the command.
|
|
126
|
-
* Overrides the connection default request timeout.
|
|
127
|
-
* @return All responses to the command.
|
|
128
|
-
*/
|
|
129
|
-
genericCommandMultiResponse(command: string, device?: number, axis?: number, checkErrors?: boolean, timeout?: number): Promise<Response[]>;
|
|
130
|
-
/**
|
|
131
|
-
* Resets ASCII protocol message IDs. Only for testing purposes.
|
|
132
|
-
*/
|
|
133
|
-
resetIds(): void;
|
|
134
|
-
/**
|
|
135
|
-
* Close the connection.
|
|
136
|
-
*/
|
|
137
|
-
close(): Promise<void>;
|
|
138
|
-
/**
|
|
139
|
-
* Gets a Device class instance which allows you to control a particular device on this connection.
|
|
140
|
-
* Devices are numbered from 1.
|
|
141
|
-
* @param deviceAddress Address of device intended to control. Address is configured for each device.
|
|
142
|
-
* @return Device instance.
|
|
143
|
-
*/
|
|
144
|
-
getDevice(deviceAddress: number): Device;
|
|
145
|
-
/**
|
|
146
|
-
* Renumbers devices present on this connection. After renumbering, devices need to be identified again.
|
|
147
|
-
* @param firstAddress This is the address that the device closest to the computer is given.
|
|
148
|
-
* Remaining devices are numbered consecutively.
|
|
149
|
-
* @return Total number of devices that responded to the renumber.
|
|
150
|
-
*/
|
|
151
|
-
renumberDevices(firstAddress?: number): Promise<number>;
|
|
152
|
-
/**
|
|
153
|
-
* Attempts to detect any devices present on this connection.
|
|
154
|
-
* @param identifyDevices Determines whether device identification should be performed as well.
|
|
155
|
-
* @return Array of detected devices.
|
|
156
|
-
*/
|
|
157
|
-
detectDevices(identifyDevices?: boolean): Promise<Device[]>;
|
|
158
|
-
/**
|
|
159
|
-
* Stops all of the devices on this connection.
|
|
160
|
-
* @param waitUntilIdle Determines whether the function should return immediately
|
|
161
|
-
* or wait until the devices are stopped.
|
|
162
|
-
* @return The addresses of the devices that were stopped by this command.
|
|
163
|
-
*/
|
|
164
|
-
stopAll(waitUntilIdle?: boolean): Promise<number[]>;
|
|
165
|
-
/**
|
|
166
|
-
* Homes all of the devices on this connection.
|
|
167
|
-
* @param waitUntilIdle Determines whether the function should return immediately
|
|
168
|
-
* or wait until the devices are homed.
|
|
169
|
-
* @return The addresses of the devices that were homed by this command.
|
|
170
|
-
*/
|
|
171
|
-
homeAll(waitUntilIdle?: boolean): Promise<number[]>;
|
|
172
|
-
/**
|
|
173
|
-
* Returns a string that represents the connection.
|
|
174
|
-
* @return A string that represents the connection.
|
|
175
|
-
*/
|
|
176
|
-
toString(): string;
|
|
177
|
-
/**
|
|
178
|
-
* Returns default request timeout.
|
|
179
|
-
* @return Default request timeout.
|
|
180
|
-
*/
|
|
181
|
-
private _retrieveTimeout;
|
|
182
|
-
/**
|
|
183
|
-
* Sets default request timeout.
|
|
184
|
-
* @param timeout Default request timeout.
|
|
185
|
-
*/
|
|
186
|
-
private _changeTimeout;
|
|
187
|
-
/**
|
|
188
|
-
* Returns checksum enabled.
|
|
189
|
-
* @return Checksum enabled.
|
|
190
|
-
*/
|
|
191
|
-
private _retrieveChecksumEnabled;
|
|
192
|
-
/**
|
|
193
|
-
* Sets checksum enabled.
|
|
194
|
-
* @param isEnabled Checksum enabled.
|
|
195
|
-
*/
|
|
196
|
-
private _changeChecksumEnabled;
|
|
197
|
-
private _disconnected;
|
|
198
|
-
/**
|
|
199
|
-
* Event invoked when connection is interrupted or closed.
|
|
200
|
-
*/
|
|
201
|
-
get disconnected(): Observable<MotionLibException>;
|
|
202
|
-
private _subscribe;
|
|
203
|
-
}
|
|
@@ -1,380 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //
|
|
3
|
-
// ============= DO NOT EDIT DIRECTLY ============= //
|
|
4
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
-
if (k2 === undefined) k2 = k;
|
|
6
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
7
|
-
}) : (function(o, m, k, k2) {
|
|
8
|
-
if (k2 === undefined) k2 = k;
|
|
9
|
-
o[k2] = m[k];
|
|
10
|
-
}));
|
|
11
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
12
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
13
|
-
}) : function(o, v) {
|
|
14
|
-
o["default"] = v;
|
|
15
|
-
});
|
|
16
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
17
|
-
if (mod && mod.__esModule) return mod;
|
|
18
|
-
var result = {};
|
|
19
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
20
|
-
__setModuleDefault(result, mod);
|
|
21
|
-
return result;
|
|
22
|
-
};
|
|
23
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.Connection = void 0;
|
|
25
|
-
require("../init");
|
|
26
|
-
const rxjs_1 = require("rxjs");
|
|
27
|
-
const operators_1 = require("rxjs/operators");
|
|
28
|
-
const gateway = __importStar(require("../gateway"));
|
|
29
|
-
const gateway_1 = require("../gateway");
|
|
30
|
-
const device_1 = require("./device");
|
|
31
|
-
const response_1 = require("./response");
|
|
32
|
-
const unknown_response_event_1 = require("./unknown_response_event");
|
|
33
|
-
const alert_event_1 = require("./alert_event");
|
|
34
|
-
/**
|
|
35
|
-
* Class representing access to particular connection (serial port, TCP connection).
|
|
36
|
-
*/
|
|
37
|
-
class Connection {
|
|
38
|
-
constructor(interfaceId) {
|
|
39
|
-
this._disconnected = new rxjs_1.ReplaySubject();
|
|
40
|
-
this._interfaceId = interfaceId;
|
|
41
|
-
this._subscribe();
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* The interface ID identifies this Connection instance with the underlying library.
|
|
45
|
-
*/
|
|
46
|
-
get interfaceId() {
|
|
47
|
-
return this._interfaceId;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* The default timeout, in milliseconds, for a device to respond to a request.
|
|
51
|
-
* Setting the timeout to a too low value may cause request timeout exceptions.
|
|
52
|
-
*/
|
|
53
|
-
get defaultRequestTimeout() {
|
|
54
|
-
return this._retrieveTimeout();
|
|
55
|
-
}
|
|
56
|
-
set defaultRequestTimeout(value) {
|
|
57
|
-
this._changeTimeout(value);
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Controls whether outgoing messages contain checksum.
|
|
61
|
-
*/
|
|
62
|
-
get checksumEnabled() {
|
|
63
|
-
return this._retrieveChecksumEnabled();
|
|
64
|
-
}
|
|
65
|
-
set checksumEnabled(value) {
|
|
66
|
-
this._changeChecksumEnabled(value);
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Opens a serial port, if Zaber Launcher controls the port, the port will be opened through Zaber Launcher.
|
|
70
|
-
* Zaber Launcher allows sharing of the port between multiple applications.
|
|
71
|
-
* Use openSerialPortDirectly if sharing is not desirable.
|
|
72
|
-
* @param portName Name of the port to open.
|
|
73
|
-
* @param baudRate Optional baud rate (defaults to 115200).
|
|
74
|
-
* @return An object representing the port.
|
|
75
|
-
*/
|
|
76
|
-
static async openSerialPort(portName, baudRate = Connection.DEFAULT_BAUD_RATE) {
|
|
77
|
-
const request = new gateway.OpenInterfaceRequest();
|
|
78
|
-
request.setInterfaceType(gateway.InterfaceType.SERIAL_PORT);
|
|
79
|
-
request.setPortName(portName);
|
|
80
|
-
request.setBaudRate(baudRate);
|
|
81
|
-
const response = await gateway.callAsync('interface/open', request, gateway.OpenInterfaceResponse);
|
|
82
|
-
return new Connection(response.getInterfaceId());
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Opens a serial port, bypassing Zaber Launcher.
|
|
86
|
-
* If the port is already opened by Zaber Launcher, this will fail.
|
|
87
|
-
* @param portName Name of the port to open.
|
|
88
|
-
* @param baudRate Optional baud rate (defaults to 115200).
|
|
89
|
-
* @return An object representing the port.
|
|
90
|
-
*/
|
|
91
|
-
static async openSerialPortDirectly(portName, baudRate = Connection.DEFAULT_BAUD_RATE) {
|
|
92
|
-
const request = new gateway.OpenInterfaceRequest();
|
|
93
|
-
request.setInterfaceType(gateway.InterfaceType.SERIAL_PORT);
|
|
94
|
-
request.setRejectRoutedConnection(true);
|
|
95
|
-
request.setPortName(portName);
|
|
96
|
-
request.setBaudRate(baudRate);
|
|
97
|
-
const response = await gateway.callAsync('interface/open', request, gateway.OpenInterfaceResponse);
|
|
98
|
-
return new Connection(response.getInterfaceId());
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Opens a TCP connection.
|
|
102
|
-
* @param hostName Hostname or IP address.
|
|
103
|
-
* @param port Port number.
|
|
104
|
-
* @return An object representing the connection.
|
|
105
|
-
*/
|
|
106
|
-
static async openTcp(hostName, port) {
|
|
107
|
-
const request = new gateway.OpenInterfaceRequest();
|
|
108
|
-
request.setInterfaceType(gateway.InterfaceType.TCP);
|
|
109
|
-
request.setHostName(hostName);
|
|
110
|
-
request.setPort(port);
|
|
111
|
-
const response = await gateway.callAsync('interface/open', request, gateway.OpenInterfaceResponse);
|
|
112
|
-
return new Connection(response.getInterfaceId());
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Opens a connection using a custom transport.
|
|
116
|
-
* @param transport The custom connection transport.
|
|
117
|
-
* @return An object representing the connection.
|
|
118
|
-
*/
|
|
119
|
-
static async openCustom(transport) {
|
|
120
|
-
const request = new gateway.OpenInterfaceRequest();
|
|
121
|
-
request.setInterfaceType(gateway.InterfaceType.CUSTOM);
|
|
122
|
-
request.setTransport(transport.transportId);
|
|
123
|
-
const response = await gateway.callAsync('interface/open', request, gateway.OpenInterfaceResponse);
|
|
124
|
-
return new Connection(response.getInterfaceId());
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Opens a unauthenticated connection to a cloud connected device chain.
|
|
128
|
-
* Use this method to connect to Virtual Device Demo instance.
|
|
129
|
-
* @param cloudId The cloud ID to connect to.
|
|
130
|
-
* @param connectionName The name of the connection to open.
|
|
131
|
-
* Can be left empty to default to the only connection present.
|
|
132
|
-
* Otherwise, use serial port name for serial port connection or hostname:port for TCP connection.
|
|
133
|
-
* @param api The URL of the API to receive connection info from.
|
|
134
|
-
* @return An object representing the connection.
|
|
135
|
-
*/
|
|
136
|
-
static async openIotUnauthenticated(cloudId, connectionName = '', api = 'https://api.zaber.io') {
|
|
137
|
-
const request = new gateway.OpenInterfaceRequest();
|
|
138
|
-
request.setInterfaceType(gateway.InterfaceType.IOT);
|
|
139
|
-
request.setRealm('unauthenticated');
|
|
140
|
-
request.setToken('unauthenticated');
|
|
141
|
-
request.setCloudId(cloudId);
|
|
142
|
-
request.setConnectionName(connectionName);
|
|
143
|
-
request.setApi(api);
|
|
144
|
-
const response = await gateway.callAsync('interface/open', request, gateway.OpenInterfaceResponse);
|
|
145
|
-
return new Connection(response.getInterfaceId());
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Opens a secured connection to a cloud connected device chain.
|
|
149
|
-
* Use this method to connect to devices on your account.
|
|
150
|
-
* @param cloudId The cloud ID to connect to.
|
|
151
|
-
* @param token The token to authenticate with.
|
|
152
|
-
* @param connectionName The name of the connection to open.
|
|
153
|
-
* Can be left empty to default to the only connection present.
|
|
154
|
-
* Otherwise, use serial port name for serial port connection or hostname:port for TCP connection.
|
|
155
|
-
* @param realm The realm to connect to.
|
|
156
|
-
* @param api The URL of the API to receive connection info from.
|
|
157
|
-
* @return An object representing the connection.
|
|
158
|
-
*/
|
|
159
|
-
static async openIotAuthenticated(cloudId, token, connectionName = '', realm = '', api = 'https://api.zaber.io') {
|
|
160
|
-
const request = new gateway.OpenInterfaceRequest();
|
|
161
|
-
request.setInterfaceType(gateway.InterfaceType.IOT);
|
|
162
|
-
request.setCloudId(cloudId);
|
|
163
|
-
request.setToken(token);
|
|
164
|
-
request.setConnectionName(connectionName);
|
|
165
|
-
request.setRealm(realm);
|
|
166
|
-
request.setApi(api);
|
|
167
|
-
const response = await gateway.callAsync('interface/open', request, gateway.OpenInterfaceResponse);
|
|
168
|
-
return new Connection(response.getInterfaceId());
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Sends a generic ASCII command to this connection.
|
|
172
|
-
* For more information refer to the [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).
|
|
173
|
-
* @param command Command and its parameters.
|
|
174
|
-
* @param device Optional device address to send the command to.
|
|
175
|
-
* @param axis Optional axis number to send the command to.
|
|
176
|
-
* @param checkErrors Controls whether to throw an exception when the device rejects the command.
|
|
177
|
-
* @param timeout The timeout, in milliseconds, for a device to respond to the command.
|
|
178
|
-
* Overrides the connection default request timeout.
|
|
179
|
-
* @return A response to the command.
|
|
180
|
-
*/
|
|
181
|
-
async genericCommand(command, device = 0, axis = 0, checkErrors = true, timeout = 0) {
|
|
182
|
-
const request = new gateway.GenericCommandRequest();
|
|
183
|
-
request.setInterfaceId(this.interfaceId);
|
|
184
|
-
request.setCommand(command);
|
|
185
|
-
request.setDevice(device);
|
|
186
|
-
request.setAxis(axis);
|
|
187
|
-
request.setCheckErrors(checkErrors);
|
|
188
|
-
request.setTimeout(timeout);
|
|
189
|
-
const response = await gateway.callAsync('interface/generic_command', request, gateway.GenericCommandResponse);
|
|
190
|
-
return response_1.Response.fromProtobuf(response.toObject());
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Sends a generic ASCII command to this connection without expecting a response and without adding a message ID.
|
|
194
|
-
* For more information refer to the [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).
|
|
195
|
-
* @param command Command and its parameters.
|
|
196
|
-
* @param device Optional device address to send the command to.
|
|
197
|
-
* @param axis Optional axis number to send the command to.
|
|
198
|
-
*/
|
|
199
|
-
async genericCommandNoResponse(command, device = 0, axis = 0) {
|
|
200
|
-
const request = new gateway.GenericCommandRequest();
|
|
201
|
-
request.setInterfaceId(this.interfaceId);
|
|
202
|
-
request.setCommand(command);
|
|
203
|
-
request.setDevice(device);
|
|
204
|
-
request.setAxis(axis);
|
|
205
|
-
await gateway.callAsync('interface/generic_command_no_response', request);
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Sends a generic ASCII command to this connection and expect multiple responses,
|
|
209
|
-
* either from one device or from many devices.
|
|
210
|
-
* Responses are returned in order of arrival.
|
|
211
|
-
* For more information refer to the [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).
|
|
212
|
-
* @param command Command and its parameters.
|
|
213
|
-
* @param device Optional device address to send the command to.
|
|
214
|
-
* @param axis Optional axis number to send the command to.
|
|
215
|
-
* @param checkErrors Controls whether to throw an exception when a device rejects the command.
|
|
216
|
-
* @param timeout The timeout, in milliseconds, for a device to respond to the command.
|
|
217
|
-
* Overrides the connection default request timeout.
|
|
218
|
-
* @return All responses to the command.
|
|
219
|
-
*/
|
|
220
|
-
async genericCommandMultiResponse(command, device = 0, axis = 0, checkErrors = true, timeout = 0) {
|
|
221
|
-
const request = new gateway.GenericCommandRequest();
|
|
222
|
-
request.setInterfaceId(this.interfaceId);
|
|
223
|
-
request.setCommand(command);
|
|
224
|
-
request.setDevice(device);
|
|
225
|
-
request.setAxis(axis);
|
|
226
|
-
request.setCheckErrors(checkErrors);
|
|
227
|
-
request.setTimeout(timeout);
|
|
228
|
-
const response = await gateway.callAsync('interface/generic_command_multi_response', request, gateway.GenericCommandResponseCollection);
|
|
229
|
-
return response.toObject().responsesList.map(resp => response_1.Response.fromProtobuf(resp));
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
* Resets ASCII protocol message IDs. Only for testing purposes.
|
|
233
|
-
*/
|
|
234
|
-
resetIds() {
|
|
235
|
-
const request = new gateway.EmptyInterfaceRequest();
|
|
236
|
-
request.setInterfaceId(this.interfaceId);
|
|
237
|
-
gateway.callSync('interface/reset_ids', request);
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* Close the connection.
|
|
241
|
-
*/
|
|
242
|
-
async close() {
|
|
243
|
-
const request = new gateway.CloseInterfaceRequest();
|
|
244
|
-
request.setInterfaceId(this.interfaceId);
|
|
245
|
-
await gateway.callAsync('interface/close', request);
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* Gets a Device class instance which allows you to control a particular device on this connection.
|
|
249
|
-
* Devices are numbered from 1.
|
|
250
|
-
* @param deviceAddress Address of device intended to control. Address is configured for each device.
|
|
251
|
-
* @return Device instance.
|
|
252
|
-
*/
|
|
253
|
-
getDevice(deviceAddress) {
|
|
254
|
-
if (deviceAddress <= 0) {
|
|
255
|
-
throw new TypeError('Invalid value; physical devices are numbered from 1.');
|
|
256
|
-
}
|
|
257
|
-
return new device_1.Device(this, deviceAddress);
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* Renumbers devices present on this connection. After renumbering, devices need to be identified again.
|
|
261
|
-
* @param firstAddress This is the address that the device closest to the computer is given.
|
|
262
|
-
* Remaining devices are numbered consecutively.
|
|
263
|
-
* @return Total number of devices that responded to the renumber.
|
|
264
|
-
*/
|
|
265
|
-
async renumberDevices(firstAddress = 1) {
|
|
266
|
-
if (firstAddress <= 0) {
|
|
267
|
-
throw new TypeError('Invalid value; device addresses are numbered from 1.');
|
|
268
|
-
}
|
|
269
|
-
const request = new gateway.DeviceRenumberRequest();
|
|
270
|
-
request.setInterfaceId(this.interfaceId);
|
|
271
|
-
request.setFirstAddress(firstAddress);
|
|
272
|
-
const response = await gateway.callAsync('device/renumber', request, gateway.DeviceRenumberResponse);
|
|
273
|
-
return response.getNumberDevices();
|
|
274
|
-
}
|
|
275
|
-
/**
|
|
276
|
-
* Attempts to detect any devices present on this connection.
|
|
277
|
-
* @param identifyDevices Determines whether device identification should be performed as well.
|
|
278
|
-
* @return Array of detected devices.
|
|
279
|
-
*/
|
|
280
|
-
async detectDevices(identifyDevices = true) {
|
|
281
|
-
const request = new gateway.DeviceDetectRequest();
|
|
282
|
-
request.setInterfaceId(this.interfaceId);
|
|
283
|
-
request.setIdentifyDevices(identifyDevices);
|
|
284
|
-
const response = await gateway.callAsync('device/detect', request, gateway.DeviceDetectResponse);
|
|
285
|
-
return response.getDevicesList().map(deviceAddress => this.getDevice(deviceAddress));
|
|
286
|
-
}
|
|
287
|
-
/**
|
|
288
|
-
* Stops all of the devices on this connection.
|
|
289
|
-
* @param waitUntilIdle Determines whether the function should return immediately
|
|
290
|
-
* or wait until the devices are stopped.
|
|
291
|
-
* @return The addresses of the devices that were stopped by this command.
|
|
292
|
-
*/
|
|
293
|
-
async stopAll(waitUntilIdle = true) {
|
|
294
|
-
const request = new gateway.DeviceOnAllRequest();
|
|
295
|
-
request.setInterfaceId(this.interfaceId);
|
|
296
|
-
request.setWaitUntilIdle(waitUntilIdle);
|
|
297
|
-
const response = await gateway.callAsync('device/stop_all', request, gateway.DeviceOnAllResponse);
|
|
298
|
-
return response.getDeviceAddressesList();
|
|
299
|
-
}
|
|
300
|
-
/**
|
|
301
|
-
* Homes all of the devices on this connection.
|
|
302
|
-
* @param waitUntilIdle Determines whether the function should return immediately
|
|
303
|
-
* or wait until the devices are homed.
|
|
304
|
-
* @return The addresses of the devices that were homed by this command.
|
|
305
|
-
*/
|
|
306
|
-
async homeAll(waitUntilIdle = true) {
|
|
307
|
-
const request = new gateway.DeviceOnAllRequest();
|
|
308
|
-
request.setInterfaceId(this.interfaceId);
|
|
309
|
-
request.setWaitUntilIdle(waitUntilIdle);
|
|
310
|
-
const response = await gateway.callAsync('device/home_all', request, gateway.DeviceOnAllResponse);
|
|
311
|
-
return response.getDeviceAddressesList();
|
|
312
|
-
}
|
|
313
|
-
/**
|
|
314
|
-
* Returns a string that represents the connection.
|
|
315
|
-
* @return A string that represents the connection.
|
|
316
|
-
*/
|
|
317
|
-
toString() {
|
|
318
|
-
const request = new gateway.ToStringRequest();
|
|
319
|
-
request.setInterfaceId(this.interfaceId);
|
|
320
|
-
const response = gateway.callSync('interface/to_string', request, gateway.ToStringResponse);
|
|
321
|
-
return response.getToStr();
|
|
322
|
-
}
|
|
323
|
-
/**
|
|
324
|
-
* Returns default request timeout.
|
|
325
|
-
* @return Default request timeout.
|
|
326
|
-
*/
|
|
327
|
-
_retrieveTimeout() {
|
|
328
|
-
const request = new gateway.EmptyInterfaceRequest();
|
|
329
|
-
request.setInterfaceId(this.interfaceId);
|
|
330
|
-
const response = gateway.callSync('interface/get_timeout', request, gateway.GetInterfaceTimeoutResponse);
|
|
331
|
-
return response.getValue();
|
|
332
|
-
}
|
|
333
|
-
/**
|
|
334
|
-
* Sets default request timeout.
|
|
335
|
-
* @param timeout Default request timeout.
|
|
336
|
-
*/
|
|
337
|
-
_changeTimeout(timeout) {
|
|
338
|
-
const request = new gateway.SetInterfaceTimeoutRequest();
|
|
339
|
-
request.setInterfaceId(this.interfaceId);
|
|
340
|
-
request.setTimeout(timeout);
|
|
341
|
-
gateway.callSync('interface/set_timeout', request);
|
|
342
|
-
}
|
|
343
|
-
/**
|
|
344
|
-
* Returns checksum enabled.
|
|
345
|
-
* @return Checksum enabled.
|
|
346
|
-
*/
|
|
347
|
-
_retrieveChecksumEnabled() {
|
|
348
|
-
const request = new gateway.EmptyInterfaceRequest();
|
|
349
|
-
request.setInterfaceId(this.interfaceId);
|
|
350
|
-
const response = gateway.callSync('interface/get_checksum_enabled', request, gateway.GetInterfaceChecksumEnabledResponse);
|
|
351
|
-
return response.getValue();
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* Sets checksum enabled.
|
|
355
|
-
* @param isEnabled Checksum enabled.
|
|
356
|
-
*/
|
|
357
|
-
_changeChecksumEnabled(isEnabled) {
|
|
358
|
-
const request = new gateway.SetInterfaceChecksumEnabledRequest();
|
|
359
|
-
request.setInterfaceId(this.interfaceId);
|
|
360
|
-
request.setIsEnabled(isEnabled);
|
|
361
|
-
gateway.callSync('interface/set_checksum_enabled', request);
|
|
362
|
-
}
|
|
363
|
-
/**
|
|
364
|
-
* Event invoked when connection is interrupted or closed.
|
|
365
|
-
*/
|
|
366
|
-
get disconnected() {
|
|
367
|
-
return this._disconnected;
|
|
368
|
-
}
|
|
369
|
-
_subscribe() {
|
|
370
|
-
this.unknownResponse = gateway_1.events.pipe(operators_1.takeUntil(this._disconnected), gateway_1.filterEvent('interface/unknown_response'), operators_1.filter(event => event.interfaceId === this.interfaceId), operators_1.map(event => unknown_response_event_1.UnknownResponseEvent.fromProtobuf(event)));
|
|
371
|
-
this.alert = gateway_1.events.pipe(operators_1.takeUntil(this._disconnected), gateway_1.filterEvent('interface/alert'), operators_1.filter(event => event.interfaceId === this.interfaceId), operators_1.map(event => alert_event_1.AlertEvent.fromProtobuf(event)));
|
|
372
|
-
gateway_1.events.pipe(gateway_1.filterEvent('interface/disconnected'), operators_1.filter(event => event.interfaceId === this.interfaceId), operators_1.take(1), operators_1.map(({ errorMessage, errorType }) => gateway.convertToException(errorType, errorMessage))).subscribe(this._disconnected);
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
exports.Connection = Connection;
|
|
376
|
-
/**
|
|
377
|
-
* Default baud rate for serial connections.
|
|
378
|
-
*/
|
|
379
|
-
Connection.DEFAULT_BAUD_RATE = 115200;
|
|
380
|
-
//# sourceMappingURL=connection.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/ascii/connection.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAEtD,mBAAiB;AACjB,+BAAiD;AACjD,8CAA8D;AAC9D,oDAAsC;AACtC,wCAAiD;AAEjD,qCAAkC;AAClC,yCAAsC;AACtC,qEAAgE;AAChE,+CAA2C;AAG3C;;GAEG;AACH,MAAa,UAAU;IAgDrB,YAAY,WAAmB;QAqbvB,kBAAa,GAAG,IAAI,oBAAa,EAAsB,CAAC;QApb9D,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IA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ROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport '../init';\nimport { Observable, ReplaySubject } from 'rxjs';\nimport { map, filter, takeUntil, take } from 'rxjs/operators';\nimport * as gateway from '../gateway';\nimport { events, filterEvent } from '../gateway';\nimport { Transport } from './transport';\nimport { Device } from './device';\nimport { Response } from './response';\nimport { UnknownResponseEvent } from './unknown_response_event';\nimport { AlertEvent } from './alert_event';\nimport { MotionLibException } from '../exceptions';\n\n/**\n * Class representing access to particular connection (serial port, TCP connection).\n */\nexport class Connection {\n\n /**\n * Event invoked when a response from a device cannot be matched to any known request.\n */\n public unknownResponse!: Observable<UnknownResponseEvent>;\n\n /**\n * Event invoked when an alert is received from a device.\n */\n public alert!: Observable<AlertEvent>;\n\n /**\n * Default baud rate for serial connections.\n */\n public static readonly DEFAULT_BAUD_RATE: number = 115200;\n\n /**\n * The interface ID identifies this Connection instance with the underlying library.\n */\n public get interfaceId(): number {\n return this._interfaceId;\n }\n private _interfaceId: number;\n\n /**\n * The default timeout, in milliseconds, for a device to respond to a request.\n * Setting the timeout to a too low value may cause request timeout exceptions.\n */\n public get defaultRequestTimeout(): number {\n return this._retrieveTimeout();\n }\n\n public set defaultRequestTimeout(value: number) {\n this._changeTimeout(value);\n }\n\n /**\n * Controls whether outgoing messages contain checksum.\n */\n public get checksumEnabled(): boolean {\n return this._retrieveChecksumEnabled();\n }\n\n public set checksumEnabled(value: boolean) {\n this._changeChecksumEnabled(value);\n }\n\n constructor(interfaceId: number) {\n this._interfaceId = interfaceId;\n this._subscribe();\n }\n\n /**\n * Opens a serial port, if Zaber Launcher controls the port, the port will be opened through Zaber Launcher.\n * Zaber Launcher allows sharing of the port between multiple applications.\n * Use openSerialPortDirectly if sharing is not desirable.\n * @param portName Name of the port to open.\n * @param baudRate Optional baud rate (defaults to 115200).\n * @return An object representing the port.\n */\n public static async openSerialPort(\n portName: string,\n baudRate: number = Connection.DEFAULT_BAUD_RATE\n ): Promise<Connection> {\n const request = new gateway.OpenInterfaceRequest();\n request.setInterfaceType(gateway.InterfaceType.SERIAL_PORT);\n request.setPortName(portName);\n request.setBaudRate(baudRate);\n\n const response = await gateway.callAsync<gateway.OpenInterfaceResponse>(\n 'interface/open',\n request,\n gateway.OpenInterfaceResponse);\n return new Connection(response.getInterfaceId());\n }\n\n /**\n * Opens a serial port, bypassing Zaber Launcher.\n * If the port is already opened by Zaber Launcher, this will fail.\n * @param portName Name of the port to open.\n * @param baudRate Optional baud rate (defaults to 115200).\n * @return An object representing the port.\n */\n public static async openSerialPortDirectly(\n portName: string,\n baudRate: number = Connection.DEFAULT_BAUD_RATE\n ): Promise<Connection> {\n const request = new gateway.OpenInterfaceRequest();\n request.setInterfaceType(gateway.InterfaceType.SERIAL_PORT);\n request.setRejectRoutedConnection(true);\n request.setPortName(portName);\n request.setBaudRate(baudRate);\n\n const response = await gateway.callAsync<gateway.OpenInterfaceResponse>(\n 'interface/open',\n request,\n gateway.OpenInterfaceResponse);\n return new Connection(response.getInterfaceId());\n }\n\n /**\n * Opens a TCP connection.\n * @param hostName Hostname or IP address.\n * @param port Port number.\n * @return An object representing the connection.\n */\n public static async openTcp(\n hostName: string,\n port: number\n ): Promise<Connection> {\n const request = new gateway.OpenInterfaceRequest();\n request.setInterfaceType(gateway.InterfaceType.TCP);\n request.setHostName(hostName);\n request.setPort(port);\n\n const response = await gateway.callAsync<gateway.OpenInterfaceResponse>(\n 'interface/open',\n request,\n gateway.OpenInterfaceResponse);\n return new Connection(response.getInterfaceId());\n }\n\n /**\n * Opens a connection using a custom transport.\n * @param transport The custom connection transport.\n * @return An object representing the connection.\n */\n public static async openCustom(\n transport: Transport\n ): Promise<Connection> {\n const request = new gateway.OpenInterfaceRequest();\n request.setInterfaceType(gateway.InterfaceType.CUSTOM);\n request.setTransport(transport.transportId);\n\n const response = await gateway.callAsync<gateway.OpenInterfaceResponse>(\n 'interface/open',\n request,\n gateway.OpenInterfaceResponse);\n return new Connection(response.getInterfaceId());\n }\n\n /**\n * Opens a unauthenticated connection to a cloud connected device chain.\n * Use this method to connect to Virtual Device Demo instance.\n * @param cloudId The cloud ID to connect to.\n * @param connectionName The name of the connection to open.\n * Can be left empty to default to the only connection present.\n * Otherwise, use serial port name for serial port connection or hostname:port for TCP connection.\n * @param api The URL of the API to receive connection info from.\n * @return An object representing the connection.\n */\n public static async openIotUnauthenticated(\n cloudId: string,\n connectionName: string = '',\n api: string = 'https://api.zaber.io'\n ): Promise<Connection> {\n const request = new gateway.OpenInterfaceRequest();\n request.setInterfaceType(gateway.InterfaceType.IOT);\n request.setRealm('unauthenticated');\n request.setToken('unauthenticated');\n request.setCloudId(cloudId);\n request.setConnectionName(connectionName);\n request.setApi(api);\n\n const response = await gateway.callAsync<gateway.OpenInterfaceResponse>(\n 'interface/open',\n request,\n gateway.OpenInterfaceResponse);\n return new Connection(response.getInterfaceId());\n }\n\n /**\n * Opens a secured connection to a cloud connected device chain.\n * Use this method to connect to devices on your account.\n * @param cloudId The cloud ID to connect to.\n * @param token The token to authenticate with.\n * @param connectionName The name of the connection to open.\n * Can be left empty to default to the only connection present.\n * Otherwise, use serial port name for serial port connection or hostname:port for TCP connection.\n * @param realm The realm to connect to.\n * @param api The URL of the API to receive connection info from.\n * @return An object representing the connection.\n */\n public static async openIotAuthenticated(\n cloudId: string,\n token: string,\n connectionName: string = '',\n realm: string = '',\n api: string = 'https://api.zaber.io'\n ): Promise<Connection> {\n const request = new gateway.OpenInterfaceRequest();\n request.setInterfaceType(gateway.InterfaceType.IOT);\n request.setCloudId(cloudId);\n request.setToken(token);\n request.setConnectionName(connectionName);\n request.setRealm(realm);\n request.setApi(api);\n\n const response = await gateway.callAsync<gateway.OpenInterfaceResponse>(\n 'interface/open',\n request,\n gateway.OpenInterfaceResponse);\n return new Connection(response.getInterfaceId());\n }\n\n /**\n * Sends a generic ASCII command to this connection.\n * For more information refer to the [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param device Optional device address to send the command to.\n * @param axis Optional axis number to send the command to.\n * @param checkErrors Controls whether to throw an exception when the device rejects the command.\n * @param timeout The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @return A response to the command.\n */\n public async genericCommand(\n command: string,\n device: number = 0,\n axis: number = 0,\n checkErrors: boolean = true,\n timeout: number = 0\n ): Promise<Response> {\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.interfaceId);\n request.setCommand(command);\n request.setDevice(device);\n request.setAxis(axis);\n request.setCheckErrors(checkErrors);\n request.setTimeout(timeout);\n\n const response = await gateway.callAsync<gateway.GenericCommandResponse>(\n 'interface/generic_command',\n request,\n gateway.GenericCommandResponse);\n return Response.fromProtobuf(response.toObject());\n }\n\n /**\n * Sends a generic ASCII command to this connection without expecting a response and without adding a message ID.\n * For more information refer to the [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param device Optional device address to send the command to.\n * @param axis Optional axis number to send the command to.\n */\n public async genericCommandNoResponse(\n command: string,\n device: number = 0,\n axis: number = 0\n ): Promise<void> {\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.interfaceId);\n request.setCommand(command);\n request.setDevice(device);\n request.setAxis(axis);\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Sends a generic ASCII command to this connection and expect multiple responses,\n * either from one device or from many devices.\n * Responses are returned in order of arrival.\n * For more information refer to the [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param device Optional device address to send the command to.\n * @param axis Optional axis number to send the command to.\n * @param checkErrors Controls whether to throw an exception when a device rejects the command.\n * @param timeout The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @return All responses to the command.\n */\n public async genericCommandMultiResponse(\n command: string,\n device: number = 0,\n axis: number = 0,\n checkErrors: boolean = true,\n timeout: number = 0\n ): Promise<Response[]> {\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.interfaceId);\n request.setCommand(command);\n request.setDevice(device);\n request.setAxis(axis);\n request.setCheckErrors(checkErrors);\n request.setTimeout(timeout);\n\n const response = await gateway.callAsync<gateway.GenericCommandResponseCollection>(\n 'interface/generic_command_multi_response',\n request,\n gateway.GenericCommandResponseCollection);\n return response.toObject().responsesList.map(resp => Response.fromProtobuf(resp));\n }\n\n /**\n * Resets ASCII protocol message IDs. Only for testing purposes.\n */\n public resetIds(): void {\n const request = new gateway.EmptyInterfaceRequest();\n request.setInterfaceId(this.interfaceId);\n\n gateway.callSync('interface/reset_ids', request);\n }\n\n /**\n * Close the connection.\n */\n public async close(): Promise<void> {\n const request = new gateway.CloseInterfaceRequest();\n request.setInterfaceId(this.interfaceId);\n\n await gateway.callAsync('interface/close', request);\n }\n\n /**\n * Gets a Device class instance which allows you to control a particular device on this connection.\n * Devices are numbered from 1.\n * @param deviceAddress Address of device intended to control. Address is configured for each device.\n * @return Device instance.\n */\n public getDevice(\n deviceAddress: number\n ): Device {\n if (deviceAddress <= 0) {\n throw new TypeError('Invalid value; physical devices are numbered from 1.');\n }\n return new Device(this, deviceAddress);\n }\n\n /**\n * Renumbers devices present on this connection. After renumbering, devices need to be identified again.\n * @param firstAddress This is the address that the device closest to the computer is given.\n * Remaining devices are numbered consecutively.\n * @return Total number of devices that responded to the renumber.\n */\n public async renumberDevices(\n firstAddress: number = 1\n ): Promise<number> {\n if (firstAddress <= 0) {\n throw new TypeError('Invalid value; device addresses are numbered from 1.');\n }\n const request = new gateway.DeviceRenumberRequest();\n request.setInterfaceId(this.interfaceId);\n request.setFirstAddress(firstAddress);\n\n const response = await gateway.callAsync<gateway.DeviceRenumberResponse>(\n 'device/renumber',\n request,\n gateway.DeviceRenumberResponse);\n return response.getNumberDevices();\n }\n\n /**\n * Attempts to detect any devices present on this connection.\n * @param identifyDevices Determines whether device identification should be performed as well.\n * @return Array of detected devices.\n */\n public async detectDevices(\n identifyDevices: boolean = true\n ): Promise<Device[]> {\n const request = new gateway.DeviceDetectRequest();\n request.setInterfaceId(this.interfaceId);\n request.setIdentifyDevices(identifyDevices);\n\n const response = await gateway.callAsync<gateway.DeviceDetectResponse>(\n 'device/detect',\n request,\n gateway.DeviceDetectResponse);\n return response.getDevicesList().map(deviceAddress => this.getDevice(deviceAddress));\n }\n\n /**\n * Stops all of the devices on this connection.\n * @param waitUntilIdle Determines whether the function should return immediately\n * or wait until the devices are stopped.\n * @return The addresses of the devices that were stopped by this command.\n */\n public async stopAll(\n waitUntilIdle: boolean = true\n ): Promise<number[]> {\n const request = new gateway.DeviceOnAllRequest();\n request.setInterfaceId(this.interfaceId);\n request.setWaitUntilIdle(waitUntilIdle);\n\n const response = await gateway.callAsync<gateway.DeviceOnAllResponse>(\n 'device/stop_all',\n request,\n gateway.DeviceOnAllResponse);\n return response.getDeviceAddressesList();\n }\n\n /**\n * Homes all of the devices on this connection.\n * @param waitUntilIdle Determines whether the function should return immediately\n * or wait until the devices are homed.\n * @return The addresses of the devices that were homed by this command.\n */\n public async homeAll(\n waitUntilIdle: boolean = true\n ): Promise<number[]> {\n const request = new gateway.DeviceOnAllRequest();\n request.setInterfaceId(this.interfaceId);\n request.setWaitUntilIdle(waitUntilIdle);\n\n const response = await gateway.callAsync<gateway.DeviceOnAllResponse>(\n 'device/home_all',\n request,\n gateway.DeviceOnAllResponse);\n return response.getDeviceAddressesList();\n }\n\n /**\n * Returns a string that represents the connection.\n * @return A string that represents the connection.\n */\n public toString(): string {\n const request = new gateway.ToStringRequest();\n request.setInterfaceId(this.interfaceId);\n\n const response = gateway.callSync<gateway.ToStringResponse>(\n 'interface/to_string',\n request,\n gateway.ToStringResponse);\n return response.getToStr();\n }\n\n /**\n * Returns default request timeout.\n * @return Default request timeout.\n */\n private _retrieveTimeout(): number {\n const request = new gateway.EmptyInterfaceRequest();\n request.setInterfaceId(this.interfaceId);\n\n const response = gateway.callSync<gateway.GetInterfaceTimeoutResponse>(\n 'interface/get_timeout',\n request,\n gateway.GetInterfaceTimeoutResponse);\n return response.getValue();\n }\n\n /**\n * Sets default request timeout.\n * @param timeout Default request timeout.\n */\n private _changeTimeout(\n timeout: number\n ): void {\n const request = new gateway.SetInterfaceTimeoutRequest();\n request.setInterfaceId(this.interfaceId);\n request.setTimeout(timeout);\n\n gateway.callSync('interface/set_timeout', request);\n }\n\n /**\n * Returns checksum enabled.\n * @return Checksum enabled.\n */\n private _retrieveChecksumEnabled(): boolean {\n const request = new gateway.EmptyInterfaceRequest();\n request.setInterfaceId(this.interfaceId);\n\n const response = gateway.callSync<gateway.GetInterfaceChecksumEnabledResponse>(\n 'interface/get_checksum_enabled',\n request,\n gateway.GetInterfaceChecksumEnabledResponse);\n return response.getValue();\n }\n\n /**\n * Sets checksum enabled.\n * @param isEnabled Checksum enabled.\n */\n private _changeChecksumEnabled(\n isEnabled: boolean\n ): void {\n const request = new gateway.SetInterfaceChecksumEnabledRequest();\n request.setInterfaceId(this.interfaceId);\n request.setIsEnabled(isEnabled);\n\n gateway.callSync('interface/set_checksum_enabled', request);\n }\n\n private _disconnected = new ReplaySubject<MotionLibException>();\n\n /**\n * Event invoked when connection is interrupted or closed.\n */\n public get disconnected(): Observable<MotionLibException> {\n return this._disconnected;\n }\n\n private _subscribe(): void {\n this.unknownResponse = events.pipe(\n takeUntil(this._disconnected),\n filterEvent<gateway.UnknownResponseEvent.AsObject>('interface/unknown_response'),\n filter(event => event.interfaceId === this.interfaceId),\n map(event => UnknownResponseEvent.fromProtobuf(event))\n );\n\n this.alert = events.pipe(\n takeUntil(this._disconnected),\n filterEvent<gateway.AlertEvent.AsObject>('interface/alert'),\n filter(event => event.interfaceId === this.interfaceId),\n map(event => AlertEvent.fromProtobuf(event))\n );\n\n events.pipe(\n filterEvent<gateway.DisconnectedEvent.AsObject>('interface/disconnected'),\n filter(event => event.interfaceId === this.interfaceId),\n take(1),\n map(({ errorMessage, errorType }) => gateway.convertToException(errorType, errorMessage))\n ).subscribe(this._disconnected);\n }\n}\n"]}
|