@zaber/motion 2.11.2 → 2.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/LICENSE +1538 -3009
  2. package/dist/binding/wasm/zaber-motion-lib.wasm +0 -0
  3. package/dist/lib/ascii/all_axes.js +8 -8
  4. package/dist/lib/ascii/all_axes.js.map +1 -1
  5. package/dist/lib/ascii/axis.d.ts +39 -6
  6. package/dist/lib/ascii/axis.js +77 -24
  7. package/dist/lib/ascii/axis.js.map +1 -1
  8. package/dist/lib/ascii/axis_settings.d.ts +19 -0
  9. package/dist/lib/ascii/axis_settings.js +48 -4
  10. package/dist/lib/ascii/axis_settings.js.map +1 -1
  11. package/dist/lib/ascii/connection.d.ts +2 -0
  12. package/dist/lib/ascii/connection.js +13 -11
  13. package/dist/lib/ascii/connection.js.map +1 -1
  14. package/dist/lib/ascii/device.d.ts +7 -0
  15. package/dist/lib/ascii/device.js +22 -13
  16. package/dist/lib/ascii/device.js.map +1 -1
  17. package/dist/lib/ascii/device_io.js +5 -5
  18. package/dist/lib/ascii/device_io.js.map +1 -1
  19. package/dist/lib/ascii/device_settings.d.ts +19 -0
  20. package/dist/lib/ascii/device_settings.js +45 -4
  21. package/dist/lib/ascii/device_settings.js.map +1 -1
  22. package/dist/lib/ascii/index.d.ts +1 -0
  23. package/dist/lib/ascii/index.js +4 -1
  24. package/dist/lib/ascii/index.js.map +1 -1
  25. package/dist/lib/ascii/lockstep.d.ts +33 -6
  26. package/dist/lib/ascii/lockstep.js +61 -16
  27. package/dist/lib/ascii/lockstep.js.map +1 -1
  28. package/dist/lib/ascii/oscilloscope.js +5 -5
  29. package/dist/lib/ascii/oscilloscope.js.map +1 -1
  30. package/dist/lib/ascii/oscilloscope_data.d.ts +1 -7
  31. package/dist/lib/ascii/oscilloscope_data.js +7 -24
  32. package/dist/lib/ascii/oscilloscope_data.js.map +1 -1
  33. package/dist/lib/ascii/servo_tuner.d.ts +11 -0
  34. package/dist/lib/ascii/servo_tuner.js +26 -4
  35. package/dist/lib/ascii/servo_tuner.js.map +1 -1
  36. package/dist/lib/ascii/setting_constants.d.ts +124 -0
  37. package/dist/lib/ascii/setting_constants.js +124 -0
  38. package/dist/lib/ascii/setting_constants.js.map +1 -1
  39. package/dist/lib/ascii/storage.d.ts +98 -0
  40. package/dist/lib/ascii/storage.js +220 -0
  41. package/dist/lib/ascii/storage.js.map +1 -0
  42. package/dist/lib/ascii/stream.d.ts +5 -5
  43. package/dist/lib/ascii/stream.js +19 -19
  44. package/dist/lib/ascii/stream.js.map +1 -1
  45. package/dist/lib/ascii/transport.js +2 -2
  46. package/dist/lib/ascii/transport.js.map +1 -1
  47. package/dist/lib/ascii_ns.d.ts +4 -0
  48. package/dist/lib/ascii_ns.js +2 -0
  49. package/dist/lib/ascii_ns.js.map +1 -1
  50. package/dist/lib/binary/connection.js +7 -7
  51. package/dist/lib/binary/connection.js.map +1 -1
  52. package/dist/lib/binary/device.js +30 -30
  53. package/dist/lib/binary/device.js.map +1 -1
  54. package/dist/lib/binary/device_settings.js +1 -1
  55. package/dist/lib/binary/device_settings.js.map +1 -1
  56. package/dist/lib/exceptions/command_too_long_exception.d.ts +14 -0
  57. package/dist/lib/exceptions/command_too_long_exception.js +32 -0
  58. package/dist/lib/exceptions/command_too_long_exception.js.map +1 -0
  59. package/dist/lib/exceptions/command_too_long_exception_data.d.ts +24 -0
  60. package/dist/lib/exceptions/command_too_long_exception_data.js +20 -0
  61. package/dist/lib/exceptions/command_too_long_exception_data.js.map +1 -0
  62. package/dist/lib/exceptions/index.d.ts +3 -0
  63. package/dist/lib/exceptions/index.js +8 -2
  64. package/dist/lib/exceptions/index.js.map +1 -1
  65. package/dist/lib/exceptions/no_value_for_key_exception.d.ts +7 -0
  66. package/dist/lib/exceptions/no_value_for_key_exception.js +17 -0
  67. package/dist/lib/exceptions/no_value_for_key_exception.js.map +1 -0
  68. package/dist/lib/gateway/convert_exceptions.js +2 -0
  69. package/dist/lib/gateway/convert_exceptions.js.map +1 -1
  70. package/dist/lib/gcode/offline_translator.js +3 -3
  71. package/dist/lib/gcode/offline_translator.js.map +1 -1
  72. package/dist/lib/gcode/translator.js +3 -3
  73. package/dist/lib/gcode/translator.js.map +1 -1
  74. package/dist/lib/protobufs/main_pb.d.ts +564 -1738
  75. package/dist/lib/protobufs/main_pb.js +12002 -20930
  76. package/dist/lib/protobufs/main_pb.js.map +1 -1
  77. package/dist/lib/tools.js +1 -1
  78. package/dist/lib/tools.js.map +1 -1
  79. package/dist/lib/units.d.ts +63 -1
  80. package/dist/lib/units.js +70 -1
  81. package/dist/lib/units.js.map +1 -1
  82. package/package.json +3 -2
@@ -90,7 +90,7 @@ class DeviceIO {
90
90
  request.setDevice(this._device.deviceAddress);
91
91
  request.setChannelType('di');
92
92
  request.setChannelNumber(channelNumber);
93
- const response = await gateway.callAsync('device/get_digital_io', request, gateway.DeviceGetDigitalIOResponse);
93
+ const response = await gateway.callAsync('device/get_digital_io', request, gateway.BoolResponse);
94
94
  return response.getValue();
95
95
  }
96
96
  /**
@@ -104,7 +104,7 @@ class DeviceIO {
104
104
  request.setDevice(this._device.deviceAddress);
105
105
  request.setChannelType('do');
106
106
  request.setChannelNumber(channelNumber);
107
- const response = await gateway.callAsync('device/get_digital_io', request, gateway.DeviceGetDigitalIOResponse);
107
+ const response = await gateway.callAsync('device/get_digital_io', request, gateway.BoolResponse);
108
108
  return response.getValue();
109
109
  }
110
110
  /**
@@ -118,7 +118,7 @@ class DeviceIO {
118
118
  request.setDevice(this._device.deviceAddress);
119
119
  request.setChannelType('ai');
120
120
  request.setChannelNumber(channelNumber);
121
- const response = await gateway.callAsync('device/get_analog_io', request, gateway.DeviceGetAnalogIOResponse);
121
+ const response = await gateway.callAsync('device/get_analog_io', request, gateway.DoubleResponse);
122
122
  return response.getValue();
123
123
  }
124
124
  /**
@@ -132,7 +132,7 @@ class DeviceIO {
132
132
  request.setDevice(this._device.deviceAddress);
133
133
  request.setChannelType('ao');
134
134
  request.setChannelNumber(channelNumber);
135
- const response = await gateway.callAsync('device/get_analog_io', request, gateway.DeviceGetAnalogIOResponse);
135
+ const response = await gateway.callAsync('device/get_analog_io', request, gateway.DoubleResponse);
136
136
  return response.getValue();
137
137
  }
138
138
  /**
@@ -188,7 +188,7 @@ class DeviceIO {
188
188
  * @return An object containing the number of I/O channels the device has.
189
189
  */
