@zaber/motion 2.9.1 → 2.11.0

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.
Files changed (98) hide show
  1. package/dist/binding/wasm/zaber-motion-lib.wasm +0 -0
  2. package/dist/lib/ascii/connection.d.ts +11 -0
  3. package/dist/lib/ascii/connection.js +11 -0
  4. package/dist/lib/ascii/connection.js.map +1 -1
  5. package/dist/lib/ascii/device.d.ts +6 -0
  6. package/dist/lib/ascii/device.js +8 -0
  7. package/dist/lib/ascii/device.js.map +1 -1
  8. package/dist/lib/ascii/index.d.ts +9 -0
  9. package/dist/lib/ascii/index.js +19 -1
  10. package/dist/lib/ascii/index.js.map +1 -1
  11. package/dist/lib/ascii/oscilloscope.d.ts +62 -0
  12. package/dist/lib/ascii/oscilloscope.js +153 -0
  13. package/dist/lib/ascii/oscilloscope.js.map +1 -0
  14. package/dist/lib/ascii/oscilloscope_capture_properties.d.ts +16 -0
  15. package/dist/lib/ascii/oscilloscope_capture_properties.js +18 -0
  16. package/dist/lib/ascii/oscilloscope_capture_properties.js.map +1 -0
  17. package/dist/lib/ascii/oscilloscope_data.d.ts +67 -0
  18. package/dist/lib/ascii/oscilloscope_data.js +151 -0
  19. package/dist/lib/ascii/oscilloscope_data.js.map +1 -0
  20. package/dist/lib/ascii/paramset_info.d.ts +17 -0
  21. package/dist/lib/ascii/paramset_info.js +19 -0
  22. package/dist/lib/ascii/paramset_info.js.map +1 -0
  23. package/dist/lib/ascii/pid_tuning.d.ts +32 -0
  24. package/dist/lib/ascii/pid_tuning.js +22 -0
  25. package/dist/lib/ascii/pid_tuning.js.map +1 -0
  26. package/dist/lib/ascii/servo_tuner.d.ts +77 -0
  27. package/dist/lib/ascii/servo_tuner.js +180 -0
  28. package/dist/lib/ascii/servo_tuner.js.map +1 -0
  29. package/dist/lib/ascii/servo_tuning_param.d.ts +16 -0
  30. package/dist/lib/ascii/servo_tuning_param.js +49 -0
  31. package/dist/lib/ascii/servo_tuning_param.js.map +1 -0
  32. package/dist/lib/ascii/servo_tuning_paramset.d.ts +17 -0
  33. package/dist/lib/ascii/servo_tuning_paramset.js +24 -0
  34. package/dist/lib/ascii/servo_tuning_paramset.js.map +1 -0
  35. package/dist/lib/ascii/simple_tuning_param.d.ts +24 -0
  36. package/dist/lib/ascii/simple_tuning_param.js +20 -0
  37. package/dist/lib/ascii/simple_tuning_param.js.map +1 -0
  38. package/dist/lib/ascii/stream.d.ts +7 -0
  39. package/dist/lib/ascii/stream.js +14 -0
  40. package/dist/lib/ascii/stream.js.map +1 -1
  41. package/dist/lib/ascii/stream_axis_definition.js +3 -0
  42. package/dist/lib/ascii/stream_axis_definition.js.map +1 -1
  43. package/dist/lib/ascii/transport.d.ts +4 -0
  44. package/dist/lib/ascii/transport.js +4 -0
  45. package/dist/lib/ascii/transport.js.map +1 -1
  46. package/dist/lib/ascii_ns.d.ts +18 -0
  47. package/dist/lib/ascii_ns.js +9 -0
  48. package/dist/lib/ascii_ns.js.map +1 -1
  49. package/dist/lib/exceptions/index.d.ts +1 -0
  50. package/dist/lib/exceptions/index.js +4 -2
  51. package/dist/lib/exceptions/index.js.map +1 -1
  52. package/dist/lib/exceptions/invalid_operation_exception.d.ts +7 -0
  53. package/dist/lib/exceptions/invalid_operation_exception.js +17 -0
  54. package/dist/lib/exceptions/invalid_operation_exception.js.map +1 -0
  55. package/dist/lib/gateway/convert_exceptions.js +1 -0
  56. package/dist/lib/gateway/convert_exceptions.js.map +1 -1
  57. package/dist/lib/gcode/axis_definition.d.ts +18 -0
  58. package/dist/lib/gcode/{translator_axis_definition.js → axis_definition.js} +11 -10
  59. package/dist/lib/gcode/axis_definition.js.map +1 -0
  60. package/dist/lib/gcode/axis_mapping.js +3 -0
  61. package/dist/lib/gcode/axis_mapping.js.map +1 -1
  62. package/dist/lib/gcode/axis_transformation.d.ts +21 -0
  63. package/dist/lib/gcode/axis_transformation.js +43 -0
  64. package/dist/lib/gcode/axis_transformation.js.map +1 -0
  65. package/dist/lib/gcode/device_definition.d.ts +24 -0
  66. package/dist/lib/gcode/{translator_definition.js → device_definition.js} +14 -9
  67. package/dist/lib/gcode/device_definition.js.map +1 -0
  68. package/dist/lib/gcode/index.d.ts +4 -3
  69. package/dist/lib/gcode/index.js +9 -7
  70. package/dist/lib/gcode/index.js.map +1 -1
  71. package/dist/lib/gcode/offline_translator.d.ts +114 -0
  72. package/dist/lib/gcode/offline_translator.js +226 -0
  73. package/dist/lib/gcode/offline_translator.js.map +1 -0
  74. package/dist/lib/gcode/translator.d.ts +66 -12
  75. package/dist/lib/gcode/translator.js +113 -17
  76. package/dist/lib/gcode/translator.js.map +1 -1
  77. package/dist/lib/gcode/translator_config.d.ts +6 -6
  78. package/dist/lib/gcode/translator_config.js +7 -4
  79. package/dist/lib/gcode/translator_config.js.map +1 -1
  80. package/dist/lib/gcode_ns.d.ts +8 -6
  81. package/dist/lib/gcode_ns.js +4 -3
  82. package/dist/lib/gcode_ns.js.map +1 -1
  83. package/dist/lib/measurement.js +3 -0
  84. package/dist/lib/measurement.js.map +1 -1
  85. package/dist/lib/protobufs/main_pb.d.ts +1011 -30
  86. package/dist/lib/protobufs/main_pb.js +12857 -5306
  87. package/dist/lib/protobufs/main_pb.js.map +1 -1
  88. package/dist/lib/tools.d.ts +6 -0
  89. package/dist/lib/tools.js +10 -0
  90. package/dist/lib/tools.js.map +1 -1
  91. package/package.json +1 -1
  92. package/dist/lib/gcode/translator_axis_definition.d.ts +0 -20
  93. package/dist/lib/gcode/translator_axis_definition.js.map +0 -1
  94. package/dist/lib/gcode/translator_definition.d.ts +0 -18
  95. package/dist/lib/gcode/translator_definition.js.map +0 -1
  96. package/dist/lib/gcode/translator_live.d.ts +0 -70
  97. package/dist/lib/gcode/translator_live.js +0 -147
  98. package/dist/lib/gcode/translator_live.js.map +0 -1
