@zaber/motion 2.8.1-alpha-2 → 2.10.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 (100) hide show
  1. package/dist/binding/wasm/zaber-motion-lib.wasm +0 -0
  2. package/dist/lib/ascii/device.d.ts +10 -0
  3. package/dist/lib/ascii/device.js +14 -0
  4. package/dist/lib/ascii/device.js.map +1 -1
  5. package/dist/lib/ascii/device_identity.d.ts +4 -0
  6. package/dist/lib/ascii/device_identity.js +1 -0
  7. package/dist/lib/ascii/device_identity.js.map +1 -1
  8. package/dist/lib/ascii/index.d.ts +3 -0
  9. package/dist/lib/ascii/index.js +7 -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/stream.d.ts +23 -0
  21. package/dist/lib/ascii/stream.js +51 -0
  22. package/dist/lib/ascii/stream.js.map +1 -1
  23. package/dist/lib/ascii/stream_axis_definition.d.ts +1 -1
  24. package/dist/lib/ascii/stream_axis_definition.js +3 -0
  25. package/dist/lib/ascii/stream_axis_definition.js.map +1 -1
  26. package/dist/lib/ascii/stream_buffer.d.ts +1 -0
  27. package/dist/lib/ascii/stream_buffer.js +1 -0
  28. package/dist/lib/ascii/stream_buffer.js.map +1 -1
  29. package/dist/lib/ascii/transport.d.ts +4 -0
  30. package/dist/lib/ascii/transport.js +4 -0
  31. package/dist/lib/ascii/transport.js.map +1 -1
  32. package/dist/lib/ascii_ns.d.ts +6 -0
  33. package/dist/lib/ascii_ns.js +3 -0
  34. package/dist/lib/ascii_ns.js.map +1 -1
  35. package/dist/lib/exceptions/g_code_execution_exception.d.ts +14 -0
  36. package/dist/lib/exceptions/g_code_execution_exception.js +32 -0
  37. package/dist/lib/exceptions/g_code_execution_exception.js.map +1 -0
  38. package/dist/lib/exceptions/g_code_execution_exception_data.d.ts +17 -0
  39. package/dist/lib/exceptions/g_code_execution_exception_data.js +18 -0
  40. package/dist/lib/exceptions/g_code_execution_exception_data.js.map +1 -0
  41. package/dist/lib/exceptions/g_code_syntax_exception.d.ts +14 -0
  42. package/dist/lib/exceptions/g_code_syntax_exception.js +32 -0
  43. package/dist/lib/exceptions/g_code_syntax_exception.js.map +1 -0
  44. package/dist/lib/exceptions/g_code_syntax_exception_data.d.ts +17 -0
  45. package/dist/lib/exceptions/g_code_syntax_exception_data.js +18 -0
  46. package/dist/lib/exceptions/g_code_syntax_exception_data.js.map +1 -0
  47. package/dist/lib/exceptions/index.d.ts +5 -0
  48. package/dist/lib/exceptions/index.js +12 -2
  49. package/dist/lib/exceptions/index.js.map +1 -1
  50. package/dist/lib/exceptions/invalid_operation_exception.d.ts +7 -0
  51. package/dist/lib/exceptions/invalid_operation_exception.js +17 -0
  52. package/dist/lib/exceptions/invalid_operation_exception.js.map +1 -0
  53. package/dist/lib/finalizer.d.ts +5 -0
  54. package/dist/lib/finalizer.js +21 -0
  55. package/dist/lib/finalizer.js.map +1 -0
  56. package/dist/lib/gateway/convert_exceptions.js +3 -0
  57. package/dist/lib/gateway/convert_exceptions.js.map +1 -1
  58. package/dist/lib/gcode/axis_definition.d.ts +18 -0
  59. package/dist/lib/gcode/axis_definition.js +49 -0
  60. package/dist/lib/gcode/axis_definition.js.map +1 -0
  61. package/dist/lib/gcode/axis_mapping.d.ts +16 -0
  62. package/dist/lib/gcode/axis_mapping.js +41 -0
  63. package/dist/lib/gcode/axis_mapping.js.map +1 -0
  64. package/dist/lib/gcode/axis_transformation.d.ts +21 -0
  65. package/dist/lib/gcode/axis_transformation.js +43 -0
  66. package/dist/lib/gcode/axis_transformation.js.map +1 -0
  67. package/dist/lib/gcode/device_definition.d.ts +24 -0
  68. package/dist/lib/gcode/device_definition.js +44 -0
  69. package/dist/lib/gcode/device_definition.js.map +1 -0
  70. package/dist/lib/gcode/index.d.ts +9 -0
  71. package/dist/lib/gcode/index.js +22 -0
  72. package/dist/lib/gcode/index.js.map +1 -0
  73. package/dist/lib/gcode/offline_translator.d.ts +106 -0
  74. package/dist/lib/gcode/offline_translator.js +211 -0
  75. package/dist/lib/gcode/offline_translator.js.map +1 -0
  76. package/dist/lib/gcode/translate_message.d.ts +21 -0
  77. package/dist/lib/gcode/translate_message.js +19 -0
  78. package/dist/lib/gcode/translate_message.js.map +1 -0
  79. package/dist/lib/gcode/translate_result.d.ts +17 -0
  80. package/dist/lib/gcode/translate_result.js +19 -0
  81. package/dist/lib/gcode/translate_result.js.map +1 -0
  82. package/dist/lib/gcode/translator.d.ts +114 -0
  83. package/dist/lib/gcode/translator.js +225 -0
  84. package/dist/lib/gcode/translator.js.map +1 -0
  85. package/dist/lib/gcode/translator_config.d.ts +18 -0
  86. package/dist/lib/gcode/translator_config.js +44 -0
  87. package/dist/lib/gcode/translator_config.js.map +1 -0
  88. package/dist/lib/gcode_ns.d.ts +21 -0
  89. package/dist/lib/gcode_ns.js +36 -0
  90. package/dist/lib/gcode_ns.js.map +1 -0
  91. package/dist/lib/index.d.ts +1 -0
  92. package/dist/lib/index.js +1 -0
  93. package/dist/lib/index.js.map +1 -1
  94. package/dist/lib/measurement.d.ts +1 -1
  95. package/dist/lib/measurement.js +3 -0
  96. package/dist/lib/measurement.js.map +1 -1
  97. package/dist/lib/protobufs/main_pb.d.ts +1109 -24
  98. package/dist/lib/protobufs/main_pb.js +13539 -5174
  99. package/dist/lib/protobufs/main_pb.js.map +1 -1
  100. package/package.json +2 -2
