@zaber/motion 2.13.1 → 2.13.2

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 (75) hide show
  1. package/dist/lib/ascii/all_axes.js +5 -1
  2. package/dist/lib/ascii/all_axes.js.map +1 -1
  3. package/dist/lib/ascii/axis.js +5 -1
  4. package/dist/lib/ascii/axis.js.map +1 -1
  5. package/dist/lib/ascii/axis_settings.js +5 -1
  6. package/dist/lib/ascii/axis_settings.js.map +1 -1
  7. package/dist/lib/ascii/connection.js +5 -1
  8. package/dist/lib/ascii/connection.js.map +1 -1
  9. package/dist/lib/ascii/device.js +5 -1
  10. package/dist/lib/ascii/device.js.map +1 -1
  11. package/dist/lib/ascii/device_io.js +5 -1
  12. package/dist/lib/ascii/device_io.js.map +1 -1
  13. package/dist/lib/ascii/device_settings.js +5 -1
  14. package/dist/lib/ascii/device_settings.js.map +1 -1
  15. package/dist/lib/ascii/lockstep.js +5 -1
  16. package/dist/lib/ascii/lockstep.js.map +1 -1
  17. package/dist/lib/ascii/oscilloscope.js +5 -1
  18. package/dist/lib/ascii/oscilloscope.js.map +1 -1
  19. package/dist/lib/ascii/oscilloscope_data.js +5 -1
  20. package/dist/lib/ascii/oscilloscope_data.js.map +1 -1
  21. package/dist/lib/ascii/servo_tuner.js +5 -1
  22. package/dist/lib/ascii/servo_tuner.js.map +1 -1
  23. package/dist/lib/ascii/servo_tuning_param.js +5 -1
  24. package/dist/lib/ascii/servo_tuning_param.js.map +1 -1
  25. package/dist/lib/ascii/storage.js +5 -1
  26. package/dist/lib/ascii/storage.js.map +1 -1
  27. package/dist/lib/ascii/stream.js +5 -1
  28. package/dist/lib/ascii/stream.js.map +1 -1
  29. package/dist/lib/ascii/stream_axis_definition.js +5 -1
  30. package/dist/lib/ascii/stream_axis_definition.js.map +1 -1
  31. package/dist/lib/ascii/stream_buffer.js +5 -1
  32. package/dist/lib/ascii/stream_buffer.js.map +1 -1
  33. package/dist/lib/ascii/transport.js +5 -1
  34. package/dist/lib/ascii/transport.js.map +1 -1
  35. package/dist/lib/ascii/warnings.js +5 -1
  36. package/dist/lib/ascii/warnings.js.map +1 -1
  37. package/dist/lib/ascii_ns.js +5 -1
  38. package/dist/lib/ascii_ns.js.map +1 -1
  39. package/dist/lib/binary/connection.js +5 -1
  40. package/dist/lib/binary/connection.js.map +1 -1
  41. package/dist/lib/binary/device.js +5 -1
  42. package/dist/lib/binary/device.js.map +1 -1
  43. package/dist/lib/binary/device_settings.js +5 -1
  44. package/dist/lib/binary/device_settings.js.map +1 -1
  45. package/dist/lib/binary_ns.js +5 -1
  46. package/dist/lib/binary_ns.js.map +1 -1
  47. package/dist/lib/gateway/convert_exceptions.js +5 -1
  48. package/dist/lib/gateway/convert_exceptions.js.map +1 -1
  49. package/dist/lib/gateway/index.js +5 -1
  50. package/dist/lib/gateway/index.js.map +1 -1
  51. package/dist/lib/gcode/axis_definition.js +5 -1
  52. package/dist/lib/gcode/axis_definition.js.map +1 -1
  53. package/dist/lib/gcode/axis_mapping.js +5 -1
  54. package/dist/lib/gcode/axis_mapping.js.map +1 -1
  55. package/dist/lib/gcode/axis_transformation.js +5 -1
  56. package/dist/lib/gcode/axis_transformation.js.map +1 -1
  57. package/dist/lib/gcode/device_definition.js +5 -1
  58. package/dist/lib/gcode/device_definition.js.map +1 -1
  59. package/dist/lib/gcode/offline_translator.js +5 -1
  60. package/dist/lib/gcode/offline_translator.js.map +1 -1
  61. package/dist/lib/gcode/translator.js +5 -1
  62. package/dist/lib/gcode/translator.js.map +1 -1
  63. package/dist/lib/gcode/translator_config.js +5 -1
  64. package/dist/lib/gcode/translator_config.js.map +1 -1
  65. package/dist/lib/gcode_ns.js +5 -1
  66. package/dist/lib/gcode_ns.js.map +1 -1
  67. package/dist/lib/index.js +5 -1
  68. package/dist/lib/index.js.map +1 -1
  69. package/dist/lib/library.js +5 -1
  70. package/dist/lib/library.js.map +1 -1
  71. package/dist/lib/measurement.js +5 -1
  72. package/dist/lib/measurement.js.map +1 -1
  73. package/dist/lib/tools.js +5 -1
  74. package/dist/lib/tools.js.map +1 -1
  75. package/package.json +2 -2
@@ -3,7 +3,11 @@
3
3
  // ============= DO NOT EDIT DIRECTLY ============= //
4
4
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
5
  if (k2 === undefined) k2 = k;