@@ -21,6 +21,17 @@ export declare class Connection {
21
21
  * Default baud rate for serial connections.
22
22
  */
23
23
  static readonly DEFAULT_BAUD_RATE: number;
24
+ /**
25
+ * Commands send over this port are forwarded to the device chain.
26
+ * The bandwidth may be limited as the commands are forwarded over a serial connection.
27
+ */
28
+ static readonly TCP_PORT_CHAIN: number;
29
+ /**
30
+ * Commands send over this port are processed only by the device
31
+ * and not forwarded to the rest of the chain.
32
+ * Using this port typically makes the communication faster.
33
+ */
34
+ static readonly TCP_PORT_DEVICE_ONLY: number;
24
35
  /**
25
36
  * The interface ID identifies this Connection instance with the underlying library.
26
37
  */
@@ -397,4 +397,15 @@ exports.Connection = Connection;
397
397
  * Default baud rate for serial connections.
398
398
  */
399
399
  Connection.DEFAULT_BAUD_RATE = 115200;
400
+ /**
401
+ * Commands send over this port are forwarded to the device chain.
402
+ * The bandwidth may be limited as the commands are forwarded over a serial connection.
403
+ */
404
+ Connection.TCP_PORT_CHAIN = 55550;
405
+ /**
406
+ * Commands send over this port are processed only by the device
407
+ * and not forwarded to the rest of the chain.
408
+ * Using this port typically makes the communication faster.
409
+ */
410
+ Connection.TCP_PORT_DEVICE_ONLY = 55551;
400
411
  //# sourceMappingURL=connection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/ascii/connection.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAEtD,+BAAiD;AACjD,8CAA8D;AAC9D,oDAAsC;AACtC,wCAAiD;AAEjD,qCAAkC;AAClC,yCAAsC;AACtC,qEAAgE;AAChE,+CAA2C;AAG3C;;GAEG;AACH,MAAa,UAAU;IAgDrB,YAAY,WAAmB;QAmdvB,kBAAa,GAAG,IAAI,oBAAa,EAAsB,CAAC;QAld9D,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAlCD;;OAEG;IACH,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAGD;;;OAGG;IACH,IAAW,qBAAqB;QAC9B,OAA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QAEF,gBAAM,CAAC,IAAI,CACT,IAAA,qBAAW,EAAqC,wBAAwB,CAAC,EACzE,IAAA,kBAAM,EAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,KAAK,IAAI,CAAC,WAAW,CAAC,EACvD,IAAA,gBAAI,EAAC,CAAC,CAAC,EACP,IAAA,eAAG,EAAC,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,kBAAkB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAC1F,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAClC,CAAC;;AAjiBH,gCAkiBC;AAthBC;;GAEG;AACoB,4BAAiB,GAAW,MAAM,CAAC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\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 free trial instances.\n * The connection is not secured.\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 * Can be left empty for the default account realm.\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 * Opens a connection to Zaber Launcher in your Local Area Network.\n * The connection is not secured.\n * @param hostName Hostname or IP address.\n * @param port Port number.\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 * @return An object representing the connection.\n */\n public static async openNetworkShare(\n hostName: string,\n port: number,\n connectionName: string = ''\n ): Promise<Connection> {\n const request = new gateway.OpenInterfaceRequest();\n request.setInterfaceType(gateway.InterfaceType.NETWORK_SHARE);\n request.setHostName(hostName);\n request.setPort(port);\n request.setConnectionName(connectionName);\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"]}
1
+ {"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/ascii/connection.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAEtD,+BAAiD;AACjD,8CAA8D;AAC9D,oDAAsC;AACtC,wCAAiD;AAEjD,qCAAkC;AAClC,yCAAsC;AACtC,qEAAgE;AAChE,+CAA2C;AAG3C;;GAEG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AC,IAAI,CACtB,IAAA,qBAAS,EAAC,IAAI,CAAC,aAAa,CAAC,EAC7B,IAAA,qBAAW,EAA8B,iBAAiB,CAAC,EAC3D,IAAA,kBAAM,EAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,KAAK,IAAI,CAAC,WAAW,CAAC,EACvD,IAAA,eAAG,EAAC,KAAK,CAAC,EAAE,CAAC,wBAAU,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAC7C,CAAC;QAEF,gBAAM,CAAC,IAAI,CACT,IAAA,qBAAW,EAAqC,wBAAwB,CAAC,EACzE,IAAA,kBAAM,EAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,KAAK,IAAI,CAAC,WAAW,CAAC,EACvD,IAAA,gBAAI,EAAC,CAAC,CAAC,EACP,IAAA,eAAG,EAAC,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,kBAAkB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAC1F,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAClC,CAAC;;AA9iBH,gCA+iBC;AAniBC;;GAEG;AACoB,4BAAiB,GAAW,MAAM,CAAC;AAE1D;;;GAGG;AACoB,yBAAc,GAAW,KAAK,CAAC;AAEtD;;;;GAIG;AACoB,+BAAoB,GAAW,KAAK,CAAC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\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 * Commands send over this port are forwarded to the device chain.\n * The bandwidth may be limited as the commands are forwarded over a serial connection.\n */\n public static readonly TCP_PORT_CHAIN: number = 55550;\n\n /**\n * Commands send over this port are processed only by the device\n * and not forwarded to the rest of the chain.\n * Using this port typically makes the communication faster.\n */\n public static readonly TCP_PORT_DEVICE_ONLY: number = 55551;\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 free trial instances.\n * The connection is not secured.\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 * Can be left empty for the default account realm.\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 * Opens a connection to Zaber Launcher in your Local Area Network.\n * The connection is not secured.\n * @param hostName Hostname or IP address.\n * @param port Port number.\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 * @return An object representing the connection.\n */\n public static async openNetworkShare(\n hostName: string,\n port: number,\n connectionName: string = ''\n ): Promise<Connection> {\n const request = new gateway.OpenInterfaceRequest();\n request.setInterfaceType(gateway.InterfaceType.NETWORK_SHARE);\n request.setHostName(hostName);\n request.setPort(port);\n request.setConnectionName(connectionName);\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"]}
@@ -7,6 +7,7 @@ import { DeviceIdentity } from './device_identity';
7
7
  import { DeviceIO } from './device_io';