190
190
  async getChannelsInfo() {
191
- const request = new gateway.DeviceGetIOChannelsInfoRequest();
191
+ const request = new gateway.DeviceEmptyRequest();
192
192
  request.setInterfaceId(this._device.connection.interfaceId);
193
193
  request.setDevice(this._device.deviceAddress);
194
194
  const response = await gateway.callAsync('device/get_io_info', request, gateway.DeviceIOInfo);
@@ -1 +1 @@
1
- {"version":3,"file":"device_io.js","sourceRoot":"","sources":["../../../src/ascii/device_io.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAGtD,oDAAsC;AACtC,qDAAgD;AAEhD;;GAEG;AACH,MAAa,QAAQ;IAGnB,YAAY,MAAc;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,mBAAmB;QAC9B,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,4BAA4B,EAAE,CAAC;QAC3D,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,cAAc,CAAC,IAAI,CAAC,CAAC;QAE7B,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,2BAA2B,EAC3B,OAAO,EACP,OAAO,CAAC,6BAA6B,CAAC,CAAC;QACzC,OAAO,QAAQ,CAAC,aAAa,EAAE,CAAC;IAClC,CAAC;IAED;;;OAGG;IACI,KAAK,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,EACrB,KAAa;QAEb,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,4BAA4B,EAAE,CAAC;QAC3D,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,gBAAgB,CAAC,aAAa,CAAC,CAAC;QACxC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAExB,MAAM,OAAO,CAAC,SAAS,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,eAAe;QAC1B,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,8BAA8B,EAAE,CAAC;QAC7D,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;QAE9C,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,oBAAoB,EACpB,OAAO,EACP,OAAO,CAAC,YAAY,CAAC,CAAC;QACxB,OAAO,6BAAY,CAAC,YAAY,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;IACxD,CAAC;CACF;AAhPD,4BAgPC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Device } from './device';\nimport * as gateway from '../gateway';\nimport { DeviceIOInfo } from './device_io_info';\n\n/**\n * Class providing access to the I/O channels of the device.\n */\nexport class DeviceIO {\n private _device: Device;\n\n constructor(device: Device) {\n this._device = device;\n }\n\n /**\n * Returns the current values of all digital input channels.\n * @return True if voltage is present on the input channel and false otherwise.\n */\n public async getAllDigitalInputs(): Promise<boolean[]> {\n const request = new gateway.DeviceGetAllDigitalIORequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setChannelType('di');\n\n const response = await gateway.callAsync<gateway.DeviceGetAllDigitalIOResponse>(\n 'device/get_all_digital_io',\n request,\n gateway.DeviceGetAllDigitalIOResponse);\n return response.getValuesList();\n }\n\n /**\n * Returns the current values of all digital output channels.\n * @return True if the output channel is conducting and false otherwise.\n */\n public async getAllDigitalOutputs(): Promise<boolean[]> {\n const request = new gateway.DeviceGetAllDigitalIORequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setChannelType('do');\n\n const response = await gateway.callAsync<gateway.DeviceGetAllDigitalIOResponse>(\n 'device/get_all_digital_io',\n request,\n gateway.DeviceGetAllDigitalIOResponse);\n return response.getValuesList();\n }\n\n /**\n * Returns the current values of all analog input channels.\n * @return Measurements of the voltage present on the input channels.\n */\n public async getAllAnalogInputs(): Promise<number[]> {\n const request = new gateway.DeviceGetAllAnalogIORequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setChannelType('ai');\n\n const response = await gateway.callAsync<gateway.DeviceGetAllAnalogIOResponse>(\n 'device/get_all_analog_io',\n request,\n gateway.DeviceGetAllAnalogIOResponse);\n return response.getValuesList();\n }\n\n /**\n * Returns the current values of all analog output channels.\n * @return Measurements of voltage that the output channels are conducting.\n */\n public async getAllAnalogOutputs(): Promise<number[]> {\n const request = new gateway.DeviceGetAllAnalogIORequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setChannelType('ao');\n\n const response = await gateway.callAsync<gateway.DeviceGetAllAnalogIOResponse>(\n 'device/get_all_analog_io',\n request,\n gateway.DeviceGetAllAnalogIOResponse);\n return response.getValuesList();\n }\n\n /**\n * Returns the current value of the specified digital input channel.\n * @param channelNumber Channel number starting at 1.\n * @return True if voltage is present on the input channel and false otherwise.\n */\n public async getDigitalInput(\n channelNumber: number\n ): Promise<boolean> {\n const request = new gateway.DeviceGetDigitalIORequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setChannelType('di');\n request.setChannelNumber(channelNumber);\n\n const response = await gateway.callAsync<gateway.DeviceGetDigitalIOResponse>(\n 'device/get_digital_io',\n request,\n gateway.DeviceGetDigitalIOResponse);\n return response.getValue();\n }\n\n /**\n * Returns the current value of the specified digital output channel.\n * @param channelNumber Channel number starting at 1.\n * @return True if the output channel is conducting and false otherwise.\n */\n public async getDigitalOutput(\n channelNumber: number\n ): Promise<boolean> {\n const request = new gateway.DeviceGetDigitalIORequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setChannelType('do');\n request.setChannelNumber(channelNumber);\n\n const response = await gateway.callAsync<gateway.DeviceGetDigitalIOResponse>(\n 'device/get_digital_io',\n request,\n gateway.DeviceGetDigitalIOResponse);\n return response.getValue();\n }\n\n /**\n * Returns the current value of the specified analog input channel.\n * @param channelNumber Channel number starting at 1.\n * @return A measurementsof the voltage present on the input channel.\n */\n public async getAnalogInput(\n channelNumber: number\n ): Promise<number> {\n const request = new gateway.DeviceGetAnalogIORequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setChannelType('ai');\n request.setChannelNumber(channelNumber);\n\n const response = await gateway.callAsync<gateway.DeviceGetAnalogIOResponse>(\n 'device/get_analog_io',\n request,\n gateway.DeviceGetAnalogIOResponse);\n return response.getValue();\n }\n\n /**\n * Returns the current values of the specified analog output channel.\n * @param channelNumber Channel number starting at 1.\n * @return A measurement of voltage that the output channel is conducting.\n */\n public async getAnalogOutput(\n channelNumber: number\n ): Promise<number> {\n const request = new gateway.DeviceGetAnalogIORequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setChannelType('ao');\n request.setChannelNumber(channelNumber);\n\n const response = await gateway.callAsync<gateway.DeviceGetAnalogIOResponse>(\n 'device/get_analog_io',\n request,\n gateway.DeviceGetAnalogIOResponse);\n return response.getValue();\n }\n\n /**\n * Sets values for all digital output channels.\n * @param values True to set the output channel to conducting and false to turn it off.\n */\n public async setAllDigitalOutputs(\n values: boolean[]\n ): Promise<void> {\n const request = new gateway.DeviceSetAllDigitalOutputsRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setValuesList(values);\n\n await gateway.callAsync('device/set_all_digital_outputs', request);\n }\n\n /**\n * Sets values for all analog output channels.\n * @param values Voltage values to set the output channels to.\n */\n public async setAllAnalogOutputs(\n values: number[]\n ): Promise<void> {\n const request = new gateway.DeviceSetAllAnalogOutputsRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setValuesList(values);\n\n await gateway.callAsync('device/set_all_analog_outputs', request);\n }\n\n /**\n * Sets value for the specified digital output channel.\n * @param channelNumber Channel number starting at 1.\n * @param value True to set the output channel to conducting and false to turn it off.\n */\n public async setDigitalOutput(\n channelNumber: number,\n value: boolean\n ): Promise<void> {\n const request = new gateway.DeviceSetDigitalOutputRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setChannelNumber(channelNumber);\n request.setValue(value);\n\n await gateway.callAsync('device/set_digital_output', request);\n }\n\n /**\n * Sets value for the specified analog output channel.\n * @param channelNumber Channel number starting at 1.\n * @param value Value to set the output channel voltage to.\n */\n public async setAnalogOutput(\n channelNumber: number,\n value: number\n ): Promise<void> {\n const request = new gateway.DeviceSetAnalogOutputRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setChannelNumber(channelNumber);\n request.setValue(value);\n\n await gateway.callAsync('device/set_analog_output', request);\n }\n\n /**\n * Returns the number of I/O channels the device has.\n * @return An object containing the number of I/O channels the device has.\n */\n public async getChannelsInfo(): Promise<DeviceIOInfo> {\n const request = new gateway.DeviceGetIOChannelsInfoRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n\n const response = await gateway.callAsync<gateway.DeviceIOInfo>(\n 'device/get_io_info',\n request,\n gateway.DeviceIOInfo);\n return DeviceIOInfo.fromProtobuf(response.toObject());\n }\n}\n"]}
1
+ {"version":3,"file":"device_io.js","sourceRoot":"","sources":["../../../src/ascii/device_io.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAGtD,oDAAsC;AACtC,qDAAgD;AAEhD;;GAEG;AACH,MAAa,QAAQ;IAGnB,YAAY,MAAc;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,mBAAmB;QAC9B,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,4BAA4B,EAAE,CAAC;QAC3D,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,cAAc,CAAC,IAAI,CAAC,CAAC;QAE7B,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,2BAA2B,EAC3B,OAAO,EACP,OAAO,CAAC,6BAA6B,CAAC,CAAC;QACzC,OAAO,QAAQ,CAAC,aAAa,EAAE,CAAC;IAClC,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,oBAAoB;QAC/B,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,4BAA4B,EAAE,CAAC;QAC3D,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,cAA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,aAAa,CAAC,CAAC;QACxC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAExB,MAAM,OAAO,CAAC,SAAS,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,eAAe;QAC1B,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;QACjD,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;QAE9C,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,oBAAoB,EACpB,OAAO,EACP,OAAO,CAAC,YAAY,CAAC,CAAC;QACxB,OAAO,6BAAY,CAAC,YAAY,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;IACxD,CAAC;CACF;AAhPD,4BAgPC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Device } from './device';\nimport * as gateway from '../gateway';\nimport { DeviceIOInfo } from './device_io_info';\n\n/**\n * Class providing access to the I/O channels of the device.\n */\nexport class DeviceIO {\n private _device: Device;\n\n constructor(device: Device) {\n this._device = device;\n }\n\n /**\n * Returns the current values of all digital input channels.\n * @return True if voltage is present on the input channel and false otherwise.\n */\n public async getAllDigitalInputs(): Promise<boolean[]> {\n const request = new gateway.DeviceGetAllDigitalIORequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setChannelType('di');\n\n const response = await gateway.callAsync<gateway.DeviceGetAllDigitalIOResponse>(\n 'device/get_all_digital_io',\n request,\n gateway.DeviceGetAllDigitalIOResponse);\n return response.getValuesList();\n }\n\n /**\n * Returns the current values of all digital output channels.\n * @return True if the output channel is conducting and false otherwise.\n */\n public async getAllDigitalOutputs(): Promise<boolean[]> {\n const request = new gateway.DeviceGetAllDigitalIORequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setChannelType('do');\n\n const response = await gateway.callAsync<gateway.DeviceGetAllDigitalIOResponse>(\n 'device/get_all_digital_io',\n request,\n gateway.DeviceGetAllDigitalIOResponse);\n return response.getValuesList();\n }\n\n /**\n * Returns the current values of all analog input channels.\n * @return Measurements of the voltage present on the input channels.\n */\n public async getAllAnalogInputs(): Promise<number[]> {\n const request = new gateway.DeviceGetAllAnalogIORequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setChannelType('ai');\n\n const response = await gateway.callAsync<gateway.DeviceGetAllAnalogIOResponse>(\n 'device/get_all_analog_io',\n request,\n gateway.DeviceGetAllAnalogIOResponse);\n return response.getValuesList();\n }\n\n /**\n * Returns the current values of all analog output channels.\n * @return Measurements of voltage that the output channels are conducting.\n */\n public async getAllAnalogOutputs(): Promise<number[]> {\n const request = new gateway.DeviceGetAllAnalogIORequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setChannelType('ao');\n\n const response = await gateway.callAsync<gateway.DeviceGetAllAnalogIOResponse>(\n 'device/get_all_analog_io',\n request,\n gateway.DeviceGetAllAnalogIOResponse);\n return response.getValuesList();\n }\n\n /**\n * Returns the current value of the specified digital input channel.\n * @param channelNumber Channel number starting at 1.\n * @return True if voltage is present on the input channel and false otherwise.\n */\n public async getDigitalInput(\n channelNumber: number\n ): Promise<boolean> {\n const request = new gateway.DeviceGetDigitalIORequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setChannelType('di');\n request.setChannelNumber(channelNumber);\n\n const response = await gateway.callAsync<gateway.BoolResponse>(\n 'device/get_digital_io',\n request,\n gateway.BoolResponse);\n return response.getValue();\n }\n\n /**\n * Returns the current value of the specified digital output channel.\n * @param channelNumber Channel number starting at 1.\n * @return True if the output channel is conducting and false otherwise.\n */\n public async getDigitalOutput(\n channelNumber: number\n ): Promise<boolean> {\n const request = new gateway.DeviceGetDigitalIORequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setChannelType('do');\n request.setChannelNumber(channelNumber);\n\n const response = await gateway.callAsync<gateway.BoolResponse>(\n 'device/get_digital_io',\n request,\n gateway.BoolResponse);\n return response.getValue();\n }\n\n /**\n * Returns the current value of the specified analog input channel.\n * @param channelNumber Channel number starting at 1.\n * @return A measurementsof the voltage present on the input channel.\n */\n public async getAnalogInput(\n channelNumber: number\n ): Promise<number> {\n const request = new gateway.DeviceGetAnalogIORequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setChannelType('ai');\n request.setChannelNumber(channelNumber);\n\n const response = await gateway.callAsync<gateway.DoubleResponse>(\n 'device/get_analog_io',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Returns the current values of the specified analog output channel.\n * @param channelNumber Channel number starting at 1.\n * @return A measurement of voltage that the output channel is conducting.\n */\n public async getAnalogOutput(\n channelNumber: number\n ): Promise<number> {\n const request = new gateway.DeviceGetAnalogIORequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setChannelType('ao');\n request.setChannelNumber(channelNumber);\n\n const response = await gateway.callAsync<gateway.DoubleResponse>(\n 'device/get_analog_io',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Sets values for all digital output channels.\n * @param values True to set the output channel to conducting and false to turn it off.\n */\n public async setAllDigitalOutputs(\n values: boolean[]\n ): Promise<void> {\n const request = new gateway.DeviceSetAllDigitalOutputsRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setValuesList(values);\n\n await gateway.callAsync('device/set_all_digital_outputs', request);\n }\n\n /**\n * Sets values for all analog output channels.\n * @param values Voltage values to set the output channels to.\n */\n public async setAllAnalogOutputs(\n values: number[]\n ): Promise<void> {\n const request = new gateway.DeviceSetAllAnalogOutputsRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setValuesList(values);\n\n await gateway.callAsync('device/set_all_analog_outputs', request);\n }\n\n /**\n * Sets value for the specified digital output channel.\n * @param channelNumber Channel number starting at 1.\n * @param value True to set the output channel to conducting and false to turn it off.\n */\n public async setDigitalOutput(\n channelNumber: number,\n value: boolean\n ): Promise<void> {\n const request = new gateway.DeviceSetDigitalOutputRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setChannelNumber(channelNumber);\n request.setValue(value);\n\n await gateway.callAsync('device/set_digital_output', request);\n }\n\n /**\n * Sets value for the specified analog output channel.\n * @param channelNumber Channel number starting at 1.\n * @param value Value to set the output channel voltage to.\n */\n public async setAnalogOutput(\n channelNumber: number,\n value: number\n ): Promise<void> {\n const request = new gateway.DeviceSetAnalogOutputRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setChannelNumber(channelNumber);\n request.setValue(value);\n\n await gateway.callAsync('device/set_analog_output', request);\n }\n\n /**\n * Returns the number of I/O channels the device has.\n * @return An object containing the number of I/O channels the device has.\n */\n public async getChannelsInfo(): Promise<DeviceIOInfo> {\n const request = new gateway.DeviceEmptyRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n\n const response = await gateway.callAsync<gateway.DeviceIOInfo>(\n 'device/get_io_info',\n request,\n gateway.DeviceIOInfo);\n return DeviceIOInfo.fromProtobuf(response.toObject());\n }\n}\n"]}
@@ -52,4 +52,23 @@ export declare class DeviceSettings {
52
52
  * @return Setting value.
53
53
  */
54
54
  convertFromNativeUnits(setting: string, value: number, unit: Units): number;
55
+ /**
56
+ * Returns the default value of a setting.
57
+ * @param setting Name of the setting.
58
+ * @param unit Units of setting.
59
+ * @return Default setting value.
60
+ */
61
+ getDefault(setting: string, unit?: Units): number;
62
+ /**
63
+ * Returns the default value of a setting as a string.
64
+ * @param setting Name of the setting.
65
+ * @return Default setting value.
66
+ */
67
+ getDefaultString(setting: string): string;
68
+ /**
69
+ * Indicates if given setting can be converted from and to native units.
70
+ * @param setting Name of the setting.
71
+ * @return True if unit conversion can be performed.
72
+ */
73
+ canConvertNativeUnits(setting: string): boolean;
55
74
  }
@@ -44,7 +44,7 @@ class DeviceSettings {
44
44
  request.setDevice(this._device.deviceAddress);
45
45
  request.setSetting(setting);
46
46
  request.setUnit(unit);
47
- const response = await gateway.callAsync('device/get_setting', request, gateway.DeviceGetSettingResponse);
47
+ const response = await gateway.callAsync('device/get_setting', request, gateway.DoubleResponse);
48
48
  return response.getValue();
49
49
  }
50
50
  /**
@@ -74,7 +74,7 @@ class DeviceSettings {
74
74
  request.setInterfaceId(this._device.connection.interfaceId);
75
75
  request.setDevice(this._device.deviceAddress);
76
76
  request.setSetting(setting);
77
- const response = await gateway.callAsync('device/get_setting_str', request, gateway.DeviceGetSettingStrResponse);
77
+ const response = await gateway.callAsync('device/get_setting_str', request, gateway.StringResponse);
78
78
  return response.getValue();
79
79
  }
80
80
  /**
@@ -105,7 +105,7 @@ class DeviceSettings {
105
105
  request.setSetting(setting);
106
106
  request.setValue(value);
107
107
  request.setUnit(unit);
108
- const response = gateway.callSync('device/convert_setting', request, gateway.DeviceConvertSettingResponse);
108
+ const response = gateway.callSync('device/convert_setting', request, gateway.DoubleResponse);
109
109
  return response.getValue();
110
110
  }
111
111
  /**
@@ -123,7 +123,48 @@ class DeviceSettings {
123
123
  request.setSetting(setting);
124
124
  request.setValue(value);
125
125
  request.setUnit(unit);
126
- const response = gateway.callSync('device/convert_setting', request, gateway.DeviceConvertSettingResponse);
126
+ const response = gateway.callSync('device/convert_setting', request, gateway.DoubleResponse);
127
+ return response.getValue();
128
+ }
129
+ /**
130
+ * Returns the default value of a setting.
131
+ * @param setting Name of the setting.
132
+ * @param unit Units of setting.
133
+ * @return Default setting value.
134
+ */
135
+ getDefault(setting, unit = units_1.Units.NATIVE) {
136
+ const request = new gateway.DeviceGetSettingRequest();
137
+ request.setInterfaceId(this._device.connection.interfaceId);
138
+ request.setDevice(this._device.deviceAddress);
139
+ request.setSetting(setting);
140
+ request.setUnit(unit);
141
+ const response = gateway.callSync('device/get_setting_default', request, gateway.DoubleResponse);
142
+ return response.getValue();
143
+ }
144
+ /**
145
+ * Returns the default value of a setting as a string.
146
+ * @param setting Name of the setting.
147
+ * @return Default setting value.
148
+ */
149
+ getDefaultString(setting) {
150
+ const request = new gateway.DeviceGetSettingRequest();
151
+ request.setInterfaceId(this._device.connection.interfaceId);
152
+ request.setDevice(this._device.deviceAddress);
153
+ request.setSetting(setting);
154
+ const response = gateway.callSync('device/get_setting_default_str', request, gateway.StringResponse);
155
+ return response.getValue();
156
+ }
157
+ /**
158
+ * Indicates if given setting can be converted from and to native units.
159
+ * @param setting Name of the setting.
160
+ * @return True if unit conversion can be performed.
161
+ */
162
+ canConvertNativeUnits(setting) {
163
+ const request = new gateway.DeviceGetSettingRequest();
164
+ request.setInterfaceId(this._device.connection.interfaceId);
165
+ request.setDevice(this._device.deviceAddress);
166
+ request.setSetting(setting);
167
+ const response = gateway.callSync('device/can_convert_setting', request, gateway.BoolResponse);
127
168
  return response.getValue();
128
169
  }
129
170
  }