@@ -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
  */
@@ -75,6 +81,10 @@ export declare class Device {
75
81
  * Version of the firmware.
76
82
  */
77
83
  get firmwareVersion(): FirmwareVersion;
84
+ /**
85
+ * The device is an integrated product.
86
+ */
87
+ get isIntegrated(): boolean;
78
88
  constructor(connection: Connection, deviceAddress: number);
79
89
  /**
80
90
  * Queries the device and the database, gathering information about the product.
@@ -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
  */
@@ -126,6 +134,12 @@ class Device {
126
134
  get firmwareVersion() {
127
135
  return this.identity.firmwareVersion;
128
136
  }
137
+ /**
138
+ * The device is an integrated product.
139
+ */
140
+ get isIntegrated() {
141
+ return this.identity.isIntegrated;
142
+ }
129
143
  /**
130
144
  * Queries the device and the database, gathering information about the product.
131
145
  * Without this information features such as unit conversions will not work.
@@ -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;IAmGjB,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;IAzGD;;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,C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C,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;AA1YD,wBA0YC","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 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,SAAS,CAAC;IACxB,CAAC;IAGD;;OAEG;IACH,IAAW,EAAE;QACX,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IAGD;;OA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,CAAC,aAAa,CAAC,CAAC;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;AA1ZD,wBA0ZC","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"]}
@@ -27,6 +27,10 @@ export interface DeviceIdentity {
27
27
  * The device has hardware modifications.
28
28
  */
29
29
  isModified: boolean;
30
+ /**
31
+ * The device is an integrated product.
32
+ */
33
+ isIntegrated: boolean;
30
34
  }
31
35
  export declare namespace DeviceIdentity {
32
36
  const __type = "DeviceIdentity";
@@ -16,6 +16,7 @@ var DeviceIdentity;
16
16
  axisCount: pbData.axisCount,
17
17
  firmwareVersion: firmware_version_1.FirmwareVersion.fromProtobuf(pbData.firmwareVersion),
18
18
  isModified: pbData.isModified,
19
+ isIntegrated: pbData.isIntegrated,
19
20
  };
20
21
  }
