@zaber/motion 2.15.4 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/dist/binding/wasm/zaber-motion-lib.wasm +0 -0
  2. package/dist/lib/ascii/all_axes.d.ts +21 -9
  3. package/dist/lib/ascii/all_axes.js +12 -9
  4. package/dist/lib/ascii/all_axes.js.map +1 -1
  5. package/dist/lib/ascii/axis.d.ts +116 -58
  6. package/dist/lib/ascii/axis.js +74 -58
  7. package/dist/lib/ascii/axis.js.map +1 -1
  8. package/dist/lib/ascii/axis_settings.d.ts +11 -10
  9. package/dist/lib/ascii/axis_settings.js +11 -10
  10. package/dist/lib/ascii/axis_settings.js.map +1 -1
  11. package/dist/lib/ascii/connection.d.ts +91 -68
  12. package/dist/lib/ascii/connection.js +60 -86
  13. package/dist/lib/ascii/connection.js.map +1 -1
  14. package/dist/lib/ascii/device.d.ts +46 -25
  15. package/dist/lib/ascii/device.js +31 -25
  16. package/dist/lib/ascii/device.js.map +1 -1
  17. package/dist/lib/ascii/device_io.d.ts +9 -9
  18. package/dist/lib/ascii/device_io.js +9 -9
  19. package/dist/lib/ascii/device_io.js.map +1 -1
  20. package/dist/lib/ascii/device_settings.d.ts +10 -10
  21. package/dist/lib/ascii/device_settings.js +10 -10
  22. package/dist/lib/ascii/device_settings.js.map +1 -1
  23. package/dist/lib/ascii/lockstep.d.ts +99 -49
  24. package/dist/lib/ascii/lockstep.js +63 -49
  25. package/dist/lib/ascii/lockstep.js.map +1 -1
  26. package/dist/lib/ascii/oscilloscope.d.ts +14 -13
  27. package/dist/lib/ascii/oscilloscope.js +14 -13
  28. package/dist/lib/ascii/oscilloscope.js.map +1 -1
  29. package/dist/lib/ascii/oscilloscope_data.d.ts +9 -9
  30. package/dist/lib/ascii/oscilloscope_data.js +9 -9
  31. package/dist/lib/ascii/oscilloscope_data.js.map +1 -1
  32. package/dist/lib/ascii/servo_tuner.d.ts +20 -10
  33. package/dist/lib/ascii/servo_tuner.js +13 -10
  34. package/dist/lib/ascii/servo_tuner.js.map +1 -1
  35. package/dist/lib/ascii/setting_constants.d.ts +2 -2
  36. package/dist/lib/ascii/setting_constants.js +2 -2
  37. package/dist/lib/ascii/setting_constants.js.map +1 -1
  38. package/dist/lib/ascii/storage.d.ts +49 -24
  39. package/dist/lib/ascii/storage.js +32 -24
  40. package/dist/lib/ascii/storage.js.map +1 -1
  41. package/dist/lib/ascii/stream.d.ts +29 -17
  42. package/dist/lib/ascii/stream.js +24 -17
  43. package/dist/lib/ascii/stream.js.map +1 -1
  44. package/dist/lib/ascii/stream_buffer.d.ts +1 -1
  45. package/dist/lib/ascii/stream_buffer.js +1 -1
  46. package/dist/lib/ascii/stream_buffer.js.map +1 -1
  47. package/dist/lib/ascii/transport.d.ts +2 -2
  48. package/dist/lib/ascii/transport.js +2 -2
  49. package/dist/lib/ascii/transport.js.map +1 -1
  50. package/dist/lib/ascii/warnings.d.ts +2 -2
  51. package/dist/lib/ascii/warnings.js +2 -2
  52. package/dist/lib/ascii/warnings.js.map +1 -1
  53. package/dist/lib/binary/connection.d.ts +46 -25
  54. package/dist/lib/binary/connection.js +30 -25
  55. package/dist/lib/binary/connection.js.map +1 -1
  56. package/dist/lib/binary/device.d.ts +66 -38
  57. package/dist/lib/binary/device.js +48 -38
  58. package/dist/lib/binary/device.js.map +1 -1
  59. package/dist/lib/binary/device_identity.d.ts +1 -0
  60. package/dist/lib/binary/device_identity.js.map +1 -1
  61. package/dist/lib/binary/device_settings.d.ts +3 -3
  62. package/dist/lib/binary/device_settings.js +3 -3
  63. package/dist/lib/binary/device_settings.js.map +1 -1
  64. package/dist/lib/exceptions/binary_command_failed_exception.js.map +1 -1
  65. package/dist/lib/exceptions/command_failed_exception.js.map +1 -1
  66. package/dist/lib/exceptions/command_preempted_exception.js.map +1 -1
  67. package/dist/lib/exceptions/command_too_long_exception.js.map +1 -1
  68. package/dist/lib/exceptions/connection_closed_exception.js.map +1 -1
  69. package/dist/lib/exceptions/connection_failed_exception.js.map +1 -1
  70. package/dist/lib/exceptions/conversion_failed_exception.js.map +1 -1
  71. package/dist/lib/exceptions/device_address_conflict_exception.js.map +1 -1
  72. package/dist/lib/exceptions/device_busy_exception.js.map +1 -1
  73. package/dist/lib/exceptions/device_db_failed_exception.js.map +1 -1
  74. package/dist/lib/exceptions/device_failed_exception.js.map +1 -1
  75. package/dist/lib/exceptions/device_not_identified_exception.js.map +1 -1
  76. package/dist/lib/exceptions/g_code_execution_exception.js.map +1 -1
  77. package/dist/lib/exceptions/g_code_syntax_exception.js.map +1 -1
  78. package/dist/lib/exceptions/internal_error_exception.js.map +1 -1
  79. package/dist/lib/exceptions/invalid_argument_exception.js.map +1 -1
  80. package/dist/lib/exceptions/invalid_data_exception.js.map +1 -1
  81. package/dist/lib/exceptions/invalid_operation_exception.js.map +1 -1
  82. package/dist/lib/exceptions/invalid_packet_exception.js.map +1 -1
  83. package/dist/lib/exceptions/invalid_park_state_exception.js.map +1 -1
  84. package/dist/lib/exceptions/invalid_response_exception.js.map +1 -1
  85. package/dist/lib/exceptions/io_channel_out_of_range_exception.js.map +1 -1
  86. package/dist/lib/exceptions/io_failed_exception.js.map +1 -1
  87. package/dist/lib/exceptions/lockstep_enabled_exception.js.map +1 -1
  88. package/dist/lib/exceptions/lockstep_not_enabled_exception.js.map +1 -1
  89. package/dist/lib/exceptions/motion_lib_exception.js.map +1 -1
  90. package/dist/lib/exceptions/movement_failed_exception.js.map +1 -1
  91. package/dist/lib/exceptions/movement_interrupted_exception.js.map +1 -1
  92. package/dist/lib/exceptions/no_device_found_exception.js.map +1 -1
  93. package/dist/lib/exceptions/no_value_for_key_exception.js.map +1 -1
  94. package/dist/lib/exceptions/not_supported_exception.js.map +1 -1
  95. package/dist/lib/exceptions/os_failed_exception.js.map +1 -1
  96. package/dist/lib/exceptions/out_of_request_ids_exception.js.map +1 -1
  97. package/dist/lib/exceptions/request_timeout_exception.js.map +1 -1
  98. package/dist/lib/exceptions/serial_port_busy_exception.js.map +1 -1
  99. package/dist/lib/exceptions/set_device_state_failed_exception.js.map +1 -1
  100. package/dist/lib/exceptions/set_peripheral_state_failed_exception.js.map +1 -1
  101. package/dist/lib/exceptions/setting_not_found_exception.js.map +1 -1
  102. package/dist/lib/exceptions/stream_execution_exception.js.map +1 -1
  103. package/dist/lib/exceptions/stream_mode_exception.js.map +1 -1
  104. package/dist/lib/exceptions/stream_movement_failed_exception.js.map +1 -1
  105. package/dist/lib/exceptions/stream_movement_interrupted_exception.js.map +1 -1
  106. package/dist/lib/exceptions/stream_setup_failed_exception.js.map +1 -1
  107. package/dist/lib/exceptions/transport_already_used_exception.js.map +1 -1
  108. package/dist/lib/exceptions/unknown_request_exception.js.map +1 -1
  109. package/dist/lib/gateway/events.js +4 -5
  110. package/dist/lib/gateway/events.js.map +1 -1
  111. package/dist/lib/gateway/serialization.js.map +1 -1
  112. package/dist/lib/gcode/offline_translator.d.ts +8 -7
  113. package/dist/lib/gcode/offline_translator.js +8 -7
  114. package/dist/lib/gcode/offline_translator.js.map +1 -1
  115. package/dist/lib/gcode/translator.d.ts +15 -8
  116. package/dist/lib/gcode/translator.js +10 -8
  117. package/dist/lib/gcode/translator.js.map +1 -1
  118. package/dist/lib/library.d.ts +3 -3
  119. package/dist/lib/library.js +3 -3
  120. package/dist/lib/library.js.map +1 -1
  121. package/dist/lib/tools.d.ts +3 -3
  122. package/dist/lib/tools.js +3 -3
  123. package/dist/lib/tools.js.map +1 -1
  124. package/dist/lib/wasm.js +1 -3
  125. package/dist/lib/wasm.js.map +1 -1
  126. package/package.json +2 -2
@@ -4,6 +4,7 @@ import { Native, Time } from '../units';
4
4
  /**
5
5
  * Provides a convenient way to control the oscilloscope data recording feature of some devices.
6
6
  * The oscilloscope can record the values of some settings over time at high resolution.
7
+ * Requires at least Firmware 7.00.
7
8
  */