@@ -1 +1 @@
1
- {"version":3,"file":"device_settings.js","sourceRoot":"","sources":["../../../src/ascii/device_settings.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAGtD,oCAAiC;AACjC,oDAAsC;AAEtC;;GAEG;AACH,MAAa,cAAc;IAGzB,YAAY,MAAc;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,GAAG,CACd,OAAe,EACf,OAAc,aAAK,CAAC,MAAM;Q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,CAC/B,wBAAwB,EACxB,OAAO,EACP,OAAO,CAAC,4BAA4B,CAAC,CAAC;QACxC,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;IAED;;;;;;OAMG;IACI,sBAAsB,CAC3B,OAAe,EACf,KAAa,EACb,IAAW;QAEX,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,2BAA2B,EAAE,CAAC;QAC1D,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,aAAa,CAAC,IAAI,CAAC,CAAC;QAC5B,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC5B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACxB,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAEtB,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,wBAAwB,EACxB,OAAO,EACP,OAAO,CAAC,4BAA4B,CAAC,CAAC;QACxC,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;CACF;AAjJD,wCAiJC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Device } from './device';\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 * For more information refer to the [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_settings).\n * @param setting Name of the setting.\n * @param unit Units of setting.\n * @return Setting value.\n */\n public async get(\n setting: string,\n unit: Units = Units.NATIVE\n ): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setSetting(setting);\n request.setUnit(unit);\n\n const response = await gateway.callAsync<gateway.DeviceGetSettingResponse>(\n 'device/get_setting',\n request,\n gateway.DeviceGetSettingResponse);\n return response.getValue();\n }\n\n /**\n * Sets any device setting.\n * For more information refer to the [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_settings).\n * @param setting Name of the setting.\n * @param value Value of the setting.\n * @param unit Units of setting.\n */\n public async set(\n setting: string,\n value: number,\n unit: Units = Units.NATIVE\n ): Promise<void> {\n const request = new gateway.DeviceSetSettingRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setSetting(setting);\n request.setValue(value);\n request.setUnit(unit);\n\n await gateway.callAsync('device/set_setting', request);\n }\n\n /**\n * Returns any device setting or property as a string.\n * For more information refer to the [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_settings).\n * @param setting Name of the setting.\n * @return Setting value.\n */\n public async getString(\n setting: string\n ): Promise<string> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setSetting(setting);\n\n const response = await gateway.callAsync<gateway.DeviceGetSettingStrResponse>(\n 'device/get_setting_str',\n request,\n gateway.DeviceGetSettingStrResponse);\n return response.getValue();\n }\n\n /**\n * Sets any device setting as a string.\n * For more information refer to the [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_settings).\n * @param setting Name of the setting.\n * @param value Value of the setting.\n */\n public async setString(\n setting: string,\n value: string\n ): Promise<void> {\n const request = new gateway.DeviceSetSettingStrRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setSetting(setting);\n request.setValue(value);\n\n await gateway.callAsync('device/set_setting_str', request);\n }\n\n /**\n * Convert arbitrary setting value to Zaber native units.\n * @param setting Name of the setting.\n * @param value Value of the setting in units specified by following argument.\n * @param unit Units of the value.\n * @return Setting value.\n */\n public convertToNativeUnits(\n setting: string,\n value: number,\n unit: Units\n ): number {\n const request = new gateway.DeviceConvertSettingRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setSetting(setting);\n request.setValue(value);\n request.setUnit(unit);\n\n const response = gateway.callSync<gateway.DeviceConvertSettingResponse>(\n 'device/convert_setting',\n request,\n gateway.DeviceConvertSettingResponse);\n return response.getValue();\n }\n\n /**\n * Convert arbitrary setting value from Zaber native units.\n * @param setting Name of the setting.\n * @param value Value of the setting in Zaber native units.\n * @param unit Units to convert value to.\n * @return Setting value.\n */\n public convertFromNativeUnits(\n setting: string,\n value: number,\n unit: Units\n ): number {\n const request = new gateway.DeviceConvertSettingRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setFromNative(true);\n request.setSetting(setting);\n request.setValue(value);\n request.setUnit(unit);\n\n const response = gateway.callSync<gateway.DeviceConvertSettingResponse>(\n 'device/convert_setting',\n request,\n gateway.DeviceConvertSettingResponse);\n return response.getValue();\n }\n}\n"]}
1
+ {"version":3,"file":"device_settings.js","sourceRoot":"","sources":["../../../src/ascii/device_settings.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAGtD,oCAAiC;AACjC,oDAAsC;AAEtC;;GAEG;AACH,MAAa,cAAc;IAGzB,YAAY,MAAc;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,GAAG,CACd,OAAe,EACf,OAAc,aAAK,CAAC,MAAM;QAE1B,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,uBAAuB,EAAE,CAAC;QACtD,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC5D,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,OAA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AC;QACtD,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,OAAO,CAAC,CAAC;QAE5B,MAAM,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;;;;OAIG;IACI,qBAAqB,CAC1B,OAAe;QAEf,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,uBAAuB,EAAE,CAAC;QACtD,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,OAAO,CAAC,CAAC;QAE5B,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,4BAA4B,EAC5B,OAAO,EACP,OAAO,CAAC,YAAY,CAAC,CAAC;QACxB,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;CACF;AAhND,wCAgNC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Device } from './device';\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 * For more information refer to the [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_settings).\n * @param setting Name of the setting.\n * @param unit Units of setting.\n * @return Setting value.\n */\n public async get(\n setting: string,\n unit: Units = Units.NATIVE\n ): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setSetting(setting);\n request.setUnit(unit);\n\n const response = await gateway.callAsync<gateway.DoubleResponse>(\n 'device/get_setting',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Sets any device setting.\n * For more information refer to the [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_settings).\n * @param setting Name of the setting.\n * @param value Value of the setting.\n * @param unit Units of setting.\n */\n public async set(\n setting: string,\n value: number,\n unit: Units = Units.NATIVE\n ): Promise<void> {\n const request = new gateway.DeviceSetSettingRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setSetting(setting);\n request.setValue(value);\n request.setUnit(unit);\n\n await gateway.callAsync('device/set_setting', request);\n }\n\n /**\n * Returns any device setting or property as a string.\n * For more information refer to the [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_settings).\n * @param setting Name of the setting.\n * @return Setting value.\n */\n public async getString(\n setting: string\n ): Promise<string> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setSetting(setting);\n\n const response = await gateway.callAsync<gateway.StringResponse>(\n 'device/get_setting_str',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n\n /**\n * Sets any device setting as a string.\n * For more information refer to the [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_settings).\n * @param setting Name of the setting.\n * @param value Value of the setting.\n */\n public async setString(\n setting: string,\n value: string\n ): Promise<void> {\n const request = new gateway.DeviceSetSettingStrRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setSetting(setting);\n request.setValue(value);\n\n await gateway.callAsync('device/set_setting_str', request);\n }\n\n /**\n * Convert arbitrary setting value to Zaber native units.\n * @param setting Name of the setting.\n * @param value Value of the setting in units specified by following argument.\n * @param unit Units of the value.\n * @return Setting value.\n */\n public convertToNativeUnits(\n setting: string,\n value: number,\n unit: Units\n ): number {\n const request = new gateway.DeviceConvertSettingRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setSetting(setting);\n request.setValue(value);\n request.setUnit(unit);\n\n const response = gateway.callSync<gateway.DoubleResponse>(\n 'device/convert_setting',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Convert arbitrary setting value from Zaber native units.\n * @param setting Name of the setting.\n * @param value Value of the setting in Zaber native units.\n * @param unit Units to convert value to.\n * @return Setting value.\n */\n public convertFromNativeUnits(\n setting: string,\n value: number,\n unit: Units\n ): number {\n const request = new gateway.DeviceConvertSettingRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setFromNative(true);\n request.setSetting(setting);\n request.setValue(value);\n request.setUnit(unit);\n\n const response = gateway.callSync<gateway.DoubleResponse>(\n 'device/convert_setting',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Returns the default value of a setting.\n * @param setting Name of the setting.\n * @param unit Units of setting.\n * @return Default setting value.\n */\n public getDefault(\n setting: string,\n unit: Units = Units.NATIVE\n ): number {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setSetting(setting);\n request.setUnit(unit);\n\n const response = gateway.callSync<gateway.DoubleResponse>(\n 'device/get_setting_default',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Returns the default value of a setting as a string.\n * @param setting Name of the setting.\n * @return Default setting value.\n */\n public getDefaultString(\n setting: string\n ): string {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setSetting(setting);\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'device/get_setting_default_str',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n\n /**\n * Indicates if given setting can be converted from and to native units.\n * @param setting Name of the setting.\n * @return True if unit conversion can be performed.\n */\n public canConvertNativeUnits(\n setting: string\n ): boolean {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this._device.connection.interfaceId);\n request.setDevice(this._device.deviceAddress);\n request.setSetting(setting);\n\n const response = gateway.callSync<gateway.BoolResponse>(\n 'device/can_convert_setting',\n request,\n gateway.BoolResponse);\n return response.getValue();\n }\n}\n"]}
@@ -33,3 +33,4 @@ export { ParamsetInfo } from './paramset_info';
33
33
  export { PidTuning } from './pid_tuning';