21
22
  DeviceIdentity.fromProtobuf = fromProtobuf;
@@ -1 +1 @@
1
- {"version":3,"file":"device_identity.js","sourceRoot":"","sources":["../../../src/ascii/device_identity.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;AAGtD,0DAAsD;AAsCtD,IAAiB,cAAc,CAc9B;AAdD,WAAiB,cAAc;IAChB,qBAAM,GAAG,gBAAgB,CAAC;IAEvC,gBAAgB;IAChB,SAAgB,YAAY,CAAC,MAAuC;QAClE,OAAO;YACL,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,eAAe,EAAE,kCAAe,CAAC,YAAY,CAAC,MAAM,CAAC,eAAgB,CAAC;YACtE,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC;IACJ,CAAC;IATe,2BAAY,eAS3B,CAAA;AACH,CAAC,EAdgB,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAc9B","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport { FirmwareVersion } from '../firmware_version';\n\n/**\n * Representation of data gathered during device identification.\n */\nexport interface DeviceIdentity {\n /**\n * Unique ID of the device hardware.\n */\n deviceId: number;\n\n /**\n * Serial number of the device.\n */\n serialNumber: number;\n\n /**\n * Name of the product.\n */\n name: string;\n\n /**\n * Number of axes this device has.\n */\n axisCount: number;\n\n /**\n * Version of the firmware.\n */\n firmwareVersion: FirmwareVersion;\n\n /**\n * The device has hardware modifications.\n */\n isModified: boolean;\n\n}\n\nexport namespace DeviceIdentity {\n export const __type = 'DeviceIdentity';\n\n /** @internal */\n export function fromProtobuf(pbData: gateway.DeviceIdentity.AsObject): DeviceIdentity {\n return {\n deviceId: pbData.deviceId,\n serialNumber: pbData.serialNumber,\n name: pbData.name,\n axisCount: pbData.axisCount,\n firmwareVersion: FirmwareVersion.fromProtobuf(pbData.firmwareVersion!),\n isModified: pbData.isModified,\n };\n }\n}\n"]}
1
+ {"version":3,"file":"device_identity.js","sourceRoot":"","sources":["../../../src/ascii/device_identity.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;AAGtD,0DAAsD;AA2CtD,IAAiB,cAAc,CAe9B;AAfD,WAAiB,cAAc;IAChB,qBAAM,GAAG,gBAAgB,CAAC;IAEvC,gBAAgB;IAChB,SAAgB,YAAY,CAAC,MAAuC;QAClE,OAAO;YACL,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,eAAe,EAAE,kCAAe,CAAC,YAAY,CAAC,MAAM,CAAC,eAAgB,CAAC;YACtE,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,YAAY,EAAE,MAAM,CAAC,YAAY;SAClC,CAAC;IACJ,CAAC;IAVe,2BAAY,eAU3B,CAAA;AACH,CAAC,EAfgB,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAe9B","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport { FirmwareVersion } from '../firmware_version';\n\n/**\n * Representation of data gathered during device identification.\n */\nexport interface DeviceIdentity {\n /**\n * Unique ID of the device hardware.\n */\n deviceId: number;\n\n /**\n * Serial number of the device.\n */\n serialNumber: number;\n\n /**\n * Name of the product.\n */\n name: string;\n\n /**\n * Number of axes this device has.\n */\n axisCount: number;\n\n /**\n * Version of the firmware.\n */\n firmwareVersion: FirmwareVersion;\n\n /**\n * The device has hardware modifications.\n */\n isModified: boolean;\n\n /**\n * The device is an integrated product.\n */\n isIntegrated: boolean;\n\n}\n\nexport namespace DeviceIdentity {\n export const __type = 'DeviceIdentity';\n\n /** @internal */\n export function fromProtobuf(pbData: gateway.DeviceIdentity.AsObject): DeviceIdentity {\n return {\n deviceId: pbData.deviceId,\n serialNumber: pbData.serialNumber,\n name: pbData.name,\n axisCount: pbData.axisCount,\n firmwareVersion: FirmwareVersion.fromProtobuf(pbData.firmwareVersion!),\n isModified: pbData.isModified,\n isIntegrated: pbData.isIntegrated,\n };\n }\n}\n"]}
@@ -18,6 +18,9 @@ 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';
@@ -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.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");
@@ -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","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';\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
+ }
@@ -0,0 +1,153 @@
1
+ "use strict";
2
+ // ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //
3
+ // ============= DO NOT EDIT DIRECTLY ============= //
4
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
7
+ }) : (function(o, m, k, k2) {
8
+ if (k2 === undefined) k2 = k;
9
+ o[k2] = m[k];
10
+ }));
11
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
12
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
13
+ }) : function(o, v) {
14
+ o["default"] = v;
15
+ });
16
+ var __importStar = (this && this.__importStar) || function (mod) {
17
+ if (mod && mod.__esModule) return mod;
18
+ var result = {};
19
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
20
+ __setModuleDefault(result, mod);
21
+ return result;
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.Oscilloscope = void 0;
25
+ const oscilloscope_data_1 = require("./oscilloscope_data");
26
+ const units_1 = require("../units");
27
+ const gateway = __importStar(require("../gateway"));
28
+ /**
29
+ * Provides a convenient way to control the oscilloscope data recording feature of some devices.
30
+ * The oscilloscope can record the values of some settings over time at high resolution.
31
+ */
32
+ class Oscilloscope {
33
+ constructor(device) {
34
+ this._device = device;
35
+ }
36
+ /**
37
+ * Device that this Oscilloscope measures.
38
+ */
39
+ get device() {
40
+ return this._device;
41
+ }
42
+ /**
43
+ * Select a setting to be recorded.
44
+ * @param axis The 1-based index of the axis to record the value from.
45
+ * @param setting The name of a setting to record.
46
+ */
47
+ async addChannel(axis, setting) {
48
+ const request = new gateway.OscilloscopeAddChannelRequest();
49
+ request.setInterfaceId(this.device.connection.interfaceId);
50
+ request.setDevice(this.device.deviceAddress);
51
+ request.setAxis(axis);
52
+ request.setSetting(setting);
53
+ await gateway.callAsync('oscilloscope/add_channel', request);
54
+ }
55
+ /**
56
+ * Clear the list of channels to record.
57
+ */
58
+ async clear() {
59
+ const request = new gateway.OscilloscopeClearChannelsRequest();
60
+ request.setInterfaceId(this.device.connection.interfaceId);
61
+ request.setDevice(this.device.deviceAddress);
62
+ await gateway.callAsync('oscilloscope/clear_channels', request);
63
+ }
64
+ /**
65
+ * Get the current sampling interval.
66
+ * @param unit Unit of measure to represent the timebase in.
67
+ * @return The current sampling interval in the selected time units.
68
+ */
69
+ async getTimebase(unit = units_1.Units.NATIVE) {
70
+ const request = new gateway.DeviceGetSettingRequest();
71
+ request.setInterfaceId(this.device.connection.interfaceId);
72
+ request.setDevice(this.device.deviceAddress);
73
+ request.setSetting('scope.timebase');
74
+ request.setUnit(unit);
75
+ const response = await gateway.callAsync('device/get_setting', request, gateway.DeviceGetSettingResponse);
76
+ return response.getValue();
77
+ }
78
+ /**
79
+ * Set the sampling interval.
80
+ * @param interval Sample interval for the next oscilloscope recording. Minimum value is 100µs.
81
+ * @param unit Unit of measure the timebase is represented in.
82
+ */
83
+ async setTimebase(interval, unit = units_1.Units.NATIVE) {
84
+ const request = new gateway.DeviceSetSettingRequest();
85
+ request.setInterfaceId(this.device.connection.interfaceId);
86
+ request.setDevice(this.device.deviceAddress);
87
+ request.setSetting('scope.timebase');
88
+ request.setValue(interval);
89
+ request.setUnit(unit);
90
+ await gateway.callAsync('device/set_setting', request);
91
+ }
92
+ /**
93
+ * Get the delay before oscilloscope recording starts.
94
+ * @param unit Unit of measure to represent the delay in.
95
+ * @return The current start delay in the selected time units.
96
+ */
97
+ async getDelay(unit = units_1.Units.NATIVE) {
98
+ const request = new gateway.DeviceGetSettingRequest();
99
+ request.setInterfaceId(this.device.connection.interfaceId);
100
+ request.setDevice(this.device.deviceAddress);
101
+ request.setSetting('scope.delay');
102
+ request.setUnit(unit);
103
+ const response = await gateway.callAsync('device/get_setting', request, gateway.DeviceGetSettingResponse);
104
+ return response.getValue();
105
+ }
106
+ /**
107
+ * Set the sampling start delay.
108
+ * @param interval Delay time between triggering a recording and the first data point being recorded.
109
+ * @param unit Unit of measure the delay is represented in.
110
+ */
111
+ async setDelay(interval, unit = units_1.Units.NATIVE) {
112
+ const request = new gateway.DeviceSetSettingRequest();
113
+ request.setInterfaceId(this.device.connection.interfaceId);
114
+ request.setDevice(this.device.deviceAddress);
115
+ request.setSetting('scope.delay');
116
+ request.setValue(interval);
117
+ request.setUnit(unit);
118
+ await gateway.callAsync('device/set_setting', request);
119
+ }
120
+ /**
121
+ * Trigger data recording.
122
+ */
123
+ async start() {
124
+ const request = new gateway.OscilloscopeStartStopRequest();
125
+ request.setInterfaceId(this.device.connection.interfaceId);
126
+ request.setDevice(this.device.deviceAddress);
127
+ request.setStart(true);
128
+ await gateway.callAsync('oscilloscope/start_or_stop', request);
129
+ }
130
+ /**
131
+ * End data recording if currently in progress.
132
+ */
133
+ async stop() {
134
+ const request = new gateway.OscilloscopeStartStopRequest();
135
+ request.setInterfaceId(this.device.connection.interfaceId);
136
+ request.setDevice(this.device.deviceAddress);
137
+ request.setStart(false);
138
+ await gateway.callAsync('oscilloscope/start_or_stop', request);
139
+ }
140
+ /**
141
+ * Reads the last-recorded data from the oscilloscope. Will block until any in-progress recording completes.
142
+ * @return Array of recorded channel data arrays, in the order added.
143
+ */
144
+ async read() {
145
+ const request = new gateway.OscilloscopeReadRequest();
146
+ request.setInterfaceId(this.device.connection.interfaceId);
147
+ request.setDevice(this.device.deviceAddress);
148
+ const response = await gateway.callAsync('oscilloscope/read', request, gateway.OscilloscopeReadResponse);
149
+ return response.getDataIdsList().map(id => new oscilloscope_data_1.OscilloscopeData(this.device, id));
150
+ }
151
+ }
152
+ exports.Oscilloscope = Oscilloscope;
153
+ //# sourceMappingURL=oscilloscope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oscilloscope.js","sourceRoot":"","sources":["../../../src/ascii/oscilloscope.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAGtD,2DAAuD;AACvD,oCAA+C;AAC/C,oDAAsC;AAEtC;;;GAGG;AACH,MAAa,YAAY;IASvB,YAAY,MAAc;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAVD;;OAEG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAOD;;;;OAIG;IACI,KAAK,CAAC,UAAU,CACrB,IAAY,EACZ,OAAe;QAEf,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,6BAA6B,EAAE,CAAC;QAC5D,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3D,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAC7C,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACtB,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAE5B,MAAM,OAAO,CAAC,SAAS,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,KAAK;QAChB,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,gCAAgC,EAA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AAM,EAAE,EAAE,CAAC,CAAC,CAAC;IACrF,CAAC;CACF;AAjKD,oCAiKC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Device } from './device';\nimport { OscilloscopeData } from './oscilloscope_data';\nimport { Native, Time, Units } from '../units';\nimport * as gateway from '../gateway';\n\n/**\n * Provides a convenient way to control the oscilloscope data recording feature of some devices.\n * The oscilloscope can record the values of some settings over time at high resolution.\n */\nexport class Oscilloscope {\n /**\n * Device that this Oscilloscope measures.\n */\n public get device(): Device {\n return this._device;\n }\n private _device: Device;\n\n constructor(device: Device) {\n this._device = device;\n }\n\n /**\n * Select a setting to be recorded.\n * @param axis The 1-based index of the axis to record the value from.\n * @param setting The name of a setting to record.\n */\n public async addChannel(\n axis: number,\n setting: string\n ): Promise<void> {\n const request = new gateway.OscilloscopeAddChannelRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(axis);\n request.setSetting(setting);\n\n await gateway.callAsync('oscilloscope/add_channel', request);\n }\n\n /**\n * Clear the list of channels to record.\n */\n public async clear(): Promise<void> {\n const request = new gateway.OscilloscopeClearChannelsRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n\n await gateway.callAsync('oscilloscope/clear_channels', request);\n }\n\n /**\n * Get the current sampling interval.\n * @param unit Unit of measure to represent the timebase in.\n * @return The current sampling interval in the selected time units.\n */\n public async getTimebase(\n unit: Time | Native = Units.NATIVE\n ): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.timebase');\n request.setUnit(unit);\n\n const response = await gateway.callAsync<gateway.DeviceGetSettingResponse>(\n 'device/get_setting',\n request,\n gateway.DeviceGetSettingResponse);\n return response.getValue();\n }\n\n /**\n * Set the sampling interval.\n * @param interval Sample interval for the next oscilloscope recording. Minimum value is 100µs.\n * @param unit Unit of measure the timebase is represented in.\n */\n public async setTimebase(\n interval: number,\n unit: Time | Native = Units.NATIVE\n ): Promise<void> {\n const request = new gateway.DeviceSetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.timebase');\n request.setValue(interval);\n request.setUnit(unit);\n\n await gateway.callAsync('device/set_setting', request);\n }\n\n /**\n * Get the delay before oscilloscope recording starts.\n * @param unit Unit of measure to represent the delay in.\n * @return The current start delay in the selected time units.\n */\n public async getDelay(\n unit: Time | Native = Units.NATIVE\n ): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.delay');\n request.setUnit(unit);\n\n const response = await gateway.callAsync<gateway.DeviceGetSettingResponse>(\n 'device/get_setting',\n request,\n gateway.DeviceGetSettingResponse);\n return response.getValue();\n }\n\n /**\n * Set the sampling start delay.\n * @param interval Delay time between triggering a recording and the first data point being recorded.\n * @param unit Unit of measure the delay is represented in.\n */\n public async setDelay(\n interval: number,\n unit: Time | Native = Units.NATIVE\n ): Promise<void> {\n const request = new gateway.DeviceSetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.delay');\n request.setValue(interval);\n request.setUnit(unit);\n\n await gateway.callAsync('device/set_setting', request);\n }\n\n /**\n * Trigger data recording.\n */\n public async start(): Promise<void> {\n const request = new gateway.OscilloscopeStartStopRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStart(true);\n\n await gateway.callAsync('oscilloscope/start_or_stop', request);\n }\n\n /**\n * End data recording if currently in progress.\n */\n public async stop(): Promise<void> {\n const request = new gateway.OscilloscopeStartStopRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStart(false);\n\n await gateway.callAsync('oscilloscope/start_or_stop', request);\n }\n\n /**\n * Reads the last-recorded data from the oscilloscope. Will block until any in-progress recording completes.\n * @return Array of recorded channel data arrays, in the order added.\n */\n public async read(): Promise<OscilloscopeData[]> {\n const request = new gateway.OscilloscopeReadRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n\n const response = await gateway.callAsync<gateway.OscilloscopeReadResponse>(\n 'oscilloscope/read',\n request,\n gateway.OscilloscopeReadResponse);\n return response.getDataIdsList()!.map(id => new OscilloscopeData(this.device, id));\n }\n}\n"]}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The public properties of one channel of recorded oscilloscope data.
3
+ */
4
+ export interface OscilloscopeCaptureProperties {
5
+ /**
6
+ * The name of the recorded setting.
7
+ */
8
+ setting: string;
9
+ /**
10
+ * The number of the axis the data was recorded from, or 0 for the controller.
11
+ */
12
+ axisNumber: number;
13
+ }
14
+ export declare namespace OscilloscopeCaptureProperties {
15
+ const __type = "OscilloscopeCaptureProperties";
16
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ // ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //
3
+ // ============= DO NOT EDIT DIRECTLY ============= //
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.OscilloscopeCaptureProperties = void 0;
6
+ var OscilloscopeCaptureProperties;
7
+ (function (OscilloscopeCaptureProperties) {
8
+ OscilloscopeCaptureProperties.__type = 'OscilloscopeCaptureProperties';
9
+ /** @internal */
10
+ function fromProtobuf(pbData) {
11
+ return {
12
+ setting: pbData.setting,
13
+ axisNumber: pbData.axisNumber,
14
+ };
15
+ }
16
+ OscilloscopeCaptureProperties.fromProtobuf = fromProtobuf;
17
+ })(OscilloscopeCaptureProperties = exports.OscilloscopeCaptureProperties || (exports.OscilloscopeCaptureProperties = {}));
18
+ //# sourceMappingURL=oscilloscope_capture_properties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oscilloscope_capture_properties.js","sourceRoot":"","sources":["../../../src/ascii/oscilloscope_capture_properties.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;AAoBtD,IAAiB,6BAA6B,CAU7C;AAVD,WAAiB,6BAA6B;IAC/B,oCAAM,GAAG,+BAA+B,CAAC;IAEtD,gBAAgB;IAChB,SAAgB,YAAY,CAAC,MAAsD;QACjF,OAAO;YACL,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC;IACJ,CAAC;IALe,0CAAY,eAK3B,CAAA;AACH,CAAC,EAVgB,6BAA6B,GAA7B,qCAA6B,KAA7B,qCAA6B,QAU7C","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\n\n/**\n * The public properties of one channel of recorded oscilloscope data.\n */\nexport interface OscilloscopeCaptureProperties {\n /**\n * The name of the recorded setting.\n */\n setting: string;\n\n /**\n * The number of the axis the data was recorded from, or 0 for the controller.\n */\n axisNumber: number;\n\n}\n\nexport namespace OscilloscopeCaptureProperties {\n export const __type = 'OscilloscopeCaptureProperties';\n\n /** @internal */\n export function fromProtobuf(pbData: gateway.OscilloscopeCaptureProperties.AsObject): OscilloscopeCaptureProperties {\n return {\n setting: pbData.setting,\n axisNumber: pbData.axisNumber,\n };\n }\n}\n"]}
@@ -0,0 +1,67 @@
1
+ import { Device } from './device';
2
+ import { Native, Time, Units } from '../units';
3
+ /**
4
+ * Contains a block of contiguous recorded data for one channel of the device's oscilloscope.
5
+ */
6
+ export declare class OscilloscopeData {
7
+ /**
8
+ * Device that this Oscilloscope measures.
9
+ */
10
+ get device(): Device;
11
+ private _device;
12
+ /**
13
+ * Unique ID for this block of recorded data.
14
+ */
15
+ get dataId(): number;
16
+ private _dataId;
17
+ /**
18
+ * The name of the recorded setting.
19
+ */
20
+ get setting(): string;
21
+ /**
22
+ * The number of the axis the data was recorded from, or 0 for the controller.
23
+ */
24
+ get axisNumber(): number;
25
+ constructor(device: Device, dataId: number);
26
+ /**
27
+ * Get the sample interval that this data was recorded with.
28
+ * @param unit Unit of measure to represent the timebase in.
29
+ * @return The timebase setting at the time the data was recorded.
30
+ */
31
+ getTimebase(unit?: Time | Native): number;
32
+ /**
33
+ * Get the sample interval that this data was recorded with.
34
+ * @param unit Unit of measure to represent the delay in.
35
+ * @return The delay setting at the time the data was recorded.
36
+ */
37
+ getDelay(unit?: Time | Native): number;
38
+ /**
39
+ * Calculate the time a sample was recorded, relative to when the recording was triggered.
40
+ * @param index 0-based index of the sample to calculate the time of.
41
+ * @param unit Unit of measure to represent the calculated time in.
42
+ * @return The calculated time offset of the data sample at the given index.
43
+ */
44
+ getSampleTime(index: number, unit?: Time | Native): number;
45
+ /**
46
+ * Get the recorded data as an array of doubles.
47
+ * @param unit Unit of measure to convert the data to.
48
+ * @return The recorded data for one oscilloscope channel, converted to the units specified.
49
+ */
50
+ getData(unit?: Units): number[];
51
+ /**
52
+ * Releases native resources of an oscilloscope data buffer.
53
+ * @param dataId The ID of the data buffer to delete.
54
+ */
55
+ private static _free;
56
+ /**
57
+ * Returns recording properties.
58
+ * @return Capture properties.
59
+ */
60
+ private _retrieveProperties;
61
+ /**
62
+ * Releases the native resources of the oscilloscope data.
63
+ * Should only be called if your environment does not support FinalizationRegistry.
64
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry
65
+ */
66
+ free(): void;
67
+ }