6
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
7
11
  }) : (function(o, m, k, k2) {
8
12
  if (k2 === undefined) k2 = k;
9
13
  o[k2] = m[k];
@@ -1 +1 @@
1
- {"version":3,"file":"warnings.js","sourceRoot":"","sources":["../../../src/ascii/warnings.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAGtD,oDAAsC;AAEtC;;GAEG;AACH,MAAa,QAAQ;IAKnB,YAAY,MAAc,EAAE,UAAkB;QAC5C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,QAAQ;QACnB,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,wBAAwB,EAAE,CAAC;QACvD,OAAO,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,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAExB,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,qBAAqB,EACrB,OAAO,EACP,OAAO,CAAC,yBAAyB,CAAC,CAAC;QACrC,OAAO,IAAI,GAAG,CAAS,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;IAClD,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,UAAU;QACrB,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,wBAAwB,EAAE,CAAC;QACvD,OAAO,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,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAClC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEvB,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,qBAAqB,EACrB,OAAO,EACP,OAAO,CAAC,yBAAyB,CAAC,CAAC;QACrC,OAAO,IAAI,GAAG,CAAS,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;IAClD,CAAC;CACF;AA7CD,4BA6CC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Device } from './device';\nimport * as gateway from '../gateway';\n\n/**\n * Class used to check and reset warnings and faults on device or axis.\n */\nexport class Warnings {\n private _device: Device;\n\n private _axisNumber: number;\n\n constructor(device: Device, axisNumber: number) {\n this._device = device;\n this._axisNumber = axisNumber;\n }\n\n /**\n * Returns current warnings and faults on axis or device.\n * @return Retrieved warnings and faults. Refer to WarningFlags to check a particular flag.\n */\n public async getFlags(): Promise<Set<string>> {\n const request = new gateway.DeviceGetWarningsRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setAxis(this._axisNumber);\n request.setClear(false);\n\n const response = await gateway.callAsync<gateway.DeviceGetWarningsResponse>(\n 'device/get_warnings',\n request,\n gateway.DeviceGetWarningsResponse);\n return new Set<string>(response.getFlagsList());\n }\n\n /**\n * Clears (acknowledges) current warnings and faults on axis or device and returns them.\n * @return Warnings and faults before clearing. Refer to WarningFlags to check a particular flag.\n */\n public async clearFlags(): Promise<Set<string>> {\n const request = new gateway.DeviceGetWarningsRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setAxis(this._axisNumber);\n request.setClear(true);\n\n const response = await gateway.callAsync<gateway.DeviceGetWarningsResponse>(\n 'device/get_warnings',\n request,\n gateway.DeviceGetWarningsResponse);\n return new Set<string>(response.getFlagsList());\n }\n}\n"]}
1
+ {"version":3,"file":"warnings.js","sourceRoot":"","sources":["../../../src/ascii/warnings.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtD,oDAAsC;AAEtC;;GAEG;AACH,MAAa,QAAQ;IAKnB,YAAY,MAAc,EAAE,UAAkB;QAC5C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,QAAQ;QACnB,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,wBAAwB,EAAE,CAAC;QACvD,OAAO,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,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAExB,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,qBAAqB,EACrB,OAAO,EACP,OAAO,CAAC,yBAAyB,CAAC,CAAC;QACrC,OAAO,IAAI,GAAG,CAAS,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;IAClD,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,UAAU;QACrB,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,wBAAwB,EAAE,CAAC;QACvD,OAAO,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,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAClC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEvB,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,qBAAqB,EACrB,OAAO,EACP,OAAO,CAAC,yBAAyB,CAAC,CAAC;QACrC,OAAO,IAAI,GAAG,CAAS,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;IAClD,CAAC;CACF;AA7CD,4BA6CC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Device } from './device';\nimport * as gateway from '../gateway';\n\n/**\n * Class used to check and reset warnings and faults on device or axis.\n */\nexport class Warnings {\n private _device: Device;\n\n private _axisNumber: number;\n\n constructor(device: Device, axisNumber: number) {\n this._device = device;\n this._axisNumber = axisNumber;\n }\n\n /**\n * Returns current warnings and faults on axis or device.\n * @return Retrieved warnings and faults. Refer to WarningFlags to check a particular flag.\n */\n public async getFlags(): Promise<Set<string>> {\n const request = new gateway.DeviceGetWarningsRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setAxis(this._axisNumber);\n request.setClear(false);\n\n const response = await gateway.callAsync<gateway.DeviceGetWarningsResponse>(\n 'device/get_warnings',\n request,\n gateway.DeviceGetWarningsResponse);\n return new Set<string>(response.getFlagsList());\n }\n\n /**\n * Clears (acknowledges) current warnings and faults on axis or device and returns them.\n * @return Warnings and faults before clearing. Refer to WarningFlags to check a particular flag.\n */\n public async clearFlags(): Promise<Set<string>> {\n const request = new gateway.DeviceGetWarningsRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setAxis(this._axisNumber);\n request.setClear(true);\n\n const response = await gateway.callAsync<gateway.DeviceGetWarningsResponse>(\n 'device/get_warnings',\n request,\n gateway.DeviceGetWarningsResponse);\n return new Set<string>(response.getFlagsList());\n }\n}\n"]}
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1 +1 @@
1
- {"version":3,"file":"ascii_ns.js","sourceRoot":"","sources":["../../src/ascii_ns.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuC;AAEvC,IAAiB,KAAK,CA2ErB;AA3ED,WAAiB,KAAK;IACP,gBAAU,GAAG,WAAW,CAAC,UAAU,CAAC;IAEpC,aAAO,GAAG,WAAW,CAAC,OAAO,CAAC;IAE9B,UAAI,GAAG,WAAW,CAAC,IAAI,CAAC;IAExB,kBAAY,GAAG,WAAW,CAAC,YAAY,CAAC;IAExC,kBAAY,GAAG,WAAW,CAAC,YAAY,CAAC;IAExC,cAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC;IAEhC,gBAAU,GAAG,WAAW,CAAC,UAAU,CAAC;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AAG,WAAW,CAAC,iBAAiB,CAAC;IAElD,iBAAW,GAAG,WAAW,CAAC,WAAW,CAAC;IAEtC,mBAAa,GAAG,WAAW,CAAC,aAAa,CAAC;AAEzD,CAAC,EA3EgB,KAAK,GAAL,aAAK,KAAL,aAAK,QA2ErB","sourcesContent":["import * as asciiImport from './ascii';\n\nexport namespace ascii {\n export const AlertEvent = asciiImport.AlertEvent;\n export type AlertEvent = asciiImport.AlertEvent;\n export const AllAxes = asciiImport.AllAxes;\n export type AllAxes = asciiImport.AllAxes;\n export const Axis = asciiImport.Axis;\n export type Axis = asciiImport.Axis;\n export const AxisIdentity = asciiImport.AxisIdentity;\n export type AxisIdentity = asciiImport.AxisIdentity;\n export const AxisSettings = asciiImport.AxisSettings;\n export type AxisSettings = asciiImport.AxisSettings;\n export const AxisType = asciiImport.AxisType;\n export type AxisType = asciiImport.AxisType;\n export const Connection = asciiImport.Connection;\n export type Connection = asciiImport.Connection;\n export const Device = asciiImport.Device;\n export type Device = asciiImport.Device;\n export const DeviceIO = asciiImport.DeviceIO;\n export type DeviceIO = asciiImport.DeviceIO;\n export const DeviceIOInfo = asciiImport.DeviceIOInfo;\n export type DeviceIOInfo = asciiImport.DeviceIOInfo;\n export const DeviceIdentity = asciiImport.DeviceIdentity;\n export type DeviceIdentity = asciiImport.DeviceIdentity;\n export const DeviceSettings = asciiImport.DeviceSettings;\n export type DeviceSettings = asciiImport.DeviceSettings;\n export const Lockstep = asciiImport.Lockstep;\n export type Lockstep = asciiImport.Lockstep;\n export const LockstepAxes = asciiImport.LockstepAxes;\n export type LockstepAxes = asciiImport.LockstepAxes;\n export const Oscilloscope = asciiImport.Oscilloscope;\n export type Oscilloscope = asciiImport.Oscilloscope;\n export const OscilloscopeData = asciiImport.OscilloscopeData;\n export type OscilloscopeData = asciiImport.OscilloscopeData;\n export const OscilloscopeCaptureProperties = asciiImport.OscilloscopeCaptureProperties;\n export type OscilloscopeCaptureProperties = asciiImport.OscilloscopeCaptureProperties;\n export const MessageType = asciiImport.MessageType;\n export type MessageType = asciiImport.MessageType;\n export const Response = asciiImport.Response;\n export type Response = asciiImport.Response;\n export const SettingConstants = asciiImport.SettingConstants;\n export type SettingConstants = asciiImport.SettingConstants;\n export const UnknownResponseEvent = asciiImport.UnknownResponseEvent;\n export type UnknownResponseEvent = asciiImport.UnknownResponseEvent;\n export const Warnings = asciiImport.Warnings;\n export type Warnings = asciiImport.Warnings;\n export const WarningFlags = asciiImport.WarningFlags;\n export type WarningFlags = asciiImport.WarningFlags;\n export const Stream = asciiImport.Stream;\n export type Stream = asciiImport.Stream;\n export const StreamBuffer = asciiImport.StreamBuffer;\n export type StreamBuffer = asciiImport.StreamBuffer;\n export const StreamMode = asciiImport.StreamMode;\n export type StreamMode = asciiImport.StreamMode;\n export const StreamAxisType = asciiImport.StreamAxisType;\n export type StreamAxisType = asciiImport.StreamAxisType;\n export const StreamAxisDefinition = asciiImport.StreamAxisDefinition;\n export type StreamAxisDefinition = asciiImport.StreamAxisDefinition;\n export const Transport = asciiImport.Transport;\n export type Transport = asciiImport.Transport;\n export const ServoTuner = asciiImport.ServoTuner;\n export type ServoTuner = asciiImport.ServoTuner;\n export const ServoTuningParamset = asciiImport.ServoTuningParamset;\n export type ServoTuningParamset = asciiImport.ServoTuningParamset;\n export const ParamsetInfo = asciiImport.ParamsetInfo;\n export type ParamsetInfo = asciiImport.ParamsetInfo;\n export const PidTuning = asciiImport.PidTuning;\n export type PidTuning = asciiImport.PidTuning;\n export const ServoTuningParam = asciiImport.ServoTuningParam;\n export type ServoTuningParam = asciiImport.ServoTuningParam;\n export const SimpleTuningParam = asciiImport.SimpleTuningParam;\n export type SimpleTuningParam = asciiImport.SimpleTuningParam;\n export const AxisStorage = asciiImport.AxisStorage;\n export type AxisStorage = asciiImport.AxisStorage;\n export const DeviceStorage = asciiImport.DeviceStorage;\n export type DeviceStorage = asciiImport.DeviceStorage;\n}\n"]}
1
+ {"version":3,"file":"ascii_ns.js","sourceRoot":"","sources":["../../src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CAAC;IAExC,gBAAU,GAAG,WAAW,CAAC,UAAU,CAAC;IAEpC,oBAAc,GAAG,WAAW,CAAC,cAAc,CAAC;IAE5C,0BAAoB,GAAG,WAAW,CAAC,oBAAoB,CAAC;IAExD,eAAS,GAAG,WAAW,CAAC,SAAS,CAAC;IAElC,gBAAU,GAAG,WAAW,CAAC,UAAU,CAAC;IAEpC,yBAAmB,GAAG,WAAW,CAAC,mBAAmB,CAAC;IAEtD,kBAAY,GAAG,WAAW,CAAC,YAAY,CAAC;IAExC,eAAS,GAAG,WAAW,CAAC,SAAS,CAAC;IAElC,sBAAgB,GAAG,WAAW,CAAC,gBAAgB,CAAC;IAEhD,uBAAiB,GAAG,WAAW,CAAC,iBAAiB,CAAC;IAElD,iBAAW,GAAG,WAAW,CAAC,WAAW,CAAC;IAEtC,mBAAa,GAAG,WAAW,CAAC,aAAa,CAAC;AAEzD,CAAC,EA3EgB,KAAK,GAAL,aAAK,KAAL,aAAK,QA2ErB","sourcesContent":["import * as asciiImport from './ascii';\n\nexport namespace ascii {\n export const AlertEvent = asciiImport.AlertEvent;\n export type AlertEvent = asciiImport.AlertEvent;\n export const AllAxes = asciiImport.AllAxes;\n export type AllAxes = asciiImport.AllAxes;\n export const Axis = asciiImport.Axis;\n export type Axis = asciiImport.Axis;\n export const AxisIdentity = asciiImport.AxisIdentity;\n export type AxisIdentity = asciiImport.AxisIdentity;\n export const AxisSettings = asciiImport.AxisSettings;\n export type AxisSettings = asciiImport.AxisSettings;\n export const AxisType = asciiImport.AxisType;\n export type AxisType = asciiImport.AxisType;\n export const Connection = asciiImport.Connection;\n export type Connection = asciiImport.Connection;\n export const Device = asciiImport.Device;\n export type Device = asciiImport.Device;\n export const DeviceIO = asciiImport.DeviceIO;\n export type DeviceIO = asciiImport.DeviceIO;\n export const DeviceIOInfo = asciiImport.DeviceIOInfo;\n export type DeviceIOInfo = asciiImport.DeviceIOInfo;\n export const DeviceIdentity = asciiImport.DeviceIdentity;\n export type DeviceIdentity = asciiImport.DeviceIdentity;\n export const DeviceSettings = asciiImport.DeviceSettings;\n export type DeviceSettings = asciiImport.DeviceSettings;\n export const Lockstep = asciiImport.Lockstep;\n export type Lockstep = asciiImport.Lockstep;\n export const LockstepAxes = asciiImport.LockstepAxes;\n export type LockstepAxes = asciiImport.LockstepAxes;\n export const Oscilloscope = asciiImport.Oscilloscope;\n export type Oscilloscope = asciiImport.Oscilloscope;\n export const OscilloscopeData = asciiImport.OscilloscopeData;\n export type OscilloscopeData = asciiImport.OscilloscopeData;\n export const OscilloscopeCaptureProperties = asciiImport.OscilloscopeCaptureProperties;\n export type OscilloscopeCaptureProperties = asciiImport.OscilloscopeCaptureProperties;\n export const MessageType = asciiImport.MessageType;\n export type MessageType = asciiImport.MessageType;\n export const Response = asciiImport.Response;\n export type Response = asciiImport.Response;\n export const SettingConstants = asciiImport.SettingConstants;\n export type SettingConstants = asciiImport.SettingConstants;\n export const UnknownResponseEvent = asciiImport.UnknownResponseEvent;\n export type UnknownResponseEvent = asciiImport.UnknownResponseEvent;\n export const Warnings = asciiImport.Warnings;\n export type Warnings = asciiImport.Warnings;\n export const WarningFlags = asciiImport.WarningFlags;\n export type WarningFlags = asciiImport.WarningFlags;\n export const Stream = asciiImport.Stream;\n export type Stream = asciiImport.Stream;\n export const StreamBuffer = asciiImport.StreamBuffer;\n export type StreamBuffer = asciiImport.StreamBuffer;\n export const StreamMode = asciiImport.StreamMode;\n export type StreamMode = asciiImport.StreamMode;\n export const StreamAxisType = asciiImport.StreamAxisType;\n export type StreamAxisType = asciiImport.StreamAxisType;\n export const StreamAxisDefinition = asciiImport.StreamAxisDefinition;\n export type StreamAxisDefinition = asciiImport.StreamAxisDefinition;\n export const Transport = asciiImport.Transport;\n export type Transport = asciiImport.Transport;\n export const ServoTuner = asciiImport.ServoTuner;\n export type ServoTuner = asciiImport.ServoTuner;\n export const ServoTuningParamset = asciiImport.ServoTuningParamset;\n export type ServoTuningParamset = asciiImport.ServoTuningParamset;\n export const ParamsetInfo = asciiImport.ParamsetInfo;\n export type ParamsetInfo = asciiImport.ParamsetInfo;\n export const PidTuning = asciiImport.PidTuning;\n export type PidTuning = asciiImport.PidTuning;\n export const ServoTuningParam = asciiImport.ServoTuningParam;\n export type ServoTuningParam = asciiImport.ServoTuningParam;\n export const SimpleTuningParam = asciiImport.SimpleTuningParam;\n export type SimpleTuningParam = asciiImport.SimpleTuningParam;\n export const AxisStorage = asciiImport.AxisStorage;\n export type AxisStorage = asciiImport.AxisStorage;\n export const DeviceStorage = asciiImport.DeviceStorage;\n export type DeviceStorage = asciiImport.DeviceStorage;\n}\n"]}
@@ -3,7 +3,11 @@
3
3
  // ============= DO NOT EDIT DIRECTLY ============= //
4
4
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
5
  if (k2 === undefined) k2 = k;
6
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
7
11
  }) : (function(o, m, k, k2) {
8
12
  if (k2 === undefined) k2 = k;
9
13
  o[k2] = m[k];
@@ -1 +1 @@
1
- {"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/binary/connection.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAEtD,+BAAiD;AACjD,8CAA8D;AAC9D,oDAAsC;AACtC,wCAAiD;AACjD,qCAAkC;AAClC,qEAAgE;AAChE,yDAAoD;AAEpD,uCAAoC;AAGpC;;GAEG;AACH,MAAa,UAAU;IAyBrB,YAAY,WAAmB;QAyNvB,kBAAa,GAAG,IAAI,oBAAa,EAAsB,CAAC;QAxN9D,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,UAAU,EAAE,CAAC;IACp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BAAM,EAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,KAAK,IAAI,CAAC,WAAW,CAAC,EACvD,IAAA,eAAG,EAAC,KAAK,CAAC,EAAE,CAAC,6CAAoB,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CACvD,CAAC;QAEF,IAAI,CAAC,SAAS,GAAG,gBAAM,CAAC,IAAI,CAC1B,IAAA,qBAAS,EAAC,IAAI,CAAC,aAAa,CAAC,EAC7B,IAAA,qBAAW,EAAwC,6BAA6B,CAAC,EACjF,IAAA,kBAAM,EAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,KAAK,IAAI,CAAC,WAAW,CAAC,EACvD,IAAA,eAAG,EAAC,KAAK,CAAC,EAAE,CAAC,iCAAc,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CACjD,CAAC;QAEF,gBAAM,CAAC,IAAI,CACT,IAAA,qBAAW,EAAqC,wBAAwB,CAAC,EACzE,IAAA,kBAAM,EAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,KAAK,IAAI,CAAC,WAAW,CAAC,EACvD,IAAA,gBAAI,EAAC,CAAC,CAAC,EACP,IAAA,eAAG,EAAC,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,kBAAkB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAC1F,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAClC,CAAC;;AAhRH,gCAiRC;AArQC;;GAEG;AACoB,4BAAiB,GAAW,IAAI,CAAC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Observable, ReplaySubject } from 'rxjs';\nimport { map, filter, takeUntil, take } from 'rxjs/operators';\nimport * as gateway from '../gateway';\nimport { events, filterEvent } from '../gateway';\nimport { Device } from './device';\nimport { UnknownResponseEvent } from './unknown_response_event';\nimport { ReplyOnlyEvent } from './reply_only_event';\nimport { CommandCode } from './command_code';\nimport { Message } from './message';\nimport { MotionLibException } from '../exceptions';\n\n/**\n * Class representing access to particular connection (serial port, TCP connection) using the legacy Binary protocol.\n */\nexport class Connection {\n\n /**\n * Event invoked when a response from a device cannot be matched to any known request.\n */\n public unknownResponse!: Observable<UnknownResponseEvent>;\n\n /**\n * Event invoked when a reply-only command such as a move tracking message is received from a device.\n */\n public replyOnly!: Observable<ReplyOnlyEvent>;\n\n /**\n * Default baud rate for serial connections.\n */\n public static readonly DEFAULT_BAUD_RATE: number = 9600;\n\n /**\n * The interface ID identifies thisConnection instance with the underlying library.\n */\n public get interfaceId(): number {\n return this._interfaceId;\n }\n private _interfaceId: number;\n\n constructor(interfaceId: number) {\n this._interfaceId = interfaceId;\n this._subscribe();\n }\n\n /**\n * Opens a serial port.\n * @param portName Name of the port to open.\n * @param baudRate Optional baud rate (defaults to 9600).\n * @param useMessageIds Enable use of message IDs (defaults to disabled).\n * All your devices must be pre-configured to match.\n * @return An object representing the port.\n */\n public static async openSerialPort(\n portName: string,\n baudRate: number = Connection.DEFAULT_BAUD_RATE,\n useMessageIds: boolean = false\n ): Promise<Connection> {\n const request = new gateway.OpenBinaryInterfaceRequest();\n request.setInterfaceType(gateway.InterfaceType.SERIAL_PORT);\n request.setPortName(portName);\n request.setBaudRate(baudRate);\n request.setUseMessageIds(useMessageIds);\n\n const response = await gateway.callAsync<gateway.OpenInterfaceResponse>(\n 'binary/interface/open',\n request,\n gateway.OpenInterfaceResponse);\n return new Connection(response.getInterfaceId());\n }\n\n /**\n * Opens a TCP connection.\n * @param hostName Hostname or IP address.\n * @param port Optional port number (defaults to 8657).\n * @param useMessageIds Enable use of message IDs (defaults to disabled).\n * All your devices must be pre-configured to match.\n * @return An object representing the connection.\n */\n public static async openTcp(\n hostName: string,\n port: number = 0,\n useMessageIds: boolean = false\n ): Promise<Connection> {\n const request = new gateway.OpenBinaryInterfaceRequest();\n request.setInterfaceType(gateway.InterfaceType.TCP);\n request.setHostName(hostName);\n request.setPort(port);\n request.setUseMessageIds(useMessageIds);\n\n const response = await gateway.callAsync<gateway.OpenInterfaceResponse>(\n 'binary/interface/open',\n request,\n gateway.OpenInterfaceResponse);\n return new Connection(response.getInterfaceId());\n }\n\n /**\n * Close the connection.\n */\n public async close(): Promise<void> {\n const request = new gateway.InterfaceEmptyRequest();\n request.setInterfaceId(this.interfaceId);\n\n await gateway.callAsync('interface/close', request);\n }\n\n /**\n * Sends a generic Binary command to this connection.\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 device Device address to send the command to. Use zero for broadcast.\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 device: number,\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.interfaceId);\n request.setDevice(device);\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 connection 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 device Device address to send the command to. Use zero for broadcast.\n * @param command Command to send.\n * @param data Optional data argument to the command. Defaults to zero.\n */\n public async genericCommandNoResponse(\n device: number,\n command: CommandCode,\n data: number = 0\n ): Promise<void> {\n const request = new gateway.GenericBinaryRequest();\n request.setInterfaceId(this.interfaceId);\n request.setDevice(device);\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 connection and expects responses from one or more devices.\n * Responses are returned in order of arrival.\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 all responses from the device chain. 0 or negative defaults to 0.5s.\n * @param checkErrors Controls whether to throw an exception when any device rejects the command.\n * @return All responses to the command.\n */\n public async genericCommandMultiResponse(\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.interfaceId);\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.BinaryMessageCollection>(\n 'binary/interface/generic_command_multi_response',\n request,\n gateway.BinaryMessageCollection);\n return response.toObject().messagesList.map(resp => Message.fromProtobuf(resp));\n }\n\n /**\n * Renumbers devices present on this connection. After renumbering, you must identify devices again.\n * @return Total number of devices that responded to the renumber.\n */\n public async renumberDevices(): Promise<number> {\n const request = new gateway.InterfaceEmptyRequest();\n request.setInterfaceId(this.interfaceId);\n\n const response = await gateway.callAsync<gateway.IntResponse>(\n 'binary/device/renumber',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Attempts to detect any devices present on this connection.\n * @param identifyDevices Determines whether device identification should be performed as well.\n * @return Array of detected devices.\n */\n public async detectDevices(\n identifyDevices: boolean = true\n ): Promise<Device[]> {\n const request = new gateway.BinaryDeviceDetectRequest();\n request.setInterfaceId(this.interfaceId);\n request.setIdentifyDevices(identifyDevices);\n\n const response = await gateway.callAsync<gateway.BinaryDeviceDetectResponse>(\n 'binary/device/detect',\n request,\n gateway.BinaryDeviceDetectResponse);\n return response.getDevicesList().map(deviceAddress => this.getDevice(deviceAddress));\n }\n\n /**\n * Gets a Device class instance which allows you to control a particular device on this connection.\n * Devices are numbered from 1.\n * @param deviceAddress Address of device intended to control. Address is configured for each device.\n * @return Device instance.\n */\n public getDevice(\n deviceAddress: number\n ): Device {\n if (deviceAddress <= 0) {\n throw new TypeError('Invalid value; physical devices are numbered from 1.');\n }\n return new Device(this, deviceAddress);\n }\n\n /**\n * Returns a string that represents the connection.\n * @return A string that represents the connection.\n */\n public toString(): string {\n const request = new gateway.InterfaceEmptyRequest();\n request.setInterfaceId(this.interfaceId);\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'interface/to_string',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n\n private _disconnected = new ReplaySubject<MotionLibException>();\n\n /**\n * Event invoked when connection is interrupted or closed.\n */\n public get disconnected(): Observable<MotionLibException> {\n return this._disconnected;\n }\n\n private _subscribe(): void {\n this.unknownResponse = events.pipe(\n takeUntil(this._disconnected),\n filterEvent<gateway.UnknownBinaryResponseEvent.AsObject>('binary/interface/unknown_response'),\n filter(event => event.interfaceId === this.interfaceId),\n map(event => UnknownResponseEvent.fromProtobuf(event))\n );\n\n this.replyOnly = events.pipe(\n takeUntil(this._disconnected),\n filterEvent<gateway.BinaryReplyOnlyEvent.AsObject>('binary/interface/reply_only'),\n filter(event => event.interfaceId === this.interfaceId),\n map(event => ReplyOnlyEvent.fromProtobuf(event))\n );\n\n events.pipe(\n filterEvent<gateway.DisconnectedEvent.AsObject>('interface/disconnected'),\n filter(event => event.interfaceId === this.interfaceId),\n take(1),\n map(({ errorMessage, errorType }) => gateway.convertToException(errorType, errorMessage))\n ).subscribe(this._disconnected);\n }\n}\n"]}
1
+ {"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/binary/connection.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,+BAAiD;AACjD,8CAA8D;AAC9D,oDAAsC;AACtC,wCAAiD;AACjD,qCAAkC;AAClC,qEAAgE;AA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GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Observable, ReplaySubject } from 'rxjs';\nimport { map, filter, takeUntil, take } from 'rxjs/operators';\nimport * as gateway from '../gateway';\nimport { events, filterEvent } from '../gateway';\nimport { Device } from './device';\nimport { UnknownResponseEvent } from './unknown_response_event';\nimport { ReplyOnlyEvent } from './reply_only_event';\nimport { CommandCode } from './command_code';\nimport { Message } from './message';\nimport { MotionLibException } from '../exceptions';\n\n/**\n * Class representing access to particular connection (serial port, TCP connection) using the legacy Binary protocol.\n */\nexport class Connection {\n\n /**\n * Event invoked when a response from a device cannot be matched to any known request.\n */\n public unknownResponse!: Observable<UnknownResponseEvent>;\n\n /**\n * Event invoked when a reply-only command such as a move tracking message is received from a device.\n */\n public replyOnly!: Observable<ReplyOnlyEvent>;\n\n /**\n * Default baud rate for serial connections.\n */\n public static readonly DEFAULT_BAUD_RATE: number = 9600;\n\n /**\n * The interface ID identifies thisConnection instance with the underlying library.\n */\n public get interfaceId(): number {\n return this._interfaceId;\n }\n private _interfaceId: number;\n\n constructor(interfaceId: number) {\n this._interfaceId = interfaceId;\n this._subscribe();\n }\n\n /**\n * Opens a serial port.\n * @param portName Name of the port to open.\n * @param baudRate Optional baud rate (defaults to 9600).\n * @param useMessageIds Enable use of message IDs (defaults to disabled).\n * All your devices must be pre-configured to match.\n * @return An object representing the port.\n */\n public static async openSerialPort(\n portName: string,\n baudRate: number = Connection.DEFAULT_BAUD_RATE,\n useMessageIds: boolean = false\n ): Promise<Connection> {\n const request = new gateway.OpenBinaryInterfaceRequest();\n request.setInterfaceType(gateway.InterfaceType.SERIAL_PORT);\n request.setPortName(portName);\n request.setBaudRate(baudRate);\n request.setUseMessageIds(useMessageIds);\n\n const response = await gateway.callAsync<gateway.OpenInterfaceResponse>(\n 'binary/interface/open',\n request,\n gateway.OpenInterfaceResponse);\n return new Connection(response.getInterfaceId());\n }\n\n /**\n * Opens a TCP connection.\n * @param hostName Hostname or IP address.\n * @param port Optional port number (defaults to 8657).\n * @param useMessageIds Enable use of message IDs (defaults to disabled).\n * All your devices must be pre-configured to match.\n * @return An object representing the connection.\n */\n public static async openTcp(\n hostName: string,\n port: number = 0,\n useMessageIds: boolean = false\n ): Promise<Connection> {\n const request = new gateway.OpenBinaryInterfaceRequest();\n request.setInterfaceType(gateway.InterfaceType.TCP);\n request.setHostName(hostName);\n request.setPort(port);\n request.setUseMessageIds(useMessageIds);\n\n const response = await gateway.callAsync<gateway.OpenInterfaceResponse>(\n 'binary/interface/open',\n request,\n gateway.OpenInterfaceResponse);\n return new Connection(response.getInterfaceId());\n }\n\n /**\n * Close the connection.\n */\n public async close(): Promise<void> {\n const request = new gateway.InterfaceEmptyRequest();\n request.setInterfaceId(this.interfaceId);\n\n await gateway.callAsync('interface/close', request);\n }\n\n /**\n * Sends a generic Binary command to this connection.\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 device Device address to send the command to. Use zero for broadcast.\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 device: number,\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.interfaceId);\n request.setDevice(device);\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 connection 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 device Device address to send the command to. Use zero for broadcast.\n * @param command Command to send.\n * @param data Optional data argument to the command. Defaults to zero.\n */\n public async genericCommandNoResponse(\n device: number,\n command: CommandCode,\n data: number = 0\n ): Promise<void> {\n const request = new gateway.GenericBinaryRequest();\n request.setInterfaceId(this.interfaceId);\n request.setDevice(device);\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 connection and expects responses from one or more devices.\n * Responses are returned in order of arrival.\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 all responses from the device chain. 0 or negative defaults to 0.5s.\n * @param checkErrors Controls whether to throw an exception when any device rejects the command.\n * @return All responses to the command.\n */\n public async genericCommandMultiResponse(\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.interfaceId);\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.BinaryMessageCollection>(\n 'binary/interface/generic_command_multi_response',\n request,\n gateway.BinaryMessageCollection);\n return response.toObject().messagesList.map(resp => Message.fromProtobuf(resp));\n }\n\n /**\n * Renumbers devices present on this connection. After renumbering, you must identify devices again.\n * @return Total number of devices that responded to the renumber.\n */\n public async renumberDevices(): Promise<number> {\n const request = new gateway.InterfaceEmptyRequest();\n request.setInterfaceId(this.interfaceId);\n\n const response = await gateway.callAsync<gateway.IntResponse>(\n 'binary/device/renumber',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Attempts to detect any devices present on this connection.\n * @param identifyDevices Determines whether device identification should be performed as well.\n * @return Array of detected devices.\n */\n public async detectDevices(\n identifyDevices: boolean = true\n ): Promise<Device[]> {\n const request = new gateway.BinaryDeviceDetectRequest();\n request.setInterfaceId(this.interfaceId);\n request.setIdentifyDevices(identifyDevices);\n\n const response = await gateway.callAsync<gateway.BinaryDeviceDetectResponse>(\n 'binary/device/detect',\n request,\n gateway.BinaryDeviceDetectResponse);\n return response.getDevicesList().map(deviceAddress => this.getDevice(deviceAddress));\n }\n\n /**\n * Gets a Device class instance which allows you to control a particular device on this connection.\n * Devices are numbered from 1.\n * @param deviceAddress Address of device intended to control. Address is configured for each device.\n * @return Device instance.\n */\n public getDevice(\n deviceAddress: number\n ): Device {\n if (deviceAddress <= 0) {\n throw new TypeError('Invalid value; physical devices are numbered from 1.');\n }\n return new Device(this, deviceAddress);\n }\n\n /**\n * Returns a string that represents the connection.\n * @return A string that represents the connection.\n */\n public toString(): string {\n const request = new gateway.InterfaceEmptyRequest();\n request.setInterfaceId(this.interfaceId);\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'interface/to_string',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n\n private _disconnected = new ReplaySubject<MotionLibException>();\n\n /**\n * Event invoked when connection is interrupted or closed.\n */\n public get disconnected(): Observable<MotionLibException> {\n return this._disconnected;\n }\n\n private _subscribe(): void {\n this.unknownResponse = events.pipe(\n takeUntil(this._disconnected),\n filterEvent<gateway.UnknownBinaryResponseEvent.AsObject>('binary/interface/unknown_response'),\n filter(event => event.interfaceId === this.interfaceId),\n map(event => UnknownResponseEvent.fromProtobuf(event))\n );\n\n this.replyOnly = events.pipe(\n takeUntil(this._disconnected),\n filterEvent<gateway.BinaryReplyOnlyEvent.AsObject>('binary/interface/reply_only'),\n filter(event => event.interfaceId === this.interfaceId),\n map(event => ReplyOnlyEvent.fromProtobuf(event))\n );\n\n events.pipe(\n filterEvent<gateway.DisconnectedEvent.AsObject>('interface/disconnected'),\n filter(event => event.interfaceId === this.interfaceId),\n take(1),\n map(({ errorMessage, errorType }) => gateway.convertToException(errorType, errorMessage))\n ).subscribe(this._disconnected);\n }\n}\n"]}
@@ -3,7 +3,11 @@
3
3
  // ============= DO NOT EDIT DIRECTLY ============= //
4
4
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
5
  if (k2 === undefined) k2 = k;
6
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
7
11
  }) : (function(o, m, k, k2) {
8
12
  if (k2 === undefined) k2 = k;
9
13
  o[k2] = m[k];
@@ -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,CAAC;IAC7B,CAAC;IAGD;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,IA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;;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"]}
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,CAAC;IAC7B,CAAC;IAGD;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,qBAAqB,EAAE,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC;IACpC,CAAC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AAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,gCAAgC,EAChC,OAAO,EACP,OAAO,CAAC,cAAc,CAAC,CAAC;QAC1B,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACK,iBAAiB;QACvB,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;QACjD,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,4BAA4B,EAC5B,OAAO,EACP,OAAO,CAAC,+BAA+B,CAAC,CAAC;QAC3C,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,kBAAkB,EAAE,CAAC;QACjD,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,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"]}
@@ -3,7 +3,11 @@
3
3
  // ============= DO NOT EDIT DIRECTLY ============= //
4
4
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
5
  if (k2 === undefined) k2 = k;
6
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
7
11
  }) : (function(o, m, k, k2) {
8
12
  if (k2 === undefined) k2 = k;
9
13
  o[k2] = m[k];
@@ -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,OAAO,CAAC,aAAa,CAAC,CAAC;QAC9C,OAAO,CAAC,UAAU,CAAC,OAAc,CAAC,CAAC;QACnC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAEtB,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,2BAA2B,EAC3B,OAAO,EACP,OAAO,CAAC,cAAc,CAAC,CAAC;QAC1B,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,GAAG,CACd,OAAuB,EACvB,KAAa,EACb,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,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"]}
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,OAAO,CAAC,aAAa,CAAC,CAAC;QAC9C,OAAO,CAAC,UAAU,CAAC,OAAc,CAAC,CAAC;QACnC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAEtB,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,2BAA2B,EAC3B,OAAO,EACP,OAAO,CAAC,cAAc,CAAC,CAAC;QAC1B,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,GAAG,CACd,OAAuB,EACvB,KAAa,EACb,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,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"]}
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1 +1 @@
1
- {"version":3,"file":"binary_ns.js","sourceRoot":"","sources":["../../src/binary_ns.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA,uDAAyC;AAEzC,IAAiB,MAAM,CAyBtB;AAzBD,WAAiB,MAAM;IACR,qBAAc,GAAG,YAAY,CAAC,cAAc,CAAC;IAE7C,kBAAW,GAAG,YAAY,CAAC,WAAW,CAAC;IAEvC,iBAAU,GAAG,YAAY,CAAC,UAAU,CAAC;IAErC,aAAM,GAAG,YAAY,CAAC,MAAM,CAAC;IAE7B,qBAAc,GAAG,YAAY,CAAC,cAAc,CAAC;IAE7C,qBAAc,GAAG,YAAY,CAAC,cAAc,CAAC;IAE7C,iBAAU,GAAG,YAAY,CAAC,UAAU,CAAC;IAErC,gBAAS,GAAG,YAAY,CAAC,SAAS,CAAC;IAEnC,cAAO,GAAG,YAAY,CAAC,OAAO,CAAC;IAE/B,gBAAS,GAAG,YAAY,CAAC,SAAS,CAAC;IAEnC,qBAAc,GAAG,YAAY,CAAC,cAAc,CAAC;IAE7C,2BAAoB,GAAG,YAAY,CAAC,oBAAoB,CAAC;AAExE,CAAC,EAzBgB,MAAM,GAAN,cAAM,KAAN,cAAM,QAyBtB","sourcesContent":["\nimport * as binaryImport from './binary';\n\nexport namespace binary {\n export const BinarySettings = binaryImport.BinarySettings;\n export type BinarySettings = binaryImport.BinarySettings;\n export const CommandCode = binaryImport.CommandCode;\n export type CommandCode = binaryImport.CommandCode;\n export const Connection = binaryImport.Connection;\n export type Connection = binaryImport.Connection;\n export const Device = binaryImport.Device;\n export type Device = binaryImport.Device;\n export const DeviceIdentity = binaryImport.DeviceIdentity;\n export type DeviceIdentity = binaryImport.DeviceIdentity;\n export const DeviceSettings = binaryImport.DeviceSettings;\n export type DeviceSettings = binaryImport.DeviceSettings;\n export const DeviceType = binaryImport.DeviceType;\n export type DeviceType = binaryImport.DeviceType;\n export const ErrorCode = binaryImport.ErrorCode;\n export type ErrorCode = binaryImport.ErrorCode;\n export const Message = binaryImport.Message;\n export type Message = binaryImport.Message;\n export const ReplyCode = binaryImport.ReplyCode;\n export type ReplyCode = binaryImport.ReplyCode;\n export const ReplyOnlyEvent = binaryImport.ReplyOnlyEvent;\n export type ReplyOnlyEvent = binaryImport.ReplyOnlyEvent;\n export const UnknownResponseEvent = binaryImport.UnknownResponseEvent;\n export type UnknownResponseEvent = binaryImport.UnknownResponseEvent;\n}\n"]}
1
+ {"version":3,"file":"binary_ns.js","sourceRoot":"","sources":["../../src/binary_ns.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,uDAAyC;AAEzC,IAAiB,MAAM,CAyBtB;AAzBD,WAAiB,MAAM;IACR,qBAAc,GAAG,YAAY,CAAC,cAAc,CAAC;IAE7C,kBAAW,GAAG,YAAY,CAAC,WAAW,CAAC;IAEvC,iBAAU,GAAG,YAAY,CAAC,UAAU,CAAC;IAErC,aAAM,GAAG,YAAY,CAAC,MAAM,CAAC;IAE7B,qBAAc,GAAG,YAAY,CAAC,cAAc,CAAC;IAE7C,qBAAc,GAAG,YAAY,CAAC,cAAc,CAAC;IAE7C,iBAAU,GAAG,YAAY,CAAC,UAAU,CAAC;IAErC,gBAAS,GAAG,YAAY,CAAC,SAAS,CAAC;IAEnC,cAAO,GAAG,YAAY,CAAC,OAAO,CAAC;IAE/B,gBAAS,GAAG,YAAY,CAAC,SAAS,CAAC;IAEnC,qBAAc,GAAG,YAAY,CAAC,cAAc,CAAC;IAE7C,2BAAoB,GAAG,YAAY,CAAC,oBAAoB,CAAC;AAExE,CAAC,EAzBgB,MAAM,GAAN,cAAM,KAAN,cAAM,QAyBtB","sourcesContent":["\nimport * as binaryImport from './binary';\n\nexport namespace binary {\n export const BinarySettings = binaryImport.BinarySettings;\n export type BinarySettings = binaryImport.BinarySettings;\n export const CommandCode = binaryImport.CommandCode;\n export type CommandCode = binaryImport.CommandCode;\n export const Connection = binaryImport.Connection;\n export type Connection = binaryImport.Connection;\n export const Device = binaryImport.Device;\n export type Device = binaryImport.Device;\n export const DeviceIdentity = binaryImport.DeviceIdentity;\n export type DeviceIdentity = binaryImport.DeviceIdentity;\n export const DeviceSettings = binaryImport.DeviceSettings;\n export type DeviceSettings = binaryImport.DeviceSettings;\n export const DeviceType = binaryImport.DeviceType;\n export type DeviceType = binaryImport.DeviceType;\n export const ErrorCode = binaryImport.ErrorCode;\n export type ErrorCode = binaryImport.ErrorCode;\n export const Message = binaryImport.Message;\n export type Message = binaryImport.Message;\n export const ReplyCode = binaryImport.ReplyCode;\n export type ReplyCode = binaryImport.ReplyCode;\n export const ReplyOnlyEvent = binaryImport.ReplyOnlyEvent;\n export type ReplyOnlyEvent = binaryImport.ReplyOnlyEvent;\n export const UnknownResponseEvent = binaryImport.UnknownResponseEvent;\n export type UnknownResponseEvent = binaryImport.UnknownResponseEvent;\n}\n"]}
@@ -3,7 +3,11 @@
3
3
  // ============= DO NOT EDIT DIRECTLY ============= //
4
4
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
5
  if (k2 === undefined) k2 = k;
6
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
7
11
  }) : (function(o, m, k, k2) {
8
12
  if (k2 === undefined) k2 = k;
9
13
  o[k2] = m[k];
@@ -1 +1 @@
1
- {"version":3,"file":"convert_exceptions.js","sourceRoot":"","sources":["../../../src/gateway/convert_exceptions.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAEtD,kDAA0D;AAC1D,0DAA4C;AAE5C,MAAM,YAAY,GAAG,IAAI,GAAG,EAAwF,CAAC;AACrH,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,qBAAqB,EAAE,UAAU,CAAC,4BAA4B,CAAC,CAAC;AAC1F,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,cAAc,EAAE,UAAU,CAAC,sBAAsB,CAAC,CAAC;AAC7E,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,iBAAiB,EAAE,UAAU,CAAC,yBAAyB,CAAC,CAAC;AACnF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,gBAAgB,EAAE,UAAU,CAAC,uBAAuB,CAAC,CAAC;AAChF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,iBAAiB,EAAE,UAAU,CAAC,yBAAyB,CAAC,CAAC;AACnF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,iBAAiB,EAAE,UAAU,CAAC,yBAAyB,CAAC,CAAC;AACnF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,iBAAiB,EAAE,UAAU,CAAC,yBAAyB,CAAC,CAAC;AACnF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,uBAAuB,EAAE,UAAU,CAAC,8BAA8B,CAAC,CAAC;AAC9F,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,WAAW,EAAE,UAAU,CAAC,mBAAmB,CAAC,CAAC;AACvE,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,g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EAAE,UAAU,CAAC,wBAAwB,CAAC,CAAC;AAClF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,gBAAgB,EAAE,UAAU,CAAC,wBAAwB,CAAC,CAAC;AACjF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,WAAW,EAAE,UAAU,CAAC,mBAAmB,CAAC,CAAC;AACvE,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,sBAAsB,EAAE,UAAU,CAAC,6BAA6B,CAAC,CAAC;AAC5F,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,2BAA2B,EAAE,UAAU,CAAC,kCAAkC,CAAC,CAAC;AACtG,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,mBAAmB,EAAE,UAAU,CAAC,0BAA0B,CAAC,CAAC;AACtF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,sBAAsB,EAAE,UAAU,CAAC,6BAA6B,CAAC,CAAC;AAC5F,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,eAAe,EAAE,UAAU,CAAC,uBAAuB,CAAC,CAAC;AAE/E,SAAgB,kBAAkB,CAAC,KAAe,EAAE,OAAe,EAAE,UAAmB;IACtF,MAAM,iBAAiB,GAAG,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAElD,wBAAwB;IACxB,IAAI,CAAC,iBAAiB,EAAE;QACtB,OAAO,IAAI,UAAU,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;KACnD;IAED,OAAO,IAAI,iBAAiB,CAAC,OAAO,EAAE,UAAW,CAAC,CAAC;AACrD,CAAC;AATD,gDASC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Errors as PbErrors } from '../protobufs/main_pb';\nimport * as exceptions from '../exceptions';\n\nconst errorMapping = new Map<PbErrors, new (message: string, customData: Buffer) => exceptions.MotionLibException>();\nerrorMapping.set(PbErrors.BINARY_COMMAND_FAILED, exceptions.BinaryCommandFailedException);\nerrorMapping.set(PbErrors.COMMAND_FAILED, exceptions.CommandFailedException);\nerrorMapping.set(PbErrors.COMMAND_PREEMPTED, exceptions.CommandPreemptedException);\nerrorMapping.set(PbErrors.COMMAND_TOO_LONG, exceptions.CommandTooLongException);\nerrorMapping.set(PbErrors.CONNECTION_CLOSED, exceptions.ConnectionClosedException);\nerrorMapping.set(PbErrors.CONNECTION_FAILED, exceptions.ConnectionFailedException);\nerrorMapping.set(PbErrors.CONVERSION_FAILED, exceptions.ConversionFailedException);\nerrorMapping.set(PbErrors.DEVICE_ADDRESS_CONFLICT, exceptions.DeviceAddressConflictException);\nerrorMapping.set(PbErrors.DEVICE_BUSY, exceptions.DeviceBusyException);\nerrorMapping.set(PbErrors.DEVICE_DB_FAILED, exceptions.DeviceDbFailedException);\nerrorMapping.set(PbErrors.DEVICE_FAILED, exceptions.DeviceFailedException);\nerrorMapping.set(PbErrors.DEVICE_NOT_IDENTIFIED, exceptions.DeviceNotIdentifiedException);\nerrorMapping.set(PbErrors.G_CODE_EXECUTION, exceptions.GCodeExecutionException);\nerrorMapping.set(PbErrors.G_CODE_SYNTAX, exceptions.GCodeSyntaxException);\nerrorMapping.set(PbErrors.INTERNAL_ERROR, exceptions.InternalErrorException);\nerrorMapping.set(PbErrors.INVALID_ARGUMENT, exceptions.InvalidArgumentException);\nerrorMapping.set(PbErrors.INVALID_DATA, exceptions.InvalidDataException);\nerrorMapping.set(PbErrors.INVALID_OPERATION, exceptions.InvalidOperationException);\nerrorMapping.set(PbErrors.INVALID_PACKET, exceptions.InvalidPacketException);\nerrorMapping.set(PbErrors.INVALID_PARK_STATE, exceptions.InvalidParkStateException);\nerrorMapping.set(PbErrors.INVALID_RESPONSE, exceptions.InvalidResponseException);\nerrorMapping.set(PbErrors.IO_CHANNEL_OUT_OF_RANGE, exceptions.IoChannelOutOfRangeException);\nerrorMapping.set(PbErrors.IO_FAILED, exceptions.IoFailedException);\nerrorMapping.set(PbErrors.LOCKSTEP_ENABLED, exceptions.LockstepEnabledException);\nerrorMapping.set(PbErrors.LOCKSTEP_NOT_ENABLED, exceptions.LockstepNotEnabledException);\nerrorMapping.set(PbErrors.MOVEMENT_FAILED, exceptions.MovementFailedException);\nerrorMapping.set(PbErrors.MOVEMENT_INTERRUPTED, exceptions.MovementInterruptedException);\nerrorMapping.set(PbErrors.NO_DEVICE_FOUND, exceptions.NoDeviceFoundException);\nerrorMapping.set(PbErrors.NO_VALUE_FOR_KEY, exceptions.NoValueForKeyException);\nerrorMapping.set(PbErrors.NOT_SUPPORTED, exceptions.NotSupportedException);\nerrorMapping.set(PbErrors.OS_FAILED, exceptions.OsFailedException);\nerrorMapping.set(PbErrors.OUT_OF_REQUEST_IDS, exceptions.OutOfRequestIdsException);\nerrorMapping.set(PbErrors.REQUEST_TIMEOUT, exceptions.RequestTimeoutException);\nerrorMapping.set(PbErrors.SERIAL_PORT_BUSY, exceptions.SerialPortBusyException);\nerrorMapping.set(PbErrors.SET_DEVICE_STATE_FAILED, exceptions.SetDeviceStateFailedException);\nerrorMapping.set(PbErrors.SET_PERIPHERAL_STATE_FAILED, exceptions.SetPeripheralStateFailedException);\nerrorMapping.set(PbErrors.SETTING_NOT_FOUND, exceptions.SettingNotFoundException);\nerrorMapping.set(PbErrors.STREAM_EXECUTION, exceptions.StreamExecutionException);\nerrorMapping.set(PbErrors.STREAM_MODE, exceptions.StreamModeException);\nerrorMapping.set(PbErrors.STREAM_MOVEMENT_FAILED, exceptions.StreamMovementFailedException);\nerrorMapping.set(PbErrors.STREAM_MOVEMENT_INTERRUPTED, exceptions.StreamMovementInterruptedException);\nerrorMapping.set(PbErrors.STREAM_SETUP_FAILED, exceptions.StreamSetupFailedException);\nerrorMapping.set(PbErrors.TRANSPORT_ALREADY_USED, exceptions.TransportAlreadyUsedException);\nerrorMapping.set(PbErrors.UNKNOWN_REQUEST, exceptions.UnknownRequestException);\n\nexport function convertToException(error: PbErrors, message: string, customData?: Buffer): exceptions.MotionLibException {\n const SpecificException = errorMapping.get(error);\n\n /* istanbul ignore if */\n if (!SpecificException) {\n return new exceptions.MotionLibException(message);\n }\n\n return new SpecificException(message, customData!);\n}\n"]}
1
+ {"version":3,"file":"convert_exceptions.js","sourceRoot":"","sources":["../../../src/gateway/convert_exceptions.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,kDAA0D;AAC1D,0DAA4C;AAE5C,MAAM,YAAY,GAAG,IAAI,GAAG,EAAwF,CAAC;AACrH,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,qBAAqB,EAAE,UAAU,CAAC,4BAA4B,CAAC,CAAC;AAC1F,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,cAAc,EAAE,UAAU,CAAC,sBAAsB,CAAC,CAAC;AAC7E,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,iBAAiB,EAAE,UAAU,CAAC,yBAAyB,CAAC,CAAC;AACnF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,gBAAgB,EAAE,UAAU,CAAC,uBAAuB,CAAC,CAAC;AAChF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,iBAAiB,EAAE,UAAU,CAAC,yBAAyB,CAAC,CAAC;AACnF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,iBAAiB,EAAE,UAAU,CAAC,yBAAyB,CAAC,CAAC;AACnF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,iBAAiB,EAAE,UAAU,CAAC,yBAAyB,CAAC,CAAC;AACnF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,uBAAuB,EAAE,UAAU,CAAC,8BAA8B,CAAC,CAAC;AAC9F,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,WAAW,EAAE,UAAU,CAAC,mBAAmB,CAAC,CAAC;AACvE,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,gBAAgB,EAAE,UAA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,wBAAwB,CAAC,CAAC;AAClF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,gBAAgB,EAAE,UAAU,CAAC,wBAAwB,CAAC,CAAC;AACjF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,WAAW,EAAE,UAAU,CAAC,mBAAmB,CAAC,CAAC;AACvE,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,sBAAsB,EAAE,UAAU,CAAC,6BAA6B,CAAC,CAAC;AAC5F,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,2BAA2B,EAAE,UAAU,CAAC,kCAAkC,CAAC,CAAC;AACtG,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,mBAAmB,EAAE,UAAU,CAAC,0BAA0B,CAAC,CAAC;AACtF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,sBAAsB,EAAE,UAAU,CAAC,6BAA6B,CAAC,CAAC;AAC5F,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,eAAe,EAAE,UAAU,CAAC,uBAAuB,CAAC,CAAC;AAE/E,SAAgB,kBAAkB,CAAC,KAAe,EAAE,OAAe,EAAE,UAAmB;IACtF,MAAM,iBAAiB,GAAG,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAElD,wBAAwB;IACxB,IAAI,CAAC,iBAAiB,EAAE;QACtB,OAAO,IAAI,UAAU,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;KACnD;IAED,OAAO,IAAI,iBAAiB,CAAC,OAAO,EAAE,UAAW,CAAC,CAAC;AACrD,CAAC;AATD,gDASC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Errors as PbErrors } from '../protobufs/main_pb';\nimport * as exceptions from '../exceptions';\n\nconst errorMapping = new Map<PbErrors, new (message: string, customData: Buffer) => exceptions.MotionLibException>();\nerrorMapping.set(PbErrors.BINARY_COMMAND_FAILED, exceptions.BinaryCommandFailedException);\nerrorMapping.set(PbErrors.COMMAND_FAILED, exceptions.CommandFailedException);\nerrorMapping.set(PbErrors.COMMAND_PREEMPTED, exceptions.CommandPreemptedException);\nerrorMapping.set(PbErrors.COMMAND_TOO_LONG, exceptions.CommandTooLongException);\nerrorMapping.set(PbErrors.CONNECTION_CLOSED, exceptions.ConnectionClosedException);\nerrorMapping.set(PbErrors.CONNECTION_FAILED, exceptions.ConnectionFailedException);\nerrorMapping.set(PbErrors.CONVERSION_FAILED, exceptions.ConversionFailedException);\nerrorMapping.set(PbErrors.DEVICE_ADDRESS_CONFLICT, exceptions.DeviceAddressConflictException);\nerrorMapping.set(PbErrors.DEVICE_BUSY, exceptions.DeviceBusyException);\nerrorMapping.set(PbErrors.DEVICE_DB_FAILED, exceptions.DeviceDbFailedException);\nerrorMapping.set(PbErrors.DEVICE_FAILED, exceptions.DeviceFailedException);\nerrorMapping.set(PbErrors.DEVICE_NOT_IDENTIFIED, exceptions.DeviceNotIdentifiedException);\nerrorMapping.set(PbErrors.G_CODE_EXECUTION, exceptions.GCodeExecutionException);\nerrorMapping.set(PbErrors.G_CODE_SYNTAX, exceptions.GCodeSyntaxException);\nerrorMapping.set(PbErrors.INTERNAL_ERROR, exceptions.InternalErrorException);\nerrorMapping.set(PbErrors.INVALID_ARGUMENT, exceptions.InvalidArgumentException);\nerrorMapping.set(PbErrors.INVALID_DATA, exceptions.InvalidDataException);\nerrorMapping.set(PbErrors.INVALID_OPERATION, exceptions.InvalidOperationException);\nerrorMapping.set(PbErrors.INVALID_PACKET, exceptions.InvalidPacketException);\nerrorMapping.set(PbErrors.INVALID_PARK_STATE, exceptions.InvalidParkStateException);\nerrorMapping.set(PbErrors.INVALID_RESPONSE, exceptions.InvalidResponseException);\nerrorMapping.set(PbErrors.IO_CHANNEL_OUT_OF_RANGE, exceptions.IoChannelOutOfRangeException);\nerrorMapping.set(PbErrors.IO_FAILED, exceptions.IoFailedException);\nerrorMapping.set(PbErrors.LOCKSTEP_ENABLED, exceptions.LockstepEnabledException);\nerrorMapping.set(PbErrors.LOCKSTEP_NOT_ENABLED, exceptions.LockstepNotEnabledException);\nerrorMapping.set(PbErrors.MOVEMENT_FAILED, exceptions.MovementFailedException);\nerrorMapping.set(PbErrors.MOVEMENT_INTERRUPTED, exceptions.MovementInterruptedException);\nerrorMapping.set(PbErrors.NO_DEVICE_FOUND, exceptions.NoDeviceFoundException);\nerrorMapping.set(PbErrors.NO_VALUE_FOR_KEY, exceptions.NoValueForKeyException);\nerrorMapping.set(PbErrors.NOT_SUPPORTED, exceptions.NotSupportedException);\nerrorMapping.set(PbErrors.OS_FAILED, exceptions.OsFailedException);\nerrorMapping.set(PbErrors.OUT_OF_REQUEST_IDS, exceptions.OutOfRequestIdsException);\nerrorMapping.set(PbErrors.REQUEST_TIMEOUT, exceptions.RequestTimeoutException);\nerrorMapping.set(PbErrors.SERIAL_PORT_BUSY, exceptions.SerialPortBusyException);\nerrorMapping.set(PbErrors.SET_DEVICE_STATE_FAILED, exceptions.SetDeviceStateFailedException);\nerrorMapping.set(PbErrors.SET_PERIPHERAL_STATE_FAILED, exceptions.SetPeripheralStateFailedException);\nerrorMapping.set(PbErrors.SETTING_NOT_FOUND, exceptions.SettingNotFoundException);\nerrorMapping.set(PbErrors.STREAM_EXECUTION, exceptions.StreamExecutionException);\nerrorMapping.set(PbErrors.STREAM_MODE, exceptions.StreamModeException);\nerrorMapping.set(PbErrors.STREAM_MOVEMENT_FAILED, exceptions.StreamMovementFailedException);\nerrorMapping.set(PbErrors.STREAM_MOVEMENT_INTERRUPTED, exceptions.StreamMovementInterruptedException);\nerrorMapping.set(PbErrors.STREAM_SETUP_FAILED, exceptions.StreamSetupFailedException);\nerrorMapping.set(PbErrors.TRANSPORT_ALREADY_USED, exceptions.TransportAlreadyUsedException);\nerrorMapping.set(PbErrors.UNKNOWN_REQUEST, exceptions.UnknownRequestException);\n\nexport function convertToException(error: PbErrors, message: string, customData?: Buffer): exceptions.MotionLibException {\n const SpecificException = errorMapping.get(error);\n\n /* istanbul ignore if */\n if (!SpecificException) {\n return new exceptions.MotionLibException(message);\n }\n\n return new SpecificException(message, customData!);\n}\n"]}
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/gateway/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,uDAAqC;AACrC,+BAA6C;AAApC,iGAAA,SAAS,OAAA;AAAE,gGAAA,QAAQ,OAAA;AAC5B,mCAA+C;AAAtC,gGAAA,MAAM,OAAA;AAAE,qGAAA,WAAW,OAAA;AAC5B,2DAA0D;AAAjD,wHAAA,kBAAkB,OAAA","sourcesContent":["export * from '../protobufs/main_pb';\nexport { callAsync, callSync } from './call';\nexport { events, filterEvent } from './events';\nexport { convertToException } from './convert_exceptions';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/gateway/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,+BAA6C;AAApC,iGAAA,SAAS,OAAA;AAAE,gGAAA,QAAQ,OAAA;AAC5B,mCAA+C;AAAtC,gGAAA,MAAM,OAAA;AAAE,qGAAA,WAAW,OAAA;AAC5B,2DAA0D;AAAjD,wHAAA,kBAAkB,OAAA","sourcesContent":["export * from '../protobufs/main_pb';\nexport { callAsync, callSync } from './call';\nexport { events, filterEvent } from './events';\nexport { convertToException } from './convert_exceptions';\n"]}
@@ -3,7 +3,11 @@
3
3
  // ============= DO NOT EDIT DIRECTLY ============= //
4
4
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
5
  if (k2 === undefined) k2 = k;
6
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
7
11
  }) : (function(o, m, k, k2) {
8
12
  if (k2 === undefined) k2 = k;
9
13
  o[k2] = m[k];
@@ -1 +1 @@
1
- {"version":3,"file":"axis_definition.js","sourceRoot":"","sources":["../../../src/gcode/axis_definition.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AAoBtC,IAAiB,cAAc,CAqB9B;AArBD,WAAiB,cAAc;IAChB,qBAAM,GAAG,gBAAgB,CAAC;IAEvC,gBAAgB;IAChB,SAAgB,YAAY,CAAC,MAAiD;QAC5E,OAAO;YACL,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;SAChD,CAAC;IACJ,CAAC;IALe,2BAAY,eAK3B,CAAA;IACD,gBAAgB;IAChB,SAAgB,UAAU,CAAC,MAAyC;QAClE,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,wBAAwB,EAAE,CAAC;QACtD,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,OAAO,MAAM,CAAC;SACf;QAED,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAC5C,MAAM,CAAC,sBAAsB,CAAC,MAAM,CAAC,mBAAoB,CAAC,CAAC;QAC3D,OAAO,MAAM,CAAC;IAChB,CAAC;IATe,yBAAU,aASzB,CAAA;AACH,CAAC,EArBgB,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAqB9B","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\n\n/**\n * Defines an axis of the translator.\n */\nexport interface AxisDefinition {\n /**\n * ID of the peripheral.\n */\n peripheralId: number;\n\n /**\n * Microstep resolution of the axis.\n * Can be obtained by reading the resolution setting.\n * Leave empty if the axis does not have the setting.\n */\n microstepResolution?: number;\n\n}\n\nexport namespace AxisDefinition {\n export const __type = 'AxisDefinition';\n\n /** @internal */\n export function fromProtobuf(pbData: gateway.TranslatorAxisDefinition.AsObject): AxisDefinition {\n return {\n peripheralId: pbData.peripheralId,\n microstepResolution: pbData.microstepResolution,\n };\n }\n /** @internal */\n export function toProtobuf(source: AxisDefinition | null | undefined): gateway.TranslatorAxisDefinition {\n const pbData = new gateway.TranslatorAxisDefinition();\n if (source == null) {\n return pbData;\n }\n\n pbData.setPeripheralId(source.peripheralId);\n pbData.setMicrostepResolution(source.microstepResolution!);\n return pbData;\n }\n}\n"]}
1
+ {"version":3,"file":"axis_definition.js","sourceRoot":"","sources":["../../../src/gcode/axis_definition.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AAoBtC,IAAiB,cAAc,CAqB9B;AArBD,WAAiB,cAAc;IAChB,qBAAM,GAAG,gBAAgB,CAAC;IAEvC,gBAAgB;IAChB,SAAgB,YAAY,CAAC,MAAiD;QAC5E,OAAO;YACL,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;SAChD,CAAC;IACJ,CAAC;IALe,2BAAY,eAK3B,CAAA;IACD,gBAAgB;IAChB,SAAgB,UAAU,CAAC,MAAyC;QAClE,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,wBAAwB,EAAE,CAAC;QACtD,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,OAAO,MAAM,CAAC;SACf;QAED,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAC5C,MAAM,CAAC,sBAAsB,CAAC,MAAM,CAAC,mBAAoB,CAAC,CAAC;QAC3D,OAAO,MAAM,CAAC;IAChB,CAAC;IATe,yBAAU,aASzB,CAAA;AACH,CAAC,EArBgB,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAqB9B","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\n\n/**\n * Defines an axis of the translator.\n */\nexport interface AxisDefinition {\n /**\n * ID of the peripheral.\n */\n peripheralId: number;\n\n /**\n * Microstep resolution of the axis.\n * Can be obtained by reading the resolution setting.\n * Leave empty if the axis does not have the setting.\n */\n microstepResolution?: number;\n\n}\n\nexport namespace AxisDefinition {\n export const __type = 'AxisDefinition';\n\n /** @internal */\n export function fromProtobuf(pbData: gateway.TranslatorAxisDefinition.AsObject): AxisDefinition {\n return {\n peripheralId: pbData.peripheralId,\n microstepResolution: pbData.microstepResolution,\n };\n }\n /** @internal */\n export function toProtobuf(source: AxisDefinition | null | undefined): gateway.TranslatorAxisDefinition {\n const pbData = new gateway.TranslatorAxisDefinition();\n if (source == null) {\n return pbData;\n }\n\n pbData.setPeripheralId(source.peripheralId);\n pbData.setMicrostepResolution(source.microstepResolution!);\n return pbData;\n }\n}\n"]}
@@ -3,7 +3,11 @@
3
3
  // ============= DO NOT EDIT DIRECTLY ============= //
4
4
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
5
  if (k2 === undefined) k2 = k;
6
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
7
11
  }) : (function(o, m, k, k2) {
8
12
  if (k2 === undefined) k2 = k;
9
13
  o[k2] = m[k];
@@ -1 +1 @@
1
- {"version":3,"file":"axis_mapping.js","sourceRoot":"","sources":["../../../src/gcode/axis_mapping.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AAkBtC,IAAiB,WAAW,CAc3B;AAdD,WAAiB,WAAW;IACb,kBAAM,GAAG,aAAa,CAAC;IAEpC,gBAAgB;IAChB,SAAgB,UAAU,CAAC,MAAsC;QAC/D,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,qBAAqB,EAAE,CAAC;QACnD,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,OAAO,MAAM,CAAC;SACf;QAED,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACxC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACtC,OAAO,MAAM,CAAC;IAChB,CAAC;IATe,sBAAU,aASzB,CAAA;AACH,CAAC,EAdgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAc3B","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\n\n/**\n * Maps a translator axis to a Zaber stream axis.\n */\nexport interface AxisMapping {\n /**\n * Letter of the translator axis (X,Y,Z,A,B,C,E).\n */\n axisLetter: string;\n\n /**\n * Index of the stream axis.\n */\n axisIndex: number;\n\n}\n\nexport namespace AxisMapping {\n export const __type = 'AxisMapping';\n\n /** @internal */\n export function toProtobuf(source: AxisMapping | null | undefined): gateway.TranslatorAxisMapping {\n const pbData = new gateway.TranslatorAxisMapping();\n if (source == null) {\n return pbData;\n }\n\n pbData.setAxisLetter(source.axisLetter);\n pbData.setAxisIndex(source.axisIndex);\n return pbData;\n }\n}\n"]}
1
+ {"version":3,"file":"axis_mapping.js","sourceRoot":"","sources":["../../../src/gcode/axis_mapping.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AAkBtC,IAAiB,WAAW,CAc3B;AAdD,WAAiB,WAAW;IACb,kBAAM,GAAG,aAAa,CAAC;IAEpC,gBAAgB;IAChB,SAAgB,UAAU,CAAC,MAAsC;QAC/D,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,qBAAqB,EAAE,CAAC;QACnD,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,OAAO,MAAM,CAAC;SACf;QAED,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACxC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACtC,OAAO,MAAM,CAAC;IAChB,CAAC;IATe,sBAAU,aASzB,CAAA;AACH,CAAC,EAdgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAc3B","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\n\n/**\n * Maps a translator axis to a Zaber stream axis.\n */\nexport interface AxisMapping {\n /**\n * Letter of the translator axis (X,Y,Z,A,B,C,E).\n */\n axisLetter: string;\n\n /**\n * Index of the stream axis.\n */\n axisIndex: number;\n\n}\n\nexport namespace AxisMapping {\n export const __type = 'AxisMapping';\n\n /** @internal */\n export function toProtobuf(source: AxisMapping | null | undefined): gateway.TranslatorAxisMapping {\n const pbData = new gateway.TranslatorAxisMapping();\n if (source == null) {\n return pbData;\n }\n\n pbData.setAxisLetter(source.axisLetter);\n pbData.setAxisIndex(source.axisIndex);\n return pbData;\n }\n}\n"]}
@@ -3,7 +3,11 @@
3
3
  // ============= DO NOT EDIT DIRECTLY ============= //
4
4
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
5
  if (k2 === undefined) k2 = k;
6
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
7
11
  }) : (function(o, m, k, k2) {
8
12
  if (k2 === undefined) k2 = k;
9
13
  o[k2] = m[k];
@@ -1 +1 @@
1
- {"version":3,"file":"axis_transformation.js","sourceRoot":"","sources":["../../../src/gcode/axis_transformation.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,gDAA6C;AAuB7C,IAAiB,kBAAkB,CAelC;AAfD,WAAiB,kBAAkB;IACpB,yBAAM,GAAG,oBAAoB,CAAC;IAE3C,gBAAgB;IAChB,SAAgB,UAAU,CAAC,MAA6C;QACtE,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,4BAA4B,EAAE,CAAC;QAC1D,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,OAAO,MAAM,CAAC;SACf;QAED,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACxC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,OAAQ,CAAC,CAAC;QACnC,MAAM,CAAC,cAAc,CAAC,yBAAW,CAAC,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;QAClE,OAAO,MAAM,CAAC;IAChB,CAAC;IAVe,6BAAU,aAUzB,CAAA;AACH,CAAC,EAfgB,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAelC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport { Measurement } from '../measurement';\n\n/**\n * Represents a transformation of a translator axis.\n */\nexport interface AxisTransformation {\n /**\n * Letter of the translator axis (X,Y,Z,A,B,C,E).\n */\n axisLetter: string;\n\n /**\n * Scaling factor.\n */\n scaling?: number;\n\n /**\n * Translation distance.\n */\n translation?: Measurement;\n\n}\n\nexport namespace AxisTransformation {\n export const __type = 'AxisTransformation';\n\n /** @internal */\n export function toProtobuf(source: AxisTransformation | null | undefined): gateway.TranslatorAxisTransformation {\n const pbData = new gateway.TranslatorAxisTransformation();\n if (source == null) {\n return pbData;\n }\n\n pbData.setAxisLetter(source.axisLetter);\n pbData.setScaling(source.scaling!);\n pbData.setTranslation(Measurement.toProtobuf(source.translation));\n return pbData;\n }\n}\n"]}
1
+ {"version":3,"file":"axis_transformation.js","sourceRoot":"","sources":["../../../src/gcode/axis_transformation.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,gDAA6C;AAuB7C,IAAiB,kBAAkB,CAelC;AAfD,WAAiB,kBAAkB;IACpB,yBAAM,GAAG,oBAAoB,CAAC;IAE3C,gBAAgB;IAChB,SAAgB,UAAU,CAAC,MAA6C;QACtE,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,4BAA4B,EAAE,CAAC;QAC1D,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,OAAO,MAAM,CAAC;SACf;QAED,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACxC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,OAAQ,CAAC,CAAC;QACnC,MAAM,CAAC,cAAc,CAAC,yBAAW,CAAC,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;QAClE,OAAO,MAAM,CAAC;IAChB,CAAC;IAVe,6BAAU,aAUzB,CAAA;AACH,CAAC,EAfgB,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAelC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport { Measurement } from '../measurement';\n\n/**\n * Represents a transformation of a translator axis.\n */\nexport interface AxisTransformation {\n /**\n * Letter of the translator axis (X,Y,Z,A,B,C,E).\n */\n axisLetter: string;\n\n /**\n * Scaling factor.\n */\n scaling?: number;\n\n /**\n * Translation distance.\n */\n translation?: Measurement;\n\n}\n\nexport namespace AxisTransformation {\n export const __type = 'AxisTransformation';\n\n /** @internal */\n export function toProtobuf(source: AxisTransformation | null | undefined): gateway.TranslatorAxisTransformation {\n const pbData = new gateway.TranslatorAxisTransformation();\n if (source == null) {\n return pbData;\n }\n\n pbData.setAxisLetter(source.axisLetter);\n pbData.setScaling(source.scaling!);\n pbData.setTranslation(Measurement.toProtobuf(source.translation));\n return pbData;\n }\n}\n"]}
@@ -3,7 +3,11 @@
3
3
  // ============= DO NOT EDIT DIRECTLY ============= //
4
4
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
5
  if (k2 === undefined) k2 = k;
6
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
7
11
  }) : (function(o, m, k, k2) {
8
12
  if (k2 === undefined) k2 = k;
9
13
  o[k2] = m[k];
@@ -1 +1 @@
1
- {"version":3,"file":"device_definition.js","sourceRoot":"","sources":["../../../src/gcode/device_definition.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,uDAAmD;AACnD,gDAA6C;AAyB7C,IAAiB,gBAAgB,CAehC;AAfD,WAAiB,gBAAgB;IAClB,uBAAM,GAAG,kBAAkB,CAAC;IAEzC,gBAAgB;IAChB,SAAgB,UAAU,CAAC,MAA2C;QACpE,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC;QAClD,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,OAAO,MAAM,CAAC;SACf;QAED,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACpC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,gCAAc,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7E,MAAM,CAAC,WAAW,CAAC,yBAAW,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC5D,OAAO,MAAM,CAAC;IAChB,CAAC;IAVe,2BAAU,aAUzB,CAAA;AACH,CAAC,EAfgB,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAehC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport { AxisDefinition } from './axis_definition';\nimport { Measurement } from '../measurement';\n\n/**\n * Holds information about device and its axes for purpose of a translator.\n */\nexport interface DeviceDefinition {\n /**\n * Device ID of the controller.\n * Can be obtained from device settings.\n */\n deviceId: number;\n\n /**\n * Applicable axes of the device.\n */\n axes: AxisDefinition[];\n\n /**\n * The smallest of each axis' maxspeed setting value.\n * This value becomes the traverse rate of the translator.\n */\n maxSpeed: Measurement;\n\n}\n\nexport namespace DeviceDefinition {\n export const __type = 'DeviceDefinition';\n\n /** @internal */\n export function toProtobuf(source: DeviceDefinition | null | undefined): gateway.TranslatorDefinition {\n const pbData = new gateway.TranslatorDefinition();\n if (source == null) {\n return pbData;\n }\n\n pbData.setDeviceId(source.deviceId);\n pbData.setAxesList(source.axes.map(item => AxisDefinition.toProtobuf(item)));\n pbData.setMaxSpeed(Measurement.toProtobuf(source.maxSpeed));\n return pbData;\n }\n}\n"]}
1
+ {"version":3,"file":"device_definition.js","sourceRoot":"","sources":["../../../src/gcode/device_definition.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,uDAAmD;AACnD,gDAA6C;AAyB7C,IAAiB,gBAAgB,CAehC;AAfD,WAAiB,gBAAgB;IAClB,uBAAM,GAAG,kBAAkB,CAAC;IAEzC,gBAAgB;IAChB,SAAgB,UAAU,CAAC,MAA2C;QACpE,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC;QAClD,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,OAAO,MAAM,CAAC;SACf;QAED,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACpC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,gCAAc,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7E,MAAM,CAAC,WAAW,CAAC,yBAAW,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC5D,OAAO,MAAM,CAAC;IAChB,CAAC;IAVe,2BAAU,aAUzB,CAAA;AACH,CAAC,EAfgB,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAehC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport { AxisDefinition } from './axis_definition';\nimport { Measurement } from '../measurement';\n\n/**\n * Holds information about device and its axes for purpose of a translator.\n */\nexport interface DeviceDefinition {\n /**\n * Device ID of the controller.\n * Can be obtained from device settings.\n */\n deviceId: number;\n\n /**\n * Applicable axes of the device.\n */\n axes: AxisDefinition[];\n\n /**\n * The smallest of each axis' maxspeed setting value.\n * This value becomes the traverse rate of the translator.\n */\n maxSpeed: Measurement;\n\n}\n\nexport namespace DeviceDefinition {\n export const __type = 'DeviceDefinition';\n\n /** @internal */\n export function toProtobuf(source: DeviceDefinition | null | undefined): gateway.TranslatorDefinition {\n const pbData = new gateway.TranslatorDefinition();\n if (source == null) {\n return pbData;\n }\n\n pbData.setDeviceId(source.deviceId);\n pbData.setAxesList(source.axes.map(item => AxisDefinition.toProtobuf(item)));\n pbData.setMaxSpeed(Measurement.toProtobuf(source.maxSpeed));\n return pbData;\n }\n}\n"]}
@@ -3,7 +3,11 @@
3
3
  // ============= DO NOT EDIT DIRECTLY ============= //
4
4
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
5
  if (k2 === undefined) k2 = k;
6
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
7
11
  }) : (function(o, m, k, k2) {
8
12
  if (k2 === undefined) k2 = k;
9
13
  o[k2] = m[k];