34
34
  export { ServoTuningParam } from './servo_tuning_param';
35
35
  export { SimpleTuningParam } from './simple_tuning_param';
36
+ export { AxisStorage, DeviceStorage } from './storage';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SimpleTuningParam = exports.ServoTuningParam = exports.PidTuning = exports.ParamsetInfo = exports.ServoTuningParamset = exports.ServoTuner = exports.Transport = exports.StreamAxisDefinition = exports.StreamAxisType = exports.StreamMode = exports.StreamBuffer = exports.Stream = exports.OscilloscopeCaptureProperties = exports.OscilloscopeData = exports.Oscilloscope = exports.LockstepAxes = exports.Lockstep = exports.Warnings = exports.WarningFlags = exports.UnknownResponseEvent = exports.SettingConstants = exports.Response = exports.MessageType = exports.DeviceIOInfo = exports.DeviceIO = exports.Device = exports.DeviceSettings = exports.DeviceIdentity = exports.Connection = exports.Axis = exports.AxisType = exports.AxisSettings = exports.AxisIdentity = exports.AllAxes = exports.AlertEvent = void 0;
3
+ exports.DeviceStorage = exports.AxisStorage = exports.SimpleTuningParam = exports.ServoTuningParam = exports.PidTuning = exports.ParamsetInfo = exports.ServoTuningParamset = exports.ServoTuner = exports.Transport = exports.StreamAxisDefinition = exports.StreamAxisType = exports.StreamMode = exports.StreamBuffer = exports.Stream = exports.OscilloscopeCaptureProperties = exports.OscilloscopeData = exports.Oscilloscope = exports.LockstepAxes = exports.Lockstep = exports.Warnings = exports.WarningFlags = exports.UnknownResponseEvent = exports.SettingConstants = exports.Response = exports.MessageType = exports.DeviceIOInfo = exports.DeviceIO = exports.Device = exports.DeviceSettings = exports.DeviceIdentity = exports.Connection = exports.Axis = exports.AxisType = exports.AxisSettings = exports.AxisIdentity = exports.AllAxes = exports.AlertEvent = void 0;
4
4
  var alert_event_1 = require("./alert_event");
