@zaber/motion 7.4.2 → 7.5.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.
- package/dist/binding/wasm/zaber-motion-core.wasm +0 -0
- package/dist/lib/ascii/axis.d.ts +11 -1
- package/dist/lib/ascii/axis.d.ts.map +1 -1
- package/dist/lib/ascii/axis.js +5 -1
- package/dist/lib/ascii/axis.js.map +1 -1
- package/dist/lib/ascii/device.d.ts +10 -1
- package/dist/lib/ascii/device.d.ts.map +1 -1
- package/dist/lib/ascii/device.js +5 -1
- package/dist/lib/ascii/device.js.map +1 -1
- package/dist/lib/library.js +1 -1
- package/dist/lib/library.js.map +1 -1
- package/dist/lib/microscopy/illuminator_channel.d.ts +11 -1
- package/dist/lib/microscopy/illuminator_channel.d.ts.map +1 -1
- package/dist/lib/microscopy/illuminator_channel.js +5 -1
- package/dist/lib/microscopy/illuminator_channel.js.map +1 -1
- package/dist/lib/product/process.d.ts +11 -1
- package/dist/lib/product/process.d.ts.map +1 -1
- package/dist/lib/product/process.js +5 -1
- package/dist/lib/product/process.js.map +1 -1
- package/dist/lib/requests/can_set_state_request.d.ts +2 -0
- package/dist/lib/requests/can_set_state_request.d.ts.map +1 -1
- package/dist/lib/requests/can_set_state_request.js +3 -0
- package/dist/lib/requests/can_set_state_request.js.map +1 -1
- package/package.json +1 -1
|
Binary file
|
package/dist/lib/ascii/axis.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { Response } from './response';
|
|
|
8
8
|
import { Measurement } from '../measurement';
|
|
9
9
|
import { AxisStorage } from './storage';
|
|
10
10
|
import { SetStateAxisResponse } from './set_state_axis_response';
|
|
11
|
+
import { FirmwareVersion } from '../firmware_version';
|
|
11
12
|
/**
|
|
12
13
|
* Represents an axis of motion associated with a device.
|
|
13
14
|
*/
|
|
@@ -272,9 +273,11 @@ export declare class Axis {
|
|
|
272
273
|
* This only covers exceptions that can be determined statically such as mismatches of ID or version,
|
|
273
274
|
* the process of applying the state can still fail when running.
|
|
274
275
|
* @param state The state object to check against.
|
|
276
|
+
* @param options.firmwareVersion The firmware version of the device to apply the state to.
|
|
277
|
+
* Use this to ensure the state will still be compatible after an update.
|
|
275
278
|
* @returns An explanation of why this state cannot be set to this axis.
|
|
276
279
|
*/
|
|
277
|
-
canSetState(state: string): Promise<string | null>;
|
|
280
|
+
canSetState(state: string, options?: Axis.CanSetStateOptions): Promise<string | null>;
|
|
278
281
|
/**
|
|
279
282
|
* Returns identity.
|
|
280
283
|
* @returns Axis identity.
|
|
@@ -508,6 +511,13 @@ declare namespace Axis {
|
|
|
508
511
|
*/
|
|
509
512
|
timeout?: number;
|
|
510
513
|
}
|
|
514
|
+
interface CanSetStateOptions {
|
|
515
|
+
/**
|
|
516
|
+
* The firmware version of the device to apply the state to.
|
|
517
|
+
* Use this to ensure the state will still be compatible after an update.
|
|
518
|
+
*/
|
|
519
|
+
firmwareVersion?: FirmwareVersion;
|
|
520
|
+
}
|
|
511
521
|
interface DriverEnableOptions {
|
|
512
522
|
/**
|
|
513
523
|
* Timeout in seconds. Specify 0 to attempt to enable the driver once.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axis.d.ts","sourceRoot":"","sources":["../../../src/ascii/axis.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,YAAY,EAAE,mBAAmB,EAAS,IAAI,EAAE,MAAM,UAAU,CAAC;AAC5H,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;A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QAC3B;;;;WAIG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QACf;;WAEG;QACH,aAAa,CAAC,EAAE,OAAO,CAAC;KAC3B;IACD,UAAiB,kBAAkB;QAC/B;;WAEG;QACH,aAAa,CAAC,EAAE,OAAO,CAAC;KAC3B;CACF"}
|
package/dist/lib/ascii/axis.js
CHANGED
|
@@ -690,16 +690,20 @@ class Axis {
|
|
|
690
690
|
* This only covers exceptions that can be determined statically such as mismatches of ID or version,
|
|
691
691
|
* the process of applying the state can still fail when running.
|
|
692
692
|
* @param state The state object to check against.
|
|
693
|
+
* @param options.firmwareVersion The firmware version of the device to apply the state to.
|
|
694
|
+
* Use this to ensure the state will still be compatible after an update.
|
|
693
695
|
* @returns An explanation of why this state cannot be set to this axis.
|
|
694
696
|
*/
|
|
695
|
-
async canSetState(state) {
|
|
697
|
+
async canSetState(state, options = {}) {
|
|
696
698
|
var _a;
|
|
699
|
+
const { firmwareVersion, } = options;
|
|
697
700
|
const request = {
|
|
698
701
|
...requests.CanSetStateRequest.DEFAULT,
|
|
699
702
|
interfaceId: this.device.connection.interfaceId,
|
|
700
703
|
device: this.device.deviceAddress,
|
|
701
704
|
axis: this.axisNumber,
|
|
702
705
|
state: state,
|
|
706
|
+
firmwareVersion: firmwareVersion,
|
|
703
707
|
toBinary() {
|
|
704
708
|
return requests.CanSetStateRequest.toBinary(this);
|
|
705
709
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axis.js","sourceRoot":"","sources":["../../../src/ascii/axis.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtD,mDAA+C;AAE/C,yCAAsC;AACtC,mDAA+C;AAC/C,oCAA4H;AAC5H,yCAAsC;AAEtC,oDAAsC;AACtC,sDAAwC;AACxC,uCAAwC;AACxC,uEAAiE;AAEjE;;GAEG;AACH,MAAa,IAAI;IACf;;OAEG;IACH,IAAW,MAAM;QACf,OAA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AAK;YACZ,aAAa,EAAE,aAAa;YAC5B,QAAQ;gBACN,OAAO,QAAQ,CAAC,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACtD,CAAC;SACF,CAAC;QAEF,MAAM,OAAO,CAAC,SAAS,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,WAAW,CACtB,UAAmC,EAAE;QAErC,MAAM,EACJ,aAAa,GAAG,IAAI,GACrB,GAAG,OAAO,CAAC;QACZ,MAAM,OAAO,GAAiD;YAC5D,GAAG,QAAQ,CAAC,iBAAiB,CAAC,OAAO;YACrC,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW;YAC/C,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa;YACjC,IAAI,EAAE,IAAI,CAAC,UAAU;YACrB,aAAa,EAAE,aAAa;YAC5B,QAAQ;gBACN,OAAO,QAAQ,CAAC,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACnD,CAAC;SACF,CAAC;QAEF,MAAM,OAAO,CAAC,SAAS,CAAC,sBAAsB,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;CACF;AAlhCD,oBAkhCC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Device } from './device';\nimport { AxisIdentity } from './axis_identity';\nimport { AxisType } from './axis_type';\nimport { Warnings } from './warnings';\nimport { AxisSettings } from './axis_settings';\nimport { Angle, Length, Native, AngularVelocity, Velocity, Acceleration, AngularAcceleration, Units, Time } from '../units';\nimport { Response } from './response';\nimport { Measurement } from '../measurement';\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { AxisStorage } from './storage';\nimport { SetStateAxisResponse } from './set_state_axis_response';\n\n/**\n * Represents an axis of motion associated with a device.\n */\nexport class Axis {\n /**\n * Device that controls this axis.\n */\n public get device(): Device {\n return this._device;\n }\n private _device: Device;\n\n /**\n * The axis number identifies the axis on the device.\n * The first axis has the number one.\n */\n public get axisNumber(): number {\n return this._axisNumber;\n }\n private _axisNumber: number;\n\n /**\n * Settings and properties of this axis.\n */\n public get settings(): AxisSettings {\n return this._settings;\n }\n private _settings: AxisSettings;\n\n /**\n * Key-value storage of this axis.\n * Requires at least Firmware 7.30.\n */\n public get storage(): AxisStorage {\n return this._storage;\n }\n private _storage: AxisStorage;\n\n /**\n * Warnings and faults of this axis.\n */\n public get warnings(): Warnings {\n return this._warnings;\n }\n private _warnings: Warnings;\n\n /**\n * Identity of the axis.\n */\n public get identity(): AxisIdentity {\n return this._retrieveIdentity();\n }\n\n /**\n * Unique ID of the peripheral hardware.\n */\n public get peripheralId(): number {\n return this.identity.peripheralId;\n }\n\n /**\n * Name of the peripheral.\n */\n public get peripheralName(): string {\n return this.identity.peripheralName;\n }\n\n /**\n * Serial number of the peripheral, or 0 when not applicable.\n */\n public get peripheralSerialNumber(): number {\n return this.identity.peripheralSerialNumber;\n }\n\n /**\n * Indicates whether the axis is a peripheral or part of an integrated device.\n */\n public get isPeripheral(): boolean {\n return this.identity.isPeripheral;\n }\n\n /**\n * Determines the type of an axis and units it accepts.\n */\n public get axisType(): AxisType {\n return this.identity.axisType;\n }\n\n /**\n * User-assigned label of the peripheral.\n */\n public get label(): string {\n return this._retrieveLabel();\n }\n\n constructor(device: Device, axisNumber: number) {\n this._device = device;\n this._axisNumber = axisNumber;\n this._settings = new AxisSettings(this);\n this._storage = new AxisStorage(this);\n this._warnings = new Warnings(device, axisNumber);\n }\n\n /**\n * Homes axis. Axis returns to its homing position.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n */\n public async home(\n options: Axis.HomeOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n } = options;\n const request: requests.DeviceHomeRequest & gateway.Message = {\n ...requests.DeviceHomeRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n waitUntilIdle: waitUntilIdle,\n toBinary() {\n return requests.DeviceHomeRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/home', request);\n }\n\n /**\n * Stops ongoing axis movement. Decelerates until zero speed.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n */\n public async stop(\n options: Axis.StopOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n } = options;\n const request: requests.DeviceStopRequest & gateway.Message = {\n ...requests.DeviceStopRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n waitUntilIdle: waitUntilIdle,\n toBinary() {\n return requests.DeviceStopRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/stop', request);\n }\n\n /**\n * Parks the axis in anticipation of turning the power off.\n * It can later be powered on, unparked, and moved without first having to home it.\n */\n public async park(): Promise<void> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/park', request);\n }\n\n /**\n * Unparks axis. Axis will now be able to move.\n */\n public async unpark(): Promise<void> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/unpark', request);\n }\n\n /**\n * Returns bool indicating whether the axis is parked or not.\n * @returns True if the axis is currently parked. False otherwise.\n */\n public async isParked(): Promise<boolean> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.BoolResponse>(\n 'device/is_parked',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Waits until axis stops moving.\n * @param [options.throwErrorOnFault=true] Determines whether to throw error when fault is observed.\n */\n public async waitUntilIdle(\n options: Axis.WaitUntilIdleOptions = {}\n ): Promise<void> {\n const {\n throwErrorOnFault = true,\n } = options;\n const request: requests.DeviceWaitUntilIdleRequest & gateway.Message = {\n ...requests.DeviceWaitUntilIdleRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n throwErrorOnFault: throwErrorOnFault,\n toBinary() {\n return requests.DeviceWaitUntilIdleRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/wait_until_idle', request);\n }\n\n /**\n * Returns bool indicating whether the axis is executing a motion command.\n * @returns True if the axis is currently executing a motion command.\n */\n public async isBusy(): Promise<boolean> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.BoolResponse>(\n 'device/is_busy',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Returns bool indicating whether the axis has position reference and was homed.\n * @returns True if the axis has position reference and was homed.\n */\n public async isHomed(): Promise<boolean> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.BoolResponse>(\n 'device/is_homed',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Move axis to absolute position.\n * @param position Absolute position.\n * @param [unit=Units.NATIVE] Units of position.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n * @param [options.velocity=0] Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.velocityUnit=Units.NATIVE] Units of velocity.\n * @param [options.acceleration=0] Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.accelerationUnit=Units.NATIVE] Units of acceleration.\n */\n public async moveAbsolute(\n position: number,\n unit: Length | Angle | Native = Units.NATIVE,\n options: Axis.MoveAbsoluteOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n velocity = 0,\n velocityUnit = Units.NATIVE,\n acceleration = 0,\n accelerationUnit = Units.NATIVE,\n } = options;\n const request: requests.DeviceMoveRequest & gateway.Message = {\n ...requests.DeviceMoveRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n type: requests.AxisMoveType.ABS,\n arg: position,\n unit: unit,\n waitUntilIdle: waitUntilIdle,\n velocity: velocity,\n velocityUnit: velocityUnit,\n acceleration: acceleration,\n accelerationUnit: accelerationUnit,\n toBinary() {\n return requests.DeviceMoveRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/move', request);\n }\n\n /**\n * Moves the axis to the maximum position as specified by limit.max.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n * @param [options.velocity=0] Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.velocityUnit=Units.NATIVE] Units of velocity.\n * @param [options.acceleration=0] Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.accelerationUnit=Units.NATIVE] Units of acceleration.\n */\n public async moveMax(\n options: Axis.MoveMaxOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n velocity = 0,\n velocityUnit = Units.NATIVE,\n acceleration = 0,\n accelerationUnit = Units.NATIVE,\n } = options;\n const request: requests.DeviceMoveRequest & gateway.Message = {\n ...requests.DeviceMoveRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n type: requests.AxisMoveType.MAX,\n waitUntilIdle: waitUntilIdle,\n velocity: velocity,\n velocityUnit: velocityUnit,\n acceleration: acceleration,\n accelerationUnit: accelerationUnit,\n toBinary() {\n return requests.DeviceMoveRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/move', request);\n }\n\n /**\n * Moves the axis to the minimum position as specified by limit.min.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n * @param [options.velocity=0] Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.velocityUnit=Units.NATIVE] Units of velocity.\n * @param [options.acceleration=0] Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.accelerationUnit=Units.NATIVE] Units of acceleration.\n */\n public async moveMin(\n options: Axis.MoveMinOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n velocity = 0,\n velocityUnit = Units.NATIVE,\n acceleration = 0,\n accelerationUnit = Units.NATIVE,\n } = options;\n const request: requests.DeviceMoveRequest & gateway.Message = {\n ...requests.DeviceMoveRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n type: requests.AxisMoveType.MIN,\n waitUntilIdle: waitUntilIdle,\n velocity: velocity,\n velocityUnit: velocityUnit,\n acceleration: acceleration,\n accelerationUnit: accelerationUnit,\n toBinary() {\n return requests.DeviceMoveRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/move', request);\n }\n\n /**\n * Move axis to position relative to current position.\n * @param position Relative position.\n * @param [unit=Units.NATIVE] Units of position.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n * @param [options.velocity=0] Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.velocityUnit=Units.NATIVE] Units of velocity.\n * @param [options.acceleration=0] Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.accelerationUnit=Units.NATIVE] Units of acceleration.\n */\n public async moveRelative(\n position: number,\n unit: Length | Angle | Native = Units.NATIVE,\n options: Axis.MoveRelativeOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n velocity = 0,\n velocityUnit = Units.NATIVE,\n acceleration = 0,\n accelerationUnit = Units.NATIVE,\n } = options;\n const request: requests.DeviceMoveRequest & gateway.Message = {\n ...requests.DeviceMoveRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n type: requests.AxisMoveType.REL,\n arg: position,\n unit: unit,\n waitUntilIdle: waitUntilIdle,\n velocity: velocity,\n velocityUnit: velocityUnit,\n acceleration: acceleration,\n accelerationUnit: accelerationUnit,\n toBinary() {\n return requests.DeviceMoveRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/move', request);\n }\n\n /**\n * Begins to move axis at specified speed.\n * @param velocity Movement velocity.\n * @param [unit=Units.NATIVE] Units of velocity.\n * @param [options.acceleration=0] Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.accelerationUnit=Units.NATIVE] Units of acceleration.\n */\n public async moveVelocity(\n velocity: number,\n unit: Velocity | AngularVelocity | Native = Units.NATIVE,\n options: Axis.MoveVelocityOptions = {}\n ): Promise<void> {\n const {\n acceleration = 0,\n accelerationUnit = Units.NATIVE,\n } = options;\n const request: requests.DeviceMoveRequest & gateway.Message = {\n ...requests.DeviceMoveRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n type: requests.AxisMoveType.VEL,\n arg: velocity,\n unit: unit,\n acceleration: acceleration,\n accelerationUnit: accelerationUnit,\n toBinary() {\n return requests.DeviceMoveRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/move', request);\n }\n\n /**\n * Returns current axis position.\n * @param [unit=Units.NATIVE] Units of position.\n * @returns Axis position.\n */\n public async getPosition(\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<number> {\n const request: requests.DeviceGetSettingRequest & gateway.Message = {\n ...requests.DeviceGetSettingRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n setting: 'pos',\n unit: unit,\n toBinary() {\n return requests.DeviceGetSettingRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'device/get_setting',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Gets number of index positions of the axis.\n * @returns Number of index positions.\n */\n public async getNumberOfIndexPositions(): Promise<number> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntResponse>(\n 'device/get_index_count',\n request,\n requests.IntResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Returns current axis index position.\n * @returns Index position starting from 1 or 0 if the position is not an index position.\n */\n public async getIndexPosition(): Promise<number> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntResponse>(\n 'device/get_index_position',\n request,\n requests.IntResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Moves the axis to index position.\n * @param index Index position. Index positions are numbered from 1.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n * @param [options.velocity=0] Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.velocityUnit=Units.NATIVE] Units of velocity.\n * @param [options.acceleration=0] Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.accelerationUnit=Units.NATIVE] Units of acceleration.\n */\n public async moveIndex(\n index: number,\n options: Axis.MoveIndexOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n velocity = 0,\n velocityUnit = Units.NATIVE,\n acceleration = 0,\n accelerationUnit = Units.NATIVE,\n } = options;\n const request: requests.DeviceMoveRequest & gateway.Message = {\n ...requests.DeviceMoveRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n type: requests.AxisMoveType.INDEX,\n argInt: index,\n waitUntilIdle: waitUntilIdle,\n velocity: velocity,\n velocityUnit: velocityUnit,\n acceleration: acceleration,\n accelerationUnit: accelerationUnit,\n toBinary() {\n return requests.DeviceMoveRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/move', request);\n }\n\n /**\n * Sends a generic ASCII command to this axis.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns A response to the command.\n */\n public async genericCommand(\n command: string,\n options: Axis.GenericCommandOptions = {}\n ): Promise<Response> {\n const {\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n command: command,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<Response>(\n 'interface/generic_command',\n request,\n Response.fromBinary);\n return response;\n }\n\n /**\n * Sends a generic ASCII command to this axis and expect multiple responses.\n * Responses are returned in order of arrival.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.checkErrors=true] Controls whether to throw an exception when a device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns All responses to the command.\n */\n public async genericCommandMultiResponse(\n command: string,\n options: Axis.GenericCommandMultiResponseOptions = {}\n ): Promise<Response[]> {\n const {\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n command: command,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.GenericCommandResponseCollection>(\n 'interface/generic_command_multi_response',\n request,\n requests.GenericCommandResponseCollection.fromBinary);\n return response.responses;\n }\n\n /**\n * Sends a generic ASCII command to this axis without expecting a response and without adding a message ID\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n */\n public async genericCommandNoResponse(\n command: string\n ): Promise<void> {\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n command: command,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Formats parameters into a command and performs unit conversions.\n * Parameters in the command template are denoted by a question mark.\n * Command returned is only valid for this axis and this device.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param commandTemplate Template of a command to prepare. Parameters are denoted by question marks.\n * @param parameters Variable number of command parameters.\n * @returns Command with converted parameters.\n */\n public prepareCommand(\n commandTemplate: string,\n ...parameters: Measurement[]\n ): string {\n const request: requests.PrepareCommandRequest & gateway.Message = {\n ...requests.PrepareCommandRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n commandTemplate: commandTemplate,\n parameters: parameters,\n toBinary() {\n return requests.PrepareCommandRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/prepare_command',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sets the user-assigned peripheral label.\n * The label is stored on the controller and recognized by other software.\n * @param label Label to set.\n */\n public async setLabel(\n label: string\n ): Promise<void> {\n const request: requests.DeviceSetStorageRequest & gateway.Message = {\n ...requests.DeviceSetStorageRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n value: label,\n toBinary() {\n return requests.DeviceSetStorageRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/set_label', request);\n }\n\n /**\n * Gets the peripheral name.\n * @returns The label.\n */\n private _retrieveLabel(): string {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/get_label',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Returns a string that represents the axis.\n * @returns A string that represents the axis.\n */\n public toString(): string {\n const request: requests.AxisToStringRequest & gateway.Message = {\n ...requests.AxisToStringRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.AxisToStringRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/axis_to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Returns a serialization of the current axis state that can be saved and reapplied.\n * @returns A serialization of the current state of the axis.\n */\n public async getState(): Promise<string> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.StringResponse>(\n 'device/get_state',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Applies a saved state to this axis.\n * @param state The state object to apply to this axis.\n * @returns Reports of any issues that were handled, but caused the state to not be exactly restored.\n */\n public async setState(\n state: string\n ): Promise<SetStateAxisResponse> {\n const request: requests.SetStateRequest & gateway.Message = {\n ...requests.SetStateRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n state: state,\n toBinary() {\n return requests.SetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<SetStateAxisResponse>(\n 'device/set_axis_state',\n request,\n SetStateAxisResponse.fromBinary);\n return response;\n }\n\n /**\n * Checks if a state can be applied to this axis.\n * This only covers exceptions that can be determined statically such as mismatches of ID or version,\n * the process of applying the state can still fail when running.\n * @param state The state object to check against.\n * @returns An explanation of why this state cannot be set to this axis.\n */\n public async canSetState(\n state: string\n ): Promise<string | null> {\n const request: requests.CanSetStateRequest & gateway.Message = {\n ...requests.CanSetStateRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n state: state,\n toBinary() {\n return requests.CanSetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.CanSetStateAxisResponse>(\n 'device/can_set_axis_state',\n request,\n requests.CanSetStateAxisResponse.fromBinary);\n return response.error ?? null;\n }\n\n /**\n * Returns identity.\n * @returns Axis identity.\n */\n private _retrieveIdentity(): AxisIdentity {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<AxisIdentity>(\n 'device/get_axis_identity',\n request,\n AxisIdentity.fromBinary);\n return response;\n }\n\n /**\n * Disables the driver, which prevents current from being sent to the motor or load.\n * If the driver is already disabled, the driver remains disabled.\n */\n public async driverDisable(): Promise<void> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/driver_disable', request);\n }\n\n /**\n * Attempts to enable the driver repeatedly for the specified timeout.\n * If the driver is already enabled, the driver remains enabled.\n * @param [options.timeout=10] Timeout in seconds. Specify 0 to attempt to enable the driver once.\n */\n public async driverEnable(\n options: Axis.DriverEnableOptions = {}\n ): Promise<void> {\n const {\n timeout = 10,\n } = options;\n const request: requests.DriverEnableRequest & gateway.Message = {\n ...requests.DriverEnableRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n timeout: timeout,\n toBinary() {\n return requests.DriverEnableRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/driver_enable', request);\n }\n\n /**\n * Activates a peripheral on this axis.\n * Removes all identity information for the device.\n * Run the identify method on the device after activating to refresh the information.\n */\n public async activate(): Promise<void> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/activate', request);\n }\n\n /**\n * Restores all axis settings to their default values.\n * Deletes all zaber axis storage keys.\n * Disables lockstep if the axis is part of one. Unparks the axis.\n * Preserves storage.\n * The device needs to be identified again after the restore.\n */\n public async restore(): Promise<void> {\n const request: requests.DeviceRestoreRequest & gateway.Message = {\n ...requests.DeviceRestoreRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.DeviceRestoreRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/restore', request);\n }\n\n /**\n * Moves the axis in a sinusoidal trajectory.\n * @param amplitude Amplitude of the sinusoidal motion (half of the motion's peak-to-peak range).\n * @param amplitudeUnits Units of position.\n * @param period Period of the sinusoidal motion in milliseconds.\n * @param periodUnits Units of time.\n * @param [options.count=0] Number of sinusoidal cycles to complete.\n * Must be a multiple of 0.5\n * If count is not specified or set to 0, the axis will move indefinitely.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n */\n public async moveSin(\n amplitude: number,\n amplitudeUnits: Length | Angle | Native,\n period: number,\n periodUnits: Time | Native,\n options: Axis.MoveSinOptions = {}\n ): Promise<void> {\n const {\n count = 0,\n waitUntilIdle = true,\n } = options;\n const request: requests.DeviceMoveSinRequest & gateway.Message = {\n ...requests.DeviceMoveSinRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n amplitude: amplitude,\n amplitudeUnits: amplitudeUnits,\n period: period,\n periodUnits: periodUnits,\n count: count,\n waitUntilIdle: waitUntilIdle,\n toBinary() {\n return requests.DeviceMoveSinRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/move_sin', request);\n }\n\n /**\n * Stops the axis at the end of the sinusoidal trajectory.\n * If the sinusoidal motion was started with an integer-plus-half cycle count,\n * the motion ends at the half-way point of the sinusoidal trajectory.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished.\n */\n public async moveSinStop(\n options: Axis.MoveSinStopOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n } = options;\n const request: requests.DeviceStopRequest & gateway.Message = {\n ...requests.DeviceStopRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n waitUntilIdle: waitUntilIdle,\n toBinary() {\n return requests.DeviceStopRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/move_sin_stop', request);\n }\n}\n\nnamespace Axis {\n export interface HomeOptions {\n /**\n * Determines whether function should return after the movement is finished or just started.\n */\n waitUntilIdle?: boolean;\n }\n export interface StopOptions {\n /**\n * Determines whether function should return after the movement is finished or just started.\n */\n waitUntilIdle?: boolean;\n }\n export interface WaitUntilIdleOptions {\n /**\n * Determines whether to throw error when fault is observed.\n */\n throwErrorOnFault?: boolean;\n }\n export interface MoveAbsoluteOptions {\n /**\n * Determines whether function should return after the movement is finished or just started.\n */\n waitUntilIdle?: boolean;\n /**\n * Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n */\n velocity?: number;\n /**\n * Units of velocity.\n */\n velocityUnit?: Velocity | AngularVelocity | Native;\n /**\n * Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n */\n acceleration?: number;\n /**\n * Units of acceleration.\n */\n accelerationUnit?: Acceleration | AngularAcceleration | Native;\n }\n export interface MoveMaxOptions {\n /**\n * Determines whether function should return after the movement is finished or just started.\n */\n waitUntilIdle?: boolean;\n /**\n * Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n */\n velocity?: number;\n /**\n * Units of velocity.\n */\n velocityUnit?: Velocity | AngularVelocity | Native;\n /**\n * Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n */\n acceleration?: number;\n /**\n * Units of acceleration.\n */\n accelerationUnit?: Acceleration | AngularAcceleration | Native;\n }\n export interface MoveMinOptions {\n /**\n * Determines whether function should return after the movement is finished or just started.\n */\n waitUntilIdle?: boolean;\n /**\n * Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n */\n velocity?: number;\n /**\n * Units of velocity.\n */\n velocityUnit?: Velocity | AngularVelocity | Native;\n /**\n * Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n */\n acceleration?: number;\n /**\n * Units of acceleration.\n */\n accelerationUnit?: Acceleration | AngularAcceleration | Native;\n }\n export interface MoveRelativeOptions {\n /**\n * Determines whether function should return after the movement is finished or just started.\n */\n waitUntilIdle?: boolean;\n /**\n * Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n */\n velocity?: number;\n /**\n * Units of velocity.\n */\n velocityUnit?: Velocity | AngularVelocity | Native;\n /**\n * Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n */\n acceleration?: number;\n /**\n * Units of acceleration.\n */\n accelerationUnit?: Acceleration | AngularAcceleration | Native;\n }\n export interface MoveVelocityOptions {\n /**\n * Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n */\n acceleration?: number;\n /**\n * Units of acceleration.\n */\n accelerationUnit?: Acceleration | AngularAcceleration | Native;\n }\n export interface MoveIndexOptions {\n /**\n * Determines whether function should return after the movement is finished or just started.\n */\n waitUntilIdle?: boolean;\n /**\n * Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n */\n velocity?: number;\n /**\n * Units of velocity.\n */\n velocityUnit?: Velocity | AngularVelocity | Native;\n /**\n * Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n */\n acceleration?: number;\n /**\n * Units of acceleration.\n */\n accelerationUnit?: Acceleration | AngularAcceleration | Native;\n }\n export interface GenericCommandOptions {\n /**\n * Controls whether to throw an exception when the device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface GenericCommandMultiResponseOptions {\n /**\n * Controls whether to throw an exception when a device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface DriverEnableOptions {\n /**\n * Timeout in seconds. Specify 0 to attempt to enable the driver once.\n */\n timeout?: number;\n }\n export interface MoveSinOptions {\n /**\n * Number of sinusoidal cycles to complete.\n * Must be a multiple of 0.5\n * If count is not specified or set to 0, the axis will move indefinitely.\n */\n count?: number;\n /**\n * Determines whether function should return after the movement is finished or just started.\n */\n waitUntilIdle?: boolean;\n }\n export interface MoveSinStopOptions {\n /**\n * Determines whether function should return after the movement is finished.\n */\n waitUntilIdle?: boolean;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"axis.js","sourceRoot":"","sources":["../../../src/ascii/axis.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtD,mDAA+C;AAE/C,yCAAsC;AACtC,mDAA+C;AAC/C,oCAA4H;AAC5H,yCAAsC;AAEtC,oDAAsC;AACtC,sDAAwC;AACxC,uCAAwC;AACxC,uEAAiE;AAGjE;;GAEG;AACH,MAAa,IAAI;IACf;;OAEG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAGD;;;OAGG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC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Aa;YAC5B,QAAQ;gBACN,OAAO,QAAQ,CAAC,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACtD,CAAC;SACF,CAAC;QAEF,MAAM,OAAO,CAAC,SAAS,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,WAAW,CACtB,UAAmC,EAAE;QAErC,MAAM,EACJ,aAAa,GAAG,IAAI,GACrB,GAAG,OAAO,CAAC;QACZ,MAAM,OAAO,GAAiD;YAC5D,GAAG,QAAQ,CAAC,iBAAiB,CAAC,OAAO;YACrC,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW;YAC/C,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa;YACjC,IAAI,EAAE,IAAI,CAAC,UAAU;YACrB,aAAa,EAAE,aAAa;YAC5B,QAAQ;gBACN,OAAO,QAAQ,CAAC,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACnD,CAAC;SACF,CAAC;QAEF,MAAM,OAAO,CAAC,SAAS,CAAC,sBAAsB,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;CACF;AAzhCD,oBAyhCC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Device } from './device';\nimport { AxisIdentity } from './axis_identity';\nimport { AxisType } from './axis_type';\nimport { Warnings } from './warnings';\nimport { AxisSettings } from './axis_settings';\nimport { Angle, Length, Native, AngularVelocity, Velocity, Acceleration, AngularAcceleration, Units, Time } from '../units';\nimport { Response } from './response';\nimport { Measurement } from '../measurement';\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { AxisStorage } from './storage';\nimport { SetStateAxisResponse } from './set_state_axis_response';\nimport { FirmwareVersion } from '../firmware_version';\n\n/**\n * Represents an axis of motion associated with a device.\n */\nexport class Axis {\n /**\n * Device that controls this axis.\n */\n public get device(): Device {\n return this._device;\n }\n private _device: Device;\n\n /**\n * The axis number identifies the axis on the device.\n * The first axis has the number one.\n */\n public get axisNumber(): number {\n return this._axisNumber;\n }\n private _axisNumber: number;\n\n /**\n * Settings and properties of this axis.\n */\n public get settings(): AxisSettings {\n return this._settings;\n }\n private _settings: AxisSettings;\n\n /**\n * Key-value storage of this axis.\n * Requires at least Firmware 7.30.\n */\n public get storage(): AxisStorage {\n return this._storage;\n }\n private _storage: AxisStorage;\n\n /**\n * Warnings and faults of this axis.\n */\n public get warnings(): Warnings {\n return this._warnings;\n }\n private _warnings: Warnings;\n\n /**\n * Identity of the axis.\n */\n public get identity(): AxisIdentity {\n return this._retrieveIdentity();\n }\n\n /**\n * Unique ID of the peripheral hardware.\n */\n public get peripheralId(): number {\n return this.identity.peripheralId;\n }\n\n /**\n * Name of the peripheral.\n */\n public get peripheralName(): string {\n return this.identity.peripheralName;\n }\n\n /**\n * Serial number of the peripheral, or 0 when not applicable.\n */\n public get peripheralSerialNumber(): number {\n return this.identity.peripheralSerialNumber;\n }\n\n /**\n * Indicates whether the axis is a peripheral or part of an integrated device.\n */\n public get isPeripheral(): boolean {\n return this.identity.isPeripheral;\n }\n\n /**\n * Determines the type of an axis and units it accepts.\n */\n public get axisType(): AxisType {\n return this.identity.axisType;\n }\n\n /**\n * User-assigned label of the peripheral.\n */\n public get label(): string {\n return this._retrieveLabel();\n }\n\n constructor(device: Device, axisNumber: number) {\n this._device = device;\n this._axisNumber = axisNumber;\n this._settings = new AxisSettings(this);\n this._storage = new AxisStorage(this);\n this._warnings = new Warnings(device, axisNumber);\n }\n\n /**\n * Homes axis. Axis returns to its homing position.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n */\n public async home(\n options: Axis.HomeOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n } = options;\n const request: requests.DeviceHomeRequest & gateway.Message = {\n ...requests.DeviceHomeRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n waitUntilIdle: waitUntilIdle,\n toBinary() {\n return requests.DeviceHomeRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/home', request);\n }\n\n /**\n * Stops ongoing axis movement. Decelerates until zero speed.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n */\n public async stop(\n options: Axis.StopOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n } = options;\n const request: requests.DeviceStopRequest & gateway.Message = {\n ...requests.DeviceStopRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n waitUntilIdle: waitUntilIdle,\n toBinary() {\n return requests.DeviceStopRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/stop', request);\n }\n\n /**\n * Parks the axis in anticipation of turning the power off.\n * It can later be powered on, unparked, and moved without first having to home it.\n */\n public async park(): Promise<void> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/park', request);\n }\n\n /**\n * Unparks axis. Axis will now be able to move.\n */\n public async unpark(): Promise<void> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/unpark', request);\n }\n\n /**\n * Returns bool indicating whether the axis is parked or not.\n * @returns True if the axis is currently parked. False otherwise.\n */\n public async isParked(): Promise<boolean> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.BoolResponse>(\n 'device/is_parked',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Waits until axis stops moving.\n * @param [options.throwErrorOnFault=true] Determines whether to throw error when fault is observed.\n */\n public async waitUntilIdle(\n options: Axis.WaitUntilIdleOptions = {}\n ): Promise<void> {\n const {\n throwErrorOnFault = true,\n } = options;\n const request: requests.DeviceWaitUntilIdleRequest & gateway.Message = {\n ...requests.DeviceWaitUntilIdleRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n throwErrorOnFault: throwErrorOnFault,\n toBinary() {\n return requests.DeviceWaitUntilIdleRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/wait_until_idle', request);\n }\n\n /**\n * Returns bool indicating whether the axis is executing a motion command.\n * @returns True if the axis is currently executing a motion command.\n */\n public async isBusy(): Promise<boolean> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.BoolResponse>(\n 'device/is_busy',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Returns bool indicating whether the axis has position reference and was homed.\n * @returns True if the axis has position reference and was homed.\n */\n public async isHomed(): Promise<boolean> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.BoolResponse>(\n 'device/is_homed',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Move axis to absolute position.\n * @param position Absolute position.\n * @param [unit=Units.NATIVE] Units of position.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n * @param [options.velocity=0] Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.velocityUnit=Units.NATIVE] Units of velocity.\n * @param [options.acceleration=0] Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.accelerationUnit=Units.NATIVE] Units of acceleration.\n */\n public async moveAbsolute(\n position: number,\n unit: Length | Angle | Native = Units.NATIVE,\n options: Axis.MoveAbsoluteOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n velocity = 0,\n velocityUnit = Units.NATIVE,\n acceleration = 0,\n accelerationUnit = Units.NATIVE,\n } = options;\n const request: requests.DeviceMoveRequest & gateway.Message = {\n ...requests.DeviceMoveRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n type: requests.AxisMoveType.ABS,\n arg: position,\n unit: unit,\n waitUntilIdle: waitUntilIdle,\n velocity: velocity,\n velocityUnit: velocityUnit,\n acceleration: acceleration,\n accelerationUnit: accelerationUnit,\n toBinary() {\n return requests.DeviceMoveRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/move', request);\n }\n\n /**\n * Moves the axis to the maximum position as specified by limit.max.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n * @param [options.velocity=0] Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.velocityUnit=Units.NATIVE] Units of velocity.\n * @param [options.acceleration=0] Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.accelerationUnit=Units.NATIVE] Units of acceleration.\n */\n public async moveMax(\n options: Axis.MoveMaxOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n velocity = 0,\n velocityUnit = Units.NATIVE,\n acceleration = 0,\n accelerationUnit = Units.NATIVE,\n } = options;\n const request: requests.DeviceMoveRequest & gateway.Message = {\n ...requests.DeviceMoveRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n type: requests.AxisMoveType.MAX,\n waitUntilIdle: waitUntilIdle,\n velocity: velocity,\n velocityUnit: velocityUnit,\n acceleration: acceleration,\n accelerationUnit: accelerationUnit,\n toBinary() {\n return requests.DeviceMoveRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/move', request);\n }\n\n /**\n * Moves the axis to the minimum position as specified by limit.min.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n * @param [options.velocity=0] Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.velocityUnit=Units.NATIVE] Units of velocity.\n * @param [options.acceleration=0] Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.accelerationUnit=Units.NATIVE] Units of acceleration.\n */\n public async moveMin(\n options: Axis.MoveMinOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n velocity = 0,\n velocityUnit = Units.NATIVE,\n acceleration = 0,\n accelerationUnit = Units.NATIVE,\n } = options;\n const request: requests.DeviceMoveRequest & gateway.Message = {\n ...requests.DeviceMoveRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n type: requests.AxisMoveType.MIN,\n waitUntilIdle: waitUntilIdle,\n velocity: velocity,\n velocityUnit: velocityUnit,\n acceleration: acceleration,\n accelerationUnit: accelerationUnit,\n toBinary() {\n return requests.DeviceMoveRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/move', request);\n }\n\n /**\n * Move axis to position relative to current position.\n * @param position Relative position.\n * @param [unit=Units.NATIVE] Units of position.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n * @param [options.velocity=0] Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.velocityUnit=Units.NATIVE] Units of velocity.\n * @param [options.acceleration=0] Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.accelerationUnit=Units.NATIVE] Units of acceleration.\n */\n public async moveRelative(\n position: number,\n unit: Length | Angle | Native = Units.NATIVE,\n options: Axis.MoveRelativeOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n velocity = 0,\n velocityUnit = Units.NATIVE,\n acceleration = 0,\n accelerationUnit = Units.NATIVE,\n } = options;\n const request: requests.DeviceMoveRequest & gateway.Message = {\n ...requests.DeviceMoveRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n type: requests.AxisMoveType.REL,\n arg: position,\n unit: unit,\n waitUntilIdle: waitUntilIdle,\n velocity: velocity,\n velocityUnit: velocityUnit,\n acceleration: acceleration,\n accelerationUnit: accelerationUnit,\n toBinary() {\n return requests.DeviceMoveRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/move', request);\n }\n\n /**\n * Begins to move axis at specified speed.\n * @param velocity Movement velocity.\n * @param [unit=Units.NATIVE] Units of velocity.\n * @param [options.acceleration=0] Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.accelerationUnit=Units.NATIVE] Units of acceleration.\n */\n public async moveVelocity(\n velocity: number,\n unit: Velocity | AngularVelocity | Native = Units.NATIVE,\n options: Axis.MoveVelocityOptions = {}\n ): Promise<void> {\n const {\n acceleration = 0,\n accelerationUnit = Units.NATIVE,\n } = options;\n const request: requests.DeviceMoveRequest & gateway.Message = {\n ...requests.DeviceMoveRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n type: requests.AxisMoveType.VEL,\n arg: velocity,\n unit: unit,\n acceleration: acceleration,\n accelerationUnit: accelerationUnit,\n toBinary() {\n return requests.DeviceMoveRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/move', request);\n }\n\n /**\n * Returns current axis position.\n * @param [unit=Units.NATIVE] Units of position.\n * @returns Axis position.\n */\n public async getPosition(\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<number> {\n const request: requests.DeviceGetSettingRequest & gateway.Message = {\n ...requests.DeviceGetSettingRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n setting: 'pos',\n unit: unit,\n toBinary() {\n return requests.DeviceGetSettingRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'device/get_setting',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Gets number of index positions of the axis.\n * @returns Number of index positions.\n */\n public async getNumberOfIndexPositions(): Promise<number> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntResponse>(\n 'device/get_index_count',\n request,\n requests.IntResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Returns current axis index position.\n * @returns Index position starting from 1 or 0 if the position is not an index position.\n */\n public async getIndexPosition(): Promise<number> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntResponse>(\n 'device/get_index_position',\n request,\n requests.IntResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Moves the axis to index position.\n * @param index Index position. Index positions are numbered from 1.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n * @param [options.velocity=0] Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.velocityUnit=Units.NATIVE] Units of velocity.\n * @param [options.acceleration=0] Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.accelerationUnit=Units.NATIVE] Units of acceleration.\n */\n public async moveIndex(\n index: number,\n options: Axis.MoveIndexOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n velocity = 0,\n velocityUnit = Units.NATIVE,\n acceleration = 0,\n accelerationUnit = Units.NATIVE,\n } = options;\n const request: requests.DeviceMoveRequest & gateway.Message = {\n ...requests.DeviceMoveRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n type: requests.AxisMoveType.INDEX,\n argInt: index,\n waitUntilIdle: waitUntilIdle,\n velocity: velocity,\n velocityUnit: velocityUnit,\n acceleration: acceleration,\n accelerationUnit: accelerationUnit,\n toBinary() {\n return requests.DeviceMoveRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/move', request);\n }\n\n /**\n * Sends a generic ASCII command to this axis.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns A response to the command.\n */\n public async genericCommand(\n command: string,\n options: Axis.GenericCommandOptions = {}\n ): Promise<Response> {\n const {\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n command: command,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<Response>(\n 'interface/generic_command',\n request,\n Response.fromBinary);\n return response;\n }\n\n /**\n * Sends a generic ASCII command to this axis and expect multiple responses.\n * Responses are returned in order of arrival.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.checkErrors=true] Controls whether to throw an exception when a device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns All responses to the command.\n */\n public async genericCommandMultiResponse(\n command: string,\n options: Axis.GenericCommandMultiResponseOptions = {}\n ): Promise<Response[]> {\n const {\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n command: command,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.GenericCommandResponseCollection>(\n 'interface/generic_command_multi_response',\n request,\n requests.GenericCommandResponseCollection.fromBinary);\n return response.responses;\n }\n\n /**\n * Sends a generic ASCII command to this axis without expecting a response and without adding a message ID\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n */\n public async genericCommandNoResponse(\n command: string\n ): Promise<void> {\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n command: command,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Formats parameters into a command and performs unit conversions.\n * Parameters in the command template are denoted by a question mark.\n * Command returned is only valid for this axis and this device.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param commandTemplate Template of a command to prepare. Parameters are denoted by question marks.\n * @param parameters Variable number of command parameters.\n * @returns Command with converted parameters.\n */\n public prepareCommand(\n commandTemplate: string,\n ...parameters: Measurement[]\n ): string {\n const request: requests.PrepareCommandRequest & gateway.Message = {\n ...requests.PrepareCommandRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n commandTemplate: commandTemplate,\n parameters: parameters,\n toBinary() {\n return requests.PrepareCommandRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/prepare_command',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sets the user-assigned peripheral label.\n * The label is stored on the controller and recognized by other software.\n * @param label Label to set.\n */\n public async setLabel(\n label: string\n ): Promise<void> {\n const request: requests.DeviceSetStorageRequest & gateway.Message = {\n ...requests.DeviceSetStorageRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n value: label,\n toBinary() {\n return requests.DeviceSetStorageRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/set_label', request);\n }\n\n /**\n * Gets the peripheral name.\n * @returns The label.\n */\n private _retrieveLabel(): string {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/get_label',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Returns a string that represents the axis.\n * @returns A string that represents the axis.\n */\n public toString(): string {\n const request: requests.AxisToStringRequest & gateway.Message = {\n ...requests.AxisToStringRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.AxisToStringRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/axis_to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Returns a serialization of the current axis state that can be saved and reapplied.\n * @returns A serialization of the current state of the axis.\n */\n public async getState(): Promise<string> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.StringResponse>(\n 'device/get_state',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Applies a saved state to this axis.\n * @param state The state object to apply to this axis.\n * @returns Reports of any issues that were handled, but caused the state to not be exactly restored.\n */\n public async setState(\n state: string\n ): Promise<SetStateAxisResponse> {\n const request: requests.SetStateRequest & gateway.Message = {\n ...requests.SetStateRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n state: state,\n toBinary() {\n return requests.SetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<SetStateAxisResponse>(\n 'device/set_axis_state',\n request,\n SetStateAxisResponse.fromBinary);\n return response;\n }\n\n /**\n * Checks if a state can be applied to this axis.\n * This only covers exceptions that can be determined statically such as mismatches of ID or version,\n * the process of applying the state can still fail when running.\n * @param state The state object to check against.\n * @param options.firmwareVersion The firmware version of the device to apply the state to.\n * Use this to ensure the state will still be compatible after an update.\n * @returns An explanation of why this state cannot be set to this axis.\n */\n public async canSetState(\n state: string,\n options: Axis.CanSetStateOptions = {}\n ): Promise<string | null> {\n const {\n firmwareVersion,\n } = options;\n const request: requests.CanSetStateRequest & gateway.Message = {\n ...requests.CanSetStateRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n state: state,\n firmwareVersion: firmwareVersion,\n toBinary() {\n return requests.CanSetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.CanSetStateAxisResponse>(\n 'device/can_set_axis_state',\n request,\n requests.CanSetStateAxisResponse.fromBinary);\n return response.error ?? null;\n }\n\n /**\n * Returns identity.\n * @returns Axis identity.\n */\n private _retrieveIdentity(): AxisIdentity {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<AxisIdentity>(\n 'device/get_axis_identity',\n request,\n AxisIdentity.fromBinary);\n return response;\n }\n\n /**\n * Disables the driver, which prevents current from being sent to the motor or load.\n * If the driver is already disabled, the driver remains disabled.\n */\n public async driverDisable(): Promise<void> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/driver_disable', request);\n }\n\n /**\n * Attempts to enable the driver repeatedly for the specified timeout.\n * If the driver is already enabled, the driver remains enabled.\n * @param [options.timeout=10] Timeout in seconds. Specify 0 to attempt to enable the driver once.\n */\n public async driverEnable(\n options: Axis.DriverEnableOptions = {}\n ): Promise<void> {\n const {\n timeout = 10,\n } = options;\n const request: requests.DriverEnableRequest & gateway.Message = {\n ...requests.DriverEnableRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n timeout: timeout,\n toBinary() {\n return requests.DriverEnableRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/driver_enable', request);\n }\n\n /**\n * Activates a peripheral on this axis.\n * Removes all identity information for the device.\n * Run the identify method on the device after activating to refresh the information.\n */\n public async activate(): Promise<void> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/activate', request);\n }\n\n /**\n * Restores all axis settings to their default values.\n * Deletes all zaber axis storage keys.\n * Disables lockstep if the axis is part of one. Unparks the axis.\n * Preserves storage.\n * The device needs to be identified again after the restore.\n */\n public async restore(): Promise<void> {\n const request: requests.DeviceRestoreRequest & gateway.Message = {\n ...requests.DeviceRestoreRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n toBinary() {\n return requests.DeviceRestoreRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/restore', request);\n }\n\n /**\n * Moves the axis in a sinusoidal trajectory.\n * @param amplitude Amplitude of the sinusoidal motion (half of the motion's peak-to-peak range).\n * @param amplitudeUnits Units of position.\n * @param period Period of the sinusoidal motion in milliseconds.\n * @param periodUnits Units of time.\n * @param [options.count=0] Number of sinusoidal cycles to complete.\n * Must be a multiple of 0.5\n * If count is not specified or set to 0, the axis will move indefinitely.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n */\n public async moveSin(\n amplitude: number,\n amplitudeUnits: Length | Angle | Native,\n period: number,\n periodUnits: Time | Native,\n options: Axis.MoveSinOptions = {}\n ): Promise<void> {\n const {\n count = 0,\n waitUntilIdle = true,\n } = options;\n const request: requests.DeviceMoveSinRequest & gateway.Message = {\n ...requests.DeviceMoveSinRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n amplitude: amplitude,\n amplitudeUnits: amplitudeUnits,\n period: period,\n periodUnits: periodUnits,\n count: count,\n waitUntilIdle: waitUntilIdle,\n toBinary() {\n return requests.DeviceMoveSinRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/move_sin', request);\n }\n\n /**\n * Stops the axis at the end of the sinusoidal trajectory.\n * If the sinusoidal motion was started with an integer-plus-half cycle count,\n * the motion ends at the half-way point of the sinusoidal trajectory.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished.\n */\n public async moveSinStop(\n options: Axis.MoveSinStopOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n } = options;\n const request: requests.DeviceStopRequest & gateway.Message = {\n ...requests.DeviceStopRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n axis: this.axisNumber,\n waitUntilIdle: waitUntilIdle,\n toBinary() {\n return requests.DeviceStopRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/move_sin_stop', request);\n }\n}\n\nnamespace Axis {\n export interface HomeOptions {\n /**\n * Determines whether function should return after the movement is finished or just started.\n */\n waitUntilIdle?: boolean;\n }\n export interface StopOptions {\n /**\n * Determines whether function should return after the movement is finished or just started.\n */\n waitUntilIdle?: boolean;\n }\n export interface WaitUntilIdleOptions {\n /**\n * Determines whether to throw error when fault is observed.\n */\n throwErrorOnFault?: boolean;\n }\n export interface MoveAbsoluteOptions {\n /**\n * Determines whether function should return after the movement is finished or just started.\n */\n waitUntilIdle?: boolean;\n /**\n * Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n */\n velocity?: number;\n /**\n * Units of velocity.\n */\n velocityUnit?: Velocity | AngularVelocity | Native;\n /**\n * Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n */\n acceleration?: number;\n /**\n * Units of acceleration.\n */\n accelerationUnit?: Acceleration | AngularAcceleration | Native;\n }\n export interface MoveMaxOptions {\n /**\n * Determines whether function should return after the movement is finished or just started.\n */\n waitUntilIdle?: boolean;\n /**\n * Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n */\n velocity?: number;\n /**\n * Units of velocity.\n */\n velocityUnit?: Velocity | AngularVelocity | Native;\n /**\n * Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n */\n acceleration?: number;\n /**\n * Units of acceleration.\n */\n accelerationUnit?: Acceleration | AngularAcceleration | Native;\n }\n export interface MoveMinOptions {\n /**\n * Determines whether function should return after the movement is finished or just started.\n */\n waitUntilIdle?: boolean;\n /**\n * Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n */\n velocity?: number;\n /**\n * Units of velocity.\n */\n velocityUnit?: Velocity | AngularVelocity | Native;\n /**\n * Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n */\n acceleration?: number;\n /**\n * Units of acceleration.\n */\n accelerationUnit?: Acceleration | AngularAcceleration | Native;\n }\n export interface MoveRelativeOptions {\n /**\n * Determines whether function should return after the movement is finished or just started.\n */\n waitUntilIdle?: boolean;\n /**\n * Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n */\n velocity?: number;\n /**\n * Units of velocity.\n */\n velocityUnit?: Velocity | AngularVelocity | Native;\n /**\n * Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n */\n acceleration?: number;\n /**\n * Units of acceleration.\n */\n accelerationUnit?: Acceleration | AngularAcceleration | Native;\n }\n export interface MoveVelocityOptions {\n /**\n * Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n */\n acceleration?: number;\n /**\n * Units of acceleration.\n */\n accelerationUnit?: Acceleration | AngularAcceleration | Native;\n }\n export interface MoveIndexOptions {\n /**\n * Determines whether function should return after the movement is finished or just started.\n */\n waitUntilIdle?: boolean;\n /**\n * Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n */\n velocity?: number;\n /**\n * Units of velocity.\n */\n velocityUnit?: Velocity | AngularVelocity | Native;\n /**\n * Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n */\n acceleration?: number;\n /**\n * Units of acceleration.\n */\n accelerationUnit?: Acceleration | AngularAcceleration | Native;\n }\n export interface GenericCommandOptions {\n /**\n * Controls whether to throw an exception when the device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface GenericCommandMultiResponseOptions {\n /**\n * Controls whether to throw an exception when a device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface CanSetStateOptions {\n /**\n * The firmware version of the device to apply the state to.\n * Use this to ensure the state will still be compatible after an update.\n */\n firmwareVersion?: FirmwareVersion;\n }\n export interface DriverEnableOptions {\n /**\n * Timeout in seconds. Specify 0 to attempt to enable the driver once.\n */\n timeout?: number;\n }\n export interface MoveSinOptions {\n /**\n * Number of sinusoidal cycles to complete.\n * Must be a multiple of 0.5\n * If count is not specified or set to 0, the axis will move indefinitely.\n */\n count?: number;\n /**\n * Determines whether function should return after the movement is finished or just started.\n */\n waitUntilIdle?: boolean;\n }\n export interface MoveSinStopOptions {\n /**\n * Determines whether function should return after the movement is finished.\n */\n waitUntilIdle?: boolean;\n }\n}\n"]}
|
|
@@ -218,9 +218,11 @@ export declare class Device {
|
|
|
218
218
|
* This only covers exceptions that can be determined statically such as mismatches of ID or version,
|
|
219
219
|
* the process of applying the state can still fail when running.
|
|
220
220
|
* @param state The state object to check against.
|
|
221
|
+
* @param options.firmwareVersion The firmware version of the device to apply the state to.
|
|
222
|
+
* Use this to ensure the state will still be compatible after an update.
|
|
221
223
|
* @returns An object listing errors that come up when trying to set the state.
|
|
222
224
|
*/
|
|
223
|
-
canSetState(state: string): Promise<CanSetStateDeviceResponse>;
|
|
225
|
+
canSetState(state: string, options?: Device.CanSetStateOptions): Promise<CanSetStateDeviceResponse>;
|
|
224
226
|
/**
|
|
225
227
|
* Waits for the device to start responding to messages.
|
|
226
228
|
* Useful to call after resetting the device.
|
|
@@ -309,6 +311,13 @@ declare namespace Device {
|
|
|
309
311
|
*/
|
|
310
312
|
deviceOnly?: boolean;
|
|
311
313
|
}
|
|
314
|
+
interface CanSetStateOptions {
|
|
315
|
+
/**
|
|
316
|
+
* The firmware version of the device to apply the state to.
|
|
317
|
+
* Use this to ensure the state will still be compatible after an update.
|
|
318
|
+
*/
|
|
319
|
+
firmwareVersion?: FirmwareVersion;
|
|
320
|
+
}
|
|
312
321
|
}
|
|
313
322
|
export {};
|
|
314
323
|
//# sourceMappingURL=device.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../../src/ascii/device.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,C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AGG;QACH,eAAe,CAAC,EAAE,eAAe,CAAC;KACrC;CACF"}
|
package/dist/lib/ascii/device.js
CHANGED
|
@@ -425,14 +425,18 @@ class Device {
|
|
|
425
425
|
* This only covers exceptions that can be determined statically such as mismatches of ID or version,
|
|
426
426
|
* the process of applying the state can still fail when running.
|
|
427
427
|
* @param state The state object to check against.
|
|
428
|
+
* @param options.firmwareVersion The firmware version of the device to apply the state to.
|
|
429
|
+
* Use this to ensure the state will still be compatible after an update.
|
|
428
430
|
* @returns An object listing errors that come up when trying to set the state.
|
|
429
431
|
*/
|
|
430
|
-
async canSetState(state) {
|
|
432
|
+
async canSetState(state, options = {}) {
|
|
433
|
+
const { firmwareVersion, } = options;
|
|
431
434
|
const request = {
|
|
432
435
|
...requests.CanSetStateRequest.DEFAULT,
|
|
433
436
|
interfaceId: this.connection.interfaceId,
|
|
434
437
|
device: this.deviceAddress,
|
|
435
438
|
state: state,
|
|
439
|
+
firmwareVersion: firmwareVersion,
|
|
436
440
|
toBinary() {
|
|
437
441
|
return requests.CanSetStateRequest.toBinary(this);
|
|
438
442
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.js","sourceRoot":"","sources":["../../../src/ascii/device.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtD,uDAAmD;AACnD,iCAA8B;AAC9B,yCAAqC;AACrC,yCAAsC;AACtC,uDAAmD;AACnD,2CAAuC;AACvC,yCAAsC;AACtC,yCAAsC;AACtC,iDAA8C;AAC9C,mFAA4E;AAC5E,+BAA4B;AAG5B,oDAAsC;AACtC,sDAAwC;AACxC,uCAA0C;AAC1C,yCAAsC;AACtC,uCAAoC;AACpC,2EAAqE;AAErE;;GAEG;AACH,MAAa,MAAM;IACjB;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAGD;;;OAGG;IACH,IAAW,aAAa;QACt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Q,CAAC,KAAK,CAAC;IACxB,CAAC;CACF;AA1nBD,wBA0nBC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Connection } from './connection';\nimport { DeviceSettings } from './device_settings';\nimport { Axis } from './axis';\nimport { AllAxes } from './all_axes';\nimport { Warnings } from './warnings';\nimport { DeviceIdentity } from './device_identity';\nimport { DeviceIO } from './device_io';\nimport { Response } from './response';\nimport { Lockstep } from './lockstep';\nimport { Oscilloscope } from './oscilloscope';\nimport { CanSetStateDeviceResponse } from './can_set_state_device_response';\nimport { Pvt } from './pvt';\nimport { Measurement } from '../measurement';\nimport { FirmwareVersion } from '../firmware_version';\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { DeviceStorage } from './storage';\nimport { Triggers } from './triggers';\nimport { Streams } from './streams';\nimport { SetStateDeviceResponse } from './set_state_device_response';\n\n/**\n * Represents the controller part of one device - may be either a standalone controller or an integrated controller.\n */\nexport class Device {\n /**\n * Connection of this device.\n */\n public get connection(): Connection {\n return this._connection;\n }\n private _connection: Connection;\n\n /**\n * The device address uniquely identifies the device on the connection.\n * It can be configured or automatically assigned by the renumber command.\n */\n public get deviceAddress(): number {\n return this._deviceAddress;\n }\n private _deviceAddress: number;\n\n /**\n * Settings and properties of this device.\n */\n public get settings(): DeviceSettings {\n return this._settings;\n }\n private _settings: DeviceSettings;\n\n /**\n * Key-value storage of this device.\n */\n public get storage(): DeviceStorage {\n return this._storage;\n }\n private _storage: DeviceStorage;\n\n /**\n * I/O channels of this device.\n */\n public get io(): DeviceIO {\n return this._io;\n }\n private _io: DeviceIO;\n\n /**\n * Virtual axis which allows you to target all axes of this device.\n */\n public get allAxes(): AllAxes {\n return this._allAxes;\n }\n private _allAxes: AllAxes;\n\n /**\n * Warnings and faults of this device and all its axes.\n */\n public get warnings(): Warnings {\n return this._warnings;\n }\n private _warnings: Warnings;\n\n /**\n * Identity of the device.\n */\n public get identity(): DeviceIdentity {\n return this._retrieveIdentity();\n }\n\n /**\n * Indicates whether or not the device has been identified.\n */\n public get isIdentified(): boolean {\n return this._retrieveIsIdentified();\n }\n\n /**\n * Oscilloscope recording helper for this device.\n * Requires at least Firmware 7.00.\n */\n public get oscilloscope(): Oscilloscope {\n return this._oscilloscope;\n }\n private _oscilloscope: Oscilloscope;\n\n /**\n * Unique ID of the device hardware.\n */\n public get deviceId(): number {\n return this.identity.deviceId;\n }\n\n /**\n * Serial number of the device.\n */\n public get serialNumber(): number {\n return this.identity.serialNumber;\n }\n\n /**\n * Name of the product.\n */\n public get name(): string {\n return this.identity.name;\n }\n\n /**\n * Number of axes this device has.\n */\n public get axisCount(): number {\n return this.identity.axisCount;\n }\n\n /**\n * Version of the firmware.\n */\n public get firmwareVersion(): FirmwareVersion {\n return this.identity.firmwareVersion;\n }\n\n /**\n * The device is an integrated product.\n */\n public get isIntegrated(): boolean {\n return this.identity.isIntegrated;\n }\n\n /**\n * User-assigned label of the device.\n */\n public get label(): string {\n return this._retrieveLabel();\n }\n\n /**\n * Triggers for this device.\n * Requires at least Firmware 7.06.\n */\n public get triggers(): Triggers {\n return this._triggers;\n }\n private _triggers: Triggers;\n\n /**\n * Gets an object that provides access to Streams on this device.\n * Requires at least Firmware 7.05.\n */\n public get streams(): Streams {\n return this._streams;\n }\n private _streams: Streams;\n\n /**\n * Gets an object that provides access to PVT functions of this device.\n * Note that as of ZML v5.0.0, this returns a Pvt object and NOT a PvtSequence object.\n * The PvtSequence can now be obtained from the Pvt object.\n * Requires at least Firmware 7.33.\n */\n public get pvt(): Pvt {\n return this._pvt;\n }\n private _pvt: Pvt;\n\n constructor(connection: Connection, deviceAddress: number) {\n this._connection = connection;\n this._deviceAddress = deviceAddress;\n this._settings = new DeviceSettings(this);\n this._storage = new DeviceStorage(this);\n this._io = new DeviceIO(this);\n this._allAxes = new AllAxes(this);\n this._warnings = new Warnings(this, 0);\n this._oscilloscope = new Oscilloscope(this);\n this._triggers = new Triggers(this);\n this._streams = new Streams(this);\n this._pvt = new Pvt(this);\n }\n\n /**\n * Queries the device and the database, gathering information about the product.\n * Without this information features such as unit conversions will not work.\n * Usually, called automatically by detect devices method.\n * @param options.assumeVersion The identification assumes the specified firmware version\n * instead of the version queried from the device.\n * Providing this argument can lead to unexpected compatibility issues.\n * @returns Device identification data.\n */\n public async identify(\n options: Device.IdentifyOptions = {}\n ): Promise<DeviceIdentity> {\n const {\n assumeVersion,\n } = options;\n const request: requests.DeviceIdentifyRequest & gateway.Message = {\n ...requests.DeviceIdentifyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n assumeVersion: assumeVersion,\n toBinary() {\n return requests.DeviceIdentifyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<DeviceIdentity>(\n 'device/identify',\n request,\n DeviceIdentity.fromBinary);\n return response;\n }\n\n /**\n * Sends a generic ASCII command to this device.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.axis=0] Optional axis number to send the command to.\n * @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns A response to the command.\n */\n public async genericCommand(\n command: string,\n options: Device.GenericCommandOptions = {}\n ): Promise<Response> {\n const {\n axis = 0,\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n axis: axis,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<Response>(\n 'interface/generic_command',\n request,\n Response.fromBinary);\n return response;\n }\n\n /**\n * Sends a generic ASCII command to this device and expect multiple responses.\n * Responses are returned in order of arrival.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.axis=0] Optional axis number to send the command to.\n * @param [options.checkErrors=true] Controls whether to throw an exception when a device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns All responses to the command.\n */\n public async genericCommandMultiResponse(\n command: string,\n options: Device.GenericCommandMultiResponseOptions = {}\n ): Promise<Response[]> {\n const {\n axis = 0,\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n axis: axis,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.GenericCommandResponseCollection>(\n 'interface/generic_command_multi_response',\n request,\n requests.GenericCommandResponseCollection.fromBinary);\n return response.responses;\n }\n\n /**\n * Sends a generic ASCII command to this device without expecting a response and without adding a message ID\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.axis=0] Optional axis number to send the command to.\n * Specifying -1 omits the number completely.\n */\n public async genericCommandNoResponse(\n command: string,\n options: Device.GenericCommandNoResponseOptions = {}\n ): Promise<void> {\n const {\n axis = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n axis: axis,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Gets an Axis class instance which allows you to control a particular axis on this device.\n * Axes are numbered from 1.\n * @param axisNumber Number of axis intended to control.\n * @returns Axis instance.\n */\n public getAxis(\n axisNumber: number\n ): Axis {\n if (axisNumber <= 0) {\n throw new TypeError('Invalid value; physical axes are numbered from 1.');\n }\n return new Axis(this, axisNumber);\n }\n\n /**\n * Gets a Lockstep class instance which allows you to control a particular lockstep group on the device.\n * Requires at least Firmware 6.15 or 7.11.\n * @param lockstepGroupId The ID of the lockstep group to control. Lockstep group IDs start at one.\n * @returns Lockstep instance.\n */\n public getLockstep(\n lockstepGroupId: number\n ): Lockstep {\n if (lockstepGroupId <= 0) {\n throw new TypeError('Invalid value; lockstep groups are numbered from 1.');\n }\n return new Lockstep(this, lockstepGroupId);\n }\n\n /**\n * Formats parameters into a command and performs unit conversions.\n * Parameters in the command template are denoted by a question mark.\n * Command returned is only valid for this device.\n * Unit conversion is not supported for commands where axes can be remapped, such as stream and PVT commands.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param commandTemplate Template of a command to prepare. Parameters are denoted by question marks.\n * @param parameters Variable number of command parameters.\n * @returns Command with converted parameters.\n */\n public prepareCommand(\n commandTemplate: string,\n ...parameters: Measurement[]\n ): string {\n const request: requests.PrepareCommandRequest & gateway.Message = {\n ...requests.PrepareCommandRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n commandTemplate: commandTemplate,\n parameters: parameters,\n toBinary() {\n return requests.PrepareCommandRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/prepare_command',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sets the user-assigned device label.\n * The label is stored on the controller and recognized by other software.\n * @param label Label to set.\n */\n public async setLabel(\n label: string\n ): Promise<void> {\n const request: requests.DeviceSetStorageRequest & gateway.Message = {\n ...requests.DeviceSetStorageRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n value: label,\n toBinary() {\n return requests.DeviceSetStorageRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/set_label', request);\n }\n\n /**\n * Gets the device name.\n * @returns The label.\n */\n private _retrieveLabel(): string {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/get_label',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Returns a string that represents the device.\n * @returns A string that represents the device.\n */\n public toString(): string {\n const request: requests.AxisToStringRequest & gateway.Message = {\n ...requests.AxisToStringRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.AxisToStringRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/device_to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Returns a serialization of the current device state that can be saved and reapplied.\n * @returns A serialization of the current state of the device.\n */\n public async getState(): Promise<string> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.StringResponse>(\n 'device/get_state',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Applies a saved state to this device.\n * @param state The state object to apply to this device.\n * @param [options.deviceOnly=false] If true, only device scope settings and features will be set.\n * @returns Reports of any issues that were handled, but caused the state to not be exactly restored.\n */\n public async setState(\n state: string,\n options: Device.SetStateOptions = {}\n ): Promise<SetStateDeviceResponse> {\n const {\n deviceOnly = false,\n } = options;\n const request: requests.SetStateRequest & gateway.Message = {\n ...requests.SetStateRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n state: state,\n deviceOnly: deviceOnly,\n toBinary() {\n return requests.SetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<SetStateDeviceResponse>(\n 'device/set_device_state',\n request,\n SetStateDeviceResponse.fromBinary);\n return response;\n }\n\n /**\n * Checks if a state can be applied to this device.\n * This only covers exceptions that can be determined statically such as mismatches of ID or version,\n * the process of applying the state can still fail when running.\n * @param state The state object to check against.\n * @returns An object listing errors that come up when trying to set the state.\n */\n public async canSetState(\n state: string\n ): Promise<CanSetStateDeviceResponse> {\n const request: requests.CanSetStateRequest & gateway.Message = {\n ...requests.CanSetStateRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n state: state,\n toBinary() {\n return requests.CanSetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<CanSetStateDeviceResponse>(\n 'device/can_set_state',\n request,\n CanSetStateDeviceResponse.fromBinary);\n return response;\n }\n\n /**\n * Waits for the device to start responding to messages.\n * Useful to call after resetting the device.\n * Throws RequestTimeoutException upon timeout.\n * @param timeout For how long to wait in milliseconds for the device to start responding.\n */\n public async waitToRespond(\n timeout: number\n ): Promise<void> {\n const request: requests.WaitToRespondRequest & gateway.Message = {\n ...requests.WaitToRespondRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n timeout: timeout,\n toBinary() {\n return requests.WaitToRespondRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/wait_to_respond', request);\n }\n\n /**\n * Changes the address of this device.\n * After the address is successfully changed, the existing device class instance no longer represents the device.\n * Instead, use the new device instance returned by this method.\n * @param address The new address to assign to the device.\n * @returns New device instance with the new address.\n */\n public async renumber(\n address: number\n ): Promise<Device> {\n if (address < 1 || address > 99) {\n throw new TypeError('Invalid value; device addresses are numbered from 1 to 99.');\n }\n const request: requests.RenumberRequest & gateway.Message = {\n ...requests.RenumberRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n address: address,\n toBinary() {\n return requests.RenumberRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntResponse>(\n 'device/renumber',\n request,\n requests.IntResponse.fromBinary);\n return new Device(this.connection, response.value);\n }\n\n /**\n * Restores most of the settings to their default values.\n * Deletes all triggers, stream and PVT buffers, servo tunings.\n * Deletes all zaber storage keys.\n * Disables locksteps, unparks axes.\n * Preserves storage, communication settings, peripherals (unless hard is specified).\n * The device needs to be identified again after the restore.\n * @param [hard=false] If true, completely erases device's memory. The device also resets.\n */\n public async restore(\n hard: boolean = false\n ): Promise<void> {\n const request: requests.DeviceRestoreRequest & gateway.Message = {\n ...requests.DeviceRestoreRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n hard: hard,\n toBinary() {\n return requests.DeviceRestoreRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/restore', request);\n }\n\n /**\n * Returns identity.\n * @returns Device identity.\n */\n private _retrieveIdentity(): DeviceIdentity {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<DeviceIdentity>(\n 'device/get_identity',\n request,\n DeviceIdentity.fromBinary);\n return response;\n }\n\n /**\n * Returns whether or not the device have been identified.\n * @returns True if the device has already been identified. False otherwise.\n */\n private _retrieveIsIdentified(): boolean {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.BoolResponse>(\n 'device/get_is_identified',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace Device {\n export interface IdentifyOptions {\n /**\n * The identification assumes the specified firmware version\n * instead of the version queried from the device.\n * Providing this argument can lead to unexpected compatibility issues.\n */\n assumeVersion?: FirmwareVersion;\n }\n export interface GenericCommandOptions {\n /**\n * Optional axis number to send the command to.\n */\n axis?: number;\n /**\n * Controls whether to throw an exception when the device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface GenericCommandMultiResponseOptions {\n /**\n * Optional axis number to send the command to.\n */\n axis?: number;\n /**\n * Controls whether to throw an exception when a device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface GenericCommandNoResponseOptions {\n /**\n * Optional axis number to send the command to.\n * Specifying -1 omits the number completely.\n */\n axis?: number;\n }\n export interface SetStateOptions {\n /**\n * If true, only device scope settings and features will be set.\n */\n deviceOnly?: boolean;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"device.js","sourceRoot":"","sources":["../../../src/ascii/device.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtD,uDAAmD;AACnD,iCAA8B;AAC9B,yCAAqC;AACrC,yCAAsC;AACtC,uDAAmD;AACnD,2CAAuC;AACvC,yCAAsC;AACtC,yCAAsC;AACtC,iDAA8C;AAC9C,mFAA4E;AAC5E,+BAA4B;AAG5B,oDAAsC;AACtC,sDAAwC;AACxC,uCAA0C;AAC1C,yCAAsC;AACtC,uCAAoC;AACpC,2EAAqE;AAErE;;GAEG;AACH,MAAa,MAAM;IACjB;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAGD;;;OAGG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAGD;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAGD;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAGD;;OAEG;IACH,IAAW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//\n\nimport { Connection } from './connection';\nimport { DeviceSettings } from './device_settings';\nimport { Axis } from './axis';\nimport { AllAxes } from './all_axes';\nimport { Warnings } from './warnings';\nimport { DeviceIdentity } from './device_identity';\nimport { DeviceIO } from './device_io';\nimport { Response } from './response';\nimport { Lockstep } from './lockstep';\nimport { Oscilloscope } from './oscilloscope';\nimport { CanSetStateDeviceResponse } from './can_set_state_device_response';\nimport { Pvt } from './pvt';\nimport { Measurement } from '../measurement';\nimport { FirmwareVersion } from '../firmware_version';\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { DeviceStorage } from './storage';\nimport { Triggers } from './triggers';\nimport { Streams } from './streams';\nimport { SetStateDeviceResponse } from './set_state_device_response';\n\n/**\n * Represents the controller part of one device - may be either a standalone controller or an integrated controller.\n */\nexport class Device {\n /**\n * Connection of this device.\n */\n public get connection(): Connection {\n return this._connection;\n }\n private _connection: Connection;\n\n /**\n * The device address uniquely identifies the device on the connection.\n * It can be configured or automatically assigned by the renumber command.\n */\n public get deviceAddress(): number {\n return this._deviceAddress;\n }\n private _deviceAddress: number;\n\n /**\n * Settings and properties of this device.\n */\n public get settings(): DeviceSettings {\n return this._settings;\n }\n private _settings: DeviceSettings;\n\n /**\n * Key-value storage of this device.\n */\n public get storage(): DeviceStorage {\n return this._storage;\n }\n private _storage: DeviceStorage;\n\n /**\n * I/O channels of this device.\n */\n public get io(): DeviceIO {\n return this._io;\n }\n private _io: DeviceIO;\n\n /**\n * Virtual axis which allows you to target all axes of this device.\n */\n public get allAxes(): AllAxes {\n return this._allAxes;\n }\n private _allAxes: AllAxes;\n\n /**\n * Warnings and faults of this device and all its axes.\n */\n public get warnings(): Warnings {\n return this._warnings;\n }\n private _warnings: Warnings;\n\n /**\n * Identity of the device.\n */\n public get identity(): DeviceIdentity {\n return this._retrieveIdentity();\n }\n\n /**\n * Indicates whether or not the device has been identified.\n */\n public get isIdentified(): boolean {\n return this._retrieveIsIdentified();\n }\n\n /**\n * Oscilloscope recording helper for this device.\n * Requires at least Firmware 7.00.\n */\n public get oscilloscope(): Oscilloscope {\n return this._oscilloscope;\n }\n private _oscilloscope: Oscilloscope;\n\n /**\n * Unique ID of the device hardware.\n */\n public get deviceId(): number {\n return this.identity.deviceId;\n }\n\n /**\n * Serial number of the device.\n */\n public get serialNumber(): number {\n return this.identity.serialNumber;\n }\n\n /**\n * Name of the product.\n */\n public get name(): string {\n return this.identity.name;\n }\n\n /**\n * Number of axes this device has.\n */\n public get axisCount(): number {\n return this.identity.axisCount;\n }\n\n /**\n * Version of the firmware.\n */\n public get firmwareVersion(): FirmwareVersion {\n return this.identity.firmwareVersion;\n }\n\n /**\n * The device is an integrated product.\n */\n public get isIntegrated(): boolean {\n return this.identity.isIntegrated;\n }\n\n /**\n * User-assigned label of the device.\n */\n public get label(): string {\n return this._retrieveLabel();\n }\n\n /**\n * Triggers for this device.\n * Requires at least Firmware 7.06.\n */\n public get triggers(): Triggers {\n return this._triggers;\n }\n private _triggers: Triggers;\n\n /**\n * Gets an object that provides access to Streams on this device.\n * Requires at least Firmware 7.05.\n */\n public get streams(): Streams {\n return this._streams;\n }\n private _streams: Streams;\n\n /**\n * Gets an object that provides access to PVT functions of this device.\n * Note that as of ZML v5.0.0, this returns a Pvt object and NOT a PvtSequence object.\n * The PvtSequence can now be obtained from the Pvt object.\n * Requires at least Firmware 7.33.\n */\n public get pvt(): Pvt {\n return this._pvt;\n }\n private _pvt: Pvt;\n\n constructor(connection: Connection, deviceAddress: number) {\n this._connection = connection;\n this._deviceAddress = deviceAddress;\n this._settings = new DeviceSettings(this);\n this._storage = new DeviceStorage(this);\n this._io = new DeviceIO(this);\n this._allAxes = new AllAxes(this);\n this._warnings = new Warnings(this, 0);\n this._oscilloscope = new Oscilloscope(this);\n this._triggers = new Triggers(this);\n this._streams = new Streams(this);\n this._pvt = new Pvt(this);\n }\n\n /**\n * Queries the device and the database, gathering information about the product.\n * Without this information features such as unit conversions will not work.\n * Usually, called automatically by detect devices method.\n * @param options.assumeVersion The identification assumes the specified firmware version\n * instead of the version queried from the device.\n * Providing this argument can lead to unexpected compatibility issues.\n * @returns Device identification data.\n */\n public async identify(\n options: Device.IdentifyOptions = {}\n ): Promise<DeviceIdentity> {\n const {\n assumeVersion,\n } = options;\n const request: requests.DeviceIdentifyRequest & gateway.Message = {\n ...requests.DeviceIdentifyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n assumeVersion: assumeVersion,\n toBinary() {\n return requests.DeviceIdentifyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<DeviceIdentity>(\n 'device/identify',\n request,\n DeviceIdentity.fromBinary);\n return response;\n }\n\n /**\n * Sends a generic ASCII command to this device.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.axis=0] Optional axis number to send the command to.\n * @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns A response to the command.\n */\n public async genericCommand(\n command: string,\n options: Device.GenericCommandOptions = {}\n ): Promise<Response> {\n const {\n axis = 0,\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n axis: axis,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<Response>(\n 'interface/generic_command',\n request,\n Response.fromBinary);\n return response;\n }\n\n /**\n * Sends a generic ASCII command to this device and expect multiple responses.\n * Responses are returned in order of arrival.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.axis=0] Optional axis number to send the command to.\n * @param [options.checkErrors=true] Controls whether to throw an exception when a device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns All responses to the command.\n */\n public async genericCommandMultiResponse(\n command: string,\n options: Device.GenericCommandMultiResponseOptions = {}\n ): Promise<Response[]> {\n const {\n axis = 0,\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n axis: axis,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.GenericCommandResponseCollection>(\n 'interface/generic_command_multi_response',\n request,\n requests.GenericCommandResponseCollection.fromBinary);\n return response.responses;\n }\n\n /**\n * Sends a generic ASCII command to this device without expecting a response and without adding a message ID\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.axis=0] Optional axis number to send the command to.\n * Specifying -1 omits the number completely.\n */\n public async genericCommandNoResponse(\n command: string,\n options: Device.GenericCommandNoResponseOptions = {}\n ): Promise<void> {\n const {\n axis = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n axis: axis,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Gets an Axis class instance which allows you to control a particular axis on this device.\n * Axes are numbered from 1.\n * @param axisNumber Number of axis intended to control.\n * @returns Axis instance.\n */\n public getAxis(\n axisNumber: number\n ): Axis {\n if (axisNumber <= 0) {\n throw new TypeError('Invalid value; physical axes are numbered from 1.');\n }\n return new Axis(this, axisNumber);\n }\n\n /**\n * Gets a Lockstep class instance which allows you to control a particular lockstep group on the device.\n * Requires at least Firmware 6.15 or 7.11.\n * @param lockstepGroupId The ID of the lockstep group to control. Lockstep group IDs start at one.\n * @returns Lockstep instance.\n */\n public getLockstep(\n lockstepGroupId: number\n ): Lockstep {\n if (lockstepGroupId <= 0) {\n throw new TypeError('Invalid value; lockstep groups are numbered from 1.');\n }\n return new Lockstep(this, lockstepGroupId);\n }\n\n /**\n * Formats parameters into a command and performs unit conversions.\n * Parameters in the command template are denoted by a question mark.\n * Command returned is only valid for this device.\n * Unit conversion is not supported for commands where axes can be remapped, such as stream and PVT commands.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param commandTemplate Template of a command to prepare. Parameters are denoted by question marks.\n * @param parameters Variable number of command parameters.\n * @returns Command with converted parameters.\n */\n public prepareCommand(\n commandTemplate: string,\n ...parameters: Measurement[]\n ): string {\n const request: requests.PrepareCommandRequest & gateway.Message = {\n ...requests.PrepareCommandRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n commandTemplate: commandTemplate,\n parameters: parameters,\n toBinary() {\n return requests.PrepareCommandRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/prepare_command',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sets the user-assigned device label.\n * The label is stored on the controller and recognized by other software.\n * @param label Label to set.\n */\n public async setLabel(\n label: string\n ): Promise<void> {\n const request: requests.DeviceSetStorageRequest & gateway.Message = {\n ...requests.DeviceSetStorageRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n value: label,\n toBinary() {\n return requests.DeviceSetStorageRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/set_label', request);\n }\n\n /**\n * Gets the device name.\n * @returns The label.\n */\n private _retrieveLabel(): string {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/get_label',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Returns a string that represents the device.\n * @returns A string that represents the device.\n */\n public toString(): string {\n const request: requests.AxisToStringRequest & gateway.Message = {\n ...requests.AxisToStringRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.AxisToStringRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/device_to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Returns a serialization of the current device state that can be saved and reapplied.\n * @returns A serialization of the current state of the device.\n */\n public async getState(): Promise<string> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.StringResponse>(\n 'device/get_state',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Applies a saved state to this device.\n * @param state The state object to apply to this device.\n * @param [options.deviceOnly=false] If true, only device scope settings and features will be set.\n * @returns Reports of any issues that were handled, but caused the state to not be exactly restored.\n */\n public async setState(\n state: string,\n options: Device.SetStateOptions = {}\n ): Promise<SetStateDeviceResponse> {\n const {\n deviceOnly = false,\n } = options;\n const request: requests.SetStateRequest & gateway.Message = {\n ...requests.SetStateRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n state: state,\n deviceOnly: deviceOnly,\n toBinary() {\n return requests.SetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<SetStateDeviceResponse>(\n 'device/set_device_state',\n request,\n SetStateDeviceResponse.fromBinary);\n return response;\n }\n\n /**\n * Checks if a state can be applied to this device.\n * This only covers exceptions that can be determined statically such as mismatches of ID or version,\n * the process of applying the state can still fail when running.\n * @param state The state object to check against.\n * @param options.firmwareVersion The firmware version of the device to apply the state to.\n * Use this to ensure the state will still be compatible after an update.\n * @returns An object listing errors that come up when trying to set the state.\n */\n public async canSetState(\n state: string,\n options: Device.CanSetStateOptions = {}\n ): Promise<CanSetStateDeviceResponse> {\n const {\n firmwareVersion,\n } = options;\n const request: requests.CanSetStateRequest & gateway.Message = {\n ...requests.CanSetStateRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n state: state,\n firmwareVersion: firmwareVersion,\n toBinary() {\n return requests.CanSetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<CanSetStateDeviceResponse>(\n 'device/can_set_state',\n request,\n CanSetStateDeviceResponse.fromBinary);\n return response;\n }\n\n /**\n * Waits for the device to start responding to messages.\n * Useful to call after resetting the device.\n * Throws RequestTimeoutException upon timeout.\n * @param timeout For how long to wait in milliseconds for the device to start responding.\n */\n public async waitToRespond(\n timeout: number\n ): Promise<void> {\n const request: requests.WaitToRespondRequest & gateway.Message = {\n ...requests.WaitToRespondRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n timeout: timeout,\n toBinary() {\n return requests.WaitToRespondRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/wait_to_respond', request);\n }\n\n /**\n * Changes the address of this device.\n * After the address is successfully changed, the existing device class instance no longer represents the device.\n * Instead, use the new device instance returned by this method.\n * @param address The new address to assign to the device.\n * @returns New device instance with the new address.\n */\n public async renumber(\n address: number\n ): Promise<Device> {\n if (address < 1 || address > 99) {\n throw new TypeError('Invalid value; device addresses are numbered from 1 to 99.');\n }\n const request: requests.RenumberRequest & gateway.Message = {\n ...requests.RenumberRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n address: address,\n toBinary() {\n return requests.RenumberRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntResponse>(\n 'device/renumber',\n request,\n requests.IntResponse.fromBinary);\n return new Device(this.connection, response.value);\n }\n\n /**\n * Restores most of the settings to their default values.\n * Deletes all triggers, stream and PVT buffers, servo tunings.\n * Deletes all zaber storage keys.\n * Disables locksteps, unparks axes.\n * Preserves storage, communication settings, peripherals (unless hard is specified).\n * The device needs to be identified again after the restore.\n * @param [hard=false] If true, completely erases device's memory. The device also resets.\n */\n public async restore(\n hard: boolean = false\n ): Promise<void> {\n const request: requests.DeviceRestoreRequest & gateway.Message = {\n ...requests.DeviceRestoreRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n hard: hard,\n toBinary() {\n return requests.DeviceRestoreRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/restore', request);\n }\n\n /**\n * Returns identity.\n * @returns Device identity.\n */\n private _retrieveIdentity(): DeviceIdentity {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<DeviceIdentity>(\n 'device/get_identity',\n request,\n DeviceIdentity.fromBinary);\n return response;\n }\n\n /**\n * Returns whether or not the device have been identified.\n * @returns True if the device has already been identified. False otherwise.\n */\n private _retrieveIsIdentified(): boolean {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.BoolResponse>(\n 'device/get_is_identified',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace Device {\n export interface IdentifyOptions {\n /**\n * The identification assumes the specified firmware version\n * instead of the version queried from the device.\n * Providing this argument can lead to unexpected compatibility issues.\n */\n assumeVersion?: FirmwareVersion;\n }\n export interface GenericCommandOptions {\n /**\n * Optional axis number to send the command to.\n */\n axis?: number;\n /**\n * Controls whether to throw an exception when the device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface GenericCommandMultiResponseOptions {\n /**\n * Optional axis number to send the command to.\n */\n axis?: number;\n /**\n * Controls whether to throw an exception when a device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface GenericCommandNoResponseOptions {\n /**\n * Optional axis number to send the command to.\n * Specifying -1 omits the number completely.\n */\n axis?: number;\n }\n export interface SetStateOptions {\n /**\n * If true, only device scope settings and features will be set.\n */\n deviceOnly?: boolean;\n }\n export interface CanSetStateOptions {\n /**\n * The firmware version of the device to apply the state to.\n * Use this to ensure the state will still be compatible after an update.\n */\n firmwareVersion?: FirmwareVersion;\n }\n}\n"]}
|
package/dist/lib/library.js
CHANGED
package/dist/lib/library.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"library.js","sourceRoot":"","sources":["../../src/library.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,mDAAqC;AACrC,qDAAuC;AAIvC,MAAa,OAAO;IAClB;;;;OAIG;IACI,MAAM,CAAC,YAAY,CACxB,IAAmB,EACnB,QAAiB;QAEjB,MAAM,OAAO,GAAmD;YAC9D,GAAG,QAAQ,CAAC,mBAAmB,CAAC,OAAO;YACvC,IAAI,EAAE,IAAI;YACV,QAAQ,EAAE,QAAQ;YAClB,QAAQ;gBACN,OAAO,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACrD,CAAC;SACF,CAAC;QAEF,OAAO,CAAC,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,iBAAiB,CAC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ACF,CAAC;QAEF,OAAO,CAAC,QAAQ,CAAC,2BAA2B,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,oBAAoB,CAChC,MAAc;QAEd,MAAM,OAAO,GAA0C;YACrD,GAAG,QAAQ,CAAC,UAAU,CAAC,OAAO;YAC9B,KAAK,EAAE,MAAM;YACb,QAAQ;gBACN,OAAO,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC5C,CAAC;SACF,CAAC;QAEF,OAAO,CAAC,QAAQ,CAAC,iCAAiC,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,YAAY;QACxB,MAAM,OAAO,GAAmD;YAC9D,GAAG,QAAQ,CAAC,mBAAmB,CAAC,OAAO;YACvC,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,OAAO;YAChB,QAAQ;gBACN,OAAO,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACrD,CAAC;SACF,CAAC;QAEF,OAAO,CAAC,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;CACF;AAtID,0BAsIC;AAED,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from './gateway';\nimport * as requests from './requests';\nimport { LogOutputMode } from './log_output_mode';\nimport { DeviceDbSourceType } from './device_db_source_type';\n\nexport class Library {\n /**\n * Sets library logging output.\n * @param mode Logging output mode.\n * @param filePath Path of the file to open.\n */\n public static setLogOutput(\n mode: LogOutputMode,\n filePath?: string\n ): void {\n const request: requests.SetLogOutputRequest & gateway.Message = {\n ...requests.SetLogOutputRequest.DEFAULT,\n mode: mode,\n filePath: filePath,\n toBinary() {\n return requests.SetLogOutputRequest.toBinary(this);\n },\n };\n\n gateway.callSync('logging/set_output', request);\n }\n\n /**\n * Sets source of Device DB data. Allows selection of a web service or a local file.\n * @param sourceType Source type.\n * @param urlOrFilePath URL of the web service or path to the local file.\n * Leave empty for the default URL of Zaber web service.\n */\n public static setDeviceDbSource(\n sourceType: DeviceDbSourceType,\n urlOrFilePath?: string\n ): void {\n const request: requests.SetDeviceDbSourceRequest & gateway.Message = {\n ...requests.SetDeviceDbSourceRequest.DEFAULT,\n sourceType: sourceType,\n urlOrFilePath: urlOrFilePath,\n toBinary() {\n return requests.SetDeviceDbSourceRequest.toBinary(this);\n },\n };\n\n gateway.callSync('device_db/set_source', request);\n }\n\n /**\n * Enables Device DB store.\n * The store uses filesystem to save information obtained from the Device DB.\n * The stored data are later used instead of the Device DB.\n * @param storeLocation Specifies relative or absolute path of the folder used by the store.\n * If left empty defaults to a folder in user home directory.\n * Must be accessible by the process.\n */\n public static enableDeviceDbStore(\n storeLocation?: string\n ): void {\n const request: requests.ToggleDeviceDbStoreRequest & gateway.Message = {\n ...requests.ToggleDeviceDbStoreRequest.DEFAULT,\n toggleOn: true,\n storeLocation: storeLocation,\n toBinary() {\n return requests.ToggleDeviceDbStoreRequest.toBinary(this);\n },\n };\n\n gateway.callSync('device_db/toggle_store', request);\n }\n\n /**\n * Disables Device DB store.\n */\n public static disableDeviceDbStore(): void {\n const request: requests.ToggleDeviceDbStoreRequest & gateway.Message = {\n ...requests.ToggleDeviceDbStoreRequest.DEFAULT,\n toBinary() {\n return requests.ToggleDeviceDbStoreRequest.toBinary(this);\n },\n };\n\n gateway.callSync('device_db/toggle_store', request);\n }\n\n /**\n * Disables certain customer checks (like FF flag).\n * @param mode Whether to turn internal mode on or off.\n */\n public static setInternalMode(\n mode: boolean\n ): void {\n const request: requests.SetInternalModeRequest & gateway.Message = {\n ...requests.SetInternalModeRequest.DEFAULT,\n mode: mode,\n toBinary() {\n return requests.SetInternalModeRequest.toBinary(this);\n },\n };\n\n gateway.callSync('library/set_internal_mode', request);\n }\n\n /**\n * Sets the period between polling for IDLE during movements.\n * Caution: Setting the period too low may cause performance issues.\n * @param period Period in milliseconds.\n * Negative value restores the default period.\n */\n public static setIdlePollingPeriod(\n period: number\n ): void {\n const request: requests.IntRequest & gateway.Message = {\n ...requests.IntRequest.DEFAULT,\n value: period,\n toBinary() {\n return requests.IntRequest.toBinary(this);\n },\n };\n\n gateway.callSync('library/set_idle_polling_period', request);\n }\n\n /**\n * Throws an error if the version of the loaded shared library does not match the caller's version.\n */\n public static checkVersion(): void {\n const request: requests.CheckVersionRequest & gateway.Message = {\n ...requests.CheckVersionRequest.DEFAULT,\n host: 'js',\n version: '7.
|
|
1
|
+
{"version":3,"file":"library.js","sourceRoot":"","sources":["../../src/library.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,mDAAqC;AACrC,qDAAuC;AAIvC,MAAa,OAAO;IAClB;;;;OAIG;IACI,MAAM,CAAC,YAAY,CACxB,IAAmB,EACnB,QAAiB;QAEjB,MAAM,OAAO,GAAmD;YAC9D,GAAG,QAAQ,CAAC,mBAAmB,CAAC,OAAO;YACvC,IAAI,EAAE,IAAI;YACV,QAAQ,EAAE,QAAQ;YAClB,QAAQ;gBACN,OAAO,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACrD,CAAC;SACF,CAAC;QAEF,OAAO,CAAC,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,iBAAiB,CAC7B,UAA8B,EAC9B,aAAsB;QAEtB,MAAM,OAAO,GAAwD;YACnE,GAAG,QAAQ,CAAC,wBAAwB,CAAC,OAAO;YAC5C,UAAU,EAAE,UAAU;YACtB,aAAa,EAAE,aAAa;YAC5B,QAAQ;gBACN,OAAO,QAAQ,CAAC,wBAAwB,CAAC,QAAQ,CAAC,IAAI,CAAC,C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AAM;YACb,QAAQ;gBACN,OAAO,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC5C,CAAC;SACF,CAAC;QAEF,OAAO,CAAC,QAAQ,CAAC,iCAAiC,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,YAAY;QACxB,MAAM,OAAO,GAAmD;YAC9D,GAAG,QAAQ,CAAC,mBAAmB,CAAC,OAAO;YACvC,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,OAAO;YAChB,QAAQ;gBACN,OAAO,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACrD,CAAC;SACF,CAAC;QAEF,OAAO,CAAC,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;CACF;AAtID,0BAsIC;AAED,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from './gateway';\nimport * as requests from './requests';\nimport { LogOutputMode } from './log_output_mode';\nimport { DeviceDbSourceType } from './device_db_source_type';\n\nexport class Library {\n /**\n * Sets library logging output.\n * @param mode Logging output mode.\n * @param filePath Path of the file to open.\n */\n public static setLogOutput(\n mode: LogOutputMode,\n filePath?: string\n ): void {\n const request: requests.SetLogOutputRequest & gateway.Message = {\n ...requests.SetLogOutputRequest.DEFAULT,\n mode: mode,\n filePath: filePath,\n toBinary() {\n return requests.SetLogOutputRequest.toBinary(this);\n },\n };\n\n gateway.callSync('logging/set_output', request);\n }\n\n /**\n * Sets source of Device DB data. Allows selection of a web service or a local file.\n * @param sourceType Source type.\n * @param urlOrFilePath URL of the web service or path to the local file.\n * Leave empty for the default URL of Zaber web service.\n */\n public static setDeviceDbSource(\n sourceType: DeviceDbSourceType,\n urlOrFilePath?: string\n ): void {\n const request: requests.SetDeviceDbSourceRequest & gateway.Message = {\n ...requests.SetDeviceDbSourceRequest.DEFAULT,\n sourceType: sourceType,\n urlOrFilePath: urlOrFilePath,\n toBinary() {\n return requests.SetDeviceDbSourceRequest.toBinary(this);\n },\n };\n\n gateway.callSync('device_db/set_source', request);\n }\n\n /**\n * Enables Device DB store.\n * The store uses filesystem to save information obtained from the Device DB.\n * The stored data are later used instead of the Device DB.\n * @param storeLocation Specifies relative or absolute path of the folder used by the store.\n * If left empty defaults to a folder in user home directory.\n * Must be accessible by the process.\n */\n public static enableDeviceDbStore(\n storeLocation?: string\n ): void {\n const request: requests.ToggleDeviceDbStoreRequest & gateway.Message = {\n ...requests.ToggleDeviceDbStoreRequest.DEFAULT,\n toggleOn: true,\n storeLocation: storeLocation,\n toBinary() {\n return requests.ToggleDeviceDbStoreRequest.toBinary(this);\n },\n };\n\n gateway.callSync('device_db/toggle_store', request);\n }\n\n /**\n * Disables Device DB store.\n */\n public static disableDeviceDbStore(): void {\n const request: requests.ToggleDeviceDbStoreRequest & gateway.Message = {\n ...requests.ToggleDeviceDbStoreRequest.DEFAULT,\n toBinary() {\n return requests.ToggleDeviceDbStoreRequest.toBinary(this);\n },\n };\n\n gateway.callSync('device_db/toggle_store', request);\n }\n\n /**\n * Disables certain customer checks (like FF flag).\n * @param mode Whether to turn internal mode on or off.\n */\n public static setInternalMode(\n mode: boolean\n ): void {\n const request: requests.SetInternalModeRequest & gateway.Message = {\n ...requests.SetInternalModeRequest.DEFAULT,\n mode: mode,\n toBinary() {\n return requests.SetInternalModeRequest.toBinary(this);\n },\n };\n\n gateway.callSync('library/set_internal_mode', request);\n }\n\n /**\n * Sets the period between polling for IDLE during movements.\n * Caution: Setting the period too low may cause performance issues.\n * @param period Period in milliseconds.\n * Negative value restores the default period.\n */\n public static setIdlePollingPeriod(\n period: number\n ): void {\n const request: requests.IntRequest & gateway.Message = {\n ...requests.IntRequest.DEFAULT,\n value: period,\n toBinary() {\n return requests.IntRequest.toBinary(this);\n },\n };\n\n gateway.callSync('library/set_idle_polling_period', request);\n }\n\n /**\n * Throws an error if the version of the loaded shared library does not match the caller's version.\n */\n public static checkVersion(): void {\n const request: requests.CheckVersionRequest & gateway.Message = {\n ...requests.CheckVersionRequest.DEFAULT,\n host: 'js',\n version: '7.5.0',\n toBinary() {\n return requests.CheckVersionRequest.toBinary(this);\n },\n };\n\n gateway.callSync('library/check_version', request);\n }\n}\n\ngateway.addInitCallback(Library.checkVersion);\n"]}
|
|
@@ -4,6 +4,7 @@ import { Warnings } from '../ascii/warnings';
|
|
|
4
4
|
import { Response } from '../ascii/response';
|
|
5
5
|
import type { Illuminator } from './illuminator';
|
|
6
6
|
import { SetStateAxisResponse } from '../ascii';
|
|
7
|
+
import { FirmwareVersion } from '../firmware_version';
|
|
7
8
|
/**
|
|
8
9
|
* Use to control a channel (LED lamp) on an illuminator.
|
|
9
10
|
* Requires at least Firmware 7.09.
|
|
@@ -107,9 +108,11 @@ export declare class IlluminatorChannel {
|
|
|
107
108
|
* This only covers exceptions that can be determined statically such as mismatches of ID or version,
|
|
108
109
|
* the process of applying the state can still fail when running.
|
|
109
110
|
* @param state The state object to check against.
|
|
111
|
+
* @param options.firmwareVersion The firmware version of the device to apply the state to.
|
|
112
|
+
* Use this to ensure the state will still be compatible after an update.
|
|
110
113
|
* @returns An explanation of why this state cannot be set to this channel.
|
|
111
114
|
*/
|
|
112
|
-
canSetState(state: string): Promise<string | null>;
|
|
115
|
+
canSetState(state: string, options?: IlluminatorChannel.CanSetStateOptions): Promise<string | null>;
|
|
113
116
|
/**
|
|
114
117
|
* Returns a string that represents the channel.
|
|
115
118
|
* @returns A string that represents the channel.
|
|
@@ -139,6 +142,13 @@ declare namespace IlluminatorChannel {
|
|
|
139
142
|
*/
|
|
140
143
|
timeout?: number;
|
|
141
144
|
}
|
|
145
|
+
interface CanSetStateOptions {
|
|
146
|
+
/**
|
|
147
|
+
* The firmware version of the device to apply the state to.
|
|
148
|
+
* Use this to ensure the state will still be compatible after an update.
|
|
149
|
+
*/
|
|
150
|
+
firmwareVersion?: FirmwareVersion;
|
|
151
|
+
}
|
|
142
152
|
}
|
|
143
153
|
export {};
|
|
144
154
|
//# sourceMappingURL=illuminator_channel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"illuminator_channel.d.ts","sourceRoot":"","sources":["../../../src/microscopy/illuminator_channel.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"illuminator_channel.d.ts","sourceRoot":"","sources":["../../../src/microscopy/illuminator_channel.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;;GAGG;AACH,qBAAa,kBAAkB;IAC7B;;OAEG;IACH,IAAW,WAAW,IAAI,WAAW,CAEpC;IACD,OAAO,CAAC,YAAY,CAAc;IAElC;;OAEG;IACH,IAAW,aAAa,IAAI,MAAM,CAEjC;IACD,OAAO,CAAC,cAAc,CAAS;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ACtB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,kBAAkB,CAAC,kBAAuB,GAClD,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAuBzB;;;OAGG;IACI,QAAQ,IAAI,MAAM;CAkB1B;AAED,kBAAU,kBAAkB,CAAC;IAC3B,UAAiB,qBAAqB;QAClC;;WAEG;QACH,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB;;;WAGG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KACpB;IACD,UAAiB,kCAAkC;QAC/C;;WAEG;QACH,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB;;;WAGG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KACpB;IACD,UAAiB,kBAAkB;QAC/B;;;WAGG;QACH,eAAe,CAAC,EAAE,eAAe,CAAC;KACrC;CACF"}
|
|
@@ -289,16 +289,20 @@ class IlluminatorChannel {
|
|
|
289
289
|
* This only covers exceptions that can be determined statically such as mismatches of ID or version,
|
|
290
290
|
* the process of applying the state can still fail when running.
|
|
291
291
|
* @param state The state object to check against.
|
|
292
|
+
* @param options.firmwareVersion The firmware version of the device to apply the state to.
|
|
293
|
+
* Use this to ensure the state will still be compatible after an update.
|
|
292
294
|
* @returns An explanation of why this state cannot be set to this channel.
|
|
293
295
|
*/
|
|
294
|
-
async canSetState(state) {
|
|
296
|
+
async canSetState(state, options = {}) {
|
|
295
297
|
var _a;
|
|
298
|
+
const { firmwareVersion, } = options;
|
|
296
299
|
const request = {
|
|
297
300
|
...requests.CanSetStateRequest.DEFAULT,
|
|
298
301
|
interfaceId: this.illuminator.device.connection.interfaceId,
|
|
299
302
|
device: this.illuminator.device.deviceAddress,
|
|
300
303
|
axis: this.channelNumber,
|
|
301
304
|
state: state,
|
|
305
|
+
firmwareVersion: firmwareVersion,
|
|
302
306
|
toBinary() {
|
|
303
307
|
return requests.CanSetStateRequest.toBinary(this);
|
|
304
308
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"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ATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { Axis } from '../ascii/axis';\nimport { AxisStorage } from '../ascii/storage';\nimport { AxisSettings } from '../ascii/axis_settings';\nimport { Warnings } from '../ascii/warnings';\nimport { Response } from '../ascii/response';\nimport type { Illuminator } from './illuminator';\nimport { SetStateAxisResponse } from '../ascii';\n\n/**\n * Use to control a channel (LED lamp) on an illuminator.\n * Requires at least Firmware 7.09.\n */\nexport class IlluminatorChannel {\n /**\n * Illuminator of this channel.\n */\n public get illuminator(): Illuminator {\n return this._illuminator;\n }\n private _illuminator: Illuminator;\n\n /**\n * The channel number identifies the channel on the illuminator.\n */\n public get channelNumber(): number {\n return this._channelNumber;\n }\n private _channelNumber: number;\n\n private _axis: Axis;\n\n /**\n * Settings and properties of this channel.\n */\n public get settings(): AxisSettings {\n return this._settings;\n }\n private _settings: AxisSettings;\n\n /**\n * Key-value storage of this channel.\n */\n public get storage(): AxisStorage {\n return this._storage;\n }\n private _storage: AxisStorage;\n\n /**\n * Warnings and faults of this channel.\n */\n public get warnings(): Warnings {\n return this._warnings;\n }\n private _warnings: Warnings;\n\n constructor(illuminator: Illuminator, channelNumber: number) {\n this._illuminator = illuminator;\n this._channelNumber = channelNumber;\n this._axis = new Axis(illuminator.device, channelNumber);\n this._settings = new AxisSettings(this._axis);\n this._storage = new AxisStorage(this._axis);\n this._warnings = new Warnings(illuminator.device, channelNumber);\n }\n\n /**\n * Turns this channel on.\n */\n public async on(): Promise<void> {\n const request: requests.ChannelOn & gateway.Message = {\n ...requests.ChannelOn.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n on: true,\n toBinary() {\n return requests.ChannelOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('illuminator/on', request);\n }\n\n /**\n * Turns this channel off.\n */\n public async off(): Promise<void> {\n const request: requests.ChannelOn & gateway.Message = {\n ...requests.ChannelOn.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n on: false,\n toBinary() {\n return requests.ChannelOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('illuminator/on', request);\n }\n\n /**\n * Turns this channel on or off.\n * @param on True to turn channel on, false to turn it off.\n */\n public async setOn(\n on: boolean\n ): Promise<void> {\n const request: requests.ChannelOn & gateway.Message = {\n ...requests.ChannelOn.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n on: on,\n toBinary() {\n return requests.ChannelOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('illuminator/on', request);\n }\n\n /**\n * Checks if this channel is on.\n * @returns True if channel is on, false otherwise.\n */\n public async isOn(): Promise<boolean> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.BoolResponse>(\n 'illuminator/is_on',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sets channel intensity as a fraction of the maximum flux.\n * @param intensity Fraction of intensity to set (between 0 and 1).\n */\n public async setIntensity(\n intensity: number\n ): Promise<void> {\n const request: requests.ChannelSetIntensity & gateway.Message = {\n ...requests.ChannelSetIntensity.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n intensity: intensity,\n toBinary() {\n return requests.ChannelSetIntensity.toBinary(this);\n },\n };\n\n await gateway.callAsync('illuminator/set_intensity', request);\n }\n\n /**\n * Gets the current intensity of this channel.\n * @returns Current intensity as fraction of maximum flux.\n */\n public async getIntensity(): Promise<number> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'illuminator/get_intensity',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sends a generic ASCII command to this channel.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns A response to the command.\n */\n public async genericCommand(\n command: string,\n options: IlluminatorChannel.GenericCommandOptions = {}\n ): Promise<Response> {\n const {\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n command: command,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<Response>(\n 'interface/generic_command',\n request,\n Response.fromBinary);\n return response;\n }\n\n /**\n * Sends a generic ASCII command to this channel and expects multiple responses.\n * Responses are returned in order of arrival.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.checkErrors=true] Controls whether to throw an exception when a device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns All responses to the command.\n */\n public async genericCommandMultiResponse(\n command: string,\n options: IlluminatorChannel.GenericCommandMultiResponseOptions = {}\n ): Promise<Response[]> {\n const {\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n command: command,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.GenericCommandResponseCollection>(\n 'interface/generic_command_multi_response',\n request,\n requests.GenericCommandResponseCollection.fromBinary);\n return response.responses;\n }\n\n /**\n * Sends a generic ASCII command to this channel without expecting a response and without adding a message ID\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n */\n public async genericCommandNoResponse(\n command: string\n ): Promise<void> {\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n command: command,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Returns a serialization of the current channel state that can be saved and reapplied.\n * @returns A serialization of the current state of the channel.\n */\n public async getState(): Promise<string> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.StringResponse>(\n 'device/get_state',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Applies a saved state to this channel.\n * @param state The state object to apply to this channel.\n * @returns Reports of any issues that were handled, but caused the state to not be exactly restored.\n */\n public async setState(\n state: string\n ): Promise<SetStateAxisResponse> {\n const request: requests.SetStateRequest & gateway.Message = {\n ...requests.SetStateRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n state: state,\n toBinary() {\n return requests.SetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<SetStateAxisResponse>(\n 'device/set_axis_state',\n request,\n SetStateAxisResponse.fromBinary);\n return response;\n }\n\n /**\n * Checks if a state can be applied to this channel.\n * This only covers exceptions that can be determined statically such as mismatches of ID or version,\n * the process of applying the state can still fail when running.\n * @param state The state object to check against.\n * @returns An explanation of why this state cannot be set to this channel.\n */\n public async canSetState(\n state: string\n ): Promise<string | null> {\n const request: requests.CanSetStateRequest & gateway.Message = {\n ...requests.CanSetStateRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n state: state,\n toBinary() {\n return requests.CanSetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.CanSetStateAxisResponse>(\n 'device/can_set_axis_state',\n request,\n requests.CanSetStateAxisResponse.fromBinary);\n return response.error ?? null;\n }\n\n /**\n * Returns a string that represents the channel.\n * @returns A string that represents the channel.\n */\n public toString(): string {\n const request: requests.AxisToStringRequest & gateway.Message = {\n ...requests.AxisToStringRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n typeOverride: 'Channel',\n toBinary() {\n return requests.AxisToStringRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/axis_to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace IlluminatorChannel {\n export interface GenericCommandOptions {\n /**\n * Controls whether to throw an exception when the device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface GenericCommandMultiResponseOptions {\n /**\n * Controls whether to throw an exception when a device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"illuminator_channel.js","sourceRoot":"","sources":["../../../src/microscopy/illuminator_channel.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,sDAAwC;AACxC,wCAAqC;AACrC,8CAA+C;AAC/C,0DAAsD;AACtD,gDAA6C;AAC7C,gDAA6C;AAE7C,oCAAgD;AAGhD;;;GAGG;AACH,MAAa,kBAAkB;IAC7B;;OAEG;IACH,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAGD;;OAEG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAKD;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAGD;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAGD;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAGD,YAAY,WAAwB,EAAE,aAAqB;QACzD,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,IAAI,WAAI,CAAC,WAAW,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QACzD,IAAI,CAAC,SAAS,GAAG,IAAI,4BAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC9C,IAAI,CAAC,QAAQ,GAAG,IAAI,qBAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5C,IAAI,CAAC,SAAS,GAAG,IAAI,mBAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,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O,CAAC,QAAQ,CAC/B,uBAAuB,EACvB,OAAO,EACP,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACtC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;CACF;AAxXD,gDAwXC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { Axis } from '../ascii/axis';\nimport { AxisStorage } from '../ascii/storage';\nimport { AxisSettings } from '../ascii/axis_settings';\nimport { Warnings } from '../ascii/warnings';\nimport { Response } from '../ascii/response';\nimport type { Illuminator } from './illuminator';\nimport { SetStateAxisResponse } from '../ascii';\nimport { FirmwareVersion } from '../firmware_version';\n\n/**\n * Use to control a channel (LED lamp) on an illuminator.\n * Requires at least Firmware 7.09.\n */\nexport class IlluminatorChannel {\n /**\n * Illuminator of this channel.\n */\n public get illuminator(): Illuminator {\n return this._illuminator;\n }\n private _illuminator: Illuminator;\n\n /**\n * The channel number identifies the channel on the illuminator.\n */\n public get channelNumber(): number {\n return this._channelNumber;\n }\n private _channelNumber: number;\n\n private _axis: Axis;\n\n /**\n * Settings and properties of this channel.\n */\n public get settings(): AxisSettings {\n return this._settings;\n }\n private _settings: AxisSettings;\n\n /**\n * Key-value storage of this channel.\n */\n public get storage(): AxisStorage {\n return this._storage;\n }\n private _storage: AxisStorage;\n\n /**\n * Warnings and faults of this channel.\n */\n public get warnings(): Warnings {\n return this._warnings;\n }\n private _warnings: Warnings;\n\n constructor(illuminator: Illuminator, channelNumber: number) {\n this._illuminator = illuminator;\n this._channelNumber = channelNumber;\n this._axis = new Axis(illuminator.device, channelNumber);\n this._settings = new AxisSettings(this._axis);\n this._storage = new AxisStorage(this._axis);\n this._warnings = new Warnings(illuminator.device, channelNumber);\n }\n\n /**\n * Turns this channel on.\n */\n public async on(): Promise<void> {\n const request: requests.ChannelOn & gateway.Message = {\n ...requests.ChannelOn.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n on: true,\n toBinary() {\n return requests.ChannelOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('illuminator/on', request);\n }\n\n /**\n * Turns this channel off.\n */\n public async off(): Promise<void> {\n const request: requests.ChannelOn & gateway.Message = {\n ...requests.ChannelOn.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n on: false,\n toBinary() {\n return requests.ChannelOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('illuminator/on', request);\n }\n\n /**\n * Turns this channel on or off.\n * @param on True to turn channel on, false to turn it off.\n */\n public async setOn(\n on: boolean\n ): Promise<void> {\n const request: requests.ChannelOn & gateway.Message = {\n ...requests.ChannelOn.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n on: on,\n toBinary() {\n return requests.ChannelOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('illuminator/on', request);\n }\n\n /**\n * Checks if this channel is on.\n * @returns True if channel is on, false otherwise.\n */\n public async isOn(): Promise<boolean> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.BoolResponse>(\n 'illuminator/is_on',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sets channel intensity as a fraction of the maximum flux.\n * @param intensity Fraction of intensity to set (between 0 and 1).\n */\n public async setIntensity(\n intensity: number\n ): Promise<void> {\n const request: requests.ChannelSetIntensity & gateway.Message = {\n ...requests.ChannelSetIntensity.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n intensity: intensity,\n toBinary() {\n return requests.ChannelSetIntensity.toBinary(this);\n },\n };\n\n await gateway.callAsync('illuminator/set_intensity', request);\n }\n\n /**\n * Gets the current intensity of this channel.\n * @returns Current intensity as fraction of maximum flux.\n */\n public async getIntensity(): Promise<number> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'illuminator/get_intensity',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sends a generic ASCII command to this channel.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns A response to the command.\n */\n public async genericCommand(\n command: string,\n options: IlluminatorChannel.GenericCommandOptions = {}\n ): Promise<Response> {\n const {\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n command: command,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<Response>(\n 'interface/generic_command',\n request,\n Response.fromBinary);\n return response;\n }\n\n /**\n * Sends a generic ASCII command to this channel and expects multiple responses.\n * Responses are returned in order of arrival.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.checkErrors=true] Controls whether to throw an exception when a device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns All responses to the command.\n */\n public async genericCommandMultiResponse(\n command: string,\n options: IlluminatorChannel.GenericCommandMultiResponseOptions = {}\n ): Promise<Response[]> {\n const {\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n command: command,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.GenericCommandResponseCollection>(\n 'interface/generic_command_multi_response',\n request,\n requests.GenericCommandResponseCollection.fromBinary);\n return response.responses;\n }\n\n /**\n * Sends a generic ASCII command to this channel without expecting a response and without adding a message ID\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n */\n public async genericCommandNoResponse(\n command: string\n ): Promise<void> {\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n command: command,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Returns a serialization of the current channel state that can be saved and reapplied.\n * @returns A serialization of the current state of the channel.\n */\n public async getState(): Promise<string> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.StringResponse>(\n 'device/get_state',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Applies a saved state to this channel.\n * @param state The state object to apply to this channel.\n * @returns Reports of any issues that were handled, but caused the state to not be exactly restored.\n */\n public async setState(\n state: string\n ): Promise<SetStateAxisResponse> {\n const request: requests.SetStateRequest & gateway.Message = {\n ...requests.SetStateRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n state: state,\n toBinary() {\n return requests.SetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<SetStateAxisResponse>(\n 'device/set_axis_state',\n request,\n SetStateAxisResponse.fromBinary);\n return response;\n }\n\n /**\n * Checks if a state can be applied to this channel.\n * This only covers exceptions that can be determined statically such as mismatches of ID or version,\n * the process of applying the state can still fail when running.\n * @param state The state object to check against.\n * @param options.firmwareVersion The firmware version of the device to apply the state to.\n * Use this to ensure the state will still be compatible after an update.\n * @returns An explanation of why this state cannot be set to this channel.\n */\n public async canSetState(\n state: string,\n options: IlluminatorChannel.CanSetStateOptions = {}\n ): Promise<string | null> {\n const {\n firmwareVersion,\n } = options;\n const request: requests.CanSetStateRequest & gateway.Message = {\n ...requests.CanSetStateRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n state: state,\n firmwareVersion: firmwareVersion,\n toBinary() {\n return requests.CanSetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.CanSetStateAxisResponse>(\n 'device/can_set_axis_state',\n request,\n requests.CanSetStateAxisResponse.fromBinary);\n return response.error ?? null;\n }\n\n /**\n * Returns a string that represents the channel.\n * @returns A string that represents the channel.\n */\n public toString(): string {\n const request: requests.AxisToStringRequest & gateway.Message = {\n ...requests.AxisToStringRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n typeOverride: 'Channel',\n toBinary() {\n return requests.AxisToStringRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/axis_to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace IlluminatorChannel {\n export interface GenericCommandOptions {\n /**\n * Controls whether to throw an exception when the device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface GenericCommandMultiResponseOptions {\n /**\n * Controls whether to throw an exception when a device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface CanSetStateOptions {\n /**\n * The firmware version of the device to apply the state to.\n * Use this to ensure the state will still be compatible after an update.\n */\n firmwareVersion?: FirmwareVersion;\n }\n}\n"]}
|
|
@@ -8,6 +8,7 @@ import { ProcessControllerMode } from './process_controller_mode';
|
|
|
8
8
|
import { ProcessControllerSource } from './process_controller_source';
|
|
9
9
|
import { Measurement } from '../measurement';
|
|
10
10
|
import { SetStateAxisResponse } from '../ascii';
|
|
11
|
+
import { FirmwareVersion } from '../firmware_version';
|
|
11
12
|
/**
|
|
12
13
|
* Use to drive voltage for a process such as a heater, valve, Peltier device, etc.
|
|
13
14
|
* Requires at least Firmware 7.35.
|
|
@@ -137,9 +138,11 @@ export declare class Process {
|
|
|
137
138
|
* This only covers exceptions that can be determined statically such as mismatches of ID or version,
|
|
138
139
|
* the process of applying the state can still fail when running.
|
|
139
140
|
* @param state The state object to check against.
|
|
141
|
+
* @param options.firmwareVersion The firmware version of the device to apply the state to.
|
|
142
|
+
* Use this to ensure the state will still be compatible after an update.
|
|
140
143
|
* @returns An explanation of why this state cannot be set to this process.
|
|
141
144
|
*/
|
|
142
|
-
canSetState(state: string): Promise<string | null>;
|
|
145
|
+
canSetState(state: string, options?: Process.CanSetStateOptions): Promise<string | null>;
|
|
143
146
|
/**
|
|
144
147
|
* Returns a string that represents the process.
|
|
145
148
|
* @returns A string that represents the process.
|
|
@@ -169,6 +172,13 @@ declare namespace Process {
|
|
|
169
172
|
*/
|
|
170
173
|
timeout?: number;
|
|
171
174
|
}
|
|
175
|
+
interface CanSetStateOptions {
|
|
176
|
+
/**
|
|
177
|
+
* The firmware version of the device to apply the state to.
|
|
178
|
+
* Use this to ensure the state will still be compatible after an update.
|
|
179
|
+
*/
|
|
180
|
+
firmwareVersion?: FirmwareVersion;
|
|
181
|
+
}
|
|
172
182
|
}
|
|
173
183
|
export {};
|
|
174
184
|
//# sourceMappingURL=process.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../../src/product/process.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,EAAE,MAAM,EAAS,IAAI,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../../src/product/process.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,EAAE,MAAM,EAAS,IAAI,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,EAAE,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C;;WAEG;QACH,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB;;;WAGG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KACpB;IACD,UAAiB,kCAAkC;QAC/C;;WAEG;QACH,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB;;;WAGG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KACpB;IACD,UAAiB,kBAAkB;QAC/B;;;WAGG;QACH,eAAe,CAAC,EAAE,eAAe,CAAC;KACrC;CACF"}
|
|
@@ -382,16 +382,20 @@ class Process {
|
|
|
382
382
|
* This only covers exceptions that can be determined statically such as mismatches of ID or version,
|
|
383
383
|
* the process of applying the state can still fail when running.
|
|
384
384
|
* @param state The state object to check against.
|
|
385
|
+
* @param options.firmwareVersion The firmware version of the device to apply the state to.
|
|
386
|
+
* Use this to ensure the state will still be compatible after an update.
|
|
385
387
|
* @returns An explanation of why this state cannot be set to this process.
|
|
386
388
|
*/
|
|
387
|
-
async canSetState(state) {
|
|
389
|
+
async canSetState(state, options = {}) {
|
|
388
390
|
var _a;
|
|
391
|
+
const { firmwareVersion, } = options;
|
|
389
392
|
const request = {
|
|
390
393
|
...requests.CanSetStateRequest.DEFAULT,
|
|
391
394
|
interfaceId: this.controller.device.connection.interfaceId,
|
|
392
395
|
device: this.controller.device.deviceAddress,
|
|
393
396
|
axis: this.processNumber,
|
|
394
397
|
state: state,
|
|
398
|
+
firmwareVersion: firmwareVersion,
|
|
395
399
|
toBinary() {
|
|
396
400
|
return requests.CanSetStateRequest.toBinary(this);
|
|
397
401
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process.js","sourceRoot":"","sources":["../../../src/product/process.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtD,oDAAsC;AACtC,sDAAwC;AACxC,oCAA+C;AAC/C,wCAAqC;AACrC,gDAA6C;AAC7C,0DAAsD;AACtD,8CAA+C;AAC/C,gD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;CACF;AAheD,0BAgeC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { ProcessController } from './process_controller';\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { Native, Units, Time } from '../units';\nimport { Axis } from '../ascii/axis';\nimport { Response } from '../ascii/response';\nimport { AxisSettings } from '../ascii/axis_settings';\nimport { AxisStorage } from '../ascii/storage';\nimport { Warnings } from '../ascii/warnings';\nimport { ProcessControllerMode } from './process_controller_mode';\nimport { ProcessControllerSource } from './process_controller_source';\nimport { Measurement } from '../measurement';\nimport { SetStateAxisResponse } from '../ascii';\n\n/**\n * Use to drive voltage for a process such as a heater, valve, Peltier device, etc.\n * Requires at least Firmware 7.35.\n */\nexport class Process {\n /**\n * Controller for this process.\n */\n public get controller(): ProcessController {\n return this._controller;\n }\n private _controller: ProcessController;\n\n /**\n * The process number identifies the process on the controller.\n */\n public get processNumber(): number {\n return this._processNumber;\n }\n private _processNumber: number;\n\n private _axis: Axis;\n\n /**\n * Settings and properties of this process.\n */\n public get settings(): AxisSettings {\n return this._settings;\n }\n private _settings: AxisSettings;\n\n /**\n * Key-value storage of this process.\n */\n public get storage(): AxisStorage {\n return this._storage;\n }\n private _storage: AxisStorage;\n\n /**\n * Warnings and faults of this process.\n */\n public get warnings(): Warnings {\n return this._warnings;\n }\n private _warnings: Warnings;\n\n constructor(controller: ProcessController, processNumber: number) {\n this._controller = controller;\n this._processNumber = processNumber;\n this._axis = new Axis(controller.device, processNumber);\n this._settings = new AxisSettings(this._axis);\n this._storage = new AxisStorage(this._axis);\n this._warnings = new Warnings(controller.device, processNumber);\n }\n\n /**\n * Sets the enabled state of the driver.\n * @param [enabled=true] If true (default) enables drive. If false disables.\n */\n public async enable(\n enabled: boolean = true\n ): Promise<void> {\n const request: requests.ProcessOn & gateway.Message = {\n ...requests.ProcessOn.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n on: enabled,\n toBinary() {\n return requests.ProcessOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('process-controller/enable', request);\n }\n\n /**\n * Turns this process on. In manual mode, this supplies voltage; in controlled mode, it starts the control loop.\n * @param [duration=0] How long to leave the process on.\n * @param [unit=Units.NATIVE] Units of time.\n */\n public async on(\n duration: number = 0,\n unit: Time | Native = Units.NATIVE\n ): Promise<void> {\n const request: requests.ProcessOn & gateway.Message = {\n ...requests.ProcessOn.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n on: true,\n duration: duration,\n unit: unit,\n toBinary() {\n return requests.ProcessOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('process-controller/on', request);\n }\n\n /**\n * Turns this process off.\n */\n public async off(): Promise<void> {\n const request: requests.ProcessOn & gateway.Message = {\n ...requests.ProcessOn.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n on: false,\n toBinary() {\n return requests.ProcessOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('process-controller/on', request);\n }\n\n /**\n * Sets the control mode of this process.\n * @param mode Mode to set this process to.\n */\n public async setMode(\n mode: ProcessControllerMode\n ): Promise<void> {\n const request: requests.DeviceSetSettingRequest & gateway.Message = {\n ...requests.DeviceSetSettingRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n setting: 'process.control.mode',\n value: mode,\n toBinary() {\n return requests.DeviceSetSettingRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/set_setting', request);\n }\n\n /**\n * Gets the control mode of this process.\n * @returns Control mode.\n */\n public async getMode(): Promise<ProcessControllerMode> {\n const request: requests.DeviceGetSettingRequest & gateway.Message = {\n ...requests.DeviceGetSettingRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n setting: 'process.control.mode',\n toBinary() {\n return requests.DeviceGetSettingRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'device/get_setting',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Gets the source used to control this process.\n * @returns The source providing feedback for this process.\n */\n public async getSource(): Promise<ProcessControllerSource> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<ProcessControllerSource>(\n 'process_controller/get_source',\n request,\n ProcessControllerSource.fromBinary);\n return response;\n }\n\n /**\n * Sets the source used to control this process.\n * @param source Sets the source that should provide feedback for this process.\n */\n public async setSource(\n source: ProcessControllerSource\n ): Promise<void> {\n const request: requests.SetProcessControllerSource & gateway.Message = {\n ...requests.SetProcessControllerSource.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n source: source,\n toBinary() {\n return requests.SetProcessControllerSource.toBinary(this);\n },\n };\n\n await gateway.callAsync('process_controller/set_source', request);\n }\n\n /**\n * Gets the current value of the source used to control this process.\n * @returns The current value of this process's controlling source.\n */\n public async getInput(): Promise<Measurement> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<Measurement>(\n 'process_controller/get_input',\n request,\n Measurement.fromBinary);\n return response;\n }\n\n /**\n * Creates an H-bridge between this process and its neighbor. This method is only callable on axis 1 and 3.\n */\n public async bridge(): Promise<void> {\n const request: requests.ProcessOn & gateway.Message = {\n ...requests.ProcessOn.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n on: true,\n toBinary() {\n return requests.ProcessOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('process_controller/bridge', request);\n }\n\n /**\n * Breaks the H-bridge between this process and its neighbor, allowing them to be independently controlled.\n * This method is only callable on axis 1 and 3.\n */\n public async unbridge(): Promise<void> {\n const request: requests.ProcessOn & gateway.Message = {\n ...requests.ProcessOn.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n on: false,\n toBinary() {\n return requests.ProcessOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('process_controller/bridge', request);\n }\n\n /**\n * Detects if the given process is in bridging mode.\n * @returns Whether this process is bridged with its neighbor.\n */\n public async isBridge(): Promise<boolean> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.BoolResponse>(\n 'process_controller/is_bridge',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sends a generic ASCII command to this process' underlying axis.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns A response to the command.\n */\n public async genericCommand(\n command: string,\n options: Process.GenericCommandOptions = {}\n ): Promise<Response> {\n const {\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n command: command,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<Response>(\n 'interface/generic_command',\n request,\n Response.fromBinary);\n return response;\n }\n\n /**\n * Sends a generic ASCII command to this process and expect multiple responses.\n * Responses are returned in order of arrival.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.checkErrors=true] Controls whether to throw an exception when a device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns All responses to the command.\n */\n public async genericCommandMultiResponse(\n command: string,\n options: Process.GenericCommandMultiResponseOptions = {}\n ): Promise<Response[]> {\n const {\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n command: command,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.GenericCommandResponseCollection>(\n 'interface/generic_command_multi_response',\n request,\n requests.GenericCommandResponseCollection.fromBinary);\n return response.responses;\n }\n\n /**\n * Sends a generic ASCII command to this process without expecting a response and without adding a message ID\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n */\n public async genericCommandNoResponse(\n command: string\n ): Promise<void> {\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n command: command,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Returns a serialization of the current process state that can be saved and reapplied.\n * @returns A serialization of the current state of the process.\n */\n public async getState(): Promise<string> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.StringResponse>(\n 'device/get_state',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Applies a saved state to this process.\n * @param state The state object to apply to this process.\n * @returns Reports of any issues that were handled, but caused the state to not be exactly restored.\n */\n public async setState(\n state: string\n ): Promise<SetStateAxisResponse> {\n const request: requests.SetStateRequest & gateway.Message = {\n ...requests.SetStateRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n state: state,\n toBinary() {\n return requests.SetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<SetStateAxisResponse>(\n 'device/set_axis_state',\n request,\n SetStateAxisResponse.fromBinary);\n return response;\n }\n\n /**\n * Checks if a state can be applied to this process.\n * This only covers exceptions that can be determined statically such as mismatches of ID or version,\n * the process of applying the state can still fail when running.\n * @param state The state object to check against.\n * @returns An explanation of why this state cannot be set to this process.\n */\n public async canSetState(\n state: string\n ): Promise<string | null> {\n const request: requests.CanSetStateRequest & gateway.Message = {\n ...requests.CanSetStateRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n state: state,\n toBinary() {\n return requests.CanSetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.CanSetStateAxisResponse>(\n 'device/can_set_axis_state',\n request,\n requests.CanSetStateAxisResponse.fromBinary);\n return response.error ?? null;\n }\n\n /**\n * Returns a string that represents the process.\n * @returns A string that represents the process.\n */\n public toString(): string {\n const request: requests.AxisToStringRequest & gateway.Message = {\n ...requests.AxisToStringRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n typeOverride: 'Process',\n toBinary() {\n return requests.AxisToStringRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/axis_to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace Process {\n export interface GenericCommandOptions {\n /**\n * Controls whether to throw an exception when the device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface GenericCommandMultiResponseOptions {\n /**\n * Controls whether to throw an exception when a device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"process.js","sourceRoot":"","sources":["../../../src/product/process.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtD,oDAAsC;AACtC,sDAAwC;AACxC,oCAA+C;AAC/C,wCAAqC;AACrC,gDAA6C;AAC7C,0DAAsD;AACtD,8CAA+C;AAC/C,gDAA6C;AAE7C,2EAAsE;AACtE,gDAA6C;AAC7C,oCAAgD;AAGhD;;;GAGG;AACH,MAAa,OAAO;IAClB;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAGD;;OAEG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAKD;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAGD;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;I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a;YACxB,KAAK,EAAE,KAAK;YACZ,eAAe,EAAE,eAAe;YAChC,QAAQ;gBACN,OAAO,QAAQ,CAAC,kBAAkB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACpD,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,2BAA2B,EAC3B,OAAO,EACP,QAAQ,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAC;QAC/C,OAAO,MAAA,QAAQ,CAAC,KAAK,mCAAI,IAAI,CAAC;IAChC,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,MAAM,OAAO,GAAmD;YAC9D,GAAG,QAAQ,CAAC,mBAAmB,CAAC,OAAO;YACvC,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW;YAC1D,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,aAAa;YAC5C,IAAI,EAAE,IAAI,CAAC,aAAa;YACxB,YAAY,EAAE,SAAS;YACvB,QAAQ;gBACN,OAAO,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACrD,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,uBAAuB,EACvB,OAAO,EACP,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACtC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;CACF;AAveD,0BAueC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { ProcessController } from './process_controller';\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { Native, Units, Time } from '../units';\nimport { Axis } from '../ascii/axis';\nimport { Response } from '../ascii/response';\nimport { AxisSettings } from '../ascii/axis_settings';\nimport { AxisStorage } from '../ascii/storage';\nimport { Warnings } from '../ascii/warnings';\nimport { ProcessControllerMode } from './process_controller_mode';\nimport { ProcessControllerSource } from './process_controller_source';\nimport { Measurement } from '../measurement';\nimport { SetStateAxisResponse } from '../ascii';\nimport { FirmwareVersion } from '../firmware_version';\n\n/**\n * Use to drive voltage for a process such as a heater, valve, Peltier device, etc.\n * Requires at least Firmware 7.35.\n */\nexport class Process {\n /**\n * Controller for this process.\n */\n public get controller(): ProcessController {\n return this._controller;\n }\n private _controller: ProcessController;\n\n /**\n * The process number identifies the process on the controller.\n */\n public get processNumber(): number {\n return this._processNumber;\n }\n private _processNumber: number;\n\n private _axis: Axis;\n\n /**\n * Settings and properties of this process.\n */\n public get settings(): AxisSettings {\n return this._settings;\n }\n private _settings: AxisSettings;\n\n /**\n * Key-value storage of this process.\n */\n public get storage(): AxisStorage {\n return this._storage;\n }\n private _storage: AxisStorage;\n\n /**\n * Warnings and faults of this process.\n */\n public get warnings(): Warnings {\n return this._warnings;\n }\n private _warnings: Warnings;\n\n constructor(controller: ProcessController, processNumber: number) {\n this._controller = controller;\n this._processNumber = processNumber;\n this._axis = new Axis(controller.device, processNumber);\n this._settings = new AxisSettings(this._axis);\n this._storage = new AxisStorage(this._axis);\n this._warnings = new Warnings(controller.device, processNumber);\n }\n\n /**\n * Sets the enabled state of the driver.\n * @param [enabled=true] If true (default) enables drive. If false disables.\n */\n public async enable(\n enabled: boolean = true\n ): Promise<void> {\n const request: requests.ProcessOn & gateway.Message = {\n ...requests.ProcessOn.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n on: enabled,\n toBinary() {\n return requests.ProcessOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('process-controller/enable', request);\n }\n\n /**\n * Turns this process on. In manual mode, this supplies voltage; in controlled mode, it starts the control loop.\n * @param [duration=0] How long to leave the process on.\n * @param [unit=Units.NATIVE] Units of time.\n */\n public async on(\n duration: number = 0,\n unit: Time | Native = Units.NATIVE\n ): Promise<void> {\n const request: requests.ProcessOn & gateway.Message = {\n ...requests.ProcessOn.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n on: true,\n duration: duration,\n unit: unit,\n toBinary() {\n return requests.ProcessOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('process-controller/on', request);\n }\n\n /**\n * Turns this process off.\n */\n public async off(): Promise<void> {\n const request: requests.ProcessOn & gateway.Message = {\n ...requests.ProcessOn.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n on: false,\n toBinary() {\n return requests.ProcessOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('process-controller/on', request);\n }\n\n /**\n * Sets the control mode of this process.\n * @param mode Mode to set this process to.\n */\n public async setMode(\n mode: ProcessControllerMode\n ): Promise<void> {\n const request: requests.DeviceSetSettingRequest & gateway.Message = {\n ...requests.DeviceSetSettingRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n setting: 'process.control.mode',\n value: mode,\n toBinary() {\n return requests.DeviceSetSettingRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/set_setting', request);\n }\n\n /**\n * Gets the control mode of this process.\n * @returns Control mode.\n */\n public async getMode(): Promise<ProcessControllerMode> {\n const request: requests.DeviceGetSettingRequest & gateway.Message = {\n ...requests.DeviceGetSettingRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n setting: 'process.control.mode',\n toBinary() {\n return requests.DeviceGetSettingRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'device/get_setting',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Gets the source used to control this process.\n * @returns The source providing feedback for this process.\n */\n public async getSource(): Promise<ProcessControllerSource> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<ProcessControllerSource>(\n 'process_controller/get_source',\n request,\n ProcessControllerSource.fromBinary);\n return response;\n }\n\n /**\n * Sets the source used to control this process.\n * @param source Sets the source that should provide feedback for this process.\n */\n public async setSource(\n source: ProcessControllerSource\n ): Promise<void> {\n const request: requests.SetProcessControllerSource & gateway.Message = {\n ...requests.SetProcessControllerSource.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n source: source,\n toBinary() {\n return requests.SetProcessControllerSource.toBinary(this);\n },\n };\n\n await gateway.callAsync('process_controller/set_source', request);\n }\n\n /**\n * Gets the current value of the source used to control this process.\n * @returns The current value of this process's controlling source.\n */\n public async getInput(): Promise<Measurement> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<Measurement>(\n 'process_controller/get_input',\n request,\n Measurement.fromBinary);\n return response;\n }\n\n /**\n * Creates an H-bridge between this process and its neighbor. This method is only callable on axis 1 and 3.\n */\n public async bridge(): Promise<void> {\n const request: requests.ProcessOn & gateway.Message = {\n ...requests.ProcessOn.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n on: true,\n toBinary() {\n return requests.ProcessOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('process_controller/bridge', request);\n }\n\n /**\n * Breaks the H-bridge between this process and its neighbor, allowing them to be independently controlled.\n * This method is only callable on axis 1 and 3.\n */\n public async unbridge(): Promise<void> {\n const request: requests.ProcessOn & gateway.Message = {\n ...requests.ProcessOn.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n on: false,\n toBinary() {\n return requests.ProcessOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('process_controller/bridge', request);\n }\n\n /**\n * Detects if the given process is in bridging mode.\n * @returns Whether this process is bridged with its neighbor.\n */\n public async isBridge(): Promise<boolean> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.BoolResponse>(\n 'process_controller/is_bridge',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sends a generic ASCII command to this process' underlying axis.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns A response to the command.\n */\n public async genericCommand(\n command: string,\n options: Process.GenericCommandOptions = {}\n ): Promise<Response> {\n const {\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n command: command,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<Response>(\n 'interface/generic_command',\n request,\n Response.fromBinary);\n return response;\n }\n\n /**\n * Sends a generic ASCII command to this process and expect multiple responses.\n * Responses are returned in order of arrival.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.checkErrors=true] Controls whether to throw an exception when a device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns All responses to the command.\n */\n public async genericCommandMultiResponse(\n command: string,\n options: Process.GenericCommandMultiResponseOptions = {}\n ): Promise<Response[]> {\n const {\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n command: command,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.GenericCommandResponseCollection>(\n 'interface/generic_command_multi_response',\n request,\n requests.GenericCommandResponseCollection.fromBinary);\n return response.responses;\n }\n\n /**\n * Sends a generic ASCII command to this process without expecting a response and without adding a message ID\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n */\n public async genericCommandNoResponse(\n command: string\n ): Promise<void> {\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n command: command,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Returns a serialization of the current process state that can be saved and reapplied.\n * @returns A serialization of the current state of the process.\n */\n public async getState(): Promise<string> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.StringResponse>(\n 'device/get_state',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Applies a saved state to this process.\n * @param state The state object to apply to this process.\n * @returns Reports of any issues that were handled, but caused the state to not be exactly restored.\n */\n public async setState(\n state: string\n ): Promise<SetStateAxisResponse> {\n const request: requests.SetStateRequest & gateway.Message = {\n ...requests.SetStateRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n state: state,\n toBinary() {\n return requests.SetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<SetStateAxisResponse>(\n 'device/set_axis_state',\n request,\n SetStateAxisResponse.fromBinary);\n return response;\n }\n\n /**\n * Checks if a state can be applied to this process.\n * This only covers exceptions that can be determined statically such as mismatches of ID or version,\n * the process of applying the state can still fail when running.\n * @param state The state object to check against.\n * @param options.firmwareVersion The firmware version of the device to apply the state to.\n * Use this to ensure the state will still be compatible after an update.\n * @returns An explanation of why this state cannot be set to this process.\n */\n public async canSetState(\n state: string,\n options: Process.CanSetStateOptions = {}\n ): Promise<string | null> {\n const {\n firmwareVersion,\n } = options;\n const request: requests.CanSetStateRequest & gateway.Message = {\n ...requests.CanSetStateRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n state: state,\n firmwareVersion: firmwareVersion,\n toBinary() {\n return requests.CanSetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.CanSetStateAxisResponse>(\n 'device/can_set_axis_state',\n request,\n requests.CanSetStateAxisResponse.fromBinary);\n return response.error ?? null;\n }\n\n /**\n * Returns a string that represents the process.\n * @returns A string that represents the process.\n */\n public toString(): string {\n const request: requests.AxisToStringRequest & gateway.Message = {\n ...requests.AxisToStringRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n typeOverride: 'Process',\n toBinary() {\n return requests.AxisToStringRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/axis_to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace Process {\n export interface GenericCommandOptions {\n /**\n * Controls whether to throw an exception when the device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface GenericCommandMultiResponseOptions {\n /**\n * Controls whether to throw an exception when a device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface CanSetStateOptions {\n /**\n * The firmware version of the device to apply the state to.\n * Use this to ensure the state will still be compatible after an update.\n */\n firmwareVersion?: FirmwareVersion;\n }\n}\n"]}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { FirmwareVersion } from '../firmware_version';
|
|
1
2
|
export interface CanSetStateRequest {
|
|
2
3
|
interfaceId: number;
|
|
3
4
|
device: number;
|
|
4
5
|
axis: number;
|
|
5
6
|
state: string;
|
|
7
|
+
firmwareVersion?: (FirmwareVersion | null);
|
|
6
8
|
}
|
|
7
9
|
export declare const CanSetStateRequest: {
|
|
8
10
|
fromBinary: (buffer: Uint8Array) => CanSetStateRequest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"can_set_state_request.d.ts","sourceRoot":"","sources":["../../../src/requests/can_set_state_request.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"can_set_state_request.d.ts","sourceRoot":"","sources":["../../../src/requests/can_set_state_request.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IAEpB,MAAM,EAAE,MAAM,CAAC;IAEf,IAAI,EAAE,MAAM,CAAC;IAEb,KAAK,EAAE,MAAM,CAAC;IAEd,eAAe,CAAC,EAAE,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;CAE5C;AAED,eAAO,MAAM,kBAAkB;yBACR,UAAU,KAAG,kBAAkB;sBAClC,kBAAkB,KAAG,UAAU;;sBAQ/B,kBAAkB,KAAG,kBAAkB;CAW1D,CAAC"}
|
|
@@ -4,6 +4,7 @@ exports.CanSetStateRequest = void 0;
|
|
|
4
4
|
/* This file is generated. Do not modify by hand. */
|
|
5
5
|
const bson_1 = require("bson");
|
|
6
6
|
const sanitizer_1 = require("../gateway/sanitizer");
|
|
7
|
+
const firmware_version_1 = require("../firmware_version");
|
|
7
8
|
exports.CanSetStateRequest = {
|
|
8
9
|
fromBinary: (buffer) => bson_1.BSON.deserialize(buffer),
|
|
9
10
|
toBinary: (value) => bson_1.BSON.serialize(exports.CanSetStateRequest.sanitize(value)),
|
|
@@ -12,6 +13,7 @@ exports.CanSetStateRequest = {
|
|
|
12
13
|
device: 0,
|
|
13
14
|
axis: 0,
|
|
14
15
|
state: '',
|
|
16
|
+
firmwareVersion: null,
|
|
15
17
|
}),
|
|
16
18
|
sanitize: (value) => {
|
|
17
19
|
if (value == null) {
|
|
@@ -25,6 +27,7 @@ exports.CanSetStateRequest = {
|
|
|
25
27
|
device: sanitizer_1.sanitizer.sanitizeInt(value.device, 'device'),
|
|
26
28
|
axis: sanitizer_1.sanitizer.sanitizeInt(value.axis, 'axis'),
|
|
27
29
|
state: sanitizer_1.sanitizer.sanitizeString(value.state, 'state'),
|
|
30
|
+
firmwareVersion: value.firmwareVersion != null ? firmware_version_1.FirmwareVersion.sanitize(value.firmwareVersion) : null,
|
|
28
31
|
};
|
|
29
32
|
},
|
|
30
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"can_set_state_request.js","sourceRoot":"","sources":["../../../src/requests/can_set_state_request.ts"],"names":[],"mappings":";;;AAAA,oDAAoD;AACpD,+BAA4B;AAC5B,oDAAiD;
|
|
1
|
+
{"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C,QAAQ,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI;SACxG,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["/* This file is generated. Do not modify by hand. */\nimport { BSON } from 'bson';\nimport { sanitizer } from '../gateway/sanitizer';\nimport { FirmwareVersion } from '../firmware_version';\n\nexport interface CanSetStateRequest {\n interfaceId: number;\n\n device: number;\n\n axis: number;\n\n state: string;\n\n firmwareVersion?: (FirmwareVersion | null);\n\n}\n\nexport const CanSetStateRequest = {\n fromBinary: (buffer: Uint8Array): CanSetStateRequest => BSON.deserialize(buffer) as CanSetStateRequest,\n toBinary: (value: CanSetStateRequest): Uint8Array => BSON.serialize(CanSetStateRequest.sanitize(value)),\n DEFAULT: Object.freeze({\n interfaceId: 0,\n device: 0,\n axis: 0,\n state: '',\n firmwareVersion: null,\n }) as Readonly<CanSetStateRequest>,\n sanitize: (value: CanSetStateRequest): CanSetStateRequest => {\n if (value == null) { throw new TypeError('Expected CanSetStateRequest object but got null or undefined.') }\n if (typeof value !== 'object') { throw new TypeError(`Expected CanSetStateRequest object but got ${typeof value}.`) }\n return {\n interfaceId: sanitizer.sanitizeInt(value.interfaceId, 'interfaceId'),\n device: sanitizer.sanitizeInt(value.device, 'device'),\n axis: sanitizer.sanitizeInt(value.axis, 'axis'),\n state: sanitizer.sanitizeString(value.state, 'state'),\n firmwareVersion: value.firmwareVersion != null ? FirmwareVersion.sanitize(value.firmwareVersion) : null,\n };\n },\n};\n"]}
|