@zaber/motion 3.3.0 → 3.4.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 (73) hide show
  1. package/dist/binding/wasm/zaber-motion-lib.wasm +0 -0
  2. package/dist/lib/ascii/device.d.ts +14 -0
  3. package/dist/lib/ascii/device.js +24 -0
  4. package/dist/lib/ascii/device.js.map +1 -1
  5. package/dist/lib/ascii/index.d.ts +5 -0
  6. package/dist/lib/ascii/index.js +11 -1
  7. package/dist/lib/ascii/index.js.map +1 -1
  8. package/dist/lib/ascii/pvt_axis_definition.d.ts +17 -0
  9. package/dist/lib/ascii/pvt_axis_definition.js +53 -0
  10. package/dist/lib/ascii/pvt_axis_definition.js.map +1 -0
  11. package/dist/lib/ascii/pvt_axis_type.d.ts +7 -0
  12. package/dist/lib/ascii/pvt_axis_type.js +14 -0
  13. package/dist/lib/ascii/pvt_axis_type.js.map +1 -0
  14. package/dist/lib/ascii/pvt_buffer.d.ts +28 -0
  15. package/dist/lib/ascii/pvt_buffer.js +78 -0
  16. package/dist/lib/ascii/pvt_buffer.js.map +1 -0
  17. package/dist/lib/ascii/pvt_mode.d.ts +8 -0
  18. package/dist/lib/ascii/pvt_mode.js +15 -0
  19. package/dist/lib/ascii/pvt_mode.js.map +1 -0
  20. package/dist/lib/ascii/pvt_sequence.d.ts +178 -0
  21. package/dist/lib/ascii/pvt_sequence.js +407 -0
  22. package/dist/lib/ascii/pvt_sequence.js.map +1 -0
  23. package/dist/lib/ascii/stream.d.ts +13 -5
  24. package/dist/lib/ascii/stream.js +25 -5
  25. package/dist/lib/ascii/stream.js.map +1 -1
  26. package/dist/lib/ascii/stream_buffer.d.ts +1 -1
  27. package/dist/lib/ascii/stream_buffer.js +1 -1
  28. package/dist/lib/ascii/stream_buffer.js.map +1 -1
  29. package/dist/lib/ascii_ns.d.ts +10 -0
  30. package/dist/lib/ascii_ns.js +5 -0
  31. package/dist/lib/ascii_ns.js.map +1 -1
  32. package/dist/lib/exceptions/index.d.ts +11 -0
  33. package/dist/lib/exceptions/index.js +24 -2
  34. package/dist/lib/exceptions/index.js.map +1 -1
  35. package/dist/lib/exceptions/invalid_pvt_point.d.ts +16 -0
  36. package/dist/lib/exceptions/invalid_pvt_point.js +18 -0
  37. package/dist/lib/exceptions/invalid_pvt_point.js.map +1 -0
  38. package/dist/lib/exceptions/pvt_discontinuity_exception.d.ts +7 -0
  39. package/dist/lib/exceptions/pvt_discontinuity_exception.js +17 -0
  40. package/dist/lib/exceptions/pvt_discontinuity_exception.js.map +1 -0
  41. package/dist/lib/exceptions/pvt_execution_exception.d.ts +14 -0
  42. package/dist/lib/exceptions/pvt_execution_exception.js +32 -0
  43. package/dist/lib/exceptions/pvt_execution_exception.js.map +1 -0
  44. package/dist/lib/exceptions/pvt_execution_exception_data.d.ts +21 -0
  45. package/dist/lib/exceptions/pvt_execution_exception_data.js +20 -0
  46. package/dist/lib/exceptions/pvt_execution_exception_data.js.map +1 -0
  47. package/dist/lib/exceptions/pvt_mode_exception.d.ts +7 -0
  48. package/dist/lib/exceptions/pvt_mode_exception.js +17 -0
  49. package/dist/lib/exceptions/pvt_mode_exception.js.map +1 -0
  50. package/dist/lib/exceptions/pvt_movement_failed_exception.d.ts +14 -0
  51. package/dist/lib/exceptions/pvt_movement_failed_exception.js +32 -0
  52. package/dist/lib/exceptions/pvt_movement_failed_exception.js.map +1 -0
  53. package/dist/lib/exceptions/pvt_movement_failed_exception_data.d.ts +16 -0
  54. package/dist/lib/exceptions/pvt_movement_failed_exception_data.js +18 -0
  55. package/dist/lib/exceptions/pvt_movement_failed_exception_data.js.map +1 -0
  56. package/dist/lib/exceptions/pvt_movement_interrupted_exception.d.ts +14 -0
  57. package/dist/lib/exceptions/pvt_movement_interrupted_exception.js +32 -0
  58. package/dist/lib/exceptions/pvt_movement_interrupted_exception.js.map +1 -0
  59. package/dist/lib/exceptions/pvt_movement_interrupted_exception_data.d.ts +16 -0
  60. package/dist/lib/exceptions/pvt_movement_interrupted_exception_data.js +18 -0
  61. package/dist/lib/exceptions/pvt_movement_interrupted_exception_data.js.map +1 -0
  62. package/dist/lib/exceptions/pvt_setup_failed_exception.d.ts +7 -0
  63. package/dist/lib/exceptions/pvt_setup_failed_exception.js +17 -0
  64. package/dist/lib/exceptions/pvt_setup_failed_exception.js.map +1 -0
  65. package/dist/lib/exceptions/stream_discontinuity_exception.d.ts +7 -0
  66. package/dist/lib/exceptions/stream_discontinuity_exception.js +17 -0
  67. package/dist/lib/exceptions/stream_discontinuity_exception.js.map +1 -0
  68. package/dist/lib/gateway/convert_exceptions.js +7 -0
  69. package/dist/lib/gateway/convert_exceptions.js.map +1 -1
  70. package/dist/lib/protobufs/main_pb.d.ts +304 -0
  71. package/dist/lib/protobufs/main_pb.js +3522 -1240
  72. package/dist/lib/protobufs/main_pb.js.map +1 -1
  73. package/package.json +31 -1