5
5
  Object.defineProperty(exports, "AlertEvent", { enumerable: true, get: function () { return alert_event_1.AlertEvent; } });
6
6
  var all_axes_1 = require("./all_axes");
@@ -71,4 +71,7 @@ var servo_tuning_param_1 = require("./servo_tuning_param");
71
71
  Object.defineProperty(exports, "ServoTuningParam", { enumerable: true, get: function () { return servo_tuning_param_1.ServoTuningParam; } });
72
72
  var simple_tuning_param_1 = require("./simple_tuning_param");
73
73
  Object.defineProperty(exports, "SimpleTuningParam", { enumerable: true, get: function () { return simple_tuning_param_1.SimpleTuningParam; } });
74
+ var storage_1 = require("./storage");
75
+ Object.defineProperty(exports, "AxisStorage", { enumerable: true, get: function () { return storage_1.AxisStorage; } });
76
+ Object.defineProperty(exports, "DeviceStorage", { enumerable: true, get: function () { return storage_1.DeviceStorage; } });
74
77
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ascii/index.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,uCAAqC;AAA5B,mGAAA,OAAO,OAAA;AAChB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA;AACjB,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AACvB,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AACvB,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA;AACjB,mDAAgD;AAAvC,8GAAA,YAAY,OAAA;AACrB,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AACpB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AACzB,mEAAgE;AAAvD,8HAAA,oBAAoB,OAAA;AAC7B,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AACzB,qFAAkF;AAAzE,gJAAA,6BAA6B,OAAA;AACtC,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,uDAAoD;AAA3C,kHAAA,cAAc,OAAA;AACvB,mEAAgE;AAAvD,8HAAA,oBAAoB,OAAA;AAC7B,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAClB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,iEAA8D;AAArD,4HAAA,mBAAmB,OAAA;AAC5B,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,2CAAyC;AAAhC,uGAAA,SAAS,OAAA;AAClB,2DAAwD;AAA/C,sHAAA,gBAAgB,OAAA;AACzB,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA","sourcesContent":["export { AlertEvent } from './alert_event';\nexport { AllAxes } from './all_axes';\nexport { AxisIdentity } from './axis_identity';\nexport { AxisSettings } from './axis_settings';\nexport { AxisType } from './axis_type';\nexport { Axis } from './axis';\nexport { Connection } from './connection';\nexport { DeviceIdentity } from './device_identity';\nexport { DeviceSettings } from './device_settings';\nexport { Device } from './device';\nexport { DeviceIO } from './device_io';\nexport { DeviceIOInfo } from './device_io_info';\nexport { MessageType } from './message_type';\nexport { Response } from './response';\nexport { SettingConstants } from './setting_constants';\nexport { UnknownResponseEvent } from './unknown_response_event';\nexport { WarningFlags } from './warning_flags';\nexport { Warnings } from './warnings';\nexport { Lockstep } from './lockstep';\nexport { LockstepAxes } from './lockstep_axes';\nexport { Oscilloscope } from './oscilloscope';\nexport { OscilloscopeData } from './oscilloscope_data';\nexport { OscilloscopeCaptureProperties } from './oscilloscope_capture_properties';\nexport { Stream } from './stream';\nexport { StreamBuffer } from './stream_buffer';\nexport { StreamMode } from './stream_mode';\nexport { StreamAxisType } from './stream_axis_type';\nexport { StreamAxisDefinition } from './stream_axis_definition';\nexport { Transport } from './transport';\nexport { ServoTuner } from './servo_tuner';\nexport { ServoTuningParamset } from './servo_tuning_paramset';\nexport { ParamsetInfo } from './paramset_info';\nexport { PidTuning } from './pid_tuning';\nexport { ServoTuningParam } from './servo_tuning_param';\nexport { SimpleTuningParam } from './simple_tuning_param';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ascii/index.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,uCAAqC;AAA5B,mGAAA,OAAO,OAAA;AAChB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA;AACjB,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AACvB,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AACvB,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA;AACjB,mDAAgD;AAAvC,8GAAA,YAAY,OAAA;AACrB,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AACpB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AACzB,mEAAgE;AAAvD,8HAAA,oBAAoB,OAAA;AAC7B,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AACzB,qFAAkF;AAAzE,gJAAA,6BAA6B,OAAA;AACtC,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,uDAAoD;AAA3C,kHAAA,cAAc,OAAA;AACvB,mEAAgE;AAAvD,8HAAA,oBAAoB,OAAA;AAC7B,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAClB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,iEAA8D;AAArD,4HAAA,mBAAmB,OAAA;AAC5B,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,2CAAyC;AAAhC,uGAAA,SAAS,OAAA;AAClB,2DAAwD;AAA/C,sHAAA,gBAAgB,OAAA;AACzB,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAC1B,qCAAuD;AAA9C,sGAAA,WAAW,OAAA;AAAE,wGAAA,aAAa,OAAA","sourcesContent":["export { AlertEvent } from './alert_event';\nexport { AllAxes } from './all_axes';\nexport { AxisIdentity } from './axis_identity';\nexport { AxisSettings } from './axis_settings';\nexport { AxisType } from './axis_type';\nexport { Axis } from './axis';\nexport { Connection } from './connection';\nexport { DeviceIdentity } from './device_identity';\nexport { DeviceSettings } from './device_settings';\nexport { Device } from './device';\nexport { DeviceIO } from './device_io';\nexport { DeviceIOInfo } from './device_io_info';\nexport { MessageType } from './message_type';\nexport { Response } from './response';\nexport { SettingConstants } from './setting_constants';\nexport { UnknownResponseEvent } from './unknown_response_event';\nexport { WarningFlags } from './warning_flags';\nexport { Warnings } from './warnings';\nexport { Lockstep } from './lockstep';\nexport { LockstepAxes } from './lockstep_axes';\nexport { Oscilloscope } from './oscilloscope';\nexport { OscilloscopeData } from './oscilloscope_data';\nexport { OscilloscopeCaptureProperties } from './oscilloscope_capture_properties';\nexport { Stream } from './stream';\nexport { StreamBuffer } from './stream_buffer';\nexport { StreamMode } from './stream_mode';\nexport { StreamAxisType } from './stream_axis_type';\nexport { StreamAxisDefinition } from './stream_axis_definition';\nexport { Transport } from './transport';\nexport { ServoTuner } from './servo_tuner';\nexport { ServoTuningParamset } from './servo_tuning_paramset';\nexport { ParamsetInfo } from './paramset_info';\nexport { PidTuning } from './pid_tuning';\nexport { ServoTuningParam } from './servo_tuning_param';\nexport { SimpleTuningParam } from './simple_tuning_param';\nexport { AxisStorage, DeviceStorage } from './storage';\n"]}
@@ -1,5 +1,5 @@
1
1
  import { Device } from './device';
2
- import { Angle, Length, Native, AngularVelocity, Velocity } from '../units';
2
+ import { Angle, Length, Native, AngularVelocity, Velocity, Acceleration, AngularAcceleration } from '../units';
3
3
  import { LockstepAxes } from './lockstep_axes';
4
4
  /**
5
5
  * Represents a lockstep group with this ID on a device.
@@ -42,37 +42,64 @@ export declare class Lockstep {
42
42
  * @param position Absolute position.
43
43
  * @param unit Units of position.
44
44
  * @param waitUntilIdle Determines whether function should return after the movement is finished or just started.
45
+ * @param velocity Movement velocity.
46
+ * Default value of 0 indicates that the maxspeed setting is used instead.
47
+ * @param velocityUnit Units of velocity.
48
+ * @param acceleration Movement acceleration.
49
+ * Default value of 0 indicates that the accel setting is used instead.
50
+ * @param accelerationUnit Units of acceleration.
45
51
  */
46
- moveAbsolute(position: number, unit?: Length | Angle | Native, waitUntilIdle?: boolean): Promise<void>;
52
+ moveAbsolute(position: number, unit?: Length | Angle | Native, waitUntilIdle?: boolean, velocity?: number, velocityUnit?: Velocity | AngularVelocity | Native, acceleration?: number, accelerationUnit?: Acceleration | AngularAcceleration | Native): Promise<void>;
47
53
  /**
48
54
  * Move the first axis of the lockstep group to a position relative to its current position.
49
55
  * The other axes in the lockstep group maintain their offsets throughout movement.
50
56
  * @param position Relative position.
51
57
  * @param unit Units of position.
52
58
  * @param waitUntilIdle Determines whether function should return after the movement is finished or just started.
59
+ * @param velocity Movement velocity.
60
+ * Default value of 0 indicates that the maxspeed setting is used instead.
61
+ * @param velocityUnit Units of velocity.
62
+ * @param acceleration Movement acceleration.
63
+ * Default value of 0 indicates that the accel setting is used instead.
64
+ * @param accelerationUnit Units of acceleration.
53
65
  */