8
8
  import { Response } from './response';
9
9
  import { Lockstep } from './lockstep';
10
+ import { Oscilloscope } from './oscilloscope';
10
11
  import { Stream } from './stream';
11
12
  import { StreamBuffer } from './stream_buffer';
12
13
  import { Measurement } from '../measurement';
@@ -55,6 +56,11 @@ export declare class Device {
55
56
  * Indicates whether or not the device has been identified.
56
57
  */
57
58
  get isIdentified(): boolean;
59
+ /**
60
+ * Oscilloscope recording helper for this device.
61
+ */
62
+ get oscilloscope(): Oscilloscope;
63
+ private _oscilloscope;
58
64
  /**
59
65
  * Unique ID of the device hardware.
60
66
  */
@@ -30,6 +30,7 @@ const device_identity_1 = require("./device_identity");
30
30
  const device_io_1 = require("./device_io");
31
31
  const response_1 = require("./response");
32
32
  const lockstep_1 = require("./lockstep");
33
+ const oscilloscope_1 = require("./oscilloscope");
33
34
  const stream_1 = require("./stream");
34
35
  const stream_buffer_1 = require("./stream_buffer");
35
36
  const measurement_1 = require("../measurement");
@@ -46,6 +47,7 @@ class Device {
46
47
  this._io = new device_io_1.DeviceIO(this);
47
48
  this._allAxes = new all_axes_1.AllAxes(this);
48
49
  this._warnings = new warnings_1.Warnings(this, 0);
50
+ this._oscilloscope = new oscilloscope_1.Oscilloscope(this);
49
51
  }
50
52
  /**
51
53
  * Connection of this device.
@@ -96,6 +98,12 @@ class Device {
96
98
  get isIdentified() {
97
99
  return this._retrieveIsIdentified();
98
100
  }
101
+ /**
102
+ * Oscilloscope recording helper for this device.
103
+ */
104
+ get oscilloscope() {
105
+ return this._oscilloscope;
106
+ }
99
107
  /**
100
108
  * Unique ID of the device hardware.
101
109
  */
@@ -1 +1 @@
1
- {"version":3,"file":"device.js","sourceRoot":"","sources":["../../../src/ascii/device.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAGtD,uDAAmD;AACnD,iCAA8B;AAC9B,yCAAqC;AACrC,yCAAsC;AACtC,uDAAmD;AACnD,2CAAuC;AACvC,yCAAsC;AACtC,yCAAsC;AACtC,qCAAkC;AAClC,mDAA+C;AAC/C,gDAA6C;AAE7C,oFAA6E;AAC7E,oDAAsC;AAEtC;;GAEG;AACH,MAAa,MAAM;IA0GjB,YAAY,UAAsB,EAAE,aAAqB;QACvD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;QACpC,IAAI,CAAC,SAAS,GAAG,IAAI,gCAAc,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,CAAC,GAAG,GAAG,IAAI,oBAAQ,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,QAAQ,GAAG,IAAI,kBAAO,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,SAAS,GAAG,IAAI,mBAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACzC,CAAC;IAhHD;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAGD;;;OAGG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAGD;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAGD;;OAEG;IACH,IAAW,EAAE;QAC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QACtC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAExB,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,sBAAsB,EACtB,OAAO,EACP,OAAO,CAAC,yBAAyB,CAAC,CAAC;QACrC,OAAO,yDAAyB,CAAC,YAAY,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;OAGG;IACK,iBAAiB;QACvB,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,wBAAwB,EAAE,CAAC;QACvD,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACpD,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAEtC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,qBAAqB,EACrB,OAAO,EACP,OAAO,CAAC,yBAAyB,CAAC,CAAC;QACrC,OAAO,gCAAc,CAAC,YAAY,CAAC,QAAQ,CAAC,WAAW,EAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;OAGG;IACK,qBAAqB;QAC3B,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,4BAA4B,EAAE,CAAC;QAC3D,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACpD,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAEtC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,0BAA0B,EAC1B,OAAO,EACP,OAAO,CAAC,6BAA6B,CAAC,CAAC;QACzC,OAAO,QAAQ,CAAC,eAAe,EAAE,CAAC;IACpC,CAAC;CACF;AAjZD,wBAiZC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Connection } from './connection';\nimport { DeviceSettings } from './device_settings';\nimport { Axis } from './axis';\nimport { AllAxes } from './all_axes';\nimport { Warnings } from './warnings';\nimport { DeviceIdentity } from './device_identity';\nimport { DeviceIO } from './device_io';\nimport { Response } from './response';\nimport { Lockstep } from './lockstep';\nimport { Stream } from './stream';\nimport { StreamBuffer } from './stream_buffer';\nimport { Measurement } from '../measurement';\nimport { FirmwareVersion } from '../firmware_version';\nimport { CanSetStateDeviceResponse } from '../can_set_state_device_response';\nimport * as gateway from '../gateway';\n\n/**\n * Represents the controller part of one device - may be either a standalone controller or an integrated controller.\n */\nexport class Device {\n /**\n * Connection of this device.\n */\n public get connection(): Connection {\n return this._connection;\n }\n private _connection: Connection;\n\n /**\n * The device address uniquely identifies the device on the connection.\n * It can be configured or automatically assigned by the renumber command.\n */\n public get deviceAddress(): number {\n return this._deviceAddress;\n }\n private _deviceAddress: number;\n\n /**\n * Settings and properties of this device.\n */\n public get settings(): DeviceSettings {\n return this._settings;\n }\n private _settings: DeviceSettings;\n\n /**\n * I/O channels of this device.\n */\n public get io(): DeviceIO {\n return this._io;\n }\n private _io: DeviceIO;\n\n /**\n * Virtual axis which allows you to target all axes of this device.\n */\n public get allAxes(): AllAxes {\n return this._allAxes;\n }\n private _allAxes: AllAxes;\n\n /**\n * Warnings and faults of this device and all its axes.\n */\n public get warnings(): Warnings {\n return this._warnings;\n }\n private _warnings: Warnings;\n\n /**\n * Identity of the device.\n */\n public get identity(): DeviceIdentity {\n return this._retrieveIdentity();\n }\n\n /**\n * Indicates whether or not the device has been identified.\n */\n public get isIdentified(): boolean {\n return this._retrieveIsIdentified();\n }\n\n /**\n * Unique ID of the device hardware.\n */\n public get deviceId(): number {\n return this.identity.deviceId;\n }\n\n /**\n * Serial number of the device.\n */\n public get serialNumber(): number {\n return this.identity.serialNumber;\n }\n\n /**\n * Name of the product.\n */\n public get name(): string {\n return this.identity.name;\n }\n\n /**\n * Number of axes this device has.\n */\n public get axisCount(): number {\n return this.identity.axisCount;\n }\n\n /**\n * Version of the firmware.\n */\n public get firmwareVersion(): FirmwareVersion {\n return this.identity.firmwareVersion;\n }\n\n /**\n * The device is an integrated product.\n */\n public get isIntegrated(): boolean {\n return this.identity.isIntegrated;\n }\n\n constructor(connection: Connection, deviceAddress: number) {\n this._connection = connection;\n this._deviceAddress = deviceAddress;\n this._settings = new DeviceSettings(this);\n this._io = new DeviceIO(this);\n this._allAxes = new AllAxes(this);\n this._warnings = new Warnings(this, 0);\n }\n\n /**\n * Queries the device and the database, gathering information about the product.\n * Without this information features such as unit conversions will not work.\n * Usually, called automatically by detect devices method.\n * @return Device identification data.\n */\n public async identify(): Promise<DeviceIdentity> {\n const request = new gateway.DeviceIdentifyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = await gateway.callAsync<gateway.DeviceIdentity>(\n 'device/identify',\n request,\n gateway.DeviceIdentity);\n return DeviceIdentity.fromProtobuf(response.toObject());\n }\n\n /**\n * Sends a generic ASCII command to this device.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\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 axis: number = 0,\n checkErrors: boolean = true,\n timeout: number = 0\n ): Promise<Response> {\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setCommand(command);\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 device and expect multiple responses.\n * Responses are returned in order of arrival.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\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 axis: number = 0,\n checkErrors: boolean = true,\n timeout: number = 0\n ): Promise<Response[]> {\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setCommand(command);\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 * Sends a generic ASCII command to this device without expecting a response and without adding a message ID\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param axis Optional axis number to send the command to.\n */\n public async genericCommandNoResponse(\n command: string,\n axis: number = 0\n ): Promise<void> {\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setCommand(command);\n request.setAxis(axis);\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Gets an Axis class instance which allows you to control a particular axis on this device.\n * Axes are numbered from 1.\n * @param axisNumber Number of axis intended to control.\n * @return Axis instance.\n */\n public getAxis(\n axisNumber: number\n ): Axis {\n if (axisNumber <= 0) {\n throw new TypeError('Invalid value; physical axes are numbered from 1.');\n }\n return new Axis(this, axisNumber);\n }\n\n /**\n * Gets a Lockstep class instance which allows you to control a particular lockstep group on the device.\n * @param lockstepGroupId The ID of the lockstep group to control. Lockstep group IDs start at one.\n * @return Lockstep instance.\n */\n public getLockstep(\n lockstepGroupId: number\n ): Lockstep {\n if (lockstepGroupId <= 0) {\n throw new TypeError('Invalid value; lockstep groups are numbered from 1.');\n }\n return new Lockstep(this, lockstepGroupId);\n }\n\n /**\n * Formats parameters into a command and performs unit conversions.\n * Parameters in the command template are denoted by a question mark.\n * Command returned is only valid for this device.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param commandTemplate Template of a command to prepare. Parameters are denoted by question marks.\n * @param parameters Variable number of command parameters.\n * @return Command with converted parameters.\n */\n public prepareCommand(\n commandTemplate: string,\n ...parameters: Measurement[]\n ): string {\n const request = new gateway.PrepareCommandRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setCommandTemplate(commandTemplate);\n request.setParametersList(parameters.map(Measurement.toProtobuf));\n\n const response = gateway.callSync<gateway.PrepareCommandResponse>(\n 'device/prepare_command',\n request,\n gateway.PrepareCommandResponse);\n return response.getCommand();\n }\n\n /**\n * Returns a string that represents the device.\n * @return A string that represents the device.\n */\n public toString(): string {\n const request = new gateway.ToStringRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = gateway.callSync<gateway.ToStringResponse>(\n 'device/device_to_string',\n request,\n gateway.ToStringResponse);\n return response.getToStr();\n }\n\n /**\n * Gets a Stream class instance which allows you to control a particular stream on the device.\n * @param streamId The ID of the stream to control. Stream IDs start at one.\n * @return Stream instance.\n */\n public getStream(\n streamId: number\n ): Stream {\n if (streamId <= 0) {\n throw new TypeError('Invalid value; streams are numbered from 1.');\n }\n return new Stream(this, streamId);\n }\n\n /**\n * Gets a StreamBuffer class instance which is a handle for a stream buffer on the device.\n * @param streamBufferId The ID of the stream buffer to control. Stream buffer IDs start at one.\n * @return StreamBuffer instance.\n */\n public getStreamBuffer(\n streamBufferId: number\n ): StreamBuffer {\n if (streamBufferId <= 0) {\n throw new TypeError('Invalid value; stream buffers are numbered from 1.');\n }\n return new StreamBuffer(this, streamBufferId);\n }\n\n /**\n * Returns a serialization of the current device state that can be saved and reapplied.\n * @return A serialization of the current state of the device.\n */\n public async getState(): Promise<string> {\n const request = new gateway.GetStateRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = await gateway.callAsync<gateway.GetStateResponse>(\n 'device/get_state',\n request,\n gateway.GetStateResponse);\n return response.getState();\n }\n\n /**\n * Applies a saved state to an axis.\n * @param state The state object to apply to this axis.\n * @param deviceOnly If true, only device scope settings and features will be set.\n */\n public async setState(\n state: string,\n deviceOnly: boolean = false\n ): Promise<void> {\n const request = new gateway.SetStateRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setState(state);\n request.setDeviceOnly(deviceOnly);\n\n await gateway.callAsync('device/set_state', request);\n }\n\n /**\n * Checks if a state can be applied to a device and its peripherals.\n * This only covers exceptions that can be determined statically such as mismatches of ID or version,\n * the process of applying the state can still fail when running.\n * @param state The state object to check against.\n * @return An object listing errors that come up when trying to set the state.\n */\n public async canSetState(\n state: string\n ): Promise<CanSetStateDeviceResponse> {\n const request = new gateway.CanSetStateRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setState(state);\n\n const response = await gateway.callAsync<gateway.CanSetStateDeviceResponse>(\n 'device/can_set_state',\n request,\n gateway.CanSetStateDeviceResponse);\n return CanSetStateDeviceResponse.fromProtobuf(response.toObject());\n }\n\n /**\n * Returns identity.\n * @return Device identity.\n */\n private _retrieveIdentity(): DeviceIdentity {\n const request = new gateway.DeviceGetIdentityRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = gateway.callSync<gateway.DeviceGetIdentityResponse>(\n 'device/get_identity',\n request,\n gateway.DeviceGetIdentityResponse);\n return DeviceIdentity.fromProtobuf(response.getIdentity()!.toObject());\n }\n\n /**\n * Returns whether or not the device have been identified.\n * @return True if the device has already been identified. False otherwise.\n */\n private _retrieveIsIdentified(): boolean {\n const request = new gateway.DeviceGetIsIdentifiedRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = gateway.callSync<gateway.DeviceGetIsIdentifiedResponse>(\n 'device/get_is_identified',\n request,\n gateway.DeviceGetIsIdentifiedResponse);\n return response.getIsIdentified();\n }\n}\n"]}
1
+ {"version":3,"file":"device.js","sourceRoot":"","sources":["../../../src/ascii/device.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAGtD,uDAAmD;AACnD,iCAA8B;AAC9B,yCAAqC;AACrC,yCAAsC;AACtC,uDAAmD;AACnD,2CAAuC;AACvC,yCAAsC;AACtC,yCAAsC;AACtC,iDAA8C;AAC9C,qCAAkC;AAClC,mDAA+C;AAC/C,gDAA6C;AAE7C,oFAA6E;AAC7E,oDAAsC;AAEtC;;GAEG;AACH,MAAa,MAAM;IAkHjB,YAAY,UAAsB,EAAE,aAAqB;QACvD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;QACpC,IAAI,CAAC,SAAS,GAAG,IAAI,gCAAc,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,CAAC,GAAG,GAAG,IAAI,oBAAQ,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,QAAQ,GAAG,IAAI,kBAAO,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,SAAS,GAAG,IAAI,mBAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACvC,IAAI,CAAC,aAAa,GAAG,IAAI,2BAAY,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IAzHD;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAGD;;;OAGG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAGD;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAA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ZC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Connection } from './connection';\nimport { DeviceSettings } from './device_settings';\nimport { Axis } from './axis';\nimport { AllAxes } from './all_axes';\nimport { Warnings } from './warnings';\nimport { DeviceIdentity } from './device_identity';\nimport { DeviceIO } from './device_io';\nimport { Response } from './response';\nimport { Lockstep } from './lockstep';\nimport { Oscilloscope } from './oscilloscope';\nimport { Stream } from './stream';\nimport { StreamBuffer } from './stream_buffer';\nimport { Measurement } from '../measurement';\nimport { FirmwareVersion } from '../firmware_version';\nimport { CanSetStateDeviceResponse } from '../can_set_state_device_response';\nimport * as gateway from '../gateway';\n\n/**\n * Represents the controller part of one device - may be either a standalone controller or an integrated controller.\n */\nexport class Device {\n /**\n * Connection of this device.\n */\n public get connection(): Connection {\n return this._connection;\n }\n private _connection: Connection;\n\n /**\n * The device address uniquely identifies the device on the connection.\n * It can be configured or automatically assigned by the renumber command.\n */\n public get deviceAddress(): number {\n return this._deviceAddress;\n }\n private _deviceAddress: number;\n\n /**\n * Settings and properties of this device.\n */\n public get settings(): DeviceSettings {\n return this._settings;\n }\n private _settings: DeviceSettings;\n\n /**\n * I/O channels of this device.\n */\n public get io(): DeviceIO {\n return this._io;\n }\n private _io: DeviceIO;\n\n /**\n * Virtual axis which allows you to target all axes of this device.\n */\n public get allAxes(): AllAxes {\n return this._allAxes;\n }\n private _allAxes: AllAxes;\n\n /**\n * Warnings and faults of this device and all its axes.\n */\n public get warnings(): Warnings {\n return this._warnings;\n }\n private _warnings: Warnings;\n\n /**\n * Identity of the device.\n */\n public get identity(): DeviceIdentity {\n return this._retrieveIdentity();\n }\n\n /**\n * Indicates whether or not the device has been identified.\n */\n public get isIdentified(): boolean {\n return this._retrieveIsIdentified();\n }\n\n /**\n * Oscilloscope recording helper for this device.\n */\n public get oscilloscope(): Oscilloscope {\n return this._oscilloscope;\n }\n private _oscilloscope: Oscilloscope;\n\n /**\n * Unique ID of the device hardware.\n */\n public get deviceId(): number {\n return this.identity.deviceId;\n }\n\n /**\n * Serial number of the device.\n */\n public get serialNumber(): number {\n return this.identity.serialNumber;\n }\n\n /**\n * Name of the product.\n */\n public get name(): string {\n return this.identity.name;\n }\n\n /**\n * Number of axes this device has.\n */\n public get axisCount(): number {\n return this.identity.axisCount;\n }\n\n /**\n * Version of the firmware.\n */\n public get firmwareVersion(): FirmwareVersion {\n return this.identity.firmwareVersion;\n }\n\n /**\n * The device is an integrated product.\n */\n public get isIntegrated(): boolean {\n return this.identity.isIntegrated;\n }\n\n constructor(connection: Connection, deviceAddress: number) {\n this._connection = connection;\n this._deviceAddress = deviceAddress;\n this._settings = new DeviceSettings(this);\n this._io = new DeviceIO(this);\n this._allAxes = new AllAxes(this);\n this._warnings = new Warnings(this, 0);\n this._oscilloscope = new Oscilloscope(this);\n }\n\n /**\n * Queries the device and the database, gathering information about the product.\n * Without this information features such as unit conversions will not work.\n * Usually, called automatically by detect devices method.\n * @return Device identification data.\n */\n public async identify(): Promise<DeviceIdentity> {\n const request = new gateway.DeviceIdentifyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = await gateway.callAsync<gateway.DeviceIdentity>(\n 'device/identify',\n request,\n gateway.DeviceIdentity);\n return DeviceIdentity.fromProtobuf(response.toObject());\n }\n\n /**\n * Sends a generic ASCII command to this device.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\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 axis: number = 0,\n checkErrors: boolean = true,\n timeout: number = 0\n ): Promise<Response> {\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setCommand(command);\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 device and expect multiple responses.\n * Responses are returned in order of arrival.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\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 axis: number = 0,\n checkErrors: boolean = true,\n timeout: number = 0\n ): Promise<Response[]> {\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setCommand(command);\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 * Sends a generic ASCII command to this device without expecting a response and without adding a message ID\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param axis Optional axis number to send the command to.\n */\n public async genericCommandNoResponse(\n command: string,\n axis: number = 0\n ): Promise<void> {\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setCommand(command);\n request.setAxis(axis);\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Gets an Axis class instance which allows you to control a particular axis on this device.\n * Axes are numbered from 1.\n * @param axisNumber Number of axis intended to control.\n * @return Axis instance.\n */\n public getAxis(\n axisNumber: number\n ): Axis {\n if (axisNumber <= 0) {\n throw new TypeError('Invalid value; physical axes are numbered from 1.');\n }\n return new Axis(this, axisNumber);\n }\n\n /**\n * Gets a Lockstep class instance which allows you to control a particular lockstep group on the device.\n * @param lockstepGroupId The ID of the lockstep group to control. Lockstep group IDs start at one.\n * @return Lockstep instance.\n */\n public getLockstep(\n lockstepGroupId: number\n ): Lockstep {\n if (lockstepGroupId <= 0) {\n throw new TypeError('Invalid value; lockstep groups are numbered from 1.');\n }\n return new Lockstep(this, lockstepGroupId);\n }\n\n /**\n * Formats parameters into a command and performs unit conversions.\n * Parameters in the command template are denoted by a question mark.\n * Command returned is only valid for this device.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param commandTemplate Template of a command to prepare. Parameters are denoted by question marks.\n * @param parameters Variable number of command parameters.\n * @return Command with converted parameters.\n */\n public prepareCommand(\n commandTemplate: string,\n ...parameters: Measurement[]\n ): string {\n const request = new gateway.PrepareCommandRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setCommandTemplate(commandTemplate);\n request.setParametersList(parameters.map(Measurement.toProtobuf));\n\n const response = gateway.callSync<gateway.PrepareCommandResponse>(\n 'device/prepare_command',\n request,\n gateway.PrepareCommandResponse);\n return response.getCommand();\n }\n\n /**\n * Returns a string that represents the device.\n * @return A string that represents the device.\n */\n public toString(): string {\n const request = new gateway.ToStringRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = gateway.callSync<gateway.ToStringResponse>(\n 'device/device_to_string',\n request,\n gateway.ToStringResponse);\n return response.getToStr();\n }\n\n /**\n * Gets a Stream class instance which allows you to control a particular stream on the device.\n * @param streamId The ID of the stream to control. Stream IDs start at one.\n * @return Stream instance.\n */\n public getStream(\n streamId: number\n ): Stream {\n if (streamId <= 0) {\n throw new TypeError('Invalid value; streams are numbered from 1.');\n }\n return new Stream(this, streamId);\n }\n\n /**\n * Gets a StreamBuffer class instance which is a handle for a stream buffer on the device.\n * @param streamBufferId The ID of the stream buffer to control. Stream buffer IDs start at one.\n * @return StreamBuffer instance.\n */\n public getStreamBuffer(\n streamBufferId: number\n ): StreamBuffer {\n if (streamBufferId <= 0) {\n throw new TypeError('Invalid value; stream buffers are numbered from 1.');\n }\n return new StreamBuffer(this, streamBufferId);\n }\n\n /**\n * Returns a serialization of the current device state that can be saved and reapplied.\n * @return A serialization of the current state of the device.\n */\n public async getState(): Promise<string> {\n const request = new gateway.GetStateRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = await gateway.callAsync<gateway.GetStateResponse>(\n 'device/get_state',\n request,\n gateway.GetStateResponse);\n return response.getState();\n }\n\n /**\n * Applies a saved state to an axis.\n * @param state The state object to apply to this axis.\n * @param deviceOnly If true, only device scope settings and features will be set.\n */\n public async setState(\n state: string,\n deviceOnly: boolean = false\n ): Promise<void> {\n const request = new gateway.SetStateRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setState(state);\n request.setDeviceOnly(deviceOnly);\n\n await gateway.callAsync('device/set_state', request);\n }\n\n /**\n * Checks if a state can be applied to a device and its peripherals.\n * This only covers exceptions that can be determined statically such as mismatches of ID or version,\n * the process of applying the state can still fail when running.\n * @param state The state object to check against.\n * @return An object listing errors that come up when trying to set the state.\n */\n public async canSetState(\n state: string\n ): Promise<CanSetStateDeviceResponse> {\n const request = new gateway.CanSetStateRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setState(state);\n\n const response = await gateway.callAsync<gateway.CanSetStateDeviceResponse>(\n 'device/can_set_state',\n request,\n gateway.CanSetStateDeviceResponse);\n return CanSetStateDeviceResponse.fromProtobuf(response.toObject());\n }\n\n /**\n * Returns identity.\n * @return Device identity.\n */\n private _retrieveIdentity(): DeviceIdentity {\n const request = new gateway.DeviceGetIdentityRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = gateway.callSync<gateway.DeviceGetIdentityResponse>(\n 'device/get_identity',\n request,\n gateway.DeviceGetIdentityResponse);\n return DeviceIdentity.fromProtobuf(response.getIdentity()!.toObject());\n }\n\n /**\n * Returns whether or not the device have been identified.\n * @return True if the device has already been identified. False otherwise.\n */\n private _retrieveIsIdentified(): boolean {\n const request = new gateway.DeviceGetIsIdentifiedRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = gateway.callSync<gateway.DeviceGetIsIdentifiedResponse>(\n 'device/get_is_identified',\n request,\n gateway.DeviceGetIsIdentifiedResponse);\n return response.getIsIdentified();\n }\n}\n"]}
@@ -18,9 +18,18 @@ export { WarningFlags } from './warning_flags';
18
18
  export { Warnings } from './warnings';
19
19
  export { Lockstep } from './lockstep';
20
20
  export { LockstepAxes } from './lockstep_axes';
21
+ export { Oscilloscope } from './oscilloscope';
22
+ export { OscilloscopeData } from './oscilloscope_data';
23
+ export { OscilloscopeCaptureProperties } from './oscilloscope_capture_properties';
21
24
  export { Stream } from './stream';
22
25
  export { StreamBuffer } from './stream_buffer';
23
26
  export { StreamMode } from './stream_mode';
24
27
  export { StreamAxisType } from './stream_axis_type';
25
28
  export { StreamAxisDefinition } from './stream_axis_definition';
26
29
  export { Transport } from './transport';
30
+ export { ServoTuner } from './servo_tuner';
31
+ export { ServoTuningParamset } from './servo_tuning_paramset';
32
+ export { ParamsetInfo } from './paramset_info';
33
+ export { PidTuning } from './pid_tuning';
34
+ export { ServoTuningParam } from './servo_tuning_param';
35
+ export { SimpleTuningParam } from './simple_tuning_param';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Transport = exports.StreamAxisDefinition = exports.StreamAxisType = exports.StreamMode = exports.StreamBuffer = exports.Stream = exports.LockstepAxes = exports.Lockstep = exports.Warnings = exports.WarningFlags = exports.UnknownResponseEvent = exports.SettingConstants = exports.Response = exports.MessageType = exports.DeviceIOInfo = exports.DeviceIO = exports.Device = exports.DeviceSettings = exports.DeviceIdentity = exports.Connection = exports.Axis = exports.AxisType = exports.AxisSettings = exports.AxisIdentity = exports.AllAxes = exports.AlertEvent = void 0;
3
+ exports.SimpleTuningParam = exports.ServoTuningParam = exports.PidTuning = exports.ParamsetInfo = exports.ServoTuningParamset = exports.ServoTuner = exports.Transport = exports.StreamAxisDefinition = exports.StreamAxisType = exports.StreamMode = exports.StreamBuffer = exports.Stream = exports.OscilloscopeCaptureProperties = exports.OscilloscopeData = exports.Oscilloscope = exports.LockstepAxes = exports.Lockstep = exports.Warnings = exports.WarningFlags = exports.UnknownResponseEvent = exports.SettingConstants = exports.Response = exports.MessageType = exports.DeviceIOInfo = exports.DeviceIO = exports.Device = exports.DeviceSettings = exports.DeviceIdentity = exports.Connection = exports.Axis = exports.AxisType = exports.AxisSettings = exports.AxisIdentity = exports.AllAxes = exports.AlertEvent = void 0;
4
4
  var alert_event_1 = require("./alert_event");
5
5
  Object.defineProperty(exports, "AlertEvent", { enumerable: true, get: function () { return alert_event_1.AlertEvent; } });
6
6
  var all_axes_1 = require("./all_axes");
@@ -41,6 +41,12 @@ var lockstep_1 = require("./lockstep");
41
41
  Object.defineProperty(exports, "Lockstep", { enumerable: true, get: function () { return lockstep_1.Lockstep; } });
42
42
  var lockstep_axes_1 = require("./lockstep_axes");
43
43
  Object.defineProperty(exports, "LockstepAxes", { enumerable: true, get: function () { return lockstep_axes_1.LockstepAxes; } });
44
+ var oscilloscope_1 = require("./oscilloscope");
45
+ Object.defineProperty(exports, "Oscilloscope", { enumerable: true, get: function () { return oscilloscope_1.Oscilloscope; } });
46
+ var oscilloscope_data_1 = require("./oscilloscope_data");
47
+ Object.defineProperty(exports, "OscilloscopeData", { enumerable: true, get: function () { return oscilloscope_data_1.OscilloscopeData; } });
48
+ var oscilloscope_capture_properties_1 = require("./oscilloscope_capture_properties");
49
+ Object.defineProperty(exports, "OscilloscopeCaptureProperties", { enumerable: true, get: function () { return oscilloscope_capture_properties_1.OscilloscopeCaptureProperties; } });
44
50
  var stream_1 = require("./stream");
45
51
  Object.defineProperty(exports, "Stream", { enumerable: true, get: function () { return stream_1.Stream; } });
46
52
  var stream_buffer_1 = require("./stream_buffer");
@@ -53,4 +59,16 @@ var stream_axis_definition_1 = require("./stream_axis_definition");
53
59
  Object.defineProperty(exports, "StreamAxisDefinition", { enumerable: true, get: function () { return stream_axis_definition_1.StreamAxisDefinition; } });
54
60
  var transport_1 = require("./transport");
55
61
  Object.defineProperty(exports, "Transport", { enumerable: true, get: function () { return transport_1.Transport; } });
62
+ var servo_tuner_1 = require("./servo_tuner");
63
+ Object.defineProperty(exports, "ServoTuner", { enumerable: true, get: function () { return servo_tuner_1.ServoTuner; } });
64
+ var servo_tuning_paramset_1 = require("./servo_tuning_paramset");
65
+ Object.defineProperty(exports, "ServoTuningParamset", { enumerable: true, get: function () { return servo_tuning_paramset_1.ServoTuningParamset; } });
66
+ var paramset_info_1 = require("./paramset_info");
67
+ Object.defineProperty(exports, "ParamsetInfo", { enumerable: true, get: function () { return paramset_info_1.ParamsetInfo; } });
68
+ var pid_tuning_1 = require("./pid_tuning");
69
+ Object.defineProperty(exports, "PidTuning", { enumerable: true, get: function () { return pid_tuning_1.PidTuning; } });
70
+ var servo_tuning_param_1 = require("./servo_tuning_param");
71
+ Object.defineProperty(exports, "ServoTuningParam", { enumerable: true, get: function () { return servo_tuning_param_1.ServoTuningParam; } });
72
+ var simple_tuning_param_1 = require("./simple_tuning_param");
73
+ Object.defineProperty(exports, "SimpleTuningParam", { enumerable: true, get: function () { return simple_tuning_param_1.SimpleTuningParam; } });
56
74
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ascii/index.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,uCAAqC;AAA5B,mGAAA,OAAO,OAAA;AAChB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA;AACjB,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AACvB,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AACvB,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA;AACjB,mDAAgD;AAAvC,8GAAA,YAAY,OAAA;AACrB,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AACpB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AACzB,mEAAgE;AAAvD,8HAAA,oBAAoB,OAAA;AAC7B,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,uDAAoD;AAA3C,kHAAA,cAAc,OAAA;AACvB,mEAAgE;AAAvD,8HAAA,oBAAoB,OAAA;AAC7B,yCAAwC;AAA/B,sGAAA,SAAS,OAAA","sourcesContent":["export { AlertEvent } from './alert_event';\nexport { AllAxes } from './all_axes';\nexport { AxisIdentity } from './axis_identity';\nexport { AxisSettings } from './axis_settings';\nexport { AxisType } from './axis_type';\nexport { Axis } from './axis';\nexport { Connection } from './connection';\nexport { DeviceIdentity } from './device_identity';\nexport { DeviceSettings } from './device_settings';\nexport { Device } from './device';\nexport { DeviceIO } from './device_io';\nexport { DeviceIOInfo } from './device_io_info';\nexport { MessageType } from './message_type';\nexport { Response } from './response';\nexport { SettingConstants } from './setting_constants';\nexport { UnknownResponseEvent } from './unknown_response_event';\nexport { WarningFlags } from './warning_flags';\nexport { Warnings } from './warnings';\nexport { Lockstep } from './lockstep';\nexport { LockstepAxes } from './lockstep_axes';\nexport { Stream } from './stream';\nexport { StreamBuffer } from './stream_buffer';\nexport { StreamMode } from './stream_mode';\nexport { StreamAxisType } from './stream_axis_type';\nexport { StreamAxisDefinition } from './stream_axis_definition';\nexport { Transport } from './transport';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ascii/index.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,uCAAqC;AAA5B,mGAAA,OAAO,OAAA;AAChB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA;AACjB,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AACvB,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AACvB,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA;AACjB,mDAAgD;AAAvC,8GAAA,YAAY,OAAA;AACrB,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AACpB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AACzB,mEAAgE;AAAvD,8HAAA,oBAAoB,OAAA;AAC7B,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AACzB,qFAAkF;AAAzE,gJAAA,6BAA6B,OAAA;AACtC,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,uDAAoD;AAA3C,kHAAA,cAAc,OAAA;AACvB,mEAAgE;AAAvD,8HAAA,oBAAoB,OAAA;AAC7B,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAClB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,iEAA8D;AAArD,4HAAA,mBAAmB,OAAA;AAC5B,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,2CAAyC;AAAhC,uGAAA,SAAS,OAAA;AAClB,2DAAwD;AAA/C,sHAAA,gBAAgB,OAAA;AACzB,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA","sourcesContent":["export { AlertEvent } from './alert_event';\nexport { AllAxes } from './all_axes';\nexport { AxisIdentity } from './axis_identity';\nexport { AxisSettings } from './axis_settings';\nexport { AxisType } from './axis_type';\nexport { Axis } from './axis';\nexport { Connection } from './connection';\nexport { DeviceIdentity } from './device_identity';\nexport { DeviceSettings } from './device_settings';\nexport { Device } from './device';\nexport { DeviceIO } from './device_io';\nexport { DeviceIOInfo } from './device_io_info';\nexport { MessageType } from './message_type';\nexport { Response } from './response';\nexport { SettingConstants } from './setting_constants';\nexport { UnknownResponseEvent } from './unknown_response_event';\nexport { WarningFlags } from './warning_flags';\nexport { Warnings } from './warnings';\nexport { Lockstep } from './lockstep';\nexport { LockstepAxes } from './lockstep_axes';\nexport { Oscilloscope } from './oscilloscope';\nexport { OscilloscopeData } from './oscilloscope_data';\nexport { OscilloscopeCaptureProperties } from './oscilloscope_capture_properties';\nexport { Stream } from './stream';\nexport { StreamBuffer } from './stream_buffer';\nexport { StreamMode } from './stream_mode';\nexport { StreamAxisType } from './stream_axis_type';\nexport { StreamAxisDefinition } from './stream_axis_definition';\nexport { Transport } from './transport';\nexport { ServoTuner } from './servo_tuner';\nexport { ServoTuningParamset } from './servo_tuning_paramset';\nexport { ParamsetInfo } from './paramset_info';\nexport { PidTuning } from './pid_tuning';\nexport { ServoTuningParam } from './servo_tuning_param';\nexport { SimpleTuningParam } from './simple_tuning_param';\n"]}
@@ -0,0 +1,62 @@
1
+ import { Device } from './device';
2
+ import { OscilloscopeData } from './oscilloscope_data';
3
+ import { Native, Time } from '../units';
4
+ /**
5
+ * Provides a convenient way to control the oscilloscope data recording feature of some devices.
6
+ * The oscilloscope can record the values of some settings over time at high resolution.
7
+ */
8
+ export declare class Oscilloscope {
9
+ /**
10
+ * Device that this Oscilloscope measures.
11
+ */
12
+ get device(): Device;
13
+ private _device;
14
+ constructor(device: Device);
15
+ /**
16
+ * Select a setting to be recorded.
17
+ * @param axis The 1-based index of the axis to record the value from.
18
+ * @param setting The name of a setting to record.
19
+ */
20
+ addChannel(axis: number, setting: string): Promise<void>;
21
+ /**
22
+ * Clear the list of channels to record.
23
+ */
24
+ clear(): Promise<void>;
25
+ /**
26
+ * Get the current sampling interval.
27
+ * @param unit Unit of measure to represent the timebase in.
28
+ * @return The current sampling interval in the selected time units.
29
+ */
30
+ getTimebase(unit?: Time | Native): Promise<number>;
31
+ /**
32
+ * Set the sampling interval.
33
+ * @param interval Sample interval for the next oscilloscope recording. Minimum value is 100µs.
34
+ * @param unit Unit of measure the timebase is represented in.
35
+ */
36
+ setTimebase(interval: number, unit?: Time | Native): Promise<void>;
37
+ /**
38
+ * Get the delay before oscilloscope recording starts.
39
+ * @param unit Unit of measure to represent the delay in.
40
+ * @return The current start delay in the selected time units.
41
+ */
42
+ getDelay(unit?: Time | Native): Promise<number>;
43
+ /**
44
+ * Set the sampling start delay.
45
+ * @param interval Delay time between triggering a recording and the first data point being recorded.
46
+ * @param unit Unit of measure the delay is represented in.
47
+ */
48
+ setDelay(interval: number, unit?: Time | Native): Promise<void>;
49
+ /**
50
+ * Trigger data recording.
51
+ */
52
+ start(): Promise<void>;
53
+ /**
54
+ * End data recording if currently in progress.
55
+ */
56
+ stop(): Promise<void>;
57
+ /**
58
+ * Reads the last-recorded data from the oscilloscope. Will block until any in-progress recording completes.
59
+ * @return Array of recorded channel data arrays, in the order added.
60
+ */
61
+ read(): Promise<OscilloscopeData[]>;
62
+ }