@@ -0,0 +1,178 @@
1
+ import { Device } from './device';
2
+ import { Measurement } from '../measurement';
3
+ import { PvtBuffer } from './pvt_buffer';
4
+ import { PvtMode } from './pvt_mode';
5
+ import { PvtAxisDefinition } from './pvt_axis_definition';
6
+ /**
7
+ * A handle for a PVT sequence with this number on the device.
8
+ * PVT sequences provide a way execute or store trajectory
9
+ * consisting of points with defined position, velocity, and time.
10
+ * PVT sequence methods append actions to a queue which executes
11
+ * or stores actions in a first in, first out order.
12
+ */
13
+ export declare class PvtSequence {
14
+ /**
15
+ * Device that controls this PVT sequence.
16
+ */
17
+ get device(): Device;
18
+ private _device;
19
+ /**
20
+ * The number that identifies the PVT sequence on the device.
21
+ */
22
+ get pvtId(): number;
23
+ private _pvtId;
24
+ /**
25
+ * Current mode of the PVT sequence.
26
+ */
27
+ get mode(): PvtMode;
28
+ /**
29
+ * An array of axes definitions the PVT sequence is set up to control.
30
+ */
31
+ get axes(): PvtAxisDefinition[];
32
+ constructor(device: Device, pvtId: number);
33
+ /**
34
+ * Setup the PVT sequence to control the specified axes and to queue actions on the device.
35
+ * Allows use of lockstep axes in a PVT sequence.
36
+ * @param axes Definition of the PVT sequence axes.
37
+ */
38
+ setupLiveComposite(...axes: PvtAxisDefinition[]): Promise<void>;
39
+ /**
40
+ * Setup the PVT sequence to control the specified axes and to queue actions on the device.
41
+ * @param axes Numbers of physical axes to setup the PVT sequence on.
42
+ */
43
+ setupLive(...axes: number[]): Promise<void>;
44
+ /**
45
+ * Setup the PVT sequence to use the specified axes and queue actions into a PVT buffer.
46
+ * Allows use of lockstep axes in a PVT sequence.
47
+ * @param pvtBuffer The PVT buffer to queue actions in.
48
+ * @param axes Definition of the PVT sequence axes.
49
+ */
50
+ setupStoreComposite(pvtBuffer: PvtBuffer, ...axes: PvtAxisDefinition[]): Promise<void>;
51
+ /**
52
+ * Setup the PVT sequence to use the specified axes and queue actions into a PVT buffer.
53
+ * @param pvtBuffer The PVT buffer to queue actions in.
54
+ * @param axes Numbers of physical axes to setup the PVT sequence on.
55
+ */
56
+ setupStore(pvtBuffer: PvtBuffer, ...axes: number[]): Promise<void>;
57
+ /**
58
+ * Append the actions in a PVT buffer to the sequence's queue.
59
+ * @param pvtBuffer The PVT buffer to call.
60
+ */
61
+ call(pvtBuffer: PvtBuffer): Promise<void>;
62
+ /**
63
+ * Queues a point with absolute coordinates in the PVT sequence.
64
+ * @param positions Positions for the axes to move through, relative to their home positions.
65
+ * @param velocities The axes velocities at the given point.
66
+ * @param time The duration between the previous point in the sequence and this one.
67
+ */
68
+ point(positions: Measurement[], velocities: Measurement[], time: Measurement): Promise<void>;
69
+ /**
70
+ * Queues a point with coordinates relative to the previous point in the PVT sequence.
71
+ * @param positions Positions for the axes to move through, relative to the previous point.
72
+ * @param velocities The axes velocities at the given point.
73
+ * @param time The duration between the previous point in the sequence and this one.
74
+ */
75
+ pointRelative(positions: Measurement[], velocities: Measurement[], time: Measurement): Promise<void>;
76
+ /**
77
+ * Set the value of a digital output channel.
78
+ * @param channelNumber The number of the digital output channel.
79
+ * Channel numbers are numbered from one.
80
+ * @param value The value to set the channel to.
81
+ */
82
+ setDigitalOutput(channelNumber: number, value: boolean): Promise<void>;
83
+ /**
84
+ * Set the value of an analog output channel.
85
+ * @param channelNumber The number of the analog output channel.
86
+ * Channel numbers are numbered from one.
87
+ * @param value The value to set the channel to, in Volts.
88
+ */
89
+ setAnalogOutput(channelNumber: number, value: number): Promise<void>;
90
+ /**
91
+ * Sets values for all digital output channels.
92
+ * @param values True to set the output channel to conducting and false to turn it off.
93
+ */
94
+ setAllDigitalOutputs(values: boolean[]): Promise<void>;
95
+ /**
96
+ * Sets values for all analog output channels.
97
+ * @param values The values to set the output channels to, in Volts.
98
+ */
99
+ setAllAnalogOutputs(values: number[]): Promise<void>;
100
+ /**
101
+ * Waits until the live PVT sequence executes all queued actions.
102
+ * @param [options.throwErrorOnFault=true] Determines whether to throw error when fault is observed.
103
+ */
104
+ waitUntilIdle(options?: PvtSequence.WaitUntilIdleOptions): Promise<void>;
105
+ /**
106
+ * Cork the front of the PVT sequences's action queue, blocking execution.
107
+ * Execution resumes upon uncorking the queue, or when the number of queued actions reaches its limit.
108
+ * Corking eliminates discontinuities in motion due to subsequent PVT commands reaching the device late.
109
+ * You can only cork an idle live PVT sequence.
110
+ */
111
+ cork(): Promise<void>;
112
+ /**
113
+ * Uncork the front of the queue, unblocking command execution.
114
+ * You can only uncork an idle live PVT sequence that is corked.
115
+ */
116
+ uncork(): Promise<void>;
117
+ /**
118
+ * Returns a boolean value indicating whether the live PVT sequence is executing a queued action.
119
+ * @returns True if the PVT sequence is executing a queued action.
120
+ */
121
+ isBusy(): Promise<boolean>;
122
+ /**
123
+ * Returns a string which represents the PVT sequence.
124
+ * @returns String which represents the PVT sequence.
125
+ */
126
+ toString(): string;
127
+ /**
128
+ * Disables the PVT sequence.
129
+ * If the PVT sequence is not setup, this command does nothing.
130
+ * Once disabled, the PVT sequence will no longer accept PVT commands.
131
+ * The PVT sequence will process the rest of the commands in the queue until it is empty.
132
+ */
133
+ disable(): Promise<void>;
134
+ /**
135
+ * Sends a generic ASCII command to the PVT sequence.
136
+ * Keeps resending the command while the device rejects with AGAIN reason.
137
+ * @param command Command and its parameters.
138
+ */
139
+ genericCommand(command: string): Promise<void>;
140
+ /**
141
+ * Sends a batch of generic ASCII commands to the PVT sequence.
142
+ * Keeps resending command while the device rejects with AGAIN reason.
143
+ * The batch is atomic in terms of thread safety.
144
+ * @param batch Array of commands.
145
+ */
146
+ genericCommandBatch(batch: string[]): Promise<void>;
147
+ /**
148
+ * Queries the PVT sequence status from the device
149
+ * and returns boolean indicating whether the PVT sequence is disabled.
150
+ * Useful to determine if execution was interrupted by other movements.
151
+ * @returns True if the PVT sequence is disabled.
152
+ */
153
+ checkDisabled(): Promise<boolean>;
154
+ /**
155
+ * Makes the PVT sequence throw PvtDiscontinuityException when it encounters discontinuities (ND warning flag).
156
+ */
157
+ treatDiscontinuitiesAsError(): void;
158
+ /**
159
+ * Prevents PvtDiscontinuityException as a result of expected discontinuity when resuming the sequence.
160
+ */
161
+ ignoreCurrentDiscontinuity(): void;
162
+ /**
163
+ * Gets the axes of the PVT sequence.
164
+ * @returns An array of axis numbers of the axes the PVT sequence is set up to control.
165
+ */
166
+ private _retrieveAxes;
167
+ /**
168
+ * Get the mode of the PVT sequence.
169
+ * @returns Mode of the PVT sequence.
170
+ */
171
+ private _retrieveMode;
172
+ }
173
+ declare namespace PvtSequence {
174
+ interface WaitUntilIdleOptions {
175
+ throwErrorOnFault?: boolean;
176
+ }
177
+ }
178
+ export {};
@@ -0,0 +1,407 @@
1
+ "use strict";
2
+ // ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //
3
+ // ============= DO NOT EDIT DIRECTLY ============= //
4
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
11
+ }) : (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ o[k2] = m[k];
14
+ }));
15
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
16
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
17
+ }) : function(o, v) {
18
+ o["default"] = v;
19
+ });
20
+ var __importStar = (this && this.__importStar) || function (mod) {
21
+ if (mod && mod.__esModule) return mod;
22
+ var result = {};
23
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
24
+ __setModuleDefault(result, mod);
25
+ return result;
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.PvtSequence = void 0;
29
+ const gateway = __importStar(require("../gateway"));
30
+ const measurement_1 = require("../measurement");
31
+ const pvt_axis_definition_1 = require("./pvt_axis_definition");
32
+ /**
33
+ * A handle for a PVT sequence with this number on the device.
34
+ * PVT sequences provide a way execute or store trajectory
35
+ * consisting of points with defined position, velocity, and time.
36
+ * PVT sequence methods append actions to a queue which executes
37
+ * or stores actions in a first in, first out order.
38
+ */
39
+ class PvtSequence {
40
+ /**
41
+ * Device that controls this PVT sequence.
42
+ */
43
+ get device() {
44
+ return this._device;
45
+ }
46
+ /**
47
+ * The number that identifies the PVT sequence on the device.
48
+ */
49
+ get pvtId() {
50
+ return this._pvtId;
51
+ }
52
+ /**
53
+ * Current mode of the PVT sequence.
54
+ */
55
+ get mode() {
56
+ return this._retrieveMode();
57
+ }
58
+ /**
59
+ * An array of axes definitions the PVT sequence is set up to control.
60
+ */
61
+ get axes() {
62
+ return this._retrieveAxes();
63
+ }
64
+ constructor(device, pvtId) {
65
+ this._device = device;
66
+ this._pvtId = pvtId;
67
+ }
68
+ /**
69
+ * Setup the PVT sequence to control the specified axes and to queue actions on the device.
70
+ * Allows use of lockstep axes in a PVT sequence.
71
+ * @param axes Definition of the PVT sequence axes.
72
+ */
73
+ async setupLiveComposite(...axes) {
74
+ const request = new gateway.StreamSetupLiveCompositeRequest();
75
+ request.setInterfaceId(this.device.connection.interfaceId);
76
+ request.setDevice(this.device.deviceAddress);
77
+ request.setStreamId(this.pvtId);
78
+ request.setPvt(true);
79
+ request.setAxesList(axes.map(pvt_axis_definition_1.PvtAxisDefinition.toProtobuf));
80
+ await gateway.callAsync('device/stream_setup_live_composite', request);
81
+ }
82
+ /**
83
+ * Setup the PVT sequence to control the specified axes and to queue actions on the device.
84
+ * @param axes Numbers of physical axes to setup the PVT sequence on.
85
+ */
86
+ async setupLive(...axes) {
87
+ const request = new gateway.StreamSetupLiveRequest();
88
+ request.setInterfaceId(this.device.connection.interfaceId);
89
+ request.setDevice(this.device.deviceAddress);
90
+ request.setStreamId(this.pvtId);
91
+ request.setPvt(true);
92
+ request.setAxesList(axes);
93
+ await gateway.callAsync('device/stream_setup_live', request);
94
+ }
95
+ /**
96
+ * Setup the PVT sequence to use the specified axes and queue actions into a PVT buffer.
97
+ * Allows use of lockstep axes in a PVT sequence.
98
+ * @param pvtBuffer The PVT buffer to queue actions in.
99
+ * @param axes Definition of the PVT sequence axes.
100
+ */
101
+ async setupStoreComposite(pvtBuffer, ...axes) {
102
+ const request = new gateway.StreamSetupStoreCompositeRequest();
103
+ request.setInterfaceId(this.device.connection.interfaceId);
104
+ request.setDevice(this.device.deviceAddress);
105
+ request.setStreamId(this.pvtId);
106
+ request.setPvt(true);
107
+ request.setPvtBuffer(pvtBuffer.bufferId);
108
+ request.setAxesList(axes.map(pvt_axis_definition_1.PvtAxisDefinition.toProtobuf));
109
+ await gateway.callAsync('device/stream_setup_store_composite', request);
110
+ }
111
+ /**
112
+ * Setup the PVT sequence to use the specified axes and queue actions into a PVT buffer.
113
+ * @param pvtBuffer The PVT buffer to queue actions in.
114
+ * @param axes Numbers of physical axes to setup the PVT sequence on.
115
+ */
116
+ async setupStore(pvtBuffer, ...axes) {
117
+ const request = new gateway.StreamSetupStoreRequest();
118
+ request.setInterfaceId(this.device.connection.interfaceId);
119
+ request.setDevice(this.device.deviceAddress);
120
+ request.setStreamId(this.pvtId);
121
+ request.setPvt(true);
122
+ request.setPvtBuffer(pvtBuffer.bufferId);
123
+ request.setAxesList(axes);
124
+ await gateway.callAsync('device/stream_setup_store', request);
125
+ }
126
+ /**
127
+ * Append the actions in a PVT buffer to the sequence's queue.
128
+ * @param pvtBuffer The PVT buffer to call.
129
+ */
130
+ async call(pvtBuffer) {
131
+ const request = new gateway.StreamCallRequest();
132
+ request.setInterfaceId(this.device.connection.interfaceId);
133
+ request.setDevice(this.device.deviceAddress);
134
+ request.setStreamId(this.pvtId);
135
+ request.setPvt(true);
136
+ request.setPvtBuffer(pvtBuffer.bufferId);
137
+ await gateway.callAsync('device/stream_call', request);
138
+ }
139
+ /**
140
+ * Queues a point with absolute coordinates in the PVT sequence.
141
+ * @param positions Positions for the axes to move through, relative to their home positions.
142
+ * @param velocities The axes velocities at the given point.
143
+ * @param time The duration between the previous point in the sequence and this one.
144
+ */
145
+ async point(positions, velocities, time) {
146
+ const request = new gateway.PvtPointRequest();
147
+ request.setInterfaceId(this.device.connection.interfaceId);
148
+ request.setDevice(this.device.deviceAddress);
149
+ request.setStreamId(this.pvtId);
150
+ request.setPvt(true);
151
+ request.setType(gateway.PvtPointRequest.Type.ABS);
152
+ request.setPositionsList(positions.map(measurement_1.Measurement.toProtobuf));
153
+ request.setVelocitiesList(velocities.map(measurement_1.Measurement.toProtobuf));
154
+ request.setTime(measurement_1.Measurement.toProtobuf(time));
155
+ await gateway.callAsync('device/stream_point', request);
156
+ }
157
+ /**
158
+ * Queues a point with coordinates relative to the previous point in the PVT sequence.
159
+ * @param positions Positions for the axes to move through, relative to the previous point.
160
+ * @param velocities The axes velocities at the given point.
161
+ * @param time The duration between the previous point in the sequence and this one.
162
+ */
163
+ async pointRelative(positions, velocities, time) {
164
+ const request = new gateway.PvtPointRequest();
165
+ request.setInterfaceId(this.device.connection.interfaceId);
166
+ request.setDevice(this.device.deviceAddress);
167
+ request.setStreamId(this.pvtId);
168
+ request.setPvt(true);
169
+ request.setType(gateway.PvtPointRequest.Type.REL);
170
+ request.setPositionsList(positions.map(measurement_1.Measurement.toProtobuf));
171
+ request.setVelocitiesList(velocities.map(measurement_1.Measurement.toProtobuf));
172
+ request.setTime(measurement_1.Measurement.toProtobuf(time));
173
+ await gateway.callAsync('device/stream_point', request);
174
+ }
175
+ /**
176
+ * Set the value of a digital output channel.
177
+ * @param channelNumber The number of the digital output channel.
178
+ * Channel numbers are numbered from one.
179
+ * @param value The value to set the channel to.
180
+ */
181
+ async setDigitalOutput(channelNumber, value) {
182
+ const request = new gateway.StreamSetDigitalOutputRequest();
183
+ request.setInterfaceId(this.device.connection.interfaceId);
184
+ request.setDevice(this.device.deviceAddress);
185
+ request.setStreamId(this.pvtId);
186
+ request.setPvt(true);
187
+ request.setChannelNumber(channelNumber);
188
+ request.setValue(value);
189
+ await gateway.callAsync('device/stream_set_digital_output', request);
190
+ }
191
+ /**
192
+ * Set the value of an analog output channel.
193
+ * @param channelNumber The number of the analog output channel.
194
+ * Channel numbers are numbered from one.
195
+ * @param value The value to set the channel to, in Volts.
196
+ */
197
+ async setAnalogOutput(channelNumber, value) {
198
+ const request = new gateway.StreamSetAnalogOutputRequest();
199
+ request.setInterfaceId(this.device.connection.interfaceId);
200
+ request.setDevice(this.device.deviceAddress);
201
+ request.setStreamId(this.pvtId);
202
+ request.setPvt(true);
203
+ request.setChannelNumber(channelNumber);
204
+ request.setValue(value);
205
+ await gateway.callAsync('device/stream_set_analog_output', request);
206
+ }
207
+ /**
208
+ * Sets values for all digital output channels.
209
+ * @param values True to set the output channel to conducting and false to turn it off.
210
+ */
211
+ async setAllDigitalOutputs(values) {
212
+ const request = new gateway.StreamSetAllDigitalOutputsRequest();
213
+ request.setInterfaceId(this.device.connection.interfaceId);
214
+ request.setDevice(this.device.deviceAddress);
215
+ request.setStreamId(this.pvtId);
216
+ request.setPvt(true);
217
+ request.setValuesList(values);
218
+ await gateway.callAsync('device/stream_set_all_digital_outputs', request);
219
+ }
220
+ /**
221
+ * Sets values for all analog output channels.
222
+ * @param values The values to set the output channels to, in Volts.
223
+ */
224
+ async setAllAnalogOutputs(values) {
225
+ const request = new gateway.StreamSetAllAnalogOutputsRequest();
226
+ request.setInterfaceId(this.device.connection.interfaceId);
227
+ request.setDevice(this.device.deviceAddress);
228
+ request.setStreamId(this.pvtId);
229
+ request.setPvt(true);
230
+ request.setValuesList(values);
231
+ await gateway.callAsync('device/stream_set_all_analog_outputs', request);
232
+ }
233
+ /**
234
+ * Waits until the live PVT sequence executes all queued actions.
235
+ * @param [options.throwErrorOnFault=true] Determines whether to throw error when fault is observed.
236
+ */
237
+ async waitUntilIdle(options = {}) {
238
+ const { throwErrorOnFault = true, } = options;
239
+ const request = new gateway.StreamWaitUntilIdleRequest();
240
+ request.setInterfaceId(this.device.connection.interfaceId);
241
+ request.setDevice(this.device.deviceAddress);
242
+ request.setStreamId(this.pvtId);
243
+ request.setPvt(true);
244
+ request.setThrowErrorOnFault(throwErrorOnFault);
245
+ await gateway.callAsync('device/stream_wait_until_idle', request);
246
+ }
247
+ /**
248
+ * Cork the front of the PVT sequences's action queue, blocking execution.
249
+ * Execution resumes upon uncorking the queue, or when the number of queued actions reaches its limit.
250
+ * Corking eliminates discontinuities in motion due to subsequent PVT commands reaching the device late.
251
+ * You can only cork an idle live PVT sequence.
252
+ */
253
+ async cork() {
254
+ const request = new gateway.StreamEmptyRequest();
255
+ request.setInterfaceId(this.device.connection.interfaceId);
256
+ request.setDevice(this.device.deviceAddress);
257
+ request.setStreamId(this.pvtId);
258
+ request.setPvt(true);
259
+ await gateway.callAsync('device/stream_cork', request);
260
+ }
261
+ /**
262
+ * Uncork the front of the queue, unblocking command execution.
263
+ * You can only uncork an idle live PVT sequence that is corked.
264
+ */
265
+ async uncork() {
266
+ const request = new gateway.StreamEmptyRequest();
267
+ request.setInterfaceId(this.device.connection.interfaceId);
268
+ request.setDevice(this.device.deviceAddress);
269
+ request.setStreamId(this.pvtId);
270
+ request.setPvt(true);
271
+ await gateway.callAsync('device/stream_uncork', request);
272
+ }
273
+ /**
274
+ * Returns a boolean value indicating whether the live PVT sequence is executing a queued action.
275
+ * @returns True if the PVT sequence is executing a queued action.
276
+ */
277
+ async isBusy() {
278
+ const request = new gateway.StreamEmptyRequest();
279
+ request.setInterfaceId(this.device.connection.interfaceId);
280
+ request.setDevice(this.device.deviceAddress);
281
+ request.setStreamId(this.pvtId);
282
+ request.setPvt(true);
283
+ const response = await gateway.callAsync('device/stream_is_busy', request, gateway.BoolResponse);
284
+ return response.getValue();
285
+ }
286
+ /**
287
+ * Returns a string which represents the PVT sequence.
288
+ * @returns String which represents the PVT sequence.
289
+ */
290
+ toString() {
291
+ const request = new gateway.StreamEmptyRequest();
292
+ request.setInterfaceId(this.device.connection.interfaceId);
293
+ request.setDevice(this.device.deviceAddress);
294
+ request.setStreamId(this.pvtId);
295
+ request.setPvt(true);
296
+ const response = gateway.callSync('device/stream_to_string', request, gateway.StringResponse);
297
+ return response.getValue();
298
+ }
299
+ /**
300
+ * Disables the PVT sequence.
301
+ * If the PVT sequence is not setup, this command does nothing.
302
+ * Once disabled, the PVT sequence will no longer accept PVT commands.
303
+ * The PVT sequence will process the rest of the commands in the queue until it is empty.
304
+ */
305
+ async disable() {
306
+ const request = new gateway.StreamEmptyRequest();
307
+ request.setInterfaceId(this.device.connection.interfaceId);
308
+ request.setDevice(this.device.deviceAddress);
309
+ request.setStreamId(this.pvtId);
310
+ request.setPvt(true);
311
+ await gateway.callAsync('device/stream_disable', request);
312
+ }
313
+ /**
314
+ * Sends a generic ASCII command to the PVT sequence.
315
+ * Keeps resending the command while the device rejects with AGAIN reason.
316
+ * @param command Command and its parameters.
317
+ */
318
+ async genericCommand(command) {
319
+ const request = new gateway.StreamGenericCommandRequest();
320
+ request.setInterfaceId(this.device.connection.interfaceId);
321
+ request.setDevice(this.device.deviceAddress);
322
+ request.setStreamId(this.pvtId);
323
+ request.setPvt(true);
324
+ request.setCommand(command);
325
+ await gateway.callAsync('device/stream_generic_command', request);
326
+ }
327
+ /**
328
+ * Sends a batch of generic ASCII commands to the PVT sequence.
329
+ * Keeps resending command while the device rejects with AGAIN reason.
330
+ * The batch is atomic in terms of thread safety.
331
+ * @param batch Array of commands.
332
+ */
333
+ async genericCommandBatch(batch) {
334
+ const request = new gateway.StreamGenericCommandBatchRequest();
335
+ request.setInterfaceId(this.device.connection.interfaceId);
336
+ request.setDevice(this.device.deviceAddress);
337
+ request.setStreamId(this.pvtId);
338
+ request.setPvt(true);
339
+ request.setBatchList(batch);
340
+ await gateway.callAsync('device/stream_generic_command_batch', request);
341
+ }
342
+ /**
343
+ * Queries the PVT sequence status from the device
344
+ * and returns boolean indicating whether the PVT sequence is disabled.
345
+ * Useful to determine if execution was interrupted by other movements.
346
+ * @returns True if the PVT sequence is disabled.
347
+ */
348
+ async checkDisabled() {
349
+ const request = new gateway.StreamEmptyRequest();
350
+ request.setInterfaceId(this.device.connection.interfaceId);
351
+ request.setDevice(this.device.deviceAddress);
352
+ request.setStreamId(this.pvtId);
353
+ request.setPvt(true);
354
+ const response = await gateway.callAsync('device/stream_check_disabled', request, gateway.BoolResponse);
355
+ return response.getValue();
356
+ }
357
+ /**
358
+ * Makes the PVT sequence throw PvtDiscontinuityException when it encounters discontinuities (ND warning flag).
359
+ */
360
+ treatDiscontinuitiesAsError() {
361
+ const request = new gateway.StreamEmptyRequest();
362
+ request.setInterfaceId(this.device.connection.interfaceId);
363
+ request.setDevice(this.device.deviceAddress);
364
+ request.setStreamId(this.pvtId);
365
+ request.setPvt(true);
366
+ gateway.callSync('device/stream_treat_discontinuities', request);
367
+ }
368
+ /**
369
+ * Prevents PvtDiscontinuityException as a result of expected discontinuity when resuming the sequence.
370
+ */
371
+ ignoreCurrentDiscontinuity() {
372
+ const request = new gateway.StreamEmptyRequest();
373
+ request.setInterfaceId(this.device.connection.interfaceId);
374
+ request.setDevice(this.device.deviceAddress);
375
+ request.setStreamId(this.pvtId);
376
+ request.setPvt(true);
377
+ gateway.callSync('device/stream_ignore_discontinuity', request);
378
+ }
379
+ /**
380
+ * Gets the axes of the PVT sequence.
381
+ * @returns An array of axis numbers of the axes the PVT sequence is set up to control.
382
+ */
383
+ _retrieveAxes() {
384
+ const request = new gateway.StreamEmptyRequest();
385
+ request.setInterfaceId(this.device.connection.interfaceId);
386
+ request.setDevice(this.device.deviceAddress);
387
+ request.setStreamId(this.pvtId);
388
+ request.setPvt(true);
389
+ const response = gateway.callSync('device/stream_get_axes', request, gateway.StreamGetAxesResponse);
390
+ return response.getAxesList().map(a => pvt_axis_definition_1.PvtAxisDefinition.fromProtobuf(a.toObject()));
391
+ }
392
+ /**
393
+ * Get the mode of the PVT sequence.
394
+ * @returns Mode of the PVT sequence.
395
+ */
396
+ _retrieveMode() {
397
+ const request = new gateway.StreamEmptyRequest();
398
+ request.setInterfaceId(this.device.connection.interfaceId);
399
+ request.setDevice(this.device.deviceAddress);
400
+ request.setStreamId(this.pvtId);
401
+ request.setPvt(true);
402
+ const response = gateway.callSync('device/stream_get_mode', request, gateway.IntResponse);
403
+ return response.getValue();
404
+ }
405
+ }
406
+ exports.PvtSequence = PvtSequence;
407
+ //# sourceMappingURL=pvt_sequence.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pvt_sequence.js","sourceRoot":"","sources":["../../../src/ascii/pvt_sequence.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtD,oDAAsC;AACtC,gDAA6C;AAG7C,+DAA0D;AAE1D;;;;;;GAMG;AACH,MAAa,WAAW;IACtB;;OAEG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAGD;;OAEG;IACH,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAGD;;OAEG;IACH,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,aAAa,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MPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Device } from './device';\nimport * as gateway from '../gateway';\nimport { Measurement } from '../measurement';\nimport { PvtBuffer } from './pvt_buffer';\nimport { PvtMode } from './pvt_mode';\nimport { PvtAxisDefinition } from './pvt_axis_definition';\n\n/**\n * A handle for a PVT sequence with this number on the device.\n * PVT sequences provide a way execute or store trajectory\n * consisting of points with defined position, velocity, and time.\n * PVT sequence methods append actions to a queue which executes\n * or stores actions in a first in, first out order.\n */\nexport class PvtSequence {\n /**\n * Device that controls this PVT sequence.\n */\n public get device(): Device {\n return this._device;\n }\n private _device: Device;\n\n /**\n * The number that identifies the PVT sequence on the device.\n */\n public get pvtId(): number {\n return this._pvtId;\n }\n private _pvtId: number;\n\n /**\n * Current mode of the PVT sequence.\n */\n public get mode(): PvtMode {\n return this._retrieveMode();\n }\n\n /**\n * An array of axes definitions the PVT sequence is set up to control.\n */\n public get axes(): PvtAxisDefinition[] {\n return this._retrieveAxes();\n }\n\n constructor(device: Device, pvtId: number) {\n this._device = device;\n this._pvtId = pvtId;\n }\n\n /**\n * Setup the PVT sequence to control the specified axes and to queue actions on the device.\n * Allows use of lockstep axes in a PVT sequence.\n * @param axes Definition of the PVT sequence axes.\n */\n public async setupLiveComposite(\n ...axes: PvtAxisDefinition[]\n ): Promise<void> {\n const request = new gateway.StreamSetupLiveCompositeRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStreamId(this.pvtId);\n request.setPvt(true);\n request.setAxesList(axes.map(PvtAxisDefinition.toProtobuf));\n\n await gateway.callAsync('device/stream_setup_live_composite', request);\n }\n\n /**\n * Setup the PVT sequence to control the specified axes and to queue actions on the device.\n * @param axes Numbers of physical axes to setup the PVT sequence on.\n */\n public async setupLive(\n ...axes: number[]\n ): Promise<void> {\n const request = new gateway.StreamSetupLiveRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStreamId(this.pvtId);\n request.setPvt(true);\n request.setAxesList(axes);\n\n await gateway.callAsync('device/stream_setup_live', request);\n }\n\n /**\n * Setup the PVT sequence to use the specified axes and queue actions into a PVT buffer.\n * Allows use of lockstep axes in a PVT sequence.\n * @param pvtBuffer The PVT buffer to queue actions in.\n * @param axes Definition of the PVT sequence axes.\n */\n public async setupStoreComposite(\n pvtBuffer: PvtBuffer,\n ...axes: PvtAxisDefinition[]\n ): Promise<void> {\n const request = new gateway.StreamSetupStoreCompositeRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStreamId(this.pvtId);\n request.setPvt(true);\n request.setPvtBuffer(pvtBuffer.bufferId);\n request.setAxesList(axes.map(PvtAxisDefinition.toProtobuf));\n\n await gateway.callAsync('device/stream_setup_store_composite', request);\n }\n\n /**\n * Setup the PVT sequence to use the specified axes and queue actions into a PVT buffer.\n * @param pvtBuffer The PVT buffer to queue actions in.\n * @param axes Numbers of physical axes to setup the PVT sequence on.\n */\n public async setupStore(\n pvtBuffer: PvtBuffer,\n ...axes: number[]\n ): Promise<void> {\n const request = new gateway.StreamSetupStoreRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStreamId(this.pvtId);\n request.setPvt(true);\n request.setPvtBuffer(pvtBuffer.bufferId);\n request.setAxesList(axes);\n\n await gateway.callAsync('device/stream_setup_store', request);\n }\n\n /**\n * Append the actions in a PVT buffer to the sequence's queue.\n * @param pvtBuffer The PVT buffer to call.\n */\n public async call(\n pvtBuffer: PvtBuffer\n ): Promise<void> {\n const request = new gateway.StreamCallRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStreamId(this.pvtId);\n request.setPvt(true);\n request.setPvtBuffer(pvtBuffer.bufferId);\n\n await gateway.callAsync('device/stream_call', request);\n }\n\n /**\n * Queues a point with absolute coordinates in the PVT sequence.\n * @param positions Positions for the axes to move through, relative to their home positions.\n * @param velocities The axes velocities at the given point.\n * @param time The duration between the previous point in the sequence and this one.\n */\n public async point(\n positions: Measurement[],\n velocities: Measurement[],\n time: Measurement\n ): Promise<void> {\n const request = new gateway.PvtPointRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStreamId(this.pvtId);\n request.setPvt(true);\n request.setType(gateway.PvtPointRequest.Type.ABS);\n request.setPositionsList(positions.map(Measurement.toProtobuf));\n request.setVelocitiesList(velocities.map(Measurement.toProtobuf));\n request.setTime(Measurement.toProtobuf(time));\n\n await gateway.callAsync('device/stream_point', request);\n }\n\n /**\n * Queues a point with coordinates relative to the previous point in the PVT sequence.\n * @param positions Positions for the axes to move through, relative to the previous point.\n * @param velocities The axes velocities at the given point.\n * @param time The duration between the previous point in the sequence and this one.\n */\n public async pointRelative(\n positions: Measurement[],\n velocities: Measurement[],\n time: Measurement\n ): Promise<void> {\n const request = new gateway.PvtPointRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStreamId(this.pvtId);\n request.setPvt(true);\n request.setType(gateway.PvtPointRequest.Type.REL);\n request.setPositionsList(positions.map(Measurement.toProtobuf));\n request.setVelocitiesList(velocities.map(Measurement.toProtobuf));\n request.setTime(Measurement.toProtobuf(time));\n\n await gateway.callAsync('device/stream_point', request);\n }\n\n /**\n * Set the value of a digital output channel.\n * @param channelNumber The number of the digital output channel.\n * Channel numbers are numbered from one.\n * @param value The value to set the channel to.\n */\n public async setDigitalOutput(\n channelNumber: number,\n value: boolean\n ): Promise<void> {\n const request = new gateway.StreamSetDigitalOutputRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStreamId(this.pvtId);\n request.setPvt(true);\n request.setChannelNumber(channelNumber);\n request.setValue(value);\n\n await gateway.callAsync('device/stream_set_digital_output', request);\n }\n\n /**\n * Set the value of an analog output channel.\n * @param channelNumber The number of the analog output channel.\n * Channel numbers are numbered from one.\n * @param value The value to set the channel to, in Volts.\n */\n public async setAnalogOutput(\n channelNumber: number,\n value: number\n ): Promise<void> {\n const request = new gateway.StreamSetAnalogOutputRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStreamId(this.pvtId);\n request.setPvt(true);\n request.setChannelNumber(channelNumber);\n request.setValue(value);\n\n await gateway.callAsync('device/stream_set_analog_output', request);\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.StreamSetAllDigitalOutputsRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStreamId(this.pvtId);\n request.setPvt(true);\n request.setValuesList(values);\n\n await gateway.callAsync('device/stream_set_all_digital_outputs', request);\n }\n\n /**\n * Sets values for all analog output channels.\n * @param values The values to set the output channels to, in Volts.\n */\n public async setAllAnalogOutputs(\n values: number[]\n ): Promise<void> {\n const request = new gateway.StreamSetAllAnalogOutputsRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStreamId(this.pvtId);\n request.setPvt(true);\n request.setValuesList(values);\n\n await gateway.callAsync('device/stream_set_all_analog_outputs', request);\n }\n\n /**\n * Waits until the live PVT sequence executes all queued actions.\n * @param [options.throwErrorOnFault=true] Determines whether to throw error when fault is observed.\n */\n public async waitUntilIdle(\n options: PvtSequence.WaitUntilIdleOptions = {}\n ): Promise<void> {\n const {\n throwErrorOnFault = true,\n } = options;\n const request = new gateway.StreamWaitUntilIdleRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStreamId(this.pvtId);\n request.setPvt(true);\n request.setThrowErrorOnFault(throwErrorOnFault);\n\n await gateway.callAsync('device/stream_wait_until_idle', request);\n }\n\n /**\n * Cork the front of the PVT sequences's action queue, blocking execution.\n * Execution resumes upon uncorking the queue, or when the number of queued actions reaches its limit.\n * Corking eliminates discontinuities in motion due to subsequent PVT commands reaching the device late.\n * You can only cork an idle live PVT sequence.\n */\n public async cork(): Promise<void> {\n const request = new gateway.StreamEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStreamId(this.pvtId);\n request.setPvt(true);\n\n await gateway.callAsync('device/stream_cork', request);\n }\n\n /**\n * Uncork the front of the queue, unblocking command execution.\n * You can only uncork an idle live PVT sequence that is corked.\n */\n public async uncork(): Promise<void> {\n const request = new gateway.StreamEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStreamId(this.pvtId);\n request.setPvt(true);\n\n await gateway.callAsync('device/stream_uncork', request);\n }\n\n /**\n * Returns a boolean value indicating whether the live PVT sequence is executing a queued action.\n * @returns True if the PVT sequence is executing a queued action.\n */\n public async isBusy(): Promise<boolean> {\n const request = new gateway.StreamEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStreamId(this.pvtId);\n request.setPvt(true);\n\n const response = await gateway.callAsync<gateway.BoolResponse>(\n 'device/stream_is_busy',\n request,\n gateway.BoolResponse);\n return response.getValue();\n }\n\n /**\n * Returns a string which represents the PVT sequence.\n * @returns String which represents the PVT sequence.\n */\n public toString(): string {\n const request = new gateway.StreamEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStreamId(this.pvtId);\n request.setPvt(true);\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'device/stream_to_string',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n\n /**\n * Disables the PVT sequence.\n * If the PVT sequence is not setup, this command does nothing.\n * Once disabled, the PVT sequence will no longer accept PVT commands.\n * The PVT sequence will process the rest of the commands in the queue until it is empty.\n */\n public async disable(): Promise<void> {\n const request = new gateway.StreamEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStreamId(this.pvtId);\n request.setPvt(true);\n\n await gateway.callAsync('device/stream_disable', request);\n }\n\n /**\n * Sends a generic ASCII command to the PVT sequence.\n * Keeps resending the command while the device rejects with AGAIN reason.\n * @param command Command and its parameters.\n */\n public async genericCommand(\n command: string\n ): Promise<void> {\n const request = new gateway.StreamGenericCommandRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStreamId(this.pvtId);\n request.setPvt(true);\n request.setCommand(command);\n\n await gateway.callAsync('device/stream_generic_command', request);\n }\n\n /**\n * Sends a batch of generic ASCII commands to the PVT sequence.\n * Keeps resending command while the device rejects with AGAIN reason.\n * The batch is atomic in terms of thread safety.\n * @param batch Array of commands.\n */\n public async genericCommandBatch(\n batch: string[]\n ): Promise<void> {\n const request = new gateway.StreamGenericCommandBatchRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStreamId(this.pvtId);\n request.setPvt(true);\n request.setBatchList(batch);\n\n await gateway.callAsync('device/stream_generic_command_batch', request);\n }\n\n /**\n * Queries the PVT sequence status from the device\n * and returns boolean indicating whether the PVT sequence is disabled.\n * Useful to determine if execution was interrupted by other movements.\n * @returns True if the PVT sequence is disabled.\n */\n public async checkDisabled(): Promise<boolean> {\n const request = new gateway.StreamEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStreamId(this.pvtId);\n request.setPvt(true);\n\n const response = await gateway.callAsync<gateway.BoolResponse>(\n 'device/stream_check_disabled',\n request,\n gateway.BoolResponse);\n return response.getValue();\n }\n\n /**\n * Makes the PVT sequence throw PvtDiscontinuityException when it encounters discontinuities (ND warning flag).\n */\n public treatDiscontinuitiesAsError(): void {\n const request = new gateway.StreamEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStreamId(this.pvtId);\n request.setPvt(true);\n\n gateway.callSync('device/stream_treat_discontinuities', request);\n }\n\n /**\n * Prevents PvtDiscontinuityException as a result of expected discontinuity when resuming the sequence.\n */\n public ignoreCurrentDiscontinuity(): void {\n const request = new gateway.StreamEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStreamId(this.pvtId);\n request.setPvt(true);\n\n gateway.callSync('device/stream_ignore_discontinuity', request);\n }\n\n /**\n * Gets the axes of the PVT sequence.\n * @returns An array of axis numbers of the axes the PVT sequence is set up to control.\n */\n private _retrieveAxes(): PvtAxisDefinition[] {\n const request = new gateway.StreamEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStreamId(this.pvtId);\n request.setPvt(true);\n\n const response = gateway.callSync<gateway.StreamGetAxesResponse>(\n 'device/stream_get_axes',\n request,\n gateway.StreamGetAxesResponse);\n return response.getAxesList().map(a => PvtAxisDefinition.fromProtobuf(a.toObject()));\n }\n\n /**\n * Get the mode of the PVT sequence.\n * @returns Mode of the PVT sequence.\n */\n private _retrieveMode(): PvtMode {\n const request = new gateway.StreamEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStreamId(this.pvtId);\n request.setPvt(true);\n\n const response = gateway.callSync<gateway.IntResponse>(\n 'device/stream_get_mode',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n}\n\nnamespace PvtSequence {\n export interface WaitUntilIdleOptions {\n throwErrorOnFault?: boolean;\n }\n}\n"]}