54
- moveRelative(position: number, unit?: Length | Angle | Native, waitUntilIdle?: boolean): Promise<void>;
66
+ moveRelative(position: number, unit?: Length | Angle | Native, waitUntilIdle?: boolean, velocity?: number, velocityUnit?: Velocity | AngularVelocity | Native, acceleration?: number, accelerationUnit?: Acceleration | AngularAcceleration | Native): Promise<void>;
55
67
  /**
56
68
  * Moves the first axis of the lockstep group at the specified speed.
57
69
  * The other axes in the lockstep group maintain their offsets throughout movement.
58
70
  * @param velocity Movement velocity.
59
71
  * @param unit Units of velocity.
72
+ * @param acceleration Movement acceleration.
73
+ * Default value of 0 indicates that the accel setting is used instead.
74
+ * @param accelerationUnit Units of acceleration.
60
75
  */
61
- moveVelocity(velocity: number, unit?: Velocity | AngularVelocity | Native): Promise<void>;
76
+ moveVelocity(velocity: number, unit?: Velocity | AngularVelocity | Native, acceleration?: number, accelerationUnit?: Acceleration | AngularAcceleration | Native): Promise<void>;
62
77
  /**
63
78
  * Moves the axes to the maximum valid position.
64
79
  * The axes in the lockstep group maintain their offsets throughout movement.
65
80
  * Respects lim.max for all axes in the group.
66
81
  * @param waitUntilIdle Determines whether function should return after the movement is finished or just started.
82
+ * @param velocity Movement velocity.
83
+ * Default value of 0 indicates that the maxspeed setting is used instead.
84
+ * @param velocityUnit Units of velocity.
85
+ * @param acceleration Movement acceleration.
86
+ * Default value of 0 indicates that the accel setting is used instead.
87
+ * @param accelerationUnit Units of acceleration.
67
88
  */
68
- moveMax(waitUntilIdle?: boolean): Promise<void>;
89
+ moveMax(waitUntilIdle?: boolean, velocity?: number, velocityUnit?: Velocity | AngularVelocity | Native, acceleration?: number, accelerationUnit?: Acceleration | AngularAcceleration | Native): Promise<void>;
69
90
  /**
70
91
  * Moves the axes to the minimum valid position.
71
92
  * The axes in the lockstep group maintain their offsets throughout movement.
72
93
  * Respects lim.min for all axes in the group.
73
94
  * @param waitUntilIdle Determines whether function should return after the movement is finished or just started.
95
+ * @param velocity Movement velocity.
96
+ * Default value of 0 indicates that the maxspeed setting is used instead.
97
+ * @param velocityUnit Units of velocity.
98
+ * @param acceleration Movement acceleration.
99
+ * Default value of 0 indicates that the accel setting is used instead.
100
+ * @param accelerationUnit Units of acceleration.
74
101
  */
75
- moveMin(waitUntilIdle?: boolean): Promise<void>;
102
+ moveMin(waitUntilIdle?: boolean, velocity?: number, velocityUnit?: Velocity | AngularVelocity | Native, acceleration?: number, accelerationUnit?: Acceleration | AngularAcceleration | Native): Promise<void>;
76
103
  /**
77
104
  * Waits until the lockstep group stops moving.
78
105
  * @param throwErrorOnFault Determines whether to throw error when fault is observed.
@@ -98,8 +98,14 @@ class Lockstep {
98
98
  * @param position Absolute position.
99
99
  * @param unit Units of position.
100
100
  * @param waitUntilIdle Determines whether function should return after the movement is finished or just started.
101
+ * @param velocity Movement velocity.
102
+ * Default value of 0 indicates that the maxspeed setting is used instead.
103
+ * @param velocityUnit Units of velocity.
104
+ * @param acceleration Movement acceleration.
105
+ * Default value of 0 indicates that the accel setting is used instead.
106
+ * @param accelerationUnit Units of acceleration.
101
107
  */