8
9
  export declare class Oscilloscope {
9
10
  /**
@@ -24,57 +25,57 @@ export declare class Oscilloscope {
24
25
  clear(): Promise<void>;
25
26
  /**
26
27
  * Get the current sampling interval.
27
- * @param unit Unit of measure to represent the timebase in.
28
- * @return The current sampling interval in the selected time units.
28
+ * @param [unit=Units.NATIVE] Unit of measure to represent the timebase in.
29
+ * @returns The current sampling interval in the selected time units.
29
30
  */
30
31
  getTimebase(unit?: Time | Native): Promise<number>;
31
32
  /**
32
33
  * Set the sampling interval.
33
34
  * @param interval Sample interval for the next oscilloscope recording. Minimum value is 100µs.
34
- * @param unit Unit of measure the timebase is represented in.
35
+ * @param [unit=Units.NATIVE] Unit of measure the timebase is represented in.
35
36
  */
36
37
  setTimebase(interval: number, unit?: Time | Native): Promise<void>;
37
38
  /**
38
39
  * Get the delay before oscilloscope recording starts.
39
- * @param unit Unit of measure to represent the delay in.
40
- * @return The current start delay in the selected time units.
40
+ * @param [unit=Units.NATIVE] Unit of measure to represent the delay in.
41
+ * @returns The current start delay in the selected time units.
41
42
  */
42
43
  getDelay(unit?: Time | Native): Promise<number>;
43
44
  /**
44
45
  * Set the sampling start delay.
45
46
  * @param interval Delay time between triggering a recording and the first data point being recorded.
46
- * @param unit Unit of measure the delay is represented in.
47
+ * @param [unit=Units.NATIVE] Unit of measure the delay is represented in.
47
48
  */
48
49
  setDelay(interval: number, unit?: Time | Native): Promise<void>;
49
50
  /**
50
51
  * Get the maximum number of channels that can be recorded.
51
- * @return The maximum number of channels that can be added to an Oscilloscope recording.
52
+ * @returns The maximum number of channels that can be added to an Oscilloscope recording.
52
53
  */
53
54
  getMaxChannels(): Promise<number>;
54
55
  /**
55
56
  * Get the maximum number of samples that can be recorded per Oscilloscope channel.
56
- * @return The maximum number of samples that can be recorded per Oscilloscope channel.
57
+ * @returns The maximum number of samples that can be recorded per Oscilloscope channel.
57
58
  */
58
59
  getMaxBufferSize(): Promise<number>;
59
60
  /**
60
61
  * Get the number of samples that can be recorded per channel given the current number of channels added.
61
- * @return Number of samples that will be recorded per channel with the current channels. Zero if none have been added.
62
+ * @returns Number of samples that will be recorded per channel with the current channels. Zero if none have been added.
62
63
  */
63
64
  getBufferSize(): Promise<number>;
64
65
  /**
65
66
  * Trigger data recording.
66
- * @param captureLength Optional number of samples to record per channel.
67
+ * @param [captureLength=0] Optional number of samples to record per channel.
67
68
  * If left empty, the device records samples until the buffer fills.
68
- * Requires Firmware 7.29 or higher.
69
+ * Requires at least Firmware 7.29.
69
70
  */
70
71
  start(captureLength?: number): Promise<void>;
71
72
  /**
72
- * End data recording if currentlyin progress.
73
+ * End data recording if currently in progress.
73
74
  */
74
75
  stop(): Promise<void>;
75
76
  /**
76
77
  * Reads the last-recorded data from the oscilloscope. Will block until any in-progress recording completes.
77
- * @return Array of recorded channel data arrays, in the order added.
78
+ * @returns Array of recorded channel data arrays, in the order added.
78
79
  */
79
80
  read(): Promise<OscilloscopeData[]>;
80
81
  }
@@ -32,6 +32,7 @@ const gateway = __importStar(require("../gateway"));
32
32
  /**
33
33
  * Provides a convenient way to control the oscilloscope data recording feature of some devices.
34
34
  * The oscilloscope can record the values of some settings over time at high resolution.
35
+ * Requires at least Firmware 7.00.
35
36
  */
