@zaber/motion 2.11.2 → 2.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1538 -3009
- package/dist/binding/wasm/zaber-motion-lib.wasm +0 -0
- package/dist/lib/ascii/all_axes.js +8 -8
- package/dist/lib/ascii/all_axes.js.map +1 -1
- package/dist/lib/ascii/axis.d.ts +39 -6
- package/dist/lib/ascii/axis.js +77 -24
- package/dist/lib/ascii/axis.js.map +1 -1
- package/dist/lib/ascii/axis_settings.d.ts +19 -0
- package/dist/lib/ascii/axis_settings.js +48 -4
- package/dist/lib/ascii/axis_settings.js.map +1 -1
- package/dist/lib/ascii/connection.d.ts +2 -0
- package/dist/lib/ascii/connection.js +13 -11
- package/dist/lib/ascii/connection.js.map +1 -1
- package/dist/lib/ascii/device.d.ts +7 -0
- package/dist/lib/ascii/device.js +22 -13
- package/dist/lib/ascii/device.js.map +1 -1
- package/dist/lib/ascii/device_io.js +5 -5
- package/dist/lib/ascii/device_io.js.map +1 -1
- package/dist/lib/ascii/device_settings.d.ts +19 -0
- package/dist/lib/ascii/device_settings.js +45 -4
- package/dist/lib/ascii/device_settings.js.map +1 -1
- package/dist/lib/ascii/index.d.ts +1 -0
- package/dist/lib/ascii/index.js +4 -1
- package/dist/lib/ascii/index.js.map +1 -1
- package/dist/lib/ascii/lockstep.d.ts +33 -6
- package/dist/lib/ascii/lockstep.js +61 -16
- package/dist/lib/ascii/lockstep.js.map +1 -1
- package/dist/lib/ascii/oscilloscope.js +5 -5
- package/dist/lib/ascii/oscilloscope.js.map +1 -1
- package/dist/lib/ascii/oscilloscope_data.d.ts +1 -7
- package/dist/lib/ascii/oscilloscope_data.js +7 -24
- package/dist/lib/ascii/oscilloscope_data.js.map +1 -1
- package/dist/lib/ascii/servo_tuner.d.ts +11 -0
- package/dist/lib/ascii/servo_tuner.js +26 -4
- package/dist/lib/ascii/servo_tuner.js.map +1 -1
- package/dist/lib/ascii/setting_constants.d.ts +124 -0
- package/dist/lib/ascii/setting_constants.js +124 -0
- package/dist/lib/ascii/setting_constants.js.map +1 -1
- package/dist/lib/ascii/storage.d.ts +98 -0
- package/dist/lib/ascii/storage.js +220 -0
- package/dist/lib/ascii/storage.js.map +1 -0
- package/dist/lib/ascii/stream.d.ts +5 -5
- package/dist/lib/ascii/stream.js +19 -19
- package/dist/lib/ascii/stream.js.map +1 -1
- package/dist/lib/ascii/transport.js +2 -2
- package/dist/lib/ascii/transport.js.map +1 -1
- package/dist/lib/ascii_ns.d.ts +4 -0
- package/dist/lib/ascii_ns.js +2 -0
- package/dist/lib/ascii_ns.js.map +1 -1
- package/dist/lib/binary/connection.js +7 -7
- package/dist/lib/binary/connection.js.map +1 -1
- package/dist/lib/binary/device.js +30 -30
- package/dist/lib/binary/device.js.map +1 -1
- package/dist/lib/binary/device_settings.js +1 -1
- package/dist/lib/binary/device_settings.js.map +1 -1
- package/dist/lib/exceptions/command_too_long_exception.d.ts +14 -0
- package/dist/lib/exceptions/command_too_long_exception.js +32 -0
- package/dist/lib/exceptions/command_too_long_exception.js.map +1 -0
- package/dist/lib/exceptions/command_too_long_exception_data.d.ts +24 -0
- package/dist/lib/exceptions/command_too_long_exception_data.js +20 -0
- package/dist/lib/exceptions/command_too_long_exception_data.js.map +1 -0
- package/dist/lib/exceptions/index.d.ts +3 -0
- package/dist/lib/exceptions/index.js +8 -2
- package/dist/lib/exceptions/index.js.map +1 -1
- package/dist/lib/exceptions/no_value_for_key_exception.d.ts +7 -0
- package/dist/lib/exceptions/no_value_for_key_exception.js +17 -0
- package/dist/lib/exceptions/no_value_for_key_exception.js.map +1 -0
- package/dist/lib/gateway/convert_exceptions.js +2 -0
- package/dist/lib/gateway/convert_exceptions.js.map +1 -1
- package/dist/lib/gcode/offline_translator.js +3 -3
- package/dist/lib/gcode/offline_translator.js.map +1 -1
- package/dist/lib/gcode/translator.js +3 -3
- package/dist/lib/gcode/translator.js.map +1 -1
- package/dist/lib/protobufs/main_pb.d.ts +564 -1738
- package/dist/lib/protobufs/main_pb.js +12002 -20930
- package/dist/lib/protobufs/main_pb.js.map +1 -1
- package/dist/lib/tools.js +1 -1
- package/dist/lib/tools.js.map +1 -1
- package/dist/lib/units.d.ts +63 -1
- package/dist/lib/units.js +70 -1
- package/dist/lib/units.js.map +1 -1
- package/package.json +3 -2
|
@@ -170,8 +170,8 @@ class Device {
|
|
|
170
170
|
request.setFromUnit(fromUnit);
|
|
171
171
|
request.setToUnit(toUnit);
|
|
172
172
|
request.setTimeout(timeout);
|
|
173
|
-
const response = await gateway.callAsync('binary/device/generic_command_with_units', request, gateway.
|
|
174
|
-
return response.
|
|
173
|
+
const response = await gateway.callAsync('binary/device/generic_command_with_units', request, gateway.DoubleResponse);
|
|
174
|
+
return response.getValue();
|
|
175
175
|
}
|
|
176
176
|
/**
|
|
177
177
|
* Homes device. Device returns to its homing position.
|
|
@@ -185,8 +185,8 @@ class Device {
|
|
|
185
185
|
request.setDevice(this.deviceAddress);
|
|
186
186
|
request.setUnit(unit);
|
|
187
187
|
request.setTimeout(timeout);
|
|
188
|
-
const response = await gateway.callAsync('binary/device/home', request, gateway.
|
|
189
|
-
return response.
|
|
188
|
+
const response = await gateway.callAsync('binary/device/home', request, gateway.DoubleResponse);
|
|
189
|
+
return response.getValue();
|
|
190
190
|
}
|
|
191
191
|
/**
|
|
192
192
|
* Stops ongoing device movement. Decelerates until zero speed.
|
|
@@ -200,8 +200,8 @@ class Device {
|
|
|
200
200
|
request.setDevice(this.deviceAddress);
|
|
201
201
|
request.setUnit(unit);
|
|
202
202
|
request.setTimeout(timeout);
|
|
203
|
-
const response = await gateway.callAsync('binary/device/stop', request, gateway.
|
|
204
|
-
return response.
|
|
203
|
+
const response = await gateway.callAsync('binary/device/stop', request, gateway.DoubleResponse);
|
|
204
|
+
return response.getValue();
|
|
205
205
|
}
|
|
206
206
|
/**
|
|
207
207
|
* Move device to absolute position.
|
|
@@ -218,8 +218,8 @@ class Device {
|
|
|
218
218
|
request.setArg(position);
|
|
219
219
|
request.setUnit(unit);
|
|
220
220
|
request.setTimeout(timeout);
|
|
221
|
-
const response = await gateway.callAsync('binary/device/move', request, gateway.
|
|
222
|
-
return response.
|
|
221
|
+
const response = await gateway.callAsync('binary/device/move', request, gateway.DoubleResponse);
|
|
222
|
+
return response.getValue();
|
|
223
223
|
}
|
|
224
224
|
/**
|
|
225
225
|
* Move device to position relative to current position.
|
|
@@ -236,8 +236,8 @@ class Device {
|
|
|
236
236
|
request.setArg(position);
|
|
237
237
|
request.setUnit(unit);
|
|
238
238
|
request.setTimeout(timeout);
|
|
239
|
-
const response = await gateway.callAsync('binary/device/move', request, gateway.
|
|
240
|
-
return response.
|
|
239
|
+
const response = await gateway.callAsync('binary/device/move', request, gateway.DoubleResponse);
|
|
240
|
+
return response.getValue();
|
|
241
241
|
}
|
|
242
242
|
/**
|
|
243
243
|
* Begins to move device at specified speed.
|
|
@@ -252,14 +252,14 @@ class Device {
|
|
|
252
252
|
request.setType(gateway.BinaryDeviceMoveRequest.MoveType.VEL);
|
|
253
253
|
request.setArg(velocity);
|
|
254
254
|
request.setUnit(unit);
|
|
255
|
-
const response = await gateway.callAsync('binary/device/move', request, gateway.
|
|
256
|
-
return response.
|
|
255
|
+
const response = await gateway.callAsync('binary/device/move', request, gateway.DoubleResponse);
|
|
256
|
+
return response.getValue();
|
|
257
257
|
}
|
|
258
258
|
/**
|
|
259
259
|
* Waits until device stops moving.
|
|
260
260
|
*/
|
|
261
261
|
async waitUntilIdle() {
|
|
262
|
-
const request = new gateway.
|
|
262
|
+
const request = new gateway.DeviceEmptyRequest();
|
|
263
263
|
request.setInterfaceId(this.connection.interfaceId);
|
|
264
264
|
request.setDevice(this.deviceAddress);
|
|
265
265
|
await gateway.callAsync('binary/device/wait_until_idle', request);
|
|
@@ -269,11 +269,11 @@ class Device {
|
|
|
269
269
|
* @return True if the device is currently executing a motion command.
|
|
270
270
|
*/
|
|
271
271
|
async isBusy() {
|
|
272
|
-
const request = new gateway.
|
|
272
|
+
const request = new gateway.DeviceEmptyRequest();
|
|
273
273
|
request.setInterfaceId(this.connection.interfaceId);
|
|
274
274
|
request.setDevice(this.deviceAddress);
|
|
275
|
-
const response = await gateway.callAsync('binary/device/is_busy', request, gateway.
|
|
276
|
-
return response.
|
|
275
|
+
const response = await gateway.callAsync('binary/device/is_busy', request, gateway.BoolResponse);
|
|
276
|
+
return response.getValue();
|
|
277
277
|
}
|
|
278
278
|
/**
|
|
279
279
|
* Queries the device and the database, gathering information about the product.
|
|
@@ -282,7 +282,7 @@ class Device {
|
|
|
282
282
|
* @return Device identification data.
|
|
283
283
|
*/
|
|
284
284
|
async identify() {
|
|
285
|
-
const request = new gateway.
|
|
285
|
+
const request = new gateway.DeviceEmptyRequest();
|
|
286
286
|
request.setInterfaceId(this.connection.interfaceId);
|
|
287
287
|
request.setDevice(this.deviceAddress);
|
|
288
288
|
const response = await gateway.callAsync('binary/device/identify', request, gateway.BinaryDeviceIdentity);
|
|
@@ -294,7 +294,7 @@ class Device {
|
|
|
294
294
|
* It can later be unparked and moved without first having to home it.
|
|
295
295
|
*/
|
|
296
296
|
async park() {
|
|
297
|
-
const request = new gateway.
|
|
297
|
+
const request = new gateway.DeviceEmptyRequest();
|
|
298
298
|
request.setInterfaceId(this.connection.interfaceId);
|
|
299
299
|
request.setDevice(this.deviceAddress);
|
|
300
300
|
await gateway.callAsync('binary/device/park', request);
|
|
@@ -303,7 +303,7 @@ class Device {
|
|
|
303
303
|
* Unparks axis. Axis will now be able to move.
|
|
304
304
|
*/
|
|
305
305
|
async unpark() {
|
|
306
|
-
const request = new gateway.
|
|
306
|
+
const request = new gateway.DeviceEmptyRequest();
|
|
307
307
|
request.setInterfaceId(this.connection.interfaceId);
|
|
308
308
|
request.setDevice(this.deviceAddress);
|
|
309
309
|
await gateway.callAsync('binary/device/unpark', request);
|
|
@@ -313,11 +313,11 @@ class Device {
|
|
|
313
313
|
* @return True if the axis is currently parked. False otherwise.
|
|
314
314
|
*/
|
|
315
315
|
async isParked() {
|
|
316
|
-
const request = new gateway.
|
|
316
|
+
const request = new gateway.DeviceEmptyRequest();
|
|
317
317
|
request.setInterfaceId(this.connection.interfaceId);
|
|
318
318
|
request.setDevice(this.deviceAddress);
|
|
319
|
-
const response = await gateway.callAsync('binary/device/is_parked', request, gateway.
|
|
320
|
-
return response.
|
|
319
|
+
const response = await gateway.callAsync('binary/device/is_parked', request, gateway.BoolResponse);
|
|
320
|
+
return response.getValue();
|
|
321
321
|
}
|
|
322
322
|
/**
|
|
323
323
|
* Returns current device position.
|
|
@@ -330,7 +330,7 @@ class Device {
|
|
|
330
330
|
request.setDevice(this.deviceAddress);
|
|
331
331
|
request.setSetting(binary_settings_1.BinarySettings.CURRENT_POSITION);
|
|
332
332
|
request.setUnit(unit);
|
|
333
|
-
const response = await gateway.callAsync('binary/device/get_setting', request, gateway.
|
|
333
|
+
const response = await gateway.callAsync('binary/device/get_setting', request, gateway.DoubleResponse);
|
|
334
334
|
return response.getValue();
|
|
335
335
|
}
|
|
336
336
|
/**
|
|
@@ -338,18 +338,18 @@ class Device {
|
|
|
338
338
|
* @return A string that represents the device.
|
|
339
339
|
*/
|
|
340
340
|
toString() {
|
|
341
|
-
const request = new gateway.
|
|
341
|
+
const request = new gateway.DeviceEmptyRequest();
|
|
342
342
|
request.setInterfaceId(this.connection.interfaceId);
|
|
343
343
|
request.setDevice(this.deviceAddress);
|
|
344
|
-
const response = gateway.callSync('binary/device/device_to_string', request, gateway.
|
|
345
|
-
return response.
|
|
344
|
+
const response = gateway.callSync('binary/device/device_to_string', request, gateway.StringResponse);
|
|
345
|
+
return response.getValue();
|
|
346
346
|
}
|
|
347
347
|
/**
|
|
348
348
|
* Returns identity.
|
|
349
349
|
* @return Device identity.
|
|
350
350
|
*/
|
|
351
351
|
_retrieveIdentity() {
|
|
352
|
-
const request = new gateway.
|
|
352
|
+
const request = new gateway.DeviceEmptyRequest();
|
|
353
353
|
request.setInterfaceId(this.connection.interfaceId);
|
|
354
354
|
request.setDevice(this.deviceAddress);
|
|
355
355
|
const response = gateway.callSync('binary/device/get_identity', request, gateway.BinaryDeviceGetIdentityResponse);
|
|
@@ -360,11 +360,11 @@ class Device {
|
|
|
360
360
|
* @return True if the device has already been identified. False otherwise.
|
|
361
361
|
*/
|
|
362
362
|
_retrieveIsIdentified() {
|
|
363
|
-
const request = new gateway.
|
|
363
|
+
const request = new gateway.DeviceEmptyRequest();
|
|
364
364
|
request.setInterfaceId(this.connection.interfaceId);
|
|
365
365
|
request.setDevice(this.deviceAddress);
|
|
366
|
-
const response = gateway.callSync('binary/device/get_is_identified', request, gateway.
|
|
367
|
-
return response.
|
|
366
|
+
const response = gateway.callSync('binary/device/get_is_identified', request, gateway.BoolResponse);
|
|
367
|
+
return response.getValue();
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
370
|
exports.Device = Device;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.js","sourceRoot":"","sources":["../../../src/binary/device.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAEtD,uDAAmD;AAEnD,uDAAmD;AACnD,uDAAmD;AACnD,oDAAsC;AAEtC,uCAAoC;AACpC,oCAAmF;AAInF;;GAEG;AACH,MAAa,MAAM;IAqGjB,YAAY,UAAsB,EAAE,aAAqB;QACvD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,SAAS,GAAG,IAAI,gCAAc,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;IACtC,CAAC;IAnGD;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAGD;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAGD;;;OAGG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,C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AAO,CAAC,QAAQ,CAC/B,iCAAiC,EACjC,OAAO,EACP,OAAO,CAAC,mCAAmC,CAAC,CAAC;QAC/C,OAAO,QAAQ,CAAC,eAAe,EAAE,CAAC;IACpC,CAAC;;AAldH,wBAmdC;AAldC;;GAEG;AACoB,+BAAwB,GAAW,EAAE,CAAC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { BinarySettings } from './binary_settings';\nimport { Connection } from './connection';\nimport { DeviceIdentity } from './device_identity';\nimport { DeviceSettings } from './device_settings';\nimport * as gateway from '../gateway';\nimport { CommandCode } from './command_code';\nimport { Message } from './message';\nimport { Angle, Length, Native, AngularVelocity, Velocity, Units } from '../units';\nimport { DeviceType } from './device_type';\nimport { FirmwareVersion } from '../firmware_version';\n\n/**\n * Represents a device using the binary protocol.\n */\nexport class Device {\n /**\n * Default timeout for move commands in seconds.\n */\n public static readonly DEFAULT_MOVEMENT_TIMEOUT: number = 60;\n\n /**\n * Connection of this device.\n */\n public get connection(): Connection {\n return this._connection;\n }\n private _connection: Connection;\n\n /**\n * Settings and properties of this axis.\n */\n public get settings(): DeviceSettings {\n return this._settings;\n }\n private _settings: DeviceSettings;\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 * 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 * Version of the firmware.\n */\n public get firmwareVersion(): FirmwareVersion {\n return this.identity.firmwareVersion;\n }\n\n /**\n * Indicates whether the device is a peripheral or part of an integrated device.\n */\n public get isPeripheral(): boolean {\n return this.identity.isPeripheral;\n }\n\n /**\n * Unique ID of the peripheral hardware.\n */\n public get peripheralId(): number {\n return this.identity.peripheralId;\n }\n\n /**\n * Name of the peripheral hardware.\n */\n public get peripheralName(): string {\n return this.identity.peripheralName;\n }\n\n /**\n * Determines the type of an device and units it accepts.\n */\n public get deviceType(): DeviceType {\n return this.identity.deviceType;\n }\n\n constructor(connection: Connection, deviceAddress: number) {\n this._connection = connection;\n this._settings = new DeviceSettings(this);\n this._deviceAddress = deviceAddress;\n }\n\n /**\n * Sends a generic Binary command to this device.\n * For more information please refer to the\n * [Binary Protocol Manual](https://www.zaber.com/protocol-manual?protocol=Binary#topic_quick_command_reference).\n * @param command Command to send.\n * @param data Optional data argument to the command. Defaults to zero.\n * @param timeout Number of seconds to wait for a response from the device. 0 or negative defaults to 0.5s.\n * @param checkErrors Controls whether to throw an exception when the device rejects the command.\n * @return A response to the command.\n */\n public async genericCommand(\n command: CommandCode,\n data: number = 0,\n timeout: number = 0.0,\n checkErrors: boolean = true\n ): Promise<Message> {\n const request = new gateway.GenericBinaryRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setCommand(command as any);\n request.setData(data);\n request.setTimeout(timeout);\n request.setCheckErrors(checkErrors);\n\n const response = await gateway.callAsync<gateway.BinaryMessage>(\n 'binary/interface/generic_command',\n request,\n gateway.BinaryMessage);\n return Message.fromProtobuf(response.toObject());\n }\n\n /**\n * Sends a generic Binary command to this device without expecting a response.\n * For more information please refer to the\n * [Binary Protocol Manual](https://www.zaber.com/protocol-manual?protocol=Binary#topic_quick_command_reference).\n * @param command Command to send.\n * @param data Optional data argument to the command. Defaults to zero.\n */\n public async genericCommandNoResponse(\n command: CommandCode,\n data: number = 0\n ): Promise<void> {\n const request = new gateway.GenericBinaryRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setCommand(command as any);\n request.setData(data);\n\n await gateway.callAsync('binary/interface/generic_command_no_response', request);\n }\n\n /**\n * Sends a generic Binary command to this device with unit conversions for both sent data and retrieved data.\n * @param command Command to send.\n * @param data Data argument to the command. Set to zero if command does not require argument.\n * @param fromUnit Unit to convert sent data from.\n * @param toUnit Unit to convert retrieved data to.\n * @param timeout Number of seconds to wait for a response from the device. 0 or negative defaults to 0.5s.\n * @return Data that has been converted to the provided unit.\n */\n public async genericCommandWithUnits(\n command: CommandCode,\n data: number,\n fromUnit: Units = Units.NATIVE,\n toUnit: Units = Units.NATIVE,\n timeout: number = 0.0\n ): Promise<number> {\n const request = new gateway.BinaryGenericWithUnitsRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setCommand(command as any);\n request.setData(data);\n request.setFromUnit(fromUnit);\n request.setToUnit(toUnit);\n request.setTimeout(timeout);\n\n const response = await gateway.callAsync<gateway.BinaryGenericWithUnitsResponse>(\n 'binary/device/generic_command_with_units',\n request,\n gateway.BinaryGenericWithUnitsResponse);\n return response.getData();\n }\n\n /**\n * Homes device. Device returns to its homing position.\n * @param unit Unit to convert returned position to.\n * @param timeout Number of seconds to wait for response from the device chain (defaults to 60s).\n * @return Current position that has been converted to the provided unit.\n */\n public async home(\n unit: Length | Angle | Native = Units.NATIVE,\n timeout: number = Device.DEFAULT_MOVEMENT_TIMEOUT\n ): Promise<number> {\n const request = new gateway.BinaryDeviceHomeRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setUnit(unit);\n request.setTimeout(timeout);\n\n const response = await gateway.callAsync<gateway.BinaryDeviceMovementResponse>(\n 'binary/device/home',\n request,\n gateway.BinaryDeviceMovementResponse);\n return response.getData();\n }\n\n /**\n * Stops ongoing device movement. Decelerates until zero speed.\n * @param unit Unit to convert returned position to.\n * @param timeout Number of seconds to wait for response from the device chain (defaults to 60s).\n * @return Current position that has been converted to the provided unit.\n */\n public async stop(\n unit: Length | Angle | Native = Units.NATIVE,\n timeout: number = Device.DEFAULT_MOVEMENT_TIMEOUT\n ): Promise<number> {\n const request = new gateway.BinaryDeviceStopRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setUnit(unit);\n request.setTimeout(timeout);\n\n const response = await gateway.callAsync<gateway.BinaryDeviceMovementResponse>(\n 'binary/device/stop',\n request,\n gateway.BinaryDeviceMovementResponse);\n return response.getData();\n }\n\n /**\n * Move device to absolute position.\n * @param position Absolute position.\n * @param unit Unit for the provided position as well as position returned by the device.\n * @param timeout Number of seconds to wait for response from the device chain (defaults to 60s).\n * @return Current position that has been converted to the provided unit.\n */\n public async moveAbsolute(\n position: number,\n unit: Length | Angle | Native = Units.NATIVE,\n timeout: number = Device.DEFAULT_MOVEMENT_TIMEOUT\n ): Promise<number> {\n const request = new gateway.BinaryDeviceMoveRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setType(gateway.BinaryDeviceMoveRequest.MoveType.ABS);\n request.setArg(position);\n request.setUnit(unit);\n request.setTimeout(timeout);\n\n const response = await gateway.callAsync<gateway.BinaryDeviceMovementResponse>(\n 'binary/device/move',\n request,\n gateway.BinaryDeviceMovementResponse);\n return response.getData();\n }\n\n /**\n * Move device to position relative to current position.\n * @param position Relative position.\n * @param unit Unit for the provided position as well as position returned by the device.\n * @param timeout Number of seconds to wait for response from the device chain (defaults to 60s).\n * @return Current position that has been converted to the provided unit.\n */\n public async moveRelative(\n position: number,\n unit: Length | Angle | Native = Units.NATIVE,\n timeout: number = Device.DEFAULT_MOVEMENT_TIMEOUT\n ): Promise<number> {\n const request = new gateway.BinaryDeviceMoveRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setType(gateway.BinaryDeviceMoveRequest.MoveType.REL);\n request.setArg(position);\n request.setUnit(unit);\n request.setTimeout(timeout);\n\n const response = await gateway.callAsync<gateway.BinaryDeviceMovementResponse>(\n 'binary/device/move',\n request,\n gateway.BinaryDeviceMovementResponse);\n return response.getData();\n }\n\n /**\n * Begins to move device at specified speed.\n * @param velocity Movement velocity.\n * @param unit Unit to convert returned velocity to.\n * @return Device velocity that has been converted to the provided unit.\n */\n public async moveVelocity(\n velocity: number,\n unit: Velocity | AngularVelocity | Native = Units.NATIVE\n ): Promise<number> {\n const request = new gateway.BinaryDeviceMoveRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setType(gateway.BinaryDeviceMoveRequest.MoveType.VEL);\n request.setArg(velocity);\n request.setUnit(unit);\n\n const response = await gateway.callAsync<gateway.BinaryDeviceMovementResponse>(\n 'binary/device/move',\n request,\n gateway.BinaryDeviceMovementResponse);\n return response.getData();\n }\n\n /**\n * Waits until device stops moving.\n */\n public async waitUntilIdle(): Promise<void> {\n const request = new gateway.BinaryDeviceWaitUntilIdleRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n await gateway.callAsync('binary/device/wait_until_idle', request);\n }\n\n /**\n * Check whether the device is moving.\n * @return True if the device is currently executing a motion command.\n */\n public async isBusy(): Promise<boolean> {\n const request = new gateway.BinaryDeviceIsBusyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = await gateway.callAsync<gateway.BinaryDeviceIsBusyResponse>(\n 'binary/device/is_busy',\n request,\n gateway.BinaryDeviceIsBusyResponse);\n return response.getIsBusy();\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.BinaryDeviceIdentifyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = await gateway.callAsync<gateway.BinaryDeviceIdentity>(\n 'binary/device/identify',\n request,\n gateway.BinaryDeviceIdentity);\n return DeviceIdentity.fromProtobuf(response.toObject());\n }\n\n /**\n * Parks the axis.\n * Motor drivers remain enabled and hold current continues to be applied until the device is powered off.\n * It can later be unparked and moved without first having to home it.\n */\n public async park(): Promise<void> {\n const request = new gateway.BinaryDeviceParkRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n await gateway.callAsync('binary/device/park', request);\n }\n\n /**\n * Unparks axis. Axis will now be able to move.\n */\n public async unpark(): Promise<void> {\n const request = new gateway.BinaryDeviceParkRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n await gateway.callAsync('binary/device/unpark', request);\n }\n\n /**\n * Returns bool indicating whether the axis is parked or not.\n * @return True if the axis is currently parked. False otherwise.\n */\n public async isParked(): Promise<boolean> {\n const request = new gateway.BinaryDeviceParkRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = await gateway.callAsync<gateway.BinaryDeviceParkResponse>(\n 'binary/device/is_parked',\n request,\n gateway.BinaryDeviceParkResponse);\n return response.getIsParked();\n }\n\n /**\n * Returns current device position.\n * @param unit Units of position.\n * @return Axis position.\n */\n public async getPosition(\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<number> {\n const request = new gateway.BinaryDeviceGetSettingRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setSetting(BinarySettings.CURRENT_POSITION);\n request.setUnit(unit);\n\n const response = await gateway.callAsync<gateway.BinaryDeviceGetSettingResponse>(\n 'binary/device/get_setting',\n request,\n gateway.BinaryDeviceGetSettingResponse);\n return response.getValue();\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 'binary/device/device_to_string',\n request,\n gateway.ToStringResponse);\n return response.getToStr();\n }\n\n /**\n * Returns identity.\n * @return Device identity.\n */\n private _retrieveIdentity(): DeviceIdentity {\n const request = new gateway.BinaryDeviceGetIdentityRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = gateway.callSync<gateway.BinaryDeviceGetIdentityResponse>(\n 'binary/device/get_identity',\n request,\n gateway.BinaryDeviceGetIdentityResponse);\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.BinaryDeviceGetIsIdentifiedRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = gateway.callSync<gateway.BinaryDeviceGetIsIdentifiedResponse>(\n 'binary/device/get_is_identified',\n request,\n gateway.BinaryDeviceGetIsIdentifiedResponse);\n return response.getIsIdentified();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"device.js","sourceRoot":"","sources":["../../../src/binary/device.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAEtD,uDAAmD;AAEnD,uDAAmD;AACnD,uDAAmD;AACnD,oDAAsC;AAEtC,uCAAoC;AACpC,oCAAmF;AAInF;;GAEG;AACH,MAAa,MAAM;IAqGjB,YAAY,UAAsB,EAAE,aAAqB;QACvD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,SAAS,GAAG,IAAI,gCAAc,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;IACtC,CAAC;IAnGD;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAGD;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAGD;;;OAGG;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AAC,CAAC;QAEtC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,iCAAiC,EACjC,OAAO,EACP,OAAO,CAAC,YAAY,CAAC,CAAC;QACxB,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;;AAldH,wBAmdC;AAldC;;GAEG;AACoB,+BAAwB,GAAW,EAAE,CAAC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { BinarySettings } from './binary_settings';\nimport { Connection } from './connection';\nimport { DeviceIdentity } from './device_identity';\nimport { DeviceSettings } from './device_settings';\nimport * as gateway from '../gateway';\nimport { CommandCode } from './command_code';\nimport { Message } from './message';\nimport { Angle, Length, Native, AngularVelocity, Velocity, Units } from '../units';\nimport { DeviceType } from './device_type';\nimport { FirmwareVersion } from '../firmware_version';\n\n/**\n * Represents a device using the binary protocol.\n */\nexport class Device {\n /**\n * Default timeout for move commands in seconds.\n */\n public static readonly DEFAULT_MOVEMENT_TIMEOUT: number = 60;\n\n /**\n * Connection of this device.\n */\n public get connection(): Connection {\n return this._connection;\n }\n private _connection: Connection;\n\n /**\n * Settings and properties of this axis.\n */\n public get settings(): DeviceSettings {\n return this._settings;\n }\n private _settings: DeviceSettings;\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 * 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 * Version of the firmware.\n */\n public get firmwareVersion(): FirmwareVersion {\n return this.identity.firmwareVersion;\n }\n\n /**\n * Indicates whether the device is a peripheral or part of an integrated device.\n */\n public get isPeripheral(): boolean {\n return this.identity.isPeripheral;\n }\n\n /**\n * Unique ID of the peripheral hardware.\n */\n public get peripheralId(): number {\n return this.identity.peripheralId;\n }\n\n /**\n * Name of the peripheral hardware.\n */\n public get peripheralName(): string {\n return this.identity.peripheralName;\n }\n\n /**\n * Determines the type of an device and units it accepts.\n */\n public get deviceType(): DeviceType {\n return this.identity.deviceType;\n }\n\n constructor(connection: Connection, deviceAddress: number) {\n this._connection = connection;\n this._settings = new DeviceSettings(this);\n this._deviceAddress = deviceAddress;\n }\n\n /**\n * Sends a generic Binary command to this device.\n * For more information please refer to the\n * [Binary Protocol Manual](https://www.zaber.com/protocol-manual?protocol=Binary#topic_quick_command_reference).\n * @param command Command to send.\n * @param data Optional data argument to the command. Defaults to zero.\n * @param timeout Number of seconds to wait for a response from the device. 0 or negative defaults to 0.5s.\n * @param checkErrors Controls whether to throw an exception when the device rejects the command.\n * @return A response to the command.\n */\n public async genericCommand(\n command: CommandCode,\n data: number = 0,\n timeout: number = 0.0,\n checkErrors: boolean = true\n ): Promise<Message> {\n const request = new gateway.GenericBinaryRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setCommand(command as any);\n request.setData(data);\n request.setTimeout(timeout);\n request.setCheckErrors(checkErrors);\n\n const response = await gateway.callAsync<gateway.BinaryMessage>(\n 'binary/interface/generic_command',\n request,\n gateway.BinaryMessage);\n return Message.fromProtobuf(response.toObject());\n }\n\n /**\n * Sends a generic Binary command to this device without expecting a response.\n * For more information please refer to the\n * [Binary Protocol Manual](https://www.zaber.com/protocol-manual?protocol=Binary#topic_quick_command_reference).\n * @param command Command to send.\n * @param data Optional data argument to the command. Defaults to zero.\n */\n public async genericCommandNoResponse(\n command: CommandCode,\n data: number = 0\n ): Promise<void> {\n const request = new gateway.GenericBinaryRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setCommand(command as any);\n request.setData(data);\n\n await gateway.callAsync('binary/interface/generic_command_no_response', request);\n }\n\n /**\n * Sends a generic Binary command to this device with unit conversions for both sent data and retrieved data.\n * @param command Command to send.\n * @param data Data argument to the command. Set to zero if command does not require argument.\n * @param fromUnit Unit to convert sent data from.\n * @param toUnit Unit to convert retrieved data to.\n * @param timeout Number of seconds to wait for a response from the device. 0 or negative defaults to 0.5s.\n * @return Data that has been converted to the provided unit.\n */\n public async genericCommandWithUnits(\n command: CommandCode,\n data: number,\n fromUnit: Units = Units.NATIVE,\n toUnit: Units = Units.NATIVE,\n timeout: number = 0.0\n ): Promise<number> {\n const request = new gateway.BinaryGenericWithUnitsRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setCommand(command as any);\n request.setData(data);\n request.setFromUnit(fromUnit);\n request.setToUnit(toUnit);\n request.setTimeout(timeout);\n\n const response = await gateway.callAsync<gateway.DoubleResponse>(\n 'binary/device/generic_command_with_units',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Homes device. Device returns to its homing position.\n * @param unit Unit to convert returned position to.\n * @param timeout Number of seconds to wait for response from the device chain (defaults to 60s).\n * @return Current position that has been converted to the provided unit.\n */\n public async home(\n unit: Length | Angle | Native = Units.NATIVE,\n timeout: number = Device.DEFAULT_MOVEMENT_TIMEOUT\n ): Promise<number> {\n const request = new gateway.BinaryDeviceHomeRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setUnit(unit);\n request.setTimeout(timeout);\n\n const response = await gateway.callAsync<gateway.DoubleResponse>(\n 'binary/device/home',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Stops ongoing device movement. Decelerates until zero speed.\n * @param unit Unit to convert returned position to.\n * @param timeout Number of seconds to wait for response from the device chain (defaults to 60s).\n * @return Current position that has been converted to the provided unit.\n */\n public async stop(\n unit: Length | Angle | Native = Units.NATIVE,\n timeout: number = Device.DEFAULT_MOVEMENT_TIMEOUT\n ): Promise<number> {\n const request = new gateway.BinaryDeviceStopRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setUnit(unit);\n request.setTimeout(timeout);\n\n const response = await gateway.callAsync<gateway.DoubleResponse>(\n 'binary/device/stop',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Move device to absolute position.\n * @param position Absolute position.\n * @param unit Unit for the provided position as well as position returned by the device.\n * @param timeout Number of seconds to wait for response from the device chain (defaults to 60s).\n * @return Current position that has been converted to the provided unit.\n */\n public async moveAbsolute(\n position: number,\n unit: Length | Angle | Native = Units.NATIVE,\n timeout: number = Device.DEFAULT_MOVEMENT_TIMEOUT\n ): Promise<number> {\n const request = new gateway.BinaryDeviceMoveRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setType(gateway.BinaryDeviceMoveRequest.MoveType.ABS);\n request.setArg(position);\n request.setUnit(unit);\n request.setTimeout(timeout);\n\n const response = await gateway.callAsync<gateway.DoubleResponse>(\n 'binary/device/move',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Move device to position relative to current position.\n * @param position Relative position.\n * @param unit Unit for the provided position as well as position returned by the device.\n * @param timeout Number of seconds to wait for response from the device chain (defaults to 60s).\n * @return Current position that has been converted to the provided unit.\n */\n public async moveRelative(\n position: number,\n unit: Length | Angle | Native = Units.NATIVE,\n timeout: number = Device.DEFAULT_MOVEMENT_TIMEOUT\n ): Promise<number> {\n const request = new gateway.BinaryDeviceMoveRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setType(gateway.BinaryDeviceMoveRequest.MoveType.REL);\n request.setArg(position);\n request.setUnit(unit);\n request.setTimeout(timeout);\n\n const response = await gateway.callAsync<gateway.DoubleResponse>(\n 'binary/device/move',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Begins to move device at specified speed.\n * @param velocity Movement velocity.\n * @param unit Unit to convert returned velocity to.\n * @return Device velocity that has been converted to the provided unit.\n */\n public async moveVelocity(\n velocity: number,\n unit: Velocity | AngularVelocity | Native = Units.NATIVE\n ): Promise<number> {\n const request = new gateway.BinaryDeviceMoveRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setType(gateway.BinaryDeviceMoveRequest.MoveType.VEL);\n request.setArg(velocity);\n request.setUnit(unit);\n\n const response = await gateway.callAsync<gateway.DoubleResponse>(\n 'binary/device/move',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Waits until device stops moving.\n */\n public async waitUntilIdle(): Promise<void> {\n const request = new gateway.DeviceEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n await gateway.callAsync('binary/device/wait_until_idle', request);\n }\n\n /**\n * Check whether the device is moving.\n * @return True if the device is currently executing a motion command.\n */\n public async isBusy(): Promise<boolean> {\n const request = new gateway.DeviceEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = await gateway.callAsync<gateway.BoolResponse>(\n 'binary/device/is_busy',\n request,\n gateway.BoolResponse);\n return response.getValue();\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.DeviceEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = await gateway.callAsync<gateway.BinaryDeviceIdentity>(\n 'binary/device/identify',\n request,\n gateway.BinaryDeviceIdentity);\n return DeviceIdentity.fromProtobuf(response.toObject());\n }\n\n /**\n * Parks the axis.\n * Motor drivers remain enabled and hold current continues to be applied until the device is powered off.\n * It can later be unparked and moved without first having to home it.\n */\n public async park(): Promise<void> {\n const request = new gateway.DeviceEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n await gateway.callAsync('binary/device/park', request);\n }\n\n /**\n * Unparks axis. Axis will now be able to move.\n */\n public async unpark(): Promise<void> {\n const request = new gateway.DeviceEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n await gateway.callAsync('binary/device/unpark', request);\n }\n\n /**\n * Returns bool indicating whether the axis is parked or not.\n * @return True if the axis is currently parked. False otherwise.\n */\n public async isParked(): Promise<boolean> {\n const request = new gateway.DeviceEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = await gateway.callAsync<gateway.BoolResponse>(\n 'binary/device/is_parked',\n request,\n gateway.BoolResponse);\n return response.getValue();\n }\n\n /**\n * Returns current device position.\n * @param unit Units of position.\n * @return Axis position.\n */\n public async getPosition(\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<number> {\n const request = new gateway.BinaryDeviceGetSettingRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setSetting(BinarySettings.CURRENT_POSITION);\n request.setUnit(unit);\n\n const response = await gateway.callAsync<gateway.DoubleResponse>(\n 'binary/device/get_setting',\n request,\n gateway.DoubleResponse);\n return response.getValue();\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.DeviceEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'binary/device/device_to_string',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n\n /**\n * Returns identity.\n * @return Device identity.\n */\n private _retrieveIdentity(): DeviceIdentity {\n const request = new gateway.DeviceEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = gateway.callSync<gateway.BinaryDeviceGetIdentityResponse>(\n 'binary/device/get_identity',\n request,\n gateway.BinaryDeviceGetIdentityResponse);\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.DeviceEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = gateway.callSync<gateway.BoolResponse>(\n 'binary/device/get_is_identified',\n request,\n gateway.BoolResponse);\n return response.getValue();\n }\n}\n"]}
|
|
@@ -43,7 +43,7 @@ class DeviceSettings {
|
|
|
43
43
|
request.setDevice(this._device.deviceAddress);
|
|
44
44
|
request.setSetting(setting);
|
|
45
45
|
request.setUnit(unit);
|
|
46
|
-
const response = await gateway.callAsync('binary/device/get_setting', request, gateway.
|
|
46
|
+
const response = await gateway.callAsync('binary/device/get_setting', request, gateway.DoubleResponse);
|
|
47
47
|
return response.getValue();
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device_settings.js","sourceRoot":"","sources":["../../../src/binary/device_settings.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAItD,oCAAiC;AACjC,oDAAsC;AAEtC;;GAEG;AACH,MAAa,cAAc;IAGzB,YAAY,MAAc;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,GAAG,CACd,OAAuB,EACvB,OAAc,aAAK,CAAC,MAAM;QAE1B,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,6BAA6B,EAAE,CAAC;QAC5D,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC5D,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,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O,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC5D,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QAC9C,OAAO,CAAC,UAAU,CAAC,OAAc,CAAC,CAAC;QACnC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACxB,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAEtB,MAAM,OAAO,CAAC,SAAS,CAAC,2BAA2B,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;CACF;AAlDD,wCAkDC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Device } from './device';\nimport { BinarySettings } from './binary_settings';\nimport { Units } from '../units';\nimport * as gateway from '../gateway';\n\n/**\n * Class providing access to various device settings and properties.\n */\nexport class DeviceSettings {\n private _device: Device;\n\n constructor(device: Device) {\n this._device = device;\n }\n\n /**\n * Returns any device setting or property.\n * @param setting Setting to get.\n * @param unit Units of setting.\n * @return Setting value.\n */\n public async get(\n setting: BinarySettings,\n unit: Units = Units.NATIVE\n ): Promise<number> {\n const request = new gateway.BinaryDeviceGetSettingRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setSetting(setting as any);\n request.setUnit(unit);\n\n const response = await gateway.callAsync<gateway.DoubleResponse>(\n 'binary/device/get_setting',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Sets any device setting.\n * @param setting Setting to set.\n * @param value Value of the setting.\n * @param unit Units of setting.\n */\n public async set(\n setting: BinarySettings,\n value: number,\n unit: Units = Units.NATIVE\n ): Promise<void> {\n const request = new gateway.BinaryDeviceSetSettingRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setSetting(setting as any);\n request.setValue(value);\n request.setUnit(unit);\n\n await gateway.callAsync('binary/device/set_setting', request);\n }\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { MotionLibException } from './motion_lib_exception';
|
|
3
|
+
import { CommandTooLongExceptionData } from './command_too_long_exception_data';
|
|
4
|
+
/**
|
|
5
|
+
* Thrown when a command is too long to be written by the ASCII protocol, even when continued across multiple lines.
|
|
6
|
+
*/
|
|
7
|
+
export declare class CommandTooLongException extends MotionLibException {
|
|
8
|
+
/**
|
|
9
|
+
* Additional data for CommandTooLongException
|
|
10
|
+
*/
|
|
11
|
+
get details(): CommandTooLongExceptionData;
|
|
12
|
+
private _details;
|
|
13
|
+
constructor(message: string, customData: Buffer | CommandTooLongExceptionData);
|
|
14
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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.CommandTooLongException = void 0;
|
|
6
|
+
const motion_lib_exception_1 = require("./motion_lib_exception");
|
|
7
|
+
const main_pb_1 = require("../protobufs/main_pb");
|
|
8
|
+
const command_too_long_exception_data_1 = require("./command_too_long_exception_data");
|
|
9
|
+
/**
|
|
10
|
+
* Thrown when a command is too long to be written by the ASCII protocol, even when continued across multiple lines.
|
|
11
|
+
*/
|
|
12
|
+
class CommandTooLongException extends motion_lib_exception_1.MotionLibException {
|
|
13
|
+
constructor(message, customData) {
|
|
14
|
+
super(message);
|
|
15
|
+
Object.setPrototypeOf(this, CommandTooLongException.prototype);
|
|
16
|
+
if (Buffer.isBuffer(customData)) {
|
|
17
|
+
const protobufObj = main_pb_1.CommandTooLongExceptionData.deserializeBinary(customData);
|
|
18
|
+
this._details = command_too_long_exception_data_1.CommandTooLongExceptionData.fromProtobuf(protobufObj.toObject());
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
this._details = customData;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Additional data for CommandTooLongException
|
|
26
|
+
*/
|
|
27
|
+
get details() {
|
|
28
|
+
return this._details;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.CommandTooLongException = CommandTooLongException;
|
|
32
|
+
//# sourceMappingURL=command_too_long_exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command_too_long_exception.js","sourceRoot":"","sources":["../../../src/exceptions/command_too_long_exception.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;AAEtD,iEAA4D;AAC5D,kDAAyF;AACzF,uFAAgF;AAEhF;;GAEG;AACH,MAAa,uBAAwB,SAAQ,yCAAkB;IAS7D,YACE,OAAe,EACf,UAAgD;QAEhD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAC;QAE/D,IAAI,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;YAC/B,MAAM,WAAW,GAAG,qCAAkB,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;YACrE,IAAI,CAAC,QAAQ,GAAG,6DAA2B,CAAC,YAAY,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;SAClF;aAAM;YACL,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC;SAC5B;IACH,CAAC;IArBD;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CAiBF;AAvBD,0DAuBC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { MotionLibException } from './motion_lib_exception';\nimport { CommandTooLongExceptionData as CustomDataProtobuf } from '../protobufs/main_pb';\nimport { CommandTooLongExceptionData } from './command_too_long_exception_data';\n\n/**\n * Thrown when a command is too long to be written by the ASCII protocol, even when continued across multiple lines.\n */\nexport class CommandTooLongException extends MotionLibException {\n /**\n * Additional data for CommandTooLongException\n */\n public get details(): CommandTooLongExceptionData {\n return this._details;\n }\n private _details: CommandTooLongExceptionData;\n\n constructor(\n message: string,\n customData: Buffer | CommandTooLongExceptionData\n ) {\n super(message);\n Object.setPrototypeOf(this, CommandTooLongException.prototype);\n\n if (Buffer.isBuffer(customData)) {\n const protobufObj = CustomDataProtobuf.deserializeBinary(customData);\n this._details = CommandTooLongExceptionData.fromProtobuf(protobufObj.toObject());\n } else {\n this._details = customData;\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Information describing why the command could not fit.
|
|
3
|
+
*/
|
|
4
|
+
export interface CommandTooLongExceptionData {
|
|
5
|
+
/**
|
|
6
|
+
* The part of the command that could be successfully fit in the space provided by the protocol.
|
|
7
|
+
*/
|
|
8
|
+
fit: string;
|
|
9
|
+
/**
|
|
10
|
+
* The part of the command that could not fit within the space provided.
|
|
11
|
+
*/
|
|
12
|
+
remainder: string;
|
|
13
|
+
/**
|
|
14
|
+
* The length of the ascii string that can be written to a single line.
|
|
15
|
+
*/
|
|
16
|
+
packetSize: number;
|
|
17
|
+
/**
|
|
18
|
+
* The number of lines a command can be split over using continuations.
|
|
19
|
+
*/
|
|
20
|
+
packetsMax: number;
|
|
21
|
+
}
|
|
22
|
+
export declare namespace CommandTooLongExceptionData {
|
|
23
|
+
const __type = "CommandTooLongExceptionData";
|
|
24
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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.CommandTooLongExceptionData = void 0;
|
|
6
|
+
var CommandTooLongExceptionData;
|
|
7
|
+
(function (CommandTooLongExceptionData) {
|
|
8
|
+
CommandTooLongExceptionData.__type = 'CommandTooLongExceptionData';
|
|
9
|
+
/** @internal */
|
|
10
|
+
function fromProtobuf(pbData) {
|
|
11
|
+
return {
|
|
12
|
+
fit: pbData.fit,
|
|
13
|
+
remainder: pbData.remainder,
|
|
14
|
+
packetSize: pbData.packetSize,
|
|
15
|
+
packetsMax: pbData.packetsMax,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
CommandTooLongExceptionData.fromProtobuf = fromProtobuf;
|
|
19
|
+
})(CommandTooLongExceptionData = exports.CommandTooLongExceptionData || (exports.CommandTooLongExceptionData = {}));
|
|
20
|
+
//# sourceMappingURL=command_too_long_exception_data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command_too_long_exception_data.js","sourceRoot":"","sources":["../../../src/exceptions/command_too_long_exception_data.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;AA8BtD,IAAiB,2BAA2B,CAY3C;AAZD,WAAiB,2BAA2B;IAC7B,kCAAM,GAAG,6BAA6B,CAAC;IAEpD,gBAAgB;IAChB,SAAgB,YAAY,CAAC,MAAoD;QAC/E,OAAO;YACL,GAAG,EAAE,MAAM,CAAC,GAAG;YACf,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC;IACJ,CAAC;IAPe,wCAAY,eAO3B,CAAA;AACH,CAAC,EAZgB,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAY3C","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\n\n/**\n * Information describing why the command could not fit.\n */\nexport interface CommandTooLongExceptionData {\n /**\n * The part of the command that could be successfully fit in the space provided by the protocol.\n */\n fit: string;\n\n /**\n * The part of the command that could not fit within the space provided.\n */\n remainder: string;\n\n /**\n * The length of the ascii string that can be written to a single line.\n */\n packetSize: number;\n\n /**\n * The number of lines a command can be split over using continuations.\n */\n packetsMax: number;\n\n}\n\nexport namespace CommandTooLongExceptionData {\n export const __type = 'CommandTooLongExceptionData';\n\n /** @internal */\n export function fromProtobuf(pbData: gateway.CommandTooLongExceptionData.AsObject): CommandTooLongExceptionData {\n return {\n fit: pbData.fit,\n remainder: pbData.remainder,\n packetSize: pbData.packetSize,\n packetsMax: pbData.packetsMax,\n };\n }\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { BinaryCommandFailedException } from './binary_command_failed_exception';
|
|
2
2
|
export { CommandFailedException } from './command_failed_exception';
|
|
3
3
|
export { CommandPreemptedException } from './command_preempted_exception';
|
|
4
|
+
export { CommandTooLongException } from './command_too_long_exception';
|
|
4
5
|
export { ConnectionClosedException } from './connection_closed_exception';
|
|
5
6
|
export { ConnectionFailedException } from './connection_failed_exception';
|
|
6
7
|
export { ConversionFailedException } from './conversion_failed_exception';
|
|
@@ -25,6 +26,7 @@ export { LockstepNotEnabledException } from './lockstep_not_enabled_exception';
|
|
|
25
26
|
export { MovementFailedException } from './movement_failed_exception';
|
|
26
27
|
export { MovementInterruptedException } from './movement_interrupted_exception';
|
|
27
28
|
export { NoDeviceFoundException } from './no_device_found_exception';
|
|
29
|
+
export { NoValueForKeyException } from './no_value_for_key_exception';
|
|
28
30
|
export { NotSupportedException } from './not_supported_exception';
|
|
29
31
|
export { OsFailedException } from './os_failed_exception';
|
|
30
32
|
export { OutOfRequestIdsException } from './out_of_request_ids_exception';
|
|
@@ -43,6 +45,7 @@ export { UnknownRequestException } from './unknown_request_exception';
|
|
|
43
45
|
export { MotionLibException } from './motion_lib_exception';
|
|
44
46
|
export { BinaryCommandFailedExceptionData } from './binary_command_failed_exception_data';
|
|
45
47
|
export { CommandFailedExceptionData } from './command_failed_exception_data';
|
|
48
|
+
export { CommandTooLongExceptionData } from './command_too_long_exception_data';
|
|
46
49
|
export { DeviceAddressConflictExceptionData } from './device_address_conflict_exception_data';
|
|
47
50
|
export { GCodeExecutionExceptionData } from './g_code_execution_exception_data';
|
|
48
51
|
export { GCodeSyntaxExceptionData } from './g_code_syntax_exception_data';
|
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //
|
|
3
3
|
// ============= DO NOT EDIT DIRECTLY ============= //
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.
|
|
6
|
-
exports.StreamMovementInterruptedExceptionData = exports.StreamMovementFailedExceptionData = exports.StreamExecutionExceptionData = exports.SetPeripheralStateExceptionData = exports.SetDeviceStateExceptionData = exports.MovementInterruptedExceptionData = exports.MovementFailedExceptionData = void 0;
|
|
5
|
+
exports.GCodeExecutionExceptionData = exports.DeviceAddressConflictExceptionData = exports.CommandTooLongExceptionData = exports.CommandFailedExceptionData = exports.BinaryCommandFailedExceptionData = exports.MotionLibException = exports.UnknownRequestException = exports.TransportAlreadyUsedException = exports.StreamSetupFailedException = exports.StreamMovementInterruptedException = exports.StreamMovementFailedException = exports.StreamModeException = exports.StreamExecutionException = exports.SettingNotFoundException = exports.SetPeripheralStateFailedException = exports.SetDeviceStateFailedException = exports.SerialPortBusyException = exports.RequestTimeoutException = exports.OutOfRequestIdsException = exports.OsFailedException = exports.NotSupportedException = exports.NoValueForKeyException = exports.NoDeviceFoundException = exports.MovementInterruptedException = exports.MovementFailedException = exports.LockstepNotEnabledException = exports.LockstepEnabledException = exports.IoFailedException = exports.IoChannelOutOfRangeException = exports.InvalidResponseException = exports.InvalidParkStateException = exports.InvalidPacketException = exports.InvalidOperationException = exports.InvalidDataException = exports.InvalidArgumentException = exports.InternalErrorException = exports.GCodeSyntaxException = exports.GCodeExecutionException = exports.DeviceNotIdentifiedException = exports.DeviceFailedException = exports.DeviceDbFailedException = exports.DeviceBusyException = exports.DeviceAddressConflictException = exports.ConversionFailedException = exports.ConnectionFailedException = exports.ConnectionClosedException = exports.CommandTooLongException = exports.CommandPreemptedException = exports.CommandFailedException = exports.BinaryCommandFailedException = void 0;
|
|
6
|
+
exports.StreamMovementInterruptedExceptionData = exports.StreamMovementFailedExceptionData = exports.StreamExecutionExceptionData = exports.SetPeripheralStateExceptionData = exports.SetDeviceStateExceptionData = exports.MovementInterruptedExceptionData = exports.MovementFailedExceptionData = exports.InvalidResponseExceptionData = exports.InvalidPacketExceptionData = exports.GCodeSyntaxExceptionData = void 0;
|
|
7
7
|
var binary_command_failed_exception_1 = require("./binary_command_failed_exception");
|
|
8
8
|
Object.defineProperty(exports, "BinaryCommandFailedException", { enumerable: true, get: function () { return binary_command_failed_exception_1.BinaryCommandFailedException; } });
|
|
9
9
|
var command_failed_exception_1 = require("./command_failed_exception");
|
|
10
10
|
Object.defineProperty(exports, "CommandFailedException", { enumerable: true, get: function () { return command_failed_exception_1.CommandFailedException; } });
|
|
11
11
|
var command_preempted_exception_1 = require("./command_preempted_exception");
|
|
12
12
|
Object.defineProperty(exports, "CommandPreemptedException", { enumerable: true, get: function () { return command_preempted_exception_1.CommandPreemptedException; } });
|
|
13
|
+
var command_too_long_exception_1 = require("./command_too_long_exception");
|
|
14
|
+
Object.defineProperty(exports, "CommandTooLongException", { enumerable: true, get: function () { return command_too_long_exception_1.CommandTooLongException; } });
|
|
13
15
|
var connection_closed_exception_1 = require("./connection_closed_exception");
|
|
14
16
|
Object.defineProperty(exports, "ConnectionClosedException", { enumerable: true, get: function () { return connection_closed_exception_1.ConnectionClosedException; } });
|
|
15
17
|
var connection_failed_exception_1 = require("./connection_failed_exception");
|
|
@@ -58,6 +60,8 @@ var movement_interrupted_exception_1 = require("./movement_interrupted_exception
|
|
|
58
60
|
Object.defineProperty(exports, "MovementInterruptedException", { enumerable: true, get: function () { return movement_interrupted_exception_1.MovementInterruptedException; } });
|
|
59
61
|
var no_device_found_exception_1 = require("./no_device_found_exception");
|
|
60
62
|
Object.defineProperty(exports, "NoDeviceFoundException", { enumerable: true, get: function () { return no_device_found_exception_1.NoDeviceFoundException; } });
|
|
63
|
+
var no_value_for_key_exception_1 = require("./no_value_for_key_exception");
|
|
64
|
+
Object.defineProperty(exports, "NoValueForKeyException", { enumerable: true, get: function () { return no_value_for_key_exception_1.NoValueForKeyException; } });
|
|
61
65
|
var not_supported_exception_1 = require("./not_supported_exception");
|
|
62
66
|
Object.defineProperty(exports, "NotSupportedException", { enumerable: true, get: function () { return not_supported_exception_1.NotSupportedException; } });
|
|
63
67
|
var os_failed_exception_1 = require("./os_failed_exception");
|
|
@@ -94,6 +98,8 @@ var binary_command_failed_exception_data_1 = require("./binary_command_failed_ex
|
|
|
94
98
|
Object.defineProperty(exports, "BinaryCommandFailedExceptionData", { enumerable: true, get: function () { return binary_command_failed_exception_data_1.BinaryCommandFailedExceptionData; } });
|
|
95
99
|
var command_failed_exception_data_1 = require("./command_failed_exception_data");
|
|
96
100
|
Object.defineProperty(exports, "CommandFailedExceptionData", { enumerable: true, get: function () { return command_failed_exception_data_1.CommandFailedExceptionData; } });
|
|
101
|
+
var command_too_long_exception_data_1 = require("./command_too_long_exception_data");
|
|
102
|
+
Object.defineProperty(exports, "CommandTooLongExceptionData", { enumerable: true, get: function () { return command_too_long_exception_data_1.CommandTooLongExceptionData; } });
|
|
97
103
|
var device_address_conflict_exception_data_1 = require("./device_address_conflict_exception_data");
|
|
98
104
|
Object.defineProperty(exports, "DeviceAddressConflictExceptionData", { enumerable: true, get: function () { return device_address_conflict_exception_data_1.DeviceAddressConflictExceptionData; } });
|
|
99
105
|
var g_code_execution_exception_data_1 = require("./g_code_execution_exception_data");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/exceptions/index.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;AAEtD,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AACrC,uEAA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MPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nexport { BinaryCommandFailedException } from './binary_command_failed_exception';\nexport { CommandFailedException } from './command_failed_exception';\nexport { CommandPreemptedException } from './command_preempted_exception';\nexport { ConnectionClosedException } from './connection_closed_exception';\nexport { ConnectionFailedException } from './connection_failed_exception';\nexport { ConversionFailedException } from './conversion_failed_exception';\nexport { DeviceAddressConflictException } from './device_address_conflict_exception';\nexport { DeviceBusyException } from './device_busy_exception';\nexport { DeviceDbFailedException } from './device_db_failed_exception';\nexport { DeviceFailedException } from './device_failed_exception';\nexport { DeviceNotIdentifiedException } from './device_not_identified_exception';\nexport { GCodeExecutionException } from './g_code_execution_exception';\nexport { GCodeSyntaxException } from './g_code_syntax_exception';\nexport { InternalErrorException } from './internal_error_exception';\nexport { InvalidArgumentException } from './invalid_argument_exception';\nexport { InvalidDataException } from './invalid_data_exception';\nexport { InvalidOperationException } from './invalid_operation_exception';\nexport { InvalidPacketException } from './invalid_packet_exception';\nexport { InvalidParkStateException } from './invalid_park_state_exception';\nexport { InvalidResponseException } from './invalid_response_exception';\nexport { IoChannelOutOfRangeException } from './io_channel_out_of_range_exception';\nexport { IoFailedException } from './io_failed_exception';\nexport { LockstepEnabledException } from './lockstep_enabled_exception';\nexport { LockstepNotEnabledException } from './lockstep_not_enabled_exception';\nexport { MovementFailedException } from './movement_failed_exception';\nexport { MovementInterruptedException } from './movement_interrupted_exception';\nexport { NoDeviceFoundException } from './no_device_found_exception';\nexport { NotSupportedException } from './not_supported_exception';\nexport { OsFailedException } from './os_failed_exception';\nexport { OutOfRequestIdsException } from './out_of_request_ids_exception';\nexport { RequestTimeoutException } from './request_timeout_exception';\nexport { SerialPortBusyException } from './serial_port_busy_exception';\nexport { SetDeviceStateFailedException } from './set_device_state_failed_exception';\nexport { SetPeripheralStateFailedException } from './set_peripheral_state_failed_exception';\nexport { SettingNotFoundException } from './setting_not_found_exception';\nexport { StreamExecutionException } from './stream_execution_exception';\nexport { StreamModeException } from './stream_mode_exception';\nexport { StreamMovementFailedException } from './stream_movement_failed_exception';\nexport { StreamMovementInterruptedException } from './stream_movement_interrupted_exception';\nexport { StreamSetupFailedException } from './stream_setup_failed_exception';\nexport { TransportAlreadyUsedException } from './transport_already_used_exception';\nexport { UnknownRequestException } from './unknown_request_exception';\nexport { MotionLibException } from './motion_lib_exception';\n\nexport { BinaryCommandFailedExceptionData } from './binary_command_failed_exception_data';\nexport { CommandFailedExceptionData } from './command_failed_exception_data';\nexport { DeviceAddressConflictExceptionData } from './device_address_conflict_exception_data';\nexport { GCodeExecutionExceptionData } from './g_code_execution_exception_data';\nexport { GCodeSyntaxExceptionData } from './g_code_syntax_exception_data';\nexport { InvalidPacketExceptionData } from './invalid_packet_exception_data';\nexport { InvalidResponseExceptionData } from './invalid_response_exception_data';\nexport { MovementFailedExceptionData } from './movement_failed_exception_data';\nexport { MovementInterruptedExceptionData } from './movement_interrupted_exception_data';\nexport { SetDeviceStateExceptionData } from './set_device_state_exception_data';\nexport { SetPeripheralStateExceptionData } from './set_peripheral_state_exception_data';\nexport { StreamExecutionExceptionData } from './stream_execution_exception_data';\nexport { StreamMovementFailedExceptionData } from './stream_movement_failed_exception_data';\nexport { StreamMovementInterruptedExceptionData } from './stream_movement_interrupted_exception_data';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/exceptions/index.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;AAEtD,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AACrC,uEAAoE;AAA3D,kIAAA,sBAAsB,OAAA;AAC/B,6EAA0E;AAAjE,wIAAA,yBAAyB,OAAA;AAClC,2EAAuE;AAA9D,qIAAA,uBAAuB,OAAA;AAChC,6EAA0E;AAAjE,wIAAA,yBAAyB,OAAA;AAClC,6EAA0E;AAAjE,wIAAA,yBAAyB,OAAA;AAClC,6EAA0E;AAAjE,wIAAA,yBAAyB,OAAA;AAClC,yFAAqF;AAA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AA,iCAAiC,OAAA;AAC1C,6EAAyE;AAAhE,uIAAA,wBAAwB,OAAA;AACjC,2EAAwE;AAA/D,sIAAA,wBAAwB,OAAA;AACjC,iEAA8D;AAArD,4HAAA,mBAAmB,OAAA;AAC5B,uFAAmF;AAA1E,iJAAA,6BAA6B,OAAA;AACtC,iGAA6F;AAApF,2JAAA,kCAAkC,OAAA;AAC3C,iFAA6E;AAApE,2IAAA,0BAA0B,OAAA;AACnC,uFAAmF;AAA1E,iJAAA,6BAA6B,OAAA;AACtC,yEAAsE;AAA7D,oIAAA,uBAAuB,OAAA;AAChC,+DAA4D;AAAnD,0HAAA,kBAAkB,OAAA;AAE3B,+FAA0F;AAAjF,wJAAA,gCAAgC,OAAA;AACzC,iFAA6E;AAApE,2IAAA,0BAA0B,OAAA;AACnC,qFAAgF;AAAvE,8IAAA,2BAA2B,OAAA;AACpC,mGAA8F;AAArF,4JAAA,kCAAkC,OAAA;AAC3C,qFAAgF;AAAvE,8IAAA,2BAA2B,OAAA;AACpC,+EAA0E;AAAjE,wIAAA,wBAAwB,OAAA;AACjC,iFAA6E;AAApE,2IAAA,0BAA0B,OAAA;AACnC,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AACrC,mFAA+E;AAAtE,6IAAA,2BAA2B,OAAA;AACpC,6FAAyF;AAAhF,uJAAA,gCAAgC,OAAA;AACzC,qFAAgF;AAAvE,8IAAA,2BAA2B,OAAA;AACpC,6FAAwF;AAA/E,sJAAA,+BAA+B,OAAA;AACxC,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AACrC,iGAA4F;AAAnF,0JAAA,iCAAiC,OAAA;AAC1C,2GAAsG;AAA7F,oKAAA,sCAAsC,OAAA","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nexport { BinaryCommandFailedException } from './binary_command_failed_exception';\nexport { CommandFailedException } from './command_failed_exception';\nexport { CommandPreemptedException } from './command_preempted_exception';\nexport { CommandTooLongException } from './command_too_long_exception';\nexport { ConnectionClosedException } from './connection_closed_exception';\nexport { ConnectionFailedException } from './connection_failed_exception';\nexport { ConversionFailedException } from './conversion_failed_exception';\nexport { DeviceAddressConflictException } from './device_address_conflict_exception';\nexport { DeviceBusyException } from './device_busy_exception';\nexport { DeviceDbFailedException } from './device_db_failed_exception';\nexport { DeviceFailedException } from './device_failed_exception';\nexport { DeviceNotIdentifiedException } from './device_not_identified_exception';\nexport { GCodeExecutionException } from './g_code_execution_exception';\nexport { GCodeSyntaxException } from './g_code_syntax_exception';\nexport { InternalErrorException } from './internal_error_exception';\nexport { InvalidArgumentException } from './invalid_argument_exception';\nexport { InvalidDataException } from './invalid_data_exception';\nexport { InvalidOperationException } from './invalid_operation_exception';\nexport { InvalidPacketException } from './invalid_packet_exception';\nexport { InvalidParkStateException } from './invalid_park_state_exception';\nexport { InvalidResponseException } from './invalid_response_exception';\nexport { IoChannelOutOfRangeException } from './io_channel_out_of_range_exception';\nexport { IoFailedException } from './io_failed_exception';\nexport { LockstepEnabledException } from './lockstep_enabled_exception';\nexport { LockstepNotEnabledException } from './lockstep_not_enabled_exception';\nexport { MovementFailedException } from './movement_failed_exception';\nexport { MovementInterruptedException } from './movement_interrupted_exception';\nexport { NoDeviceFoundException } from './no_device_found_exception';\nexport { NoValueForKeyException } from './no_value_for_key_exception';\nexport { NotSupportedException } from './not_supported_exception';\nexport { OsFailedException } from './os_failed_exception';\nexport { OutOfRequestIdsException } from './out_of_request_ids_exception';\nexport { RequestTimeoutException } from './request_timeout_exception';\nexport { SerialPortBusyException } from './serial_port_busy_exception';\nexport { SetDeviceStateFailedException } from './set_device_state_failed_exception';\nexport { SetPeripheralStateFailedException } from './set_peripheral_state_failed_exception';\nexport { SettingNotFoundException } from './setting_not_found_exception';\nexport { StreamExecutionException } from './stream_execution_exception';\nexport { StreamModeException } from './stream_mode_exception';\nexport { StreamMovementFailedException } from './stream_movement_failed_exception';\nexport { StreamMovementInterruptedException } from './stream_movement_interrupted_exception';\nexport { StreamSetupFailedException } from './stream_setup_failed_exception';\nexport { TransportAlreadyUsedException } from './transport_already_used_exception';\nexport { UnknownRequestException } from './unknown_request_exception';\nexport { MotionLibException } from './motion_lib_exception';\n\nexport { BinaryCommandFailedExceptionData } from './binary_command_failed_exception_data';\nexport { CommandFailedExceptionData } from './command_failed_exception_data';\nexport { CommandTooLongExceptionData } from './command_too_long_exception_data';\nexport { DeviceAddressConflictExceptionData } from './device_address_conflict_exception_data';\nexport { GCodeExecutionExceptionData } from './g_code_execution_exception_data';\nexport { GCodeSyntaxExceptionData } from './g_code_syntax_exception_data';\nexport { InvalidPacketExceptionData } from './invalid_packet_exception_data';\nexport { InvalidResponseExceptionData } from './invalid_response_exception_data';\nexport { MovementFailedExceptionData } from './movement_failed_exception_data';\nexport { MovementInterruptedExceptionData } from './movement_interrupted_exception_data';\nexport { SetDeviceStateExceptionData } from './set_device_state_exception_data';\nexport { SetPeripheralStateExceptionData } from './set_peripheral_state_exception_data';\nexport { StreamExecutionExceptionData } from './stream_execution_exception_data';\nexport { StreamMovementFailedExceptionData } from './stream_movement_failed_exception_data';\nexport { StreamMovementInterruptedExceptionData } from './stream_movement_interrupted_exception_data';\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
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.NoValueForKeyException = void 0;
|
|
6
|
+
const motion_lib_exception_1 = require("./motion_lib_exception");
|
|
7
|
+
/**
|
|
8
|
+
* Thrown when trying to access a key that has not been set.
|
|
9
|
+
*/
|
|
10
|
+
class NoValueForKeyException extends motion_lib_exception_1.MotionLibException {
|
|
11
|
+
constructor(message) {
|
|
12
|
+
super(message);
|
|
13
|
+
Object.setPrototypeOf(this, NoValueForKeyException.prototype);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.NoValueForKeyException = NoValueForKeyException;
|
|
17
|
+
//# sourceMappingURL=no_value_for_key_exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no_value_for_key_exception.js","sourceRoot":"","sources":["../../../src/exceptions/no_value_for_key_exception.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;AAEtD,iEAA4D;AAE5D;;GAEG;AACH,MAAa,sBAAuB,SAAQ,yCAAkB;IAE5D,YACE,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAChE,CAAC;CACF;AARD,wDAQC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { MotionLibException } from './motion_lib_exception';\n\n/**\n * Thrown when trying to access a key that has not been set.\n */\nexport class NoValueForKeyException extends MotionLibException {\n\n constructor(\n message: string\n ) {\n super(message);\n Object.setPrototypeOf(this, NoValueForKeyException.prototype);\n }\n}\n"]}
|
|
@@ -28,6 +28,7 @@ const errorMapping = new Map();
|
|
|
28
28
|
errorMapping.set(main_pb_1.Errors.BINARY_COMMAND_FAILED, exceptions.BinaryCommandFailedException);
|
|
29
29
|
errorMapping.set(main_pb_1.Errors.COMMAND_FAILED, exceptions.CommandFailedException);
|
|
30
30
|
errorMapping.set(main_pb_1.Errors.COMMAND_PREEMPTED, exceptions.CommandPreemptedException);
|
|
31
|
+
errorMapping.set(main_pb_1.Errors.COMMAND_TOO_LONG, exceptions.CommandTooLongException);
|
|
31
32
|
errorMapping.set(main_pb_1.Errors.CONNECTION_CLOSED, exceptions.ConnectionClosedException);
|
|
32
33
|
errorMapping.set(main_pb_1.Errors.CONNECTION_FAILED, exceptions.ConnectionFailedException);
|
|
33
34
|
errorMapping.set(main_pb_1.Errors.CONVERSION_FAILED, exceptions.ConversionFailedException);
|
|
@@ -52,6 +53,7 @@ errorMapping.set(main_pb_1.Errors.LOCKSTEP_NOT_ENABLED, exceptions.LockstepNotEn
|
|
|
52
53
|
errorMapping.set(main_pb_1.Errors.MOVEMENT_FAILED, exceptions.MovementFailedException);
|
|
53
54
|
errorMapping.set(main_pb_1.Errors.MOVEMENT_INTERRUPTED, exceptions.MovementInterruptedException);
|
|
54
55
|
errorMapping.set(main_pb_1.Errors.NO_DEVICE_FOUND, exceptions.NoDeviceFoundException);
|
|
56
|
+
errorMapping.set(main_pb_1.Errors.NO_VALUE_FOR_KEY, exceptions.NoValueForKeyException);
|
|
55
57
|
errorMapping.set(main_pb_1.Errors.NOT_SUPPORTED, exceptions.NotSupportedException);
|
|
56
58
|
errorMapping.set(main_pb_1.Errors.OS_FAILED, exceptions.OsFailedException);
|
|
57
59
|
errorMapping.set(main_pb_1.Errors.OUT_OF_REQUEST_IDS, exceptions.OutOfRequestIdsException);
|