102
- async moveAbsolute(position, unit = units_1.Units.NATIVE, waitUntilIdle = true) {
108
+ async moveAbsolute(position, unit = units_1.Units.NATIVE, waitUntilIdle = true, velocity = 0, velocityUnit = units_1.Units.NATIVE, acceleration = 0, accelerationUnit = units_1.Units.NATIVE) {
103
109
  const request = new gateway.LockstepMoveRequest();
104
110
  request.setInterfaceId(this.device.connection.interfaceId);
105
111
  request.setDevice(this.device.deviceAddress);
@@ -108,6 +114,10 @@ class Lockstep {
108
114
  request.setArg(position);
109
115
  request.setUnit(unit);
110
116
  request.setWaitUntilIdle(waitUntilIdle);
117
+ request.setVelocity(velocity);
118
+ request.setVelocityUnit(velocityUnit);
119
+ request.setAcceleration(acceleration);
120
+ request.setAccelerationUnit(accelerationUnit);
111
121
  await gateway.callAsync('device/lockstep_move', request);
112
122
  }
113
123
  /**
@@ -116,8 +126,14 @@ class Lockstep {
116
126
  * @param position Relative position.
117
127
  * @param unit Units of position.
118
128
  * @param waitUntilIdle Determines whether function should return after the movement is finished or just started.
129
+ * @param velocity Movement velocity.
130
+ * Default value of 0 indicates that the maxspeed setting is used instead.
131
+ * @param velocityUnit Units of velocity.
132
+ * @param acceleration Movement acceleration.
133
+ * Default value of 0 indicates that the accel setting is used instead.
134
+ * @param accelerationUnit Units of acceleration.
119
135
  */
120
- async moveRelative(position, unit = units_1.Units.NATIVE, waitUntilIdle = true) {
136
+ async moveRelative(position, unit = units_1.Units.NATIVE, waitUntilIdle = true, velocity = 0, velocityUnit = units_1.Units.NATIVE, acceleration = 0, accelerationUnit = units_1.Units.NATIVE) {
121
137
  const request = new gateway.LockstepMoveRequest();
122
138
  request.setInterfaceId(this.device.connection.interfaceId);
123
139
  request.setDevice(this.device.deviceAddress);
@@ -126,6 +142,10 @@ class Lockstep {
126
142
  request.setArg(position);
127
143
  request.setUnit(unit);
128
144
  request.setWaitUntilIdle(waitUntilIdle);
145
+ request.setVelocity(velocity);
146
+ request.setVelocityUnit(velocityUnit);
147
+ request.setAcceleration(acceleration);
148
+ request.setAccelerationUnit(accelerationUnit);
129
149
  await gateway.callAsync('device/lockstep_move', request);
130
150
  }
131
151
  /**
@@ -133,8 +153,11 @@ class Lockstep {
133
153
  * The other axes in the lockstep group maintain their offsets throughout movement.
134
154
  * @param velocity Movement velocity.
135
155
  * @param unit Units of velocity.
156
+ * @param acceleration Movement acceleration.
157
+ * Default value of 0 indicates that the accel setting is used instead.
158
+ * @param accelerationUnit Units of acceleration.
136
159
  */
137
- async moveVelocity(velocity, unit = units_1.Units.NATIVE) {
160
+ async moveVelocity(velocity, unit = units_1.Units.NATIVE, acceleration = 0, accelerationUnit = units_1.Units.NATIVE) {
138
161
  const request = new gateway.LockstepMoveRequest();
139
162
  request.setInterfaceId(this.device.connection.interfaceId);
140
163
  request.setDevice(this.device.deviceAddress);
@@ -142,6 +165,8 @@ class Lockstep {
142
165
  request.setType(gateway.LockstepMoveRequest.MoveType.VEL);
143
166
  request.setArg(velocity);
144
167
  request.setUnit(unit);
168
+ request.setAcceleration(acceleration);
169
+ request.setAccelerationUnit(accelerationUnit);
145
170
  await gateway.callAsync('device/lockstep_move', request);
146
171
  }
147
172
  /**
@@ -149,14 +174,24 @@ class Lockstep {
149
174
  * The axes in the lockstep group maintain their offsets throughout movement.
150
175
  * Respects lim.max for all axes in the group.
151
176
  * @param waitUntilIdle Determines whether function should return after the movement is finished or just started.
177
+ * @param velocity Movement velocity.
178
+ * Default value of 0 indicates that the maxspeed setting is used instead.
179
+ * @param velocityUnit Units of velocity.
180
+ * @param acceleration Movement acceleration.
181
+ * Default value of 0 indicates that the accel setting is used instead.
182
+ * @param accelerationUnit Units of acceleration.
152
183
  */
153
- async moveMax(waitUntilIdle = true) {
184
+ async moveMax(waitUntilIdle = true, velocity = 0, velocityUnit = units_1.Units.NATIVE, acceleration = 0, accelerationUnit = units_1.Units.NATIVE) {
154
185
  const request = new gateway.LockstepMoveRequest();
155
186
  request.setInterfaceId(this.device.connection.interfaceId);
156
187
  request.setDevice(this.device.deviceAddress);
157
188
  request.setLockstepGroupId(this.lockstepGroupId);
158
189
  request.setType(gateway.LockstepMoveRequest.MoveType.MAX);
159
190
  request.setWaitUntilIdle(waitUntilIdle);
191
+ request.setVelocity(velocity);
192
+ request.setVelocityUnit(velocityUnit);
193
+ request.setAcceleration(acceleration);
194
+ request.setAccelerationUnit(accelerationUnit);
160
195
  await gateway.callAsync('device/lockstep_move', request);
161
196
  }
162
197
  /**
@@ -164,14 +199,24 @@ class Lockstep {
164
199
  * The axes in the lockstep group maintain their offsets throughout movement.
165
200
  * Respects lim.min for all axes in the group.
166
201
  * @param waitUntilIdle Determines whether function should return after the movement is finished or just started.
202
+ * @param velocity Movement velocity.
203
+ * Default value of 0 indicates that the maxspeed setting is used instead.
204
+ * @param velocityUnit Units of velocity.
205
+ * @param acceleration Movement acceleration.
206
+ * Default value of 0 indicates that the accel setting is used instead.
207
+ * @param accelerationUnit Units of acceleration.
167
208
  */
168
- async moveMin(waitUntilIdle = true) {
209
+ async moveMin(waitUntilIdle = true, velocity = 0, velocityUnit = units_1.Units.NATIVE, acceleration = 0, accelerationUnit = units_1.Units.NATIVE) {
169
210
  const request = new gateway.LockstepMoveRequest();
170
211
  request.setInterfaceId(this.device.connection.interfaceId);
171
212
  request.setDevice(this.device.deviceAddress);
172
213
  request.setLockstepGroupId(this.lockstepGroupId);
173
214
  request.setType(gateway.LockstepMoveRequest.MoveType.MIN);
174
215
  request.setWaitUntilIdle(waitUntilIdle);
216
+ request.setVelocity(velocity);
217
+ request.setVelocityUnit(velocityUnit);
218
+ request.setAcceleration(acceleration);
219
+ request.setAccelerationUnit(accelerationUnit);
175
220
  await gateway.callAsync('device/lockstep_move', request);
176
221
  }
177
222
  /**
@@ -191,12 +236,12 @@ class Lockstep {
191
236
  * @return True if the axes are currently executing a motion command.
192
237
  */
193
238
  async isBusy() {
194
- const request = new gateway.LockstepIsBusyRequest();
239
+ const request = new gateway.LockstepEmptyRequest();
195
240
  request.setInterfaceId(this.device.connection.interfaceId);
196
241
  request.setDevice(this.device.deviceAddress);
197
242
  request.setLockstepGroupId(this.lockstepGroupId);
198
- const response = await gateway.callAsync('device/lockstep_is_busy', request, gateway.LockstepIsBusyResponse);
199
- return response.getIsBusy();
243
+ const response = await gateway.callAsync('device/lockstep_is_busy', request, gateway.BoolResponse);
244
+ return response.getValue();
200
245
  }
201
246
  /**
202
247
  * @deprecated Use GetAxisNumbers instead.
@@ -205,7 +250,7 @@ class Lockstep {
205
250
  * @return LockstepAxes instance which contains the axes numbers of the lockstep group.
206
251
  */
207
252
  async getAxes() {
208
- const request = new gateway.LockstepGetAxesRequest();
253
+ const request = new gateway.LockstepEmptyRequest();
209
254
  request.setInterfaceId(this.device.connection.interfaceId);
210
255
  request.setDevice(this.device.deviceAddress);
211
256
  request.setLockstepGroupId(this.lockstepGroupId);
@@ -217,7 +262,7 @@ class Lockstep {
217
262
  * @return Axis numbers in order specified when enabling lockstep.
218
263
  */
219
264
  async getAxisNumbers() {
220
- const request = new gateway.LockstepGetAxisNumbersRequest();
265
+ const request = new gateway.LockstepEmptyRequest();
221
266
  request.setInterfaceId(this.device.connection.interfaceId);
222
267
  request.setDevice(this.device.deviceAddress);
223
268
  request.setLockstepGroupId(this.lockstepGroupId);
@@ -257,24 +302,24 @@ class Lockstep {
257
302
  * @return True if a lockstep group with this ID is enabled on the device.
258
303
  */
259
304
  async isEnabled() {
260
- const request = new gateway.LockstepIsEnabledRequest();
305
+ const request = new gateway.LockstepEmptyRequest();
261
306
  request.setInterfaceId(this.device.connection.interfaceId);
262
307
  request.setDevice(this.device.deviceAddress);
263
308
  request.setLockstepGroupId(this.lockstepGroupId);
264
- const response = await gateway.callAsync('device/lockstep_is_enabled', request, gateway.LockstepIsEnabledResponse);
265
- return response.getIsEnabled();
309
+ const response = await gateway.callAsync('device/lockstep_is_enabled', request, gateway.BoolResponse);
310
+ return response.getValue();
266
311
  }
267
312
  /**
268
313
  * Returns a string which represents the enabled lockstep group.
269
314
  * @return String which represents the enabled lockstep group.
270
315
  */
271
316
  toString() {
272
- const request = new gateway.LockstepToStringRequest();
317
+ const request = new gateway.LockstepEmptyRequest();
273
318
  request.setInterfaceId(this.device.connection.interfaceId);
274
319
  request.setDevice(this.device.deviceAddress);
275
320
  request.setLockstepGroupId(this.lockstepGroupId);
276
- const response = gateway.callSync('device/lockstep_to_string', request, gateway.LockstepToStringResponse);
277
- return response.getToStr();
321
+ const response = gateway.callSync('device/lockstep_to_string', request, gateway.StringResponse);
322
+ return response.getValue();
278
323
  }
279
324
  }
280
325
  exports.Lockstep = Lockstep;