36
37
  class Oscilloscope {
37
38
  /**
@@ -67,8 +68,8 @@ class Oscilloscope {
67
68
  }
68
69
  /**
69
70
  * Get the current sampling interval.
70
- * @param unit Unit of measure to represent the timebase in.
71
- * @return The current sampling interval in the selected time units.
71
+ * @param [unit=Units.NATIVE] Unit of measure to represent the timebase in.
72
+ * @returns The current sampling interval in the selected time units.
72
73
  */
73
74
  async getTimebase(unit = units_1.Units.NATIVE) {
74
75
  const request = new gateway.DeviceGetSettingRequest();
@@ -82,7 +83,7 @@ class Oscilloscope {
82
83
  /**
83
84
  * Set the sampling interval.
84
85
  * @param interval Sample interval for the next oscilloscope recording. Minimum value is 100µs.
85
- * @param unit Unit of measure the timebase is represented in.
86
+ * @param [unit=Units.NATIVE] Unit of measure the timebase is represented in.
86
87
  */
87
88
  async setTimebase(interval, unit = units_1.Units.NATIVE) {
88
89
  const request = new gateway.DeviceSetSettingRequest();
@@ -95,8 +96,8 @@ class Oscilloscope {
95
96
  }
96
97
  /**
97
98
  * Get the delay before oscilloscope recording starts.
98
- * @param unit Unit of measure to represent the delay in.
99
- * @return The current start delay in the selected time units.
99
+ * @param [unit=Units.NATIVE] Unit of measure to represent the delay in.
100
+ * @returns The current start delay in the selected time units.
100
101
  */
101
102
  async getDelay(unit = units_1.Units.NATIVE) {
102
103
  const request = new gateway.DeviceGetSettingRequest();
@@ -110,7 +111,7 @@ class Oscilloscope {
110
111
  /**
111
112
  * Set the sampling start delay.
112
113
  * @param interval Delay time between triggering a recording and the first data point being recorded.
113
- * @param unit Unit of measure the delay is represented in.
114
+ * @param [unit=Units.NATIVE] Unit of measure the delay is represented in.
114
115
  */
115
116
  async setDelay(interval, unit = units_1.Units.NATIVE) {
116
117
  const request = new gateway.DeviceSetSettingRequest();
@@ -123,7 +124,7 @@ class Oscilloscope {
123
124
  }
124
125
  /**
125
126
  * Get the maximum number of channels that can be recorded.
126
- * @return The maximum number of channels that can be added to an Oscilloscope recording.
127
+ * @returns The maximum number of channels that can be added to an Oscilloscope recording.
127
128
  */
128
129
  async getMaxChannels() {
129
130
  const request = new gateway.DeviceGetSettingRequest();
@@ -135,7 +136,7 @@ class Oscilloscope {
135
136
  }
136
137
  /**
137
138
  * Get the maximum number of samples that can be recorded per Oscilloscope channel.
138
- * @return The maximum number of samples that can be recorded per Oscilloscope channel.
139
+ * @returns The maximum number of samples that can be recorded per Oscilloscope channel.
139
140
  */
140
141
  async getMaxBufferSize() {
141
142
  const request = new gateway.DeviceGetSettingRequest();
@@ -147,7 +148,7 @@ class Oscilloscope {
147
148
  }
148
149
  /**
149
150
  * Get the number of samples that can be recorded per channel given the current number of channels added.
150
- * @return Number of samples that will be recorded per channel with the current channels. Zero if none have been added.
151
+ * @returns Number of samples that will be recorded per channel with the current channels. Zero if none have been added.
151
152
  */
152
153
  async getBufferSize() {
153
154
  const request = new gateway.DeviceGetSettingRequest();
@@ -159,9 +160,9 @@ class Oscilloscope {
159
160
  }
160
161
  /**
161
162
  * Trigger data recording.
162
- * @param captureLength Optional number of samples to record per channel.
163
+ * @param [captureLength=0] Optional number of samples to record per channel.
163
164
  * If left empty, the device records samples until the buffer fills.
164
- * Requires Firmware 7.29 or higher.
165
+ * Requires at least Firmware 7.29.
165
166
  */
166
167
  async start(captureLength = 0) {
167
168
  const request = new gateway.OscilloscopeStartStopRequest();
@@ -172,7 +173,7 @@ class Oscilloscope {
172
173
  await gateway.callAsync('oscilloscope/start_or_stop', request);
173
174
  }
174
175
  /**
175
- * End data recording if currentlyin progress.
176
+ * End data recording if currently in progress.
176
177
  */
177
178
  async stop() {
178
179
  const request = new gateway.OscilloscopeStartStopRequest();
@@ -183,7 +184,7 @@ class Oscilloscope {
183
184
  }
184
185
  /**
185
186
  * Reads the last-recorded data from the oscilloscope. Will block until any in-progress recording completes.
186
- * @return Array of recorded channel data arrays, in the order added.
187
+ * @returns Array of recorded channel data arrays, in the order added.
187
188
  */
188
189
  async read() {
189
190
  const request = new gateway.DeviceEmptyRequest();
@@ -1 +1 @@
1
- {"version":3,"file":"oscilloscope.js","sourceRoot":"","sources":["../../../src/ascii/oscilloscope.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtD,2DAAuD;AACvD,oCAA+C;AAC/C,oDAAsC;AAEtC;;;GAGG;AACH,MAAa,YAAY;IACvB;;OAEG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAGD,YAAY,MAAc;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,UAAU,CACrB,IAAY,EACZ,OAAe;QAEf,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,6BAA6B,EAAE,CAAC;QAC5D,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3D,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QAC7C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAExB,MAAM,OAAO,CAAC,SAAS,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,IAAI;QACf,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;QACjD,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3D,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAE7C,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,mBAAmB,EACnB,OAAO,EACP,OAAO,CAAC,wBAAwB,CAAC,CAAC;QACpC,OAAO,QAAQ,CAAC,cAAc,EAAG,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,oCAAgB,CAAC,EAAE,CAAC,CAAC,CAAC;IACxE,CAAC;CACF;AA1ND,oCA0NC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Device } from './device';\nimport { OscilloscopeData } from './oscilloscope_data';\nimport { Native, Time, Units } from '../units';\nimport * as gateway from '../gateway';\n\n/**\n * Provides a convenient way to control the oscilloscope data recording feature of some devices.\n * The oscilloscope can record the values of some settings over time at high resolution.\n */\nexport class Oscilloscope {\n /**\n * Device that this Oscilloscope measures.\n */\n public get device(): Device {\n return this._device;\n }\n private _device: Device;\n\n constructor(device: Device) {\n this._device = device;\n }\n\n /**\n * Select a setting to be recorded.\n * @param axis The 1-based index of the axis to record the value from.\n * @param setting The name of a setting to record.\n */\n public async addChannel(\n axis: number,\n setting: string\n ): Promise<void> {\n const request = new gateway.OscilloscopeAddChannelRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(axis);\n request.setSetting(setting);\n\n await gateway.callAsync('oscilloscope/add_channel', request);\n }\n\n /**\n * Clear the list of channels to record.\n */\n public async clear(): Promise<void> {\n const request = new gateway.DeviceEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n\n await gateway.callAsync('oscilloscope/clear_channels', request);\n }\n\n /**\n * Get the current sampling interval.\n * @param unit Unit of measure to represent the timebase in.\n * @return The current sampling interval in the selected time units.\n */\n public async getTimebase(\n unit: Time | Native = Units.NATIVE\n ): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.timebase');\n request.setUnit(unit);\n\n const response = await gateway.callAsync<gateway.DoubleResponse>(\n 'device/get_setting',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Set the sampling interval.\n * @param interval Sample interval for the next oscilloscope recording. Minimum value is 100µs.\n * @param unit Unit of measure the timebase is represented in.\n */\n public async setTimebase(\n interval: number,\n unit: Time | Native = Units.NATIVE\n ): Promise<void> {\n const request = new gateway.DeviceSetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.timebase');\n request.setValue(interval);\n request.setUnit(unit);\n\n await gateway.callAsync('device/set_setting', request);\n }\n\n /**\n * Get the delay before oscilloscope recording starts.\n * @param unit Unit of measure to represent the delay in.\n * @return The current start delay in the selected time units.\n */\n public async getDelay(\n unit: Time | Native = Units.NATIVE\n ): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.delay');\n request.setUnit(unit);\n\n const response = await gateway.callAsync<gateway.DoubleResponse>(\n 'device/get_setting',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Set the sampling start delay.\n * @param interval Delay time between triggering a recording and the first data point being recorded.\n * @param unit Unit of measure the delay is represented in.\n */\n public async setDelay(\n interval: number,\n unit: Time | Native = Units.NATIVE\n ): Promise<void> {\n const request = new gateway.DeviceSetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.delay');\n request.setValue(interval);\n request.setUnit(unit);\n\n await gateway.callAsync('device/set_setting', request);\n }\n\n /**\n * Get the maximum number of channels that can be recorded.\n * @return The maximum number of channels that can be added to an Oscilloscope recording.\n */\n public async getMaxChannels(): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.numchannels');\n\n const response = await gateway.callAsync<gateway.IntResponse>(\n 'oscilloscope/get_setting',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Get the maximum number of samples that can be recorded per Oscilloscope channel.\n * @return The maximum number of samples that can be recorded per Oscilloscope channel.\n */\n public async getMaxBufferSize(): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.channel.size.max');\n\n const response = await gateway.callAsync<gateway.IntResponse>(\n 'oscilloscope/get_setting',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Get the number of samples that can be recorded per channel given the current number of channels added.\n * @return Number of samples that will be recorded per channel with the current channels. Zero if none have been added.\n */\n public async getBufferSize(): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.channel.size');\n\n const response = await gateway.callAsync<gateway.IntResponse>(\n 'oscilloscope/get_setting',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Trigger data recording.\n * @param captureLength Optional number of samples to record per channel.\n * If left empty, the device records samples until the buffer fills.\n * Requires Firmware 7.29 or higher.\n */\n public async start(\n captureLength: number = 0\n ): Promise<void> {\n const request = new gateway.OscilloscopeStartStopRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStart(true);\n request.setCaptureLength(captureLength);\n\n await gateway.callAsync('oscilloscope/start_or_stop', request);\n }\n\n /**\n * End data recording if currentlyin progress.\n */\n public async stop(): Promise<void> {\n const request = new gateway.OscilloscopeStartStopRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStart(false);\n\n await gateway.callAsync('oscilloscope/start_or_stop', request);\n }\n\n /**\n * Reads the last-recorded data from the oscilloscope. Will block until any in-progress recording completes.\n * @return Array of recorded channel data arrays, in the order added.\n */\n public async read(): Promise<OscilloscopeData[]> {\n const request = new gateway.DeviceEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n\n const response = await gateway.callAsync<gateway.OscilloscopeReadResponse>(\n 'oscilloscope/read',\n request,\n gateway.OscilloscopeReadResponse);\n return response.getDataIdsList()!.map(id => new OscilloscopeData(id));\n }\n}\n"]}
1
+ {"version":3,"file":"oscilloscope.js","sourceRoot":"","sources":["../../../src/ascii/oscilloscope.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtD,2DAAuD;AACvD,oCAA+C;AAC/C,oDAAsC;AAEtC;;;;GAIG;AACH,MAAa,YAAY;IACvB;;OAEG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAGD,YAAY,MAAc;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,UAAU,CACrB,IAAY,EACZ,OAAe;QAEf,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,6BAA6B,EAAE,CAAC;QAC5D,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,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,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAC7C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAExB,MAAM,OAAO,CAAC,SAAS,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,IAAI;QACf,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;QACjD,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3D,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAE7C,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,mBAAmB,EACnB,OAAO,EACP,OAAO,CAAC,wBAAwB,CAAC,CAAC;QACpC,OAAO,QAAQ,CAAC,cAAc,EAAG,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,oCAAgB,CAAC,EAAE,CAAC,CAAC,CAAC;IACxE,CAAC;CACF;AA1ND,oCA0NC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Device } from './device';\nimport { OscilloscopeData } from './oscilloscope_data';\nimport { Native, Time, Units } from '../units';\nimport * as gateway from '../gateway';\n\n/**\n * Provides a convenient way to control the oscilloscope data recording feature of some devices.\n * The oscilloscope can record the values of some settings over time at high resolution.\n * Requires at least Firmware 7.00.\n */\nexport class Oscilloscope {\n /**\n * Device that this Oscilloscope measures.\n */\n public get device(): Device {\n return this._device;\n }\n private _device: Device;\n\n constructor(device: Device) {\n this._device = device;\n }\n\n /**\n * Select a setting to be recorded.\n * @param axis The 1-based index of the axis to record the value from.\n * @param setting The name of a setting to record.\n */\n public async addChannel(\n axis: number,\n setting: string\n ): Promise<void> {\n const request = new gateway.OscilloscopeAddChannelRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(axis);\n request.setSetting(setting);\n\n await gateway.callAsync('oscilloscope/add_channel', request);\n }\n\n /**\n * Clear the list of channels to record.\n */\n public async clear(): Promise<void> {\n const request = new gateway.DeviceEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n\n await gateway.callAsync('oscilloscope/clear_channels', request);\n }\n\n /**\n * Get the current sampling interval.\n * @param [unit=Units.NATIVE] Unit of measure to represent the timebase in.\n * @returns The current sampling interval in the selected time units.\n */\n public async getTimebase(\n unit: Time | Native = Units.NATIVE\n ): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.timebase');\n request.setUnit(unit);\n\n const response = await gateway.callAsync<gateway.DoubleResponse>(\n 'device/get_setting',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Set the sampling interval.\n * @param interval Sample interval for the next oscilloscope recording. Minimum value is 100µs.\n * @param [unit=Units.NATIVE] Unit of measure the timebase is represented in.\n */\n public async setTimebase(\n interval: number,\n unit: Time | Native = Units.NATIVE\n ): Promise<void> {\n const request = new gateway.DeviceSetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.timebase');\n request.setValue(interval);\n request.setUnit(unit);\n\n await gateway.callAsync('device/set_setting', request);\n }\n\n /**\n * Get the delay before oscilloscope recording starts.\n * @param [unit=Units.NATIVE] Unit of measure to represent the delay in.\n * @returns The current start delay in the selected time units.\n */\n public async getDelay(\n unit: Time | Native = Units.NATIVE\n ): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.delay');\n request.setUnit(unit);\n\n const response = await gateway.callAsync<gateway.DoubleResponse>(\n 'device/get_setting',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Set the sampling start delay.\n * @param interval Delay time between triggering a recording and the first data point being recorded.\n * @param [unit=Units.NATIVE] Unit of measure the delay is represented in.\n */\n public async setDelay(\n interval: number,\n unit: Time | Native = Units.NATIVE\n ): Promise<void> {\n const request = new gateway.DeviceSetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.delay');\n request.setValue(interval);\n request.setUnit(unit);\n\n await gateway.callAsync('device/set_setting', request);\n }\n\n /**\n * Get the maximum number of channels that can be recorded.\n * @returns The maximum number of channels that can be added to an Oscilloscope recording.\n */\n public async getMaxChannels(): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.numchannels');\n\n const response = await gateway.callAsync<gateway.IntResponse>(\n 'oscilloscope/get_setting',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Get the maximum number of samples that can be recorded per Oscilloscope channel.\n * @returns The maximum number of samples that can be recorded per Oscilloscope channel.\n */\n public async getMaxBufferSize(): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.channel.size.max');\n\n const response = await gateway.callAsync<gateway.IntResponse>(\n 'oscilloscope/get_setting',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Get the number of samples that can be recorded per channel given the current number of channels added.\n * @returns Number of samples that will be recorded per channel with the current channels. Zero if none have been added.\n */\n public async getBufferSize(): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.channel.size');\n\n const response = await gateway.callAsync<gateway.IntResponse>(\n 'oscilloscope/get_setting',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Trigger data recording.\n * @param [captureLength=0] Optional number of samples to record per channel.\n * If left empty, the device records samples until the buffer fills.\n * Requires at least Firmware 7.29.\n */\n public async start(\n captureLength: number = 0\n ): Promise<void> {\n const request = new gateway.OscilloscopeStartStopRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStart(true);\n request.setCaptureLength(captureLength);\n\n await gateway.callAsync('oscilloscope/start_or_stop', request);\n }\n\n /**\n * End data recording if currently in progress.\n */\n public async stop(): Promise<void> {\n const request = new gateway.OscilloscopeStartStopRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStart(false);\n\n await gateway.callAsync('oscilloscope/start_or_stop', request);\n }\n\n /**\n * Reads the last-recorded data from the oscilloscope. Will block until any in-progress recording completes.\n * @returns Array of recorded channel data arrays, in the order added.\n */\n public async read(): Promise<OscilloscopeData[]> {\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.OscilloscopeReadResponse>(\n 'oscilloscope/read',\n request,\n gateway.OscilloscopeReadResponse);\n return response.getDataIdsList()!.map(id => new OscilloscopeData(id));\n }\n}\n"]}
@@ -19,28 +19,28 @@ export declare class OscilloscopeData {
19
19
  constructor(dataId: number);
20
20
  /**
21
21
  * Get the sample interval that this data was recorded with.
22
- * @param unit Unit of measure to represent the timebase in.
23
- * @return The timebase setting at the time the data was recorded.
22
+ * @param [unit=Units.NATIVE] Unit of measure to represent the timebase in.
23
+ * @returns The timebase setting at the time the data was recorded.
24
24
  */
25
25
  getTimebase(unit?: Time | Native): number;
26
26
  /**
27
27
  * Get the user-specified time period between receipt of the start command and the first data point.
28
28
  * Under some circumstances, the actual delay may be different - call GetSampleTime(0) to get the effective delay.
29
- * @param unit Unit of measure to represent the delay in.
30
- * @return The delay setting at the time the data was recorded.
29
+ * @param [unit=Units.NATIVE] Unit of measure to represent the delay in.
30
+ * @returns The delay setting at the time the data was recorded.
31
31
  */
32
32
  getDelay(unit?: Time | Native): number;
33
33
  /**
34
34
  * Calculate the time a sample was recorded, relative to when the recording was triggered.
35
35
  * @param index 0-based index of the sample to calculate the time of.
36
- * @param unit Unit of measure to represent the calculated time in.
37
- * @return The calculated time offset of the data sample at the given index.
36
+ * @param [unit=Units.NATIVE] Unit of measure to represent the calculated time in.
37
+ * @returns The calculated time offset of the data sample at the given index.
38
38
  */
39
39
  getSampleTime(index: number, unit?: Time | Native): number;
40
40
  /**
41
41
  * Get the recorded data as an array of doubles.
42
- * @param unit Unit of measure to convert the data to.
43
- * @return The recorded data for one oscilloscope channel, converted to the units specified.
42
+ * @param [unit=Units.NATIVE] Unit of measure to convert the data to.
43
+ * @returns The recorded data for one oscilloscope channel, converted to the units specified.
44
44
  */
45
45
  getData(unit?: Units): number[];
46
46
  /**
@@ -50,7 +50,7 @@ export declare class OscilloscopeData {
50
50
  private static _free;
51
51
  /**
52
52
  * Returns recording properties.
53
- * @return Capture properties.
53
+ * @returns Capture properties.
54
54
  */
55
55
  private _retrieveProperties;
56
56
  /**
@@ -58,8 +58,8 @@ class OscilloscopeData {
58
58
  }
59
59
  /**
60
60
  * Get the sample interval that this data was recorded with.
61
- * @param unit Unit of measure to represent the timebase in.
62
- * @return The timebase setting at the time the data was recorded.
61
+ * @param [unit=Units.NATIVE] Unit of measure to represent the timebase in.
62
+ * @returns The timebase setting at the time the data was recorded.
63
63
  */
64
64
  getTimebase(unit = units_1.Units.NATIVE) {
65
65
  const request = new gateway.OscilloscopeDataGetRequest();
@@ -71,8 +71,8 @@ class OscilloscopeData {
71
71
  /**
72
72
  * Get the user-specified time period between receipt of the start command and the first data point.
73
73
  * Under some circumstances, the actual delay may be different - call GetSampleTime(0) to get the effective delay.
74
- * @param unit Unit of measure to represent the delay in.
75
- * @return The delay setting at the time the data was recorded.
74
+ * @param [unit=Units.NATIVE] Unit of measure to represent the delay in.
75
+ * @returns The delay setting at the time the data was recorded.
76
76
  */
77
77
  getDelay(unit = units_1.Units.NATIVE) {
78
78
  const request = new gateway.OscilloscopeDataGetRequest();
@@ -84,8 +84,8 @@ class OscilloscopeData {
84
84
  /**
85
85
  * Calculate the time a sample was recorded, relative to when the recording was triggered.
86
86
  * @param index 0-based index of the sample to calculate the time of.
87
- * @param unit Unit of measure to represent the calculated time in.
88
- * @return The calculated time offset of the data sample at the given index.
87
+ * @param [unit=Units.NATIVE] Unit of measure to represent the calculated time in.
88
+ * @returns The calculated time offset of the data sample at the given index.
89
89
  */
90
90
  getSampleTime(index, unit = units_1.Units.NATIVE) {
91
91
  const request = new gateway.OscilloscopeDataGetSampleTimeRequest();
@@ -97,8 +97,8 @@ class OscilloscopeData {
97
97
  }
98
98
  /**
99
99
  * Get the recorded data as an array of doubles.
100
- * @param unit Unit of measure to convert the data to.
101
- * @return The recorded data for one oscilloscope channel, converted to the units specified.
100
+ * @param [unit=Units.NATIVE] Unit of measure to convert the data to.
101
+ * @returns The recorded data for one oscilloscope channel, converted to the units specified.
102
102
  */
103
103
  getData(unit = units_1.Units.NATIVE) {
104
104
  const request = new gateway.OscilloscopeDataGetRequest();
@@ -118,7 +118,7 @@ class OscilloscopeData {
118
118
  }
119
119
  /**
120
120
  * Returns recording properties.
121
- * @return Capture properties.
121
+ * @returns Capture properties.
122
122
  */
123
123
  _retrieveProperties() {
124
124
  const request = new gateway.OscilloscopeDataIdentifier();
@@ -1 +1 @@
1
- {"version":3,"file":"oscilloscope_data.js","sourceRoot":"","sources":["../../../src/ascii/oscilloscope_data.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oCAA+C;AAC/C,oDAAsC;AACtC,4CAAuD;AAEvD,uFAAkF;AAElF;;GAEG;AACH,MAAa,gBAAgB;IAC3B;;OAEG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC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CAAC,QAAQ,CAC/B,iCAAiC,EACjC,OAAO,EACP,OAAO,CAAC,6BAA6B,CAAC,CAAC;QACzC,OAAO,+DAA6B,CAAC,YAAY,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;;OAIG;IACI,IAAI;QACT,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;CACF;AAhJD,4CAgJC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Native, Time, Units } from '../units';\nimport * as gateway from '../gateway';\nimport { registerForFinalization } from '../finalizer';\n\nimport { OscilloscopeCaptureProperties } from './oscilloscope_capture_properties';\n\n/**\n * Contains a block of contiguous recorded data for one channel of the device's oscilloscope.\n */\nexport class OscilloscopeData {\n /**\n * Unique ID for this block of recorded data.\n */\n public get dataId(): number {\n return this._dataId;\n }\n private _dataId: number;\n\n /**\n * The name of the recorded setting.\n */\n public get setting(): string {\n return this._retrieveProperties().setting;\n }\n\n /**\n * The number of the axis the data was recorded from, or 0 for the controller.\n */\n public get axisNumber(): number {\n return this._retrieveProperties().axisNumber;\n }\n\n constructor(dataId: number) {\n this._dataId = dataId;\n registerForFinalization(this, OscilloscopeData._free.bind(null, dataId));\n }\n\n /**\n * Get the sample interval that this data was recorded with.\n * @param unit Unit of measure to represent the timebase in.\n * @return The timebase setting at the time the data was recorded.\n */\n public getTimebase(\n unit: Time | Native = Units.NATIVE\n ): number {\n const request = new gateway.OscilloscopeDataGetRequest();\n request.setDataId(this.dataId);\n request.setUnit(unit);\n\n const response = gateway.callSync<gateway.DoubleResponse>(\n 'oscilloscopedata/get_timebase',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Get the user-specified time period between receipt of the start command and the first data point.\n * Under some circumstances, the actual delay may be different - call GetSampleTime(0) to get the effective delay.\n * @param unit Unit of measure to represent the delay in.\n * @return The delay setting at the time the data was recorded.\n */\n public getDelay(\n unit: Time | Native = Units.NATIVE\n ): number {\n const request = new gateway.OscilloscopeDataGetRequest();\n request.setDataId(this.dataId);\n request.setUnit(unit);\n\n const response = gateway.callSync<gateway.DoubleResponse>(\n 'oscilloscopedata/get_delay',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Calculate the time a sample was recorded, relative to when the recording was triggered.\n * @param index 0-based index of the sample to calculate the time of.\n * @param unit Unit of measure to represent the calculated time in.\n * @return The calculated time offset of the data sample at the given index.\n */\n public getSampleTime(\n index: number,\n unit: Time | Native = Units.NATIVE\n ): number {\n const request = new gateway.OscilloscopeDataGetSampleTimeRequest();\n request.setDataId(this.dataId);\n request.setIndex(index);\n request.setUnit(unit);\n\n const response = gateway.callSync<gateway.DoubleResponse>(\n 'oscilloscopedata/get_sample_time',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Get the recorded data as an array of doubles.\n * @param unit Unit of measure to convert the data to.\n * @return The recorded data for one oscilloscope channel, converted to the units specified.\n */\n public getData(\n unit: Units = Units.NATIVE\n ): number[] {\n const request = new gateway.OscilloscopeDataGetRequest();\n request.setDataId(this.dataId);\n request.setUnit(unit);\n\n const response = gateway.callSync<gateway.OscilloscopeDataGetSamplesResponse>(\n 'oscilloscopedata/get_samples',\n request,\n gateway.OscilloscopeDataGetSamplesResponse);\n return response.getDataList();\n }\n\n /**\n * Releases native resources of an oscilloscope data buffer.\n * @param dataId The ID of the data buffer to delete.\n */\n private static _free(\n dataId: number\n ): void {\n const request = new gateway.OscilloscopeDataIdentifier();\n request.setDataId(dataId);\n\n gateway.callSync('oscilloscopedata/free', request);\n }\n\n /**\n * Returns recording properties.\n * @return Capture properties.\n */\n private _retrieveProperties(): OscilloscopeCaptureProperties {\n const request = new gateway.OscilloscopeDataIdentifier();\n request.setDataId(this.dataId);\n\n const response = gateway.callSync<gateway.OscilloscopeCaptureProperties>(\n 'oscilloscopedata/get_properties',\n request,\n gateway.OscilloscopeCaptureProperties);\n return OscilloscopeCaptureProperties.fromProtobuf(response.toObject());\n }\n\n /**\n * Releases the native resources of the oscilloscope data.\n * Should only be called if your environment does not support FinalizationRegistry.\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n */\n public free(): void {\n OscilloscopeData._free(this.dataId);\n }\n}\n"]}
1
+ {"version":3,"file":"oscilloscope_data.js","sourceRoot":"","sources":["../../../src/ascii/oscilloscope_data.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oCAA+C;AAC/C,oDAAsC;AACtC,4CAAuD;AAEvD,uFAAkF;AAElF;;GAEG;AACH,MAAa,gBAAgB;IAC3B;;OAEG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAGD;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,mBAAmB,EAAE,CAAC,OAAO,CAAC;IAC5C,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,mBAAmB,EAAE,CAAC,UAAU,CAAC;IAC/C,CAAC;IAED,YAAY,MAAc;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAA,mCAAuB,EAAC,IAAI,EAAE,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3E,CAAC;IAED;;;;OAIG;IACI,WAAW,CAChB,OAAsB,aAAK,CAAC,MAAM;QAElC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,0BAA0B,EAAE,CAAC;QACzD,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC/B,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAEtB,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,+BAA+B,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AQ,CAC/B,8BAA8B,EAC9B,OAAO,EACP,OAAO,CAAC,kCAAkC,CAAC,CAAC;QAC9C,OAAO,QAAQ,CAAC,WAAW,EAAE,CAAC;IAChC,CAAC;IAED;;;OAGG;IACK,MAAM,CAAC,KAAK,CAClB,MAAc;QAEd,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,0BAA0B,EAAE,CAAC;QACzD,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAE1B,OAAO,CAAC,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;IAED;;;OAGG;IACK,mBAAmB;QACzB,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,0BAA0B,EAAE,CAAC;QACzD,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAE/B,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,iCAAiC,EACjC,OAAO,EACP,OAAO,CAAC,6BAA6B,CAAC,CAAC;QACzC,OAAO,+DAA6B,CAAC,YAAY,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;;OAIG;IACI,IAAI;QACT,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;CACF;AAhJD,4CAgJC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Native, Time, Units } from '../units';\nimport * as gateway from '../gateway';\nimport { registerForFinalization } from '../finalizer';\n\nimport { OscilloscopeCaptureProperties } from './oscilloscope_capture_properties';\n\n/**\n * Contains a block of contiguous recorded data for one channel of the device's oscilloscope.\n */\nexport class OscilloscopeData {\n /**\n * Unique ID for this block of recorded data.\n */\n public get dataId(): number {\n return this._dataId;\n }\n private _dataId: number;\n\n /**\n * The name of the recorded setting.\n */\n public get setting(): string {\n return this._retrieveProperties().setting;\n }\n\n /**\n * The number of the axis the data was recorded from, or 0 for the controller.\n */\n public get axisNumber(): number {\n return this._retrieveProperties().axisNumber;\n }\n\n constructor(dataId: number) {\n this._dataId = dataId;\n registerForFinalization(this, OscilloscopeData._free.bind(null, dataId));\n }\n\n /**\n * Get the sample interval that this data was recorded with.\n * @param [unit=Units.NATIVE] Unit of measure to represent the timebase in.\n * @returns The timebase setting at the time the data was recorded.\n */\n public getTimebase(\n unit: Time | Native = Units.NATIVE\n ): number {\n const request = new gateway.OscilloscopeDataGetRequest();\n request.setDataId(this.dataId);\n request.setUnit(unit);\n\n const response = gateway.callSync<gateway.DoubleResponse>(\n 'oscilloscopedata/get_timebase',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Get the user-specified time period between receipt of the start command and the first data point.\n * Under some circumstances, the actual delay may be different - call GetSampleTime(0) to get the effective delay.\n * @param [unit=Units.NATIVE] Unit of measure to represent the delay in.\n * @returns The delay setting at the time the data was recorded.\n */\n public getDelay(\n unit: Time | Native = Units.NATIVE\n ): number {\n const request = new gateway.OscilloscopeDataGetRequest();\n request.setDataId(this.dataId);\n request.setUnit(unit);\n\n const response = gateway.callSync<gateway.DoubleResponse>(\n 'oscilloscopedata/get_delay',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Calculate the time a sample was recorded, relative to when the recording was triggered.\n * @param index 0-based index of the sample to calculate the time of.\n * @param [unit=Units.NATIVE] Unit of measure to represent the calculated time in.\n * @returns The calculated time offset of the data sample at the given index.\n */\n public getSampleTime(\n index: number,\n unit: Time | Native = Units.NATIVE\n ): number {\n const request = new gateway.OscilloscopeDataGetSampleTimeRequest();\n request.setDataId(this.dataId);\n request.setIndex(index);\n request.setUnit(unit);\n\n const response = gateway.callSync<gateway.DoubleResponse>(\n 'oscilloscopedata/get_sample_time',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Get the recorded data as an array of doubles.\n * @param [unit=Units.NATIVE] Unit of measure to convert the data to.\n * @returns The recorded data for one oscilloscope channel, converted to the units specified.\n */\n public getData(\n unit: Units = Units.NATIVE\n ): number[] {\n const request = new gateway.OscilloscopeDataGetRequest();\n request.setDataId(this.dataId);\n request.setUnit(unit);\n\n const response = gateway.callSync<gateway.OscilloscopeDataGetSamplesResponse>(\n 'oscilloscopedata/get_samples',\n request,\n gateway.OscilloscopeDataGetSamplesResponse);\n return response.getDataList();\n }\n\n /**\n * Releases native resources of an oscilloscope data buffer.\n * @param dataId The ID of the data buffer to delete.\n */\n private static _free(\n dataId: number\n ): void {\n const request = new gateway.OscilloscopeDataIdentifier();\n request.setDataId(dataId);\n\n gateway.callSync('oscilloscopedata/free', request);\n }\n\n /**\n * Returns recording properties.\n * @returns Capture properties.\n */\n private _retrieveProperties(): OscilloscopeCaptureProperties {\n const request = new gateway.OscilloscopeDataIdentifier();\n request.setDataId(this.dataId);\n\n const response = gateway.callSync<gateway.OscilloscopeCaptureProperties>(\n 'oscilloscopedata/get_properties',\n request,\n gateway.OscilloscopeCaptureProperties);\n return OscilloscopeCaptureProperties.fromProtobuf(response.toObject());\n }\n\n /**\n * Releases the native resources of the oscilloscope data.\n * Should only be called if your environment does not support FinalizationRegistry.\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n */\n public free(): void {\n OscilloscopeData._free(this.dataId);\n }\n}\n"]}
@@ -6,6 +6,7 @@ import { PidTuning } from './pid_tuning';
6
6
  import { SimpleTuningParamDefinition } from './simple_tuning_param_definition';
7
7
  /**
8
8
  * Exposes the capabilities to inspect and edit an axis' servo tuning.
9
+ * Requires at least Firmware 6.25 or 7.00.
9
10
  */
10
11
  export declare class ServoTuner {
11
12
  /**
@@ -16,7 +17,7 @@ export declare class ServoTuner {
16
17
  constructor(axis: Axis);
17
18
  /**
18
19
  * Get the paramset that this device uses by default when it starts up.
19
- * @return The paramset used at when the device restarts.
20
+ * @returns The paramset used at when the device restarts.
20
21
  */
21
22
  getStartupParamset(): Promise<ServoTuningParamset>;
22
23
  /**
@@ -33,7 +34,7 @@ export declare class ServoTuner {
33
34
  /**
34
35
  * Get the full set of tuning parameters used by the firmware driving this axis.
35
36
  * @param paramset The paramset to get tuning for.
36
- * @return The raw representation of the current tuning.
37
+ * @returns The raw representation of the current tuning.
37
38
  */
38
39
  getTuning(paramset: ServoTuningParamset): Promise<ParamsetInfo>;
39
40
  /**
@@ -50,18 +51,18 @@ export declare class ServoTuner {
50
51
  * @param i The integral gain. Must be in units of N/m⋅s.
51
52
  * @param d The derivative gain. Must be in units of N⋅s/m.
52
53
  * @param fc The cutoff frequency. Must be in units of Hz.
53
- * @return The PID representation of the current tuning after your changes have been applied.
54
+ * @returns The PID representation of the current tuning after your changes have been applied.
54
55
  */
55
56
  setPidTuning(paramset: ServoTuningParamset, p: number, i: number, d: number, fc: number): Promise<PidTuning>;
56
57
  /**
57
58
  * Gets the PID representation of this paramset's servo tuning.
58
59
  * @param paramset The paramset to get tuning for.
59
- * @return The PID representation of the current tuning.
60
+ * @returns The PID representation of the current tuning.
60
61
  */
61
62
  getPidTuning(paramset: ServoTuningParamset): Promise<PidTuning>;
62
63
  /**
63
64
  * Gets the parameters that are required to tune this device.
64
- * @return The tuning parameters.
65
+ * @returns The tuning parameters.
65
66
  */
66
67
  getSimpleTuningParamDefinitions(): Promise<SimpleTuningParamDefinition[]>;
67
68
  /**
@@ -71,9 +72,9 @@ export declare class ServoTuner {
71
72
  * To get what parameters are expected, call GetSimpleTuningParamList.
72
73
  * All values must be between 0 and 1.
73
74
  * @param loadMass The mass loaded on the stage (excluding the mass of the carriage itself) in kg.
74
- * @param carriageMass The mass of the carriage in kg. If this value is not set the default carriage mass is used.
75
+ * @param [options.carriageMass=-1.0] The mass of the carriage in kg. If this value is not set the default carriage mass is used.
75
76
  */
76
- setSimpleTuning(paramset: ServoTuningParamset, tuningParams: ServoTuningParam[], loadMass: number, carriageMass?: number): Promise<void>;
77
+ setSimpleTuning(paramset: ServoTuningParamset, tuningParams: ServoTuningParam[], loadMass: number, options?: ServoTuner.SetSimpleTuningOptions): Promise<void>;
77
78
  /**
78
79
  * Checks if the provided simple tuning is being stored by this paramset.
79
80
  * @param paramset The paramset to set tuning for.
@@ -81,8 +82,17 @@ export declare class ServoTuner {
81
82
  * To get what parameters are expected, call GetSimpleTuningParamList.
82
83
  * All values must be between 0 and 1.
83
84
  * @param loadMass The mass loaded on the stage (excluding the mass of the carriage itself) in kg.
84
- * @param carriageMass The mass of the carriage in kg. If this value is not set the default carriage mass is used.
85
- * @return True if the provided simple tuning is currently stored in this paramset.
85
+ * @param [options.carriageMass=-1.0] The mass of the carriage in kg. If this value is not set the default carriage mass is used.
86
+ * @returns True if the provided simple tuning is currently stored in this paramset.
86
87
  */
87
- isUsingSimpleTuning(paramset: ServoTuningParamset, tuningParams: ServoTuningParam[], loadMass: number, carriageMass?: number): Promise<boolean>;
88
+ isUsingSimpleTuning(paramset: ServoTuningParamset, tuningParams: ServoTuningParam[], loadMass: number, options?: ServoTuner.IsUsingSimpleTuningOptions): Promise<boolean>;
88
89
  }
90
+ declare namespace ServoTuner {
91
+ interface SetSimpleTuningOptions {
92
+ carriageMass?: number;
93
+ }
94
+ interface IsUsingSimpleTuningOptions {
95
+ carriageMass?: number;
96
+ }
97
+ }
98
+ export {};
@@ -33,6 +33,7 @@ const pid_tuning_1 = require("./pid_tuning");
33
33
  const simple_tuning_param_definition_1 = require("./simple_tuning_param_definition");
34
34
  /**
35
35
  * Exposes the capabilities to inspect and edit an axis' servo tuning.
36
+ * Requires at least Firmware 6.25 or 7.00.
36
37
  */
37
38
  class ServoTuner {
38
39
  /**
@@ -46,7 +47,7 @@ class ServoTuner {
46
47
  }
47
48
  /**
48
49
  * Get the paramset that this device uses by default when it starts up.
49
- * @return The paramset used at when the device restarts.
50
+ * @returns The paramset used at when the device restarts.
50
51
  */
51
52
  async getStartupParamset() {
52
53
  const request = new gateway.AxisEmptyRequest();
@@ -85,7 +86,7 @@ class ServoTuner {
85
86
  /**
86
87
  * Get the full set of tuning parameters used by the firmware driving this axis.
87
88
  * @param paramset The paramset to get tuning for.
88
- * @return The raw representation of the current tuning.
89
+ * @returns The raw representation of the current tuning.
89
90
  */
90
91
  async getTuning(paramset) {
91
92
  const request = new gateway.ServoTuningRequest();
@@ -118,7 +119,7 @@ class ServoTuner {
118
119
  * @param i The integral gain. Must be in units of N/m⋅s.
119
120
  * @param d The derivative gain. Must be in units of N⋅s/m.
120
121
  * @param fc The cutoff frequency. Must be in units of Hz.
121
- * @return The PID representation of the current tuning after your changes have been applied.
122
+ * @returns The PID representation of the current tuning after your changes have been applied.
122
123
  */
123
124
  async setPidTuning(paramset, p, i, d, fc) {
124
125
  const request = new gateway.SetServoTuningPIDRequest();
@@ -136,7 +137,7 @@ class ServoTuner {
136
137
  /**
137
138
  * Gets the PID representation of this paramset's servo tuning.
138
139
  * @param paramset The paramset to get tuning for.
139
- * @return The PID representation of the current tuning.
140
+ * @returns The PID representation of the current tuning.
140
141
  */
141
142
  async getPidTuning(paramset) {
142
143
  const request = new gateway.ServoTuningRequest();
@@ -149,7 +150,7 @@ class ServoTuner {
149
150
  }
150
151
  /**
151
152
  * Gets the parameters that are required to tune this device.
152
- * @return The tuning parameters.
153
+ * @returns The tuning parameters.
153
154
  */
154
155
  async getSimpleTuningParamDefinitions() {
155
156
  const request = new gateway.AxisEmptyRequest();
@@ -166,9 +167,10 @@ class ServoTuner {
166
167
  * To get what parameters are expected, call GetSimpleTuningParamList.
167
168
  * All values must be between 0 and 1.
168
169
  * @param loadMass The mass loaded on the stage (excluding the mass of the carriage itself) in kg.
169
- * @param carriageMass The mass of the carriage in kg. If this value is not set the default carriage mass is used.
170
+ * @param [options.carriageMass=-1.0] The mass of the carriage in kg. If this value is not set the default carriage mass is used.
170
171
  */
171
- async setSimpleTuning(paramset, tuningParams, loadMass, carriageMass = -1.0) {
172
+ async setSimpleTuning(paramset, tuningParams, loadMass, options = {}) {
173
+ const { carriageMass = -1.0, } = options;
172
174
  const request = new gateway.SetSimpleTuning();
173
175
  request.setInterfaceId(this.axis.device.connection.interfaceId);
174
176
  request.setDevice(this.axis.device.deviceAddress);
@@ -186,10 +188,11 @@ class ServoTuner {
186
188
  * To get what parameters are expected, call GetSimpleTuningParamList.
187
189
  * All values must be between 0 and 1.
188
190
  * @param loadMass The mass loaded on the stage (excluding the mass of the carriage itself) in kg.
189
- * @param carriageMass The mass of the carriage in kg. If this value is not set the default carriage mass is used.
190
- * @return True if the provided simple tuning is currently stored in this paramset.
191
+ * @param [options.carriageMass=-1.0] The mass of the carriage in kg. If this value is not set the default carriage mass is used.
192
+ * @returns True if the provided simple tuning is currently stored in this paramset.
191
193
  */
192
- async isUsingSimpleTuning(paramset, tuningParams, loadMass, carriageMass = -1.0) {
194
+ async isUsingSimpleTuning(paramset, tuningParams, loadMass, options = {}) {
195
+ const { carriageMass = -1.0, } = options;
193
196
  const request = new gateway.SetSimpleTuning();
194
197
  request.setInterfaceId(this.axis.device.connection.interfaceId);
195
198
  request.setDevice(this.axis.device.deviceAddress);
@@ -1 +1 @@
1
- {"version":3,"file":"servo_tuner.js","sourceRoot":"","sources":["../../../src/ascii/servo_tuner.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtD,oDAAsC;AAEtC,mDAA+C;AAC/C,6DAAwD;AACxD,6CAAyC;AACzC,qFAA+E;AAE/E;;GAEG;AACH,MAAa,UAAU;IACrB;;OAEG;IACH,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAGD,YAAY,IAAU;QACpB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,kBAAkB;QAC7B,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAC/C,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAA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AAG,MAAM,OAAO,CAAC,SAAS,CACtC,oCAAoC,EACpC,OAAO,EACP,OAAO,CAAC,YAAY,CAAC,CAAC;QACxB,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;CACF;AA3OD,gCA2OC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Axis } from './axis';\nimport * as gateway from '../gateway';\nimport { ServoTuningParamset } from './servo_tuning_paramset';\nimport { ParamsetInfo } from './paramset_info';\nimport { ServoTuningParam } from './servo_tuning_param';\nimport { PidTuning } from './pid_tuning';\nimport { SimpleTuningParamDefinition } from './simple_tuning_param_definition';\n\n/**\n * Exposes the capabilities to inspect and edit an axis' servo tuning.\n */\nexport class ServoTuner {\n /**\n * The axis that will be tuned.\n */\n public get axis(): Axis {\n return this._axis;\n }\n private _axis: Axis;\n\n constructor(axis: Axis) {\n this._axis = axis;\n }\n\n /**\n * Get the paramset that this device uses by default when it starts up.\n * @return The paramset used at when the device restarts.\n */\n public async getStartupParamset(): Promise<ServoTuningParamset> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.axis.device.connection.interfaceId);\n request.setDevice(this.axis.device.deviceAddress);\n request.setAxis(this.axis.axisNumber);\n\n const response = await gateway.callAsync<gateway.IntResponse>(\n 'servotuning/get_startup_set',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Set the paramset that this device uses by default when it starts up.\n * @param paramset The paramset to use at startup.\n */\n public async setStartupParamset(\n paramset: ServoTuningParamset\n ): Promise<void> {\n const request = new gateway.ServoTuningRequest();\n request.setInterfaceId(this.axis.device.connection.interfaceId);\n request.setDevice(this.axis.device.deviceAddress);\n request.setAxis(this.axis.axisNumber);\n request.setParamset(paramset as any);\n\n await gateway.callAsync('servotuning/set_startup_set', request);\n }\n\n /**\n * Load the values from one paramset into another.\n * @param toParamset The paramset to load into.\n * @param fromParamset The paramset to load from.\n */\n public async loadParamset(\n toParamset: ServoTuningParamset,\n fromParamset: ServoTuningParamset\n ): Promise<void> {\n const request = new gateway.LoadParamset();\n request.setInterfaceId(this.axis.device.connection.interfaceId);\n request.setDevice(this.axis.device.deviceAddress);\n request.setAxis(this.axis.axisNumber);\n request.setToParamset(toParamset as any);\n request.setFromParamset(fromParamset as any);\n\n await gateway.callAsync('servotuning/load_paramset', request);\n }\n\n /**\n * Get the full set of tuning parameters used by the firmware driving this axis.\n * @param paramset The paramset to get tuning for.\n * @return The raw representation of the current tuning.\n */\n public async getTuning(\n paramset: ServoTuningParamset\n ): Promise<ParamsetInfo> {\n const request = new gateway.ServoTuningRequest();\n request.setInterfaceId(this.axis.device.connection.interfaceId);\n request.setDevice(this.axis.device.deviceAddress);\n request.setAxis(this.axis.axisNumber);\n request.setParamset(paramset as any);\n\n const response = await gateway.callAsync<gateway.ParamsetInfo>(\n 'servotuning/get_raw',\n request,\n gateway.ParamsetInfo);\n return ParamsetInfo.fromProtobuf(response.toObject());\n }\n\n /**\n * Set individual tuning parameters.\n * Only use this method if you have a strong understanding of Zaber specific tuning parameters.\n * @param paramset The paramset to set tuning of.\n * @param tuningParams The params to set.\n */\n public async setTuning(\n paramset: ServoTuningParamset,\n tuningParams: ServoTuningParam[]\n ): Promise<void> {\n const request = new gateway.SetServoTuningRequest();\n request.setInterfaceId(this.axis.device.connection.interfaceId);\n request.setDevice(this.axis.device.deviceAddress);\n request.setAxis(this.axis.axisNumber);\n request.setParamset(paramset as any);\n request.setTuningParamsList(tuningParams.map(ServoTuningParam.toProtobuf));\n\n await gateway.callAsync('servotuning/set_raw', request);\n }\n\n /**\n * Sets the tuning of a paramset using the PID method.\n * @param paramset The paramset to get tuning for.\n * @param p The proportional gain. Must be in units of N/m.\n * @param i The integral gain. Must be in units of N/m⋅s.\n * @param d The derivative gain. Must be in units of N⋅s/m.\n * @param fc The cutoff frequency. Must be in units of Hz.\n * @return The PID representation of the current tuning after your changes have been applied.\n */\n public async setPidTuning(\n paramset: ServoTuningParamset,\n p: number,\n i: number,\n d: number,\n fc: number\n ): Promise<PidTuning> {\n const request = new gateway.SetServoTuningPIDRequest();\n request.setInterfaceId(this.axis.device.connection.interfaceId);\n request.setDevice(this.axis.device.deviceAddress);\n request.setAxis(this.axis.axisNumber);\n request.setParamset(paramset as any);\n request.setP(p);\n request.setI(i);\n request.setD(d);\n request.setFc(fc);\n\n const response = await gateway.callAsync<gateway.PidTuning>(\n 'servotuning/set_pid',\n request,\n gateway.PidTuning);\n return PidTuning.fromProtobuf(response.toObject());\n }\n\n /**\n * Gets the PID representation of this paramset's servo tuning.\n * @param paramset The paramset to get tuning for.\n * @return The PID representation of the current tuning.\n */\n public async getPidTuning(\n paramset: ServoTuningParamset\n ): Promise<PidTuning> {\n const request = new gateway.ServoTuningRequest();\n request.setInterfaceId(this.axis.device.connection.interfaceId);\n request.setDevice(this.axis.device.deviceAddress);\n request.setAxis(this.axis.axisNumber);\n request.setParamset(paramset as any);\n\n const response = await gateway.callAsync<gateway.PidTuning>(\n 'servotuning/get_pid',\n request,\n gateway.PidTuning);\n return PidTuning.fromProtobuf(response.toObject());\n }\n\n /**\n * Gets the parameters that are required to tune this device.\n * @return The tuning parameters.\n */\n public async getSimpleTuningParamDefinitions(): Promise<SimpleTuningParamDefinition[]> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.axis.device.connection.interfaceId);\n request.setDevice(this.axis.device.deviceAddress);\n request.setAxis(this.axis.axisNumber);\n\n const response = await gateway.callAsync<gateway.GetSimpleTuningParamDefinitionResponse>(\n 'servotuning/get_simple_params_definition',\n request,\n gateway.GetSimpleTuningParamDefinitionResponse);\n return response.getParamsList().map(a => SimpleTuningParamDefinition.fromProtobuf(a.toObject()));\n }\n\n /**\n * Set the tuning of this device using the simple input method.\n * @param paramset The paramset to set tuning for.\n * @param tuningParams The params used to tune this device.\n * To get what parameters are expected, call GetSimpleTuningParamList.\n * All values must be between 0 and 1.\n * @param loadMass The mass loaded on the stage (excluding the mass of the carriage itself) in kg.\n * @param carriageMass The mass of the carriage in kg. If this value is not set the default carriage mass is used.\n */\n public async setSimpleTuning(\n paramset: ServoTuningParamset,\n tuningParams: ServoTuningParam[],\n loadMass: number,\n carriageMass: number = -1.0\n ): Promise<void> {\n const request = new gateway.SetSimpleTuning();\n request.setInterfaceId(this.axis.device.connection.interfaceId);\n request.setDevice(this.axis.device.deviceAddress);\n request.setAxis(this.axis.axisNumber);\n request.setParamset(paramset as any);\n request.setTuningParamsList(tuningParams.map(ServoTuningParam.toProtobuf));\n request.setLoadMass(loadMass);\n request.setCarriageMass(carriageMass);\n\n await gateway.callAsync('servotuning/set_simple_tuning', request);\n }\n\n /**\n * Checks if the provided simple tuning is being stored by this paramset.\n * @param paramset The paramset to set tuning for.\n * @param tuningParams The params used to tune this device.\n * To get what parameters are expected, call GetSimpleTuningParamList.\n * All values must be between 0 and 1.\n * @param loadMass The mass loaded on the stage (excluding the mass of the carriage itself) in kg.\n * @param carriageMass The mass of the carriage in kg. If this value is not set the default carriage mass is used.\n * @return True if the provided simple tuning is currently stored in this paramset.\n */\n public async isUsingSimpleTuning(\n paramset: ServoTuningParamset,\n tuningParams: ServoTuningParam[],\n loadMass: number,\n carriageMass: number = -1.0\n ): Promise<boolean> {\n const request = new gateway.SetSimpleTuning();\n request.setInterfaceId(this.axis.device.connection.interfaceId);\n request.setDevice(this.axis.device.deviceAddress);\n request.setAxis(this.axis.axisNumber);\n request.setParamset(paramset as any);\n request.setTuningParamsList(tuningParams.map(ServoTuningParam.toProtobuf));\n request.setLoadMass(loadMass);\n request.setCarriageMass(carriageMass);\n\n const response = await gateway.callAsync<gateway.BoolResponse>(\n 'servotuning/is_using_simple_tuning',\n request,\n gateway.BoolResponse);\n return response.getValue();\n }\n}\n"]}
1
+ {"version":3,"file":"servo_tuner.js","sourceRoot":"","sources":["../../../src/ascii/servo_tuner.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;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ACZ,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;QAC9C,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAChE,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAClD,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACtC,OAAO,CAAC,WAAW,CAAC,QAAe,CAAC,CAAC;QACrC,OAAO,CAAC,mBAAmB,CAAC,YAAY,CAAC,GAAG,CAAC,qCAAgB,CAAC,UAAU,CAAC,CAAC,CAAC;QAC3E,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAC9B,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;QAEtC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,oCAAoC,EACpC,OAAO,EACP,OAAO,CAAC,YAAY,CAAC,CAAC;QACxB,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;CACF;AAjPD,gCAiPC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Axis } from './axis';\nimport * as gateway from '../gateway';\nimport { ServoTuningParamset } from './servo_tuning_paramset';\nimport { ParamsetInfo } from './paramset_info';\nimport { ServoTuningParam } from './servo_tuning_param';\nimport { PidTuning } from './pid_tuning';\nimport { SimpleTuningParamDefinition } from './simple_tuning_param_definition';\n\n/**\n * Exposes the capabilities to inspect and edit an axis' servo tuning.\n * Requires at least Firmware 6.25 or 7.00.\n */\nexport class ServoTuner {\n /**\n * The axis that will be tuned.\n */\n public get axis(): Axis {\n return this._axis;\n }\n private _axis: Axis;\n\n constructor(axis: Axis) {\n this._axis = axis;\n }\n\n /**\n * Get the paramset that this device uses by default when it starts up.\n * @returns The paramset used at when the device restarts.\n */\n public async getStartupParamset(): Promise<ServoTuningParamset> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.axis.device.connection.interfaceId);\n request.setDevice(this.axis.device.deviceAddress);\n request.setAxis(this.axis.axisNumber);\n\n const response = await gateway.callAsync<gateway.IntResponse>(\n 'servotuning/get_startup_set',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Set the paramset that this device uses by default when it starts up.\n * @param paramset The paramset to use at startup.\n */\n public async setStartupParamset(\n paramset: ServoTuningParamset\n ): Promise<void> {\n const request = new gateway.ServoTuningRequest();\n request.setInterfaceId(this.axis.device.connection.interfaceId);\n request.setDevice(this.axis.device.deviceAddress);\n request.setAxis(this.axis.axisNumber);\n request.setParamset(paramset as any);\n\n await gateway.callAsync('servotuning/set_startup_set', request);\n }\n\n /**\n * Load the values from one paramset into another.\n * @param toParamset The paramset to load into.\n * @param fromParamset The paramset to load from.\n */\n public async loadParamset(\n toParamset: ServoTuningParamset,\n fromParamset: ServoTuningParamset\n ): Promise<void> {\n const request = new gateway.LoadParamset();\n request.setInterfaceId(this.axis.device.connection.interfaceId);\n request.setDevice(this.axis.device.deviceAddress);\n request.setAxis(this.axis.axisNumber);\n request.setToParamset(toParamset as any);\n request.setFromParamset(fromParamset as any);\n\n await gateway.callAsync('servotuning/load_paramset', request);\n }\n\n /**\n * Get the full set of tuning parameters used by the firmware driving this axis.\n * @param paramset The paramset to get tuning for.\n * @returns The raw representation of the current tuning.\n */\n public async getTuning(\n paramset: ServoTuningParamset\n ): Promise<ParamsetInfo> {\n const request = new gateway.ServoTuningRequest();\n request.setInterfaceId(this.axis.device.connection.interfaceId);\n request.setDevice(this.axis.device.deviceAddress);\n request.setAxis(this.axis.axisNumber);\n request.setParamset(paramset as any);\n\n const response = await gateway.callAsync<gateway.ParamsetInfo>(\n 'servotuning/get_raw',\n request,\n gateway.ParamsetInfo);\n return ParamsetInfo.fromProtobuf(response.toObject());\n }\n\n /**\n * Set individual tuning parameters.\n * Only use this method if you have a strong understanding of Zaber specific tuning parameters.\n * @param paramset The paramset to set tuning of.\n * @param tuningParams The params to set.\n */\n public async setTuning(\n paramset: ServoTuningParamset,\n tuningParams: ServoTuningParam[]\n ): Promise<void> {\n const request = new gateway.SetServoTuningRequest();\n request.setInterfaceId(this.axis.device.connection.interfaceId);\n request.setDevice(this.axis.device.deviceAddress);\n request.setAxis(this.axis.axisNumber);\n request.setParamset(paramset as any);\n request.setTuningParamsList(tuningParams.map(ServoTuningParam.toProtobuf));\n\n await gateway.callAsync('servotuning/set_raw', request);\n }\n\n /**\n * Sets the tuning of a paramset using the PID method.\n * @param paramset The paramset to get tuning for.\n * @param p The proportional gain. Must be in units of N/m.\n * @param i The integral gain. Must be in units of N/m⋅s.\n * @param d The derivative gain. Must be in units of N⋅s/m.\n * @param fc The cutoff frequency. Must be in units of Hz.\n * @returns The PID representation of the current tuning after your changes have been applied.\n */\n public async setPidTuning(\n paramset: ServoTuningParamset,\n p: number,\n i: number,\n d: number,\n fc: number\n ): Promise<PidTuning> {\n const request = new gateway.SetServoTuningPIDRequest();\n request.setInterfaceId(this.axis.device.connection.interfaceId);\n request.setDevice(this.axis.device.deviceAddress);\n request.setAxis(this.axis.axisNumber);\n request.setParamset(paramset as any);\n request.setP(p);\n request.setI(i);\n request.setD(d);\n request.setFc(fc);\n\n const response = await gateway.callAsync<gateway.PidTuning>(\n 'servotuning/set_pid',\n request,\n gateway.PidTuning);\n return PidTuning.fromProtobuf(response.toObject());\n }\n\n /**\n * Gets the PID representation of this paramset's servo tuning.\n * @param paramset The paramset to get tuning for.\n * @returns The PID representation of the current tuning.\n */\n public async getPidTuning(\n paramset: ServoTuningParamset\n ): Promise<PidTuning> {\n const request = new gateway.ServoTuningRequest();\n request.setInterfaceId(this.axis.device.connection.interfaceId);\n request.setDevice(this.axis.device.deviceAddress);\n request.setAxis(this.axis.axisNumber);\n request.setParamset(paramset as any);\n\n const response = await gateway.callAsync<gateway.PidTuning>(\n 'servotuning/get_pid',\n request,\n gateway.PidTuning);\n return PidTuning.fromProtobuf(response.toObject());\n }\n\n /**\n * Gets the parameters that are required to tune this device.\n * @returns The tuning parameters.\n */\n public async getSimpleTuningParamDefinitions(): Promise<SimpleTuningParamDefinition[]> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.axis.device.connection.interfaceId);\n request.setDevice(this.axis.device.deviceAddress);\n request.setAxis(this.axis.axisNumber);\n\n const response = await gateway.callAsync<gateway.GetSimpleTuningParamDefinitionResponse>(\n 'servotuning/get_simple_params_definition',\n request,\n gateway.GetSimpleTuningParamDefinitionResponse);\n return response.getParamsList().map(a => SimpleTuningParamDefinition.fromProtobuf(a.toObject()));\n }\n\n /**\n * Set the tuning of this device using the simple input method.\n * @param paramset The paramset to set tuning for.\n * @param tuningParams The params used to tune this device.\n * To get what parameters are expected, call GetSimpleTuningParamList.\n * All values must be between 0 and 1.\n * @param loadMass The mass loaded on the stage (excluding the mass of the carriage itself) in kg.\n * @param [options.carriageMass=-1.0] The mass of the carriage in kg. If this value is not set the default carriage mass is used.\n */\n public async setSimpleTuning(\n paramset: ServoTuningParamset,\n tuningParams: ServoTuningParam[],\n loadMass: number,\n options: ServoTuner.SetSimpleTuningOptions = {}\n ): Promise<void> {\n const {\n carriageMass = -1.0,\n } = options;\n const request = new gateway.SetSimpleTuning();\n request.setInterfaceId(this.axis.device.connection.interfaceId);\n request.setDevice(this.axis.device.deviceAddress);\n request.setAxis(this.axis.axisNumber);\n request.setParamset(paramset as any);\n request.setTuningParamsList(tuningParams.map(ServoTuningParam.toProtobuf));\n request.setLoadMass(loadMass);\n request.setCarriageMass(carriageMass);\n\n await gateway.callAsync('servotuning/set_simple_tuning', request);\n }\n\n /**\n * Checks if the provided simple tuning is being stored by this paramset.\n * @param paramset The paramset to set tuning for.\n * @param tuningParams The params used to tune this device.\n * To get what parameters are expected, call GetSimpleTuningParamList.\n * All values must be between 0 and 1.\n * @param loadMass The mass loaded on the stage (excluding the mass of the carriage itself) in kg.\n * @param [options.carriageMass=-1.0] The mass of the carriage in kg. If this value is not set the default carriage mass is used.\n * @returns True if the provided simple tuning is currently stored in this paramset.\n */\n public async isUsingSimpleTuning(\n paramset: ServoTuningParamset,\n tuningParams: ServoTuningParam[],\n loadMass: number,\n options: ServoTuner.IsUsingSimpleTuningOptions = {}\n ): Promise<boolean> {\n const {\n carriageMass = -1.0,\n } = options;\n const request = new gateway.SetSimpleTuning();\n request.setInterfaceId(this.axis.device.connection.interfaceId);\n request.setDevice(this.axis.device.deviceAddress);\n request.setAxis(this.axis.axisNumber);\n request.setParamset(paramset as any);\n request.setTuningParamsList(tuningParams.map(ServoTuningParam.toProtobuf));\n request.setLoadMass(loadMass);\n request.setCarriageMass(carriageMass);\n\n const response = await gateway.callAsync<gateway.BoolResponse>(\n 'servotuning/is_using_simple_tuning',\n request,\n gateway.BoolResponse);\n return response.getValue();\n }\n}\n\nnamespace ServoTuner {\n export interface SetSimpleTuningOptions {\n carriageMass?: number;\n }\n export interface IsUsingSimpleTuningOptions {\n carriageMass?: number;\n }\n}\n"]}