@zaber/motion 7.2.1 → 7.2.3
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/all_axes.d.ts +9 -0
- package/dist/lib/ascii/all_axes.d.ts.map +1 -1
- package/dist/lib/ascii/all_axes.js.map +1 -1
- package/dist/lib/ascii/axis.d.ts +137 -0
- package/dist/lib/ascii/axis.d.ts.map +1 -1
- package/dist/lib/ascii/axis.js.map +1 -1
- package/dist/lib/ascii/connection.d.ts +71 -0
- package/dist/lib/ascii/connection.d.ts.map +1 -1
- package/dist/lib/ascii/connection.js.map +1 -1
- package/dist/lib/ascii/device.d.ts +32 -0
- package/dist/lib/ascii/device.d.ts.map +1 -1
- package/dist/lib/ascii/device.js.map +1 -1
- package/dist/lib/ascii/lockstep.d.ts +108 -0
- package/dist/lib/ascii/lockstep.d.ts.map +1 -1
- package/dist/lib/ascii/lockstep.js.map +1 -1
- package/dist/lib/ascii/pvt_sequence.d.ts +3 -0
- package/dist/lib/ascii/pvt_sequence.d.ts.map +1 -1
- package/dist/lib/ascii/pvt_sequence.js.map +1 -1
- package/dist/lib/ascii/servo_tuner.d.ts +9 -1
- package/dist/lib/ascii/servo_tuner.d.ts.map +1 -1
- package/dist/lib/ascii/servo_tuner.js +4 -1
- package/dist/lib/ascii/servo_tuner.js.map +1 -1
- package/dist/lib/ascii/storage.d.ts +24 -0
- package/dist/lib/ascii/storage.d.ts.map +1 -1
- package/dist/lib/ascii/storage.js.map +1 -1
- package/dist/lib/ascii/stream.d.ts +3 -0
- package/dist/lib/ascii/stream.d.ts.map +1 -1
- package/dist/lib/ascii/stream.js.map +1 -1
- package/dist/lib/binary/connection.d.ts +26 -0
- package/dist/lib/binary/connection.d.ts.map +1 -1
- package/dist/lib/binary/connection.js.map +1 -1
- package/dist/lib/binary/device.d.ts +39 -1
- package/dist/lib/binary/device.d.ts.map +1 -1
- package/dist/lib/binary/device.js +8 -3
- package/dist/lib/binary/device.js.map +1 -1
- package/dist/lib/gcode/translator.d.ts +3 -0
- package/dist/lib/gcode/translator.d.ts.map +1 -1
- package/dist/lib/gcode/translator.js.map +1 -1
- package/dist/lib/library.js +1 -1
- package/dist/lib/library.js.map +1 -1
- package/dist/lib/microscopy/camera_trigger.d.ts +3 -0
- package/dist/lib/microscopy/camera_trigger.d.ts.map +1 -1
- package/dist/lib/microscopy/camera_trigger.js.map +1 -1
- package/dist/lib/microscopy/illuminator.d.ts +3 -0
- package/dist/lib/microscopy/illuminator.d.ts.map +1 -1
- package/dist/lib/microscopy/illuminator.js.map +1 -1
- package/dist/lib/microscopy/illuminator_channel.d.ts +14 -0
- package/dist/lib/microscopy/illuminator_channel.d.ts.map +1 -1
- package/dist/lib/microscopy/illuminator_channel.js.map +1 -1
- package/dist/lib/microscopy/microscope.d.ts +3 -0
- package/dist/lib/microscopy/microscope.d.ts.map +1 -1
- package/dist/lib/microscopy/microscope.js.map +1 -1
- package/dist/lib/microscopy/objective_changer.d.ts +9 -0
- package/dist/lib/microscopy/objective_changer.d.ts.map +1 -1
- package/dist/lib/microscopy/objective_changer.js.map +1 -1
- package/dist/lib/microscopy/wdi_autofocus_provider.d.ts +15 -0
- package/dist/lib/microscopy/wdi_autofocus_provider.d.ts.map +1 -1
- package/dist/lib/microscopy/wdi_autofocus_provider.js.map +1 -1
- package/dist/lib/product/process.d.ts +14 -0
- package/dist/lib/product/process.d.ts.map +1 -1
- package/dist/lib/product/process.js.map +1 -1
- package/dist/lib/requests/set_servo_tuning_request.d.ts +1 -0
- package/dist/lib/requests/set_servo_tuning_request.d.ts.map +1 -1
- package/dist/lib/requests/set_servo_tuning_request.js +2 -0
- package/dist/lib/requests/set_servo_tuning_request.js.map +1 -1
- package/package.json +1 -1
|
@@ -341,15 +341,20 @@ class Device {
|
|
|
341
341
|
* Queries the device and the database, gathering information about the product.
|
|
342
342
|
* Without this information features such as unit conversions will not work.
|
|
343
343
|
* Usually, called automatically by detect devices method.
|
|
344
|
+
* @param options.assumeVersion The identification assumes the specified firmware version
|
|
345
|
+
* instead of the version queried from the device.
|
|
346
|
+
* Providing this argument can lead to unexpected compatibility issues.
|
|
344
347
|
* @returns Device identification data.
|
|
345
348
|
*/
|
|
346
|
-
async identify() {
|
|
349
|
+
async identify(options = {}) {
|
|
350
|
+
const { assumeVersion, } = options;
|
|
347
351
|
const request = {
|
|
348
|
-
...requests.
|
|
352
|
+
...requests.DeviceIdentifyRequest.DEFAULT,
|
|
349
353
|
interfaceId: this.connection.interfaceId,
|
|
350
354
|
device: this.deviceAddress,
|
|
355
|
+
assumeVersion: assumeVersion,
|
|
351
356
|
toBinary() {
|
|
352
|
-
return requests.
|
|
357
|
+
return requests.DeviceIdentifyRequest.toBinary(this);
|
|
353
358
|
},
|
|
354
359
|
};
|
|
355
360
|
const response = await gateway.callAsync('binary/device/identify', request, device_identity_1.DeviceIdentity.fromBinary);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.js","sourceRoot":"","sources":["../../../src/binary/device.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,uDAAmD;AAEnD,uDAAmD;AACnD,uDAAmD;AACnD,oDAAsC;AACtC,sDAAwC;AAExC,uCAAoC;AACpC,oCAAmF;AAInF;;GAEG;AACH,MAAa,MAAM;IAMjB;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAGD;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAGD;;;OAGG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAGD;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,IAAW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;QACtC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;IAED;;;OAGG;IACK,iBAAiB;QACvB,MAAM,OAAO,GAAkD;YAC7D,GAAG,QAAQ,CAAC,kBAAkB,CAAC,OAAO;YACtC,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,WAAW;YACxC,MAAM,EAAE,IAAI,CAAC,aAAa;YAC1B,QAAQ;gBACN,OAAO,QAAQ,CAAC,kBAAkB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACpD,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,4BAA4B,EAC5B,OAAO,EACP,gCAAc,CAAC,UAAU,CAAC,CAAC;QAC7B,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;OAGG;IACK,qBAAqB;QAC3B,MAAM,OAAO,GAAkD;YAC7D,GAAG,QAAQ,CAAC,kBAAkB,CAAC,OAAO;YACtC,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,WAAW;YACxC,MAAM,EAAE,IAAI,CAAC,aAAa;YAC1B,QAAQ;gBACN,OAAO,QAAQ,CAAC,kBAAkB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACpD,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,iCAAiC,EACjC,OAAO,EACP,QAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QACpC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;;AAlkBH,wBAmkBC;AAlkBC;;GAEG;AACoB,+BAAwB,GAAW,EAAE,CAAC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { BinarySettings } from './binary_settings';\nimport { Connection } from './connection';\nimport { DeviceIdentity } from './device_identity';\nimport { DeviceSettings } from './device_settings';\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { CommandCode } from './command_code';\nimport { Message } from './message';\nimport { Angle, Length, Native, AngularVelocity, Velocity, Units } from '../units';\nimport { DeviceType } from './device_type';\nimport { FirmwareVersion } from '../firmware_version';\n\n/**\n * Represents a device using the binary protocol.\n */\nexport class Device {\n /**\n * Default timeout for move commands in seconds.\n */\n public static readonly DEFAULT_MOVEMENT_TIMEOUT: number = 60;\n\n /**\n * Connection of this device.\n */\n public get connection(): Connection {\n return this._connection;\n }\n private _connection: Connection;\n\n /**\n * Settings and properties of this axis.\n */\n public get settings(): DeviceSettings {\n return this._settings;\n }\n private _settings: DeviceSettings;\n\n /**\n * The device address uniquely identifies the device on the connection.\n * It can be configured or automatically assigned by the renumber command.\n */\n public get deviceAddress(): number {\n return this._deviceAddress;\n }\n private _deviceAddress: number;\n\n /**\n * Identity of the device.\n */\n public get identity(): DeviceIdentity {\n return this._retrieveIdentity();\n }\n\n /**\n * Indicates whether or not the device has been identified.\n */\n public get isIdentified(): boolean {\n return this._retrieveIsIdentified();\n }\n\n /**\n * Unique ID of the device hardware.\n */\n public get deviceId(): number {\n return this.identity.deviceId;\n }\n\n /**\n * Serial number of the device.\n * Requires at least Firmware 6.15 for devices or 6.24 for peripherals.\n */\n public get serialNumber(): number {\n return this.identity.serialNumber;\n }\n\n /**\n * Name of the product.\n */\n public get name(): string {\n return this.identity.name;\n }\n\n /**\n * Version of the firmware.\n */\n public get firmwareVersion(): FirmwareVersion {\n return this.identity.firmwareVersion;\n }\n\n /**\n * Indicates whether the device is a peripheral or part of an integrated device.\n */\n public get isPeripheral(): boolean {\n return this.identity.isPeripheral;\n }\n\n /**\n * Unique ID of the peripheral hardware.\n */\n public get peripheralId(): number {\n return this.identity.peripheralId;\n }\n\n /**\n * Name of the peripheral hardware.\n */\n public get peripheralName(): string {\n return this.identity.peripheralName;\n }\n\n /**\n * Determines the type of an device and units it accepts.\n */\n public get deviceType(): DeviceType {\n return this.identity.deviceType;\n }\n\n constructor(connection: Connection, deviceAddress: number) {\n this._connection = connection;\n this._settings = new DeviceSettings(this);\n this._deviceAddress = deviceAddress;\n }\n\n /**\n * Sends a generic Binary command to this device.\n * For more information please refer to the\n * [Binary Protocol Manual](https://www.zaber.com/protocol-manual?protocol=Binary#topic_quick_command_reference).\n * @param command Command to send.\n * @param [data=0] Optional data argument to the command. Defaults to zero.\n * @param [options.timeout=0.0] Number of seconds to wait for a response from the device. 0 or negative defaults to 0.5s.\n * @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.\n * @returns A response to the command.\n */\n public async genericCommand(\n command: CommandCode,\n data: number = 0,\n options: Device.GenericCommandOptions = {}\n ): Promise<Message> {\n const {\n timeout = 0.0,\n checkErrors = true,\n } = options;\n const request: requests.GenericBinaryRequest & gateway.Message = {\n ...requests.GenericBinaryRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n data: data,\n timeout: timeout,\n checkErrors: checkErrors,\n toBinary() {\n return requests.GenericBinaryRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<Message>(\n 'binary/interface/generic_command',\n request,\n Message.fromBinary);\n return response;\n }\n\n /**\n * Sends a generic Binary command to this device without expecting a response.\n * For more information please refer to the\n * [Binary Protocol Manual](https://www.zaber.com/protocol-manual?protocol=Binary#topic_quick_command_reference).\n * @param command Command to send.\n * @param [data=0] Optional data argument to the command. Defaults to zero.\n */\n public async genericCommandNoResponse(\n command: CommandCode,\n data: number = 0\n ): Promise<void> {\n const request: requests.GenericBinaryRequest & gateway.Message = {\n ...requests.GenericBinaryRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n data: data,\n toBinary() {\n return requests.GenericBinaryRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('binary/interface/generic_command_no_response', request);\n }\n\n /**\n * Sends a generic Binary command to this device with unit conversions for both sent data and retrieved data.\n * @param command Command to send.\n * @param [data=0] Data argument to the command. Defaults to zero.\n * @param [fromUnit=Units.NATIVE] Unit to convert sent data from.\n * @param [toUnit=Units.NATIVE] Unit to convert retrieved data to.\n * @param [options.timeout=0.0] Number of seconds to wait for a response from the device. 0 or negative defaults to 0.5s.\n * @returns Data that has been converted to the provided unit.\n */\n public async genericCommandWithUnits(\n command: CommandCode,\n data: number = 0,\n fromUnit: Units = Units.NATIVE,\n toUnit: Units = Units.NATIVE,\n options: Device.GenericCommandWithUnitsOptions = {}\n ): Promise<number> {\n const {\n timeout = 0.0,\n } = options;\n const request: requests.BinaryGenericWithUnitsRequest & gateway.Message = {\n ...requests.BinaryGenericWithUnitsRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n data: data,\n fromUnit: fromUnit,\n toUnit: toUnit,\n timeout: timeout,\n toBinary() {\n return requests.BinaryGenericWithUnitsRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/generic_command_with_units',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Homes device. Device returns to its homing position.\n * @param [options.unit=Units.NATIVE] Unit to convert returned position to.\n * @param [options.timeout=Device.DEFAULT_MOVEMENT_TIMEOUT] Number of seconds to wait for response from the device chain (defaults to 60s).\n * @returns Current position that has been converted to the provided unit.\n */\n public async home(\n options: Device.HomeOptions = {}\n ): Promise<number> {\n const {\n unit = Units.NATIVE,\n timeout = Device.DEFAULT_MOVEMENT_TIMEOUT,\n } = options;\n const request: requests.BinaryDeviceHomeRequest & gateway.Message = {\n ...requests.BinaryDeviceHomeRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n unit: unit,\n timeout: timeout,\n toBinary() {\n return requests.BinaryDeviceHomeRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/home',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Stops ongoing device movement. Decelerates until zero speed.\n * @param [options.unit=Units.NATIVE] Unit to convert returned position to.\n * @param [options.timeout=Device.DEFAULT_MOVEMENT_TIMEOUT] Number of seconds to wait for response from the device chain (defaults to 60s).\n * @returns Current position that has been converted to the provided unit.\n */\n public async stop(\n options: Device.StopOptions = {}\n ): Promise<number> {\n const {\n unit = Units.NATIVE,\n timeout = Device.DEFAULT_MOVEMENT_TIMEOUT,\n } = options;\n const request: requests.BinaryDeviceStopRequest & gateway.Message = {\n ...requests.BinaryDeviceStopRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n unit: unit,\n timeout: timeout,\n toBinary() {\n return requests.BinaryDeviceStopRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/stop',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Move device to absolute position.\n * @param position Absolute position.\n * @param [unit=Units.NATIVE] Unit for the provided position as well as position returned by the device.\n * @param [options.timeout=Device.DEFAULT_MOVEMENT_TIMEOUT] Number of seconds to wait for response from the device chain (defaults to 60s).\n * @returns Current position that has been converted to the provided unit.\n */\n public async moveAbsolute(\n position: number,\n unit: Length | Angle | Native = Units.NATIVE,\n options: Device.MoveAbsoluteOptions = {}\n ): Promise<number> {\n const {\n timeout = Device.DEFAULT_MOVEMENT_TIMEOUT,\n } = options;\n const request: requests.BinaryDeviceMoveRequest & gateway.Message = {\n ...requests.BinaryDeviceMoveRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n type: requests.AxisMoveType.ABS,\n arg: position,\n unit: unit,\n timeout: timeout,\n toBinary() {\n return requests.BinaryDeviceMoveRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/move',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Move device to position relative to current position.\n * @param position Relative position.\n * @param [unit=Units.NATIVE] Unit for the provided position as well as position returned by the device.\n * @param [options.timeout=Device.DEFAULT_MOVEMENT_TIMEOUT] Number of seconds to wait for response from the device chain (defaults to 60s).\n * @returns Current position that has been converted to the provided unit.\n */\n public async moveRelative(\n position: number,\n unit: Length | Angle | Native = Units.NATIVE,\n options: Device.MoveRelativeOptions = {}\n ): Promise<number> {\n const {\n timeout = Device.DEFAULT_MOVEMENT_TIMEOUT,\n } = options;\n const request: requests.BinaryDeviceMoveRequest & gateway.Message = {\n ...requests.BinaryDeviceMoveRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n type: requests.AxisMoveType.REL,\n arg: position,\n unit: unit,\n timeout: timeout,\n toBinary() {\n return requests.BinaryDeviceMoveRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/move',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Begins to move device at specified speed.\n * @param velocity Movement velocity.\n * @param [unit=Units.NATIVE] Unit to convert returned velocity to.\n * @returns Device velocity that has been converted to the provided unit.\n */\n public async moveVelocity(\n velocity: number,\n unit: Velocity | AngularVelocity | Native = Units.NATIVE\n ): Promise<number> {\n const request: requests.BinaryDeviceMoveRequest & gateway.Message = {\n ...requests.BinaryDeviceMoveRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n type: requests.AxisMoveType.VEL,\n arg: velocity,\n unit: unit,\n toBinary() {\n return requests.BinaryDeviceMoveRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/move',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Waits until device stops moving.\n */\n public async waitUntilIdle(): Promise<void> {\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 await gateway.callAsync('binary/device/wait_until_idle', request);\n }\n\n /**\n * Check whether the device is moving.\n * @returns True if the device is currently executing a motion command.\n */\n public async isBusy(): Promise<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 = await gateway.callAsync<requests.BoolResponse>(\n 'binary/device/is_busy',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\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 * @returns Device identification data.\n */\n public async identify(): Promise<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 = await gateway.callAsync<DeviceIdentity>(\n 'binary/device/identify',\n request,\n DeviceIdentity.fromBinary);\n return response;\n }\n\n /**\n * Parks the axis.\n * Motor drivers remain enabled and hold current continues to be applied until the device is powered off.\n * It can later be unparked and moved without first having to home it.\n * Requires at least Firmware 6.06.\n */\n public async park(): Promise<void> {\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 await gateway.callAsync('binary/device/park', request);\n }\n\n /**\n * Unparks axis. Axis will now be able to move.\n * Requires at least Firmware 6.06.\n */\n public async unpark(): Promise<void> {\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 await gateway.callAsync('binary/device/unpark', request);\n }\n\n /**\n * Returns bool indicating whether the axis is parked or not.\n * Requires at least Firmware 6.06.\n * @returns True if the axis is currently parked. False otherwise.\n */\n public async isParked(): Promise<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 = await gateway.callAsync<requests.BoolResponse>(\n 'binary/device/is_parked',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Returns current device 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.BinaryDeviceGetSettingRequest & gateway.Message = {\n ...requests.BinaryDeviceGetSettingRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n setting: BinarySettings.CURRENT_POSITION,\n unit: unit,\n toBinary() {\n return requests.BinaryDeviceGetSettingRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/get_setting',\n request,\n requests.DoubleResponse.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.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.StringResponse>(\n 'binary/device/device_to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\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 'binary/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 'binary/device/get_is_identified',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace Device {\n export interface GenericCommandOptions {\n timeout?: number;\n checkErrors?: boolean;\n }\n export interface GenericCommandWithUnitsOptions {\n timeout?: number;\n }\n export interface HomeOptions {\n unit?: Length | Angle | Native;\n timeout?: number;\n }\n export interface StopOptions {\n unit?: Length | Angle | Native;\n timeout?: number;\n }\n export interface MoveAbsoluteOptions {\n timeout?: number;\n }\n export interface MoveRelativeOptions {\n timeout?: number;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"device.js","sourceRoot":"","sources":["../../../src/binary/device.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,uDAAmD;AAEnD,uDAAmD;AACnD,uDAAmD;AACnD,oDAAsC;AACtC,sDAAwC;AAExC,uCAAoC;AACpC,oCAAmF;AAInF;;GAEG;AACH,MAAa,MAAM;IAMjB;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAGD;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAGD;;;OAGG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAGD;;OAEG;IACH,IAAW,QAAQ;QAC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E ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { BinarySettings } from './binary_settings';\nimport { Connection } from './connection';\nimport { DeviceIdentity } from './device_identity';\nimport { DeviceSettings } from './device_settings';\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { CommandCode } from './command_code';\nimport { Message } from './message';\nimport { Angle, Length, Native, AngularVelocity, Velocity, Units } from '../units';\nimport { DeviceType } from './device_type';\nimport { FirmwareVersion } from '../firmware_version';\n\n/**\n * Represents a device using the binary protocol.\n */\nexport class Device {\n /**\n * Default timeout for move commands in seconds.\n */\n public static readonly DEFAULT_MOVEMENT_TIMEOUT: number = 60;\n\n /**\n * Connection of this device.\n */\n public get connection(): Connection {\n return this._connection;\n }\n private _connection: Connection;\n\n /**\n * Settings and properties of this axis.\n */\n public get settings(): DeviceSettings {\n return this._settings;\n }\n private _settings: DeviceSettings;\n\n /**\n * The device address uniquely identifies the device on the connection.\n * It can be configured or automatically assigned by the renumber command.\n */\n public get deviceAddress(): number {\n return this._deviceAddress;\n }\n private _deviceAddress: number;\n\n /**\n * Identity of the device.\n */\n public get identity(): DeviceIdentity {\n return this._retrieveIdentity();\n }\n\n /**\n * Indicates whether or not the device has been identified.\n */\n public get isIdentified(): boolean {\n return this._retrieveIsIdentified();\n }\n\n /**\n * Unique ID of the device hardware.\n */\n public get deviceId(): number {\n return this.identity.deviceId;\n }\n\n /**\n * Serial number of the device.\n * Requires at least Firmware 6.15 for devices or 6.24 for peripherals.\n */\n public get serialNumber(): number {\n return this.identity.serialNumber;\n }\n\n /**\n * Name of the product.\n */\n public get name(): string {\n return this.identity.name;\n }\n\n /**\n * Version of the firmware.\n */\n public get firmwareVersion(): FirmwareVersion {\n return this.identity.firmwareVersion;\n }\n\n /**\n * Indicates whether the device is a peripheral or part of an integrated device.\n */\n public get isPeripheral(): boolean {\n return this.identity.isPeripheral;\n }\n\n /**\n * Unique ID of the peripheral hardware.\n */\n public get peripheralId(): number {\n return this.identity.peripheralId;\n }\n\n /**\n * Name of the peripheral hardware.\n */\n public get peripheralName(): string {\n return this.identity.peripheralName;\n }\n\n /**\n * Determines the type of an device and units it accepts.\n */\n public get deviceType(): DeviceType {\n return this.identity.deviceType;\n }\n\n constructor(connection: Connection, deviceAddress: number) {\n this._connection = connection;\n this._settings = new DeviceSettings(this);\n this._deviceAddress = deviceAddress;\n }\n\n /**\n * Sends a generic Binary command to this device.\n * For more information please refer to the\n * [Binary Protocol Manual](https://www.zaber.com/protocol-manual?protocol=Binary#topic_quick_command_reference).\n * @param command Command to send.\n * @param [data=0] Optional data argument to the command. Defaults to zero.\n * @param [options.timeout=0.0] Number of seconds to wait for a response from the device. 0 or negative defaults to 0.5s.\n * @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.\n * @returns A response to the command.\n */\n public async genericCommand(\n command: CommandCode,\n data: number = 0,\n options: Device.GenericCommandOptions = {}\n ): Promise<Message> {\n const {\n timeout = 0.0,\n checkErrors = true,\n } = options;\n const request: requests.GenericBinaryRequest & gateway.Message = {\n ...requests.GenericBinaryRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n data: data,\n timeout: timeout,\n checkErrors: checkErrors,\n toBinary() {\n return requests.GenericBinaryRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<Message>(\n 'binary/interface/generic_command',\n request,\n Message.fromBinary);\n return response;\n }\n\n /**\n * Sends a generic Binary command to this device without expecting a response.\n * For more information please refer to the\n * [Binary Protocol Manual](https://www.zaber.com/protocol-manual?protocol=Binary#topic_quick_command_reference).\n * @param command Command to send.\n * @param [data=0] Optional data argument to the command. Defaults to zero.\n */\n public async genericCommandNoResponse(\n command: CommandCode,\n data: number = 0\n ): Promise<void> {\n const request: requests.GenericBinaryRequest & gateway.Message = {\n ...requests.GenericBinaryRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n data: data,\n toBinary() {\n return requests.GenericBinaryRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('binary/interface/generic_command_no_response', request);\n }\n\n /**\n * Sends a generic Binary command to this device with unit conversions for both sent data and retrieved data.\n * @param command Command to send.\n * @param [data=0] Data argument to the command. Defaults to zero.\n * @param [fromUnit=Units.NATIVE] Unit to convert sent data from.\n * @param [toUnit=Units.NATIVE] Unit to convert retrieved data to.\n * @param [options.timeout=0.0] Number of seconds to wait for a response from the device. 0 or negative defaults to 0.5s.\n * @returns Data that has been converted to the provided unit.\n */\n public async genericCommandWithUnits(\n command: CommandCode,\n data: number = 0,\n fromUnit: Units = Units.NATIVE,\n toUnit: Units = Units.NATIVE,\n options: Device.GenericCommandWithUnitsOptions = {}\n ): Promise<number> {\n const {\n timeout = 0.0,\n } = options;\n const request: requests.BinaryGenericWithUnitsRequest & gateway.Message = {\n ...requests.BinaryGenericWithUnitsRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n data: data,\n fromUnit: fromUnit,\n toUnit: toUnit,\n timeout: timeout,\n toBinary() {\n return requests.BinaryGenericWithUnitsRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/generic_command_with_units',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Homes device. Device returns to its homing position.\n * @param [options.unit=Units.NATIVE] Unit to convert returned position to.\n * @param [options.timeout=Device.DEFAULT_MOVEMENT_TIMEOUT] Number of seconds to wait for response from the device chain (defaults to 60s).\n * @returns Current position that has been converted to the provided unit.\n */\n public async home(\n options: Device.HomeOptions = {}\n ): Promise<number> {\n const {\n unit = Units.NATIVE,\n timeout = Device.DEFAULT_MOVEMENT_TIMEOUT,\n } = options;\n const request: requests.BinaryDeviceHomeRequest & gateway.Message = {\n ...requests.BinaryDeviceHomeRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n unit: unit,\n timeout: timeout,\n toBinary() {\n return requests.BinaryDeviceHomeRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/home',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Stops ongoing device movement. Decelerates until zero speed.\n * @param [options.unit=Units.NATIVE] Unit to convert returned position to.\n * @param [options.timeout=Device.DEFAULT_MOVEMENT_TIMEOUT] Number of seconds to wait for response from the device chain (defaults to 60s).\n * @returns Current position that has been converted to the provided unit.\n */\n public async stop(\n options: Device.StopOptions = {}\n ): Promise<number> {\n const {\n unit = Units.NATIVE,\n timeout = Device.DEFAULT_MOVEMENT_TIMEOUT,\n } = options;\n const request: requests.BinaryDeviceStopRequest & gateway.Message = {\n ...requests.BinaryDeviceStopRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n unit: unit,\n timeout: timeout,\n toBinary() {\n return requests.BinaryDeviceStopRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/stop',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Move device to absolute position.\n * @param position Absolute position.\n * @param [unit=Units.NATIVE] Unit for the provided position as well as position returned by the device.\n * @param [options.timeout=Device.DEFAULT_MOVEMENT_TIMEOUT] Number of seconds to wait for response from the device chain (defaults to 60s).\n * @returns Current position that has been converted to the provided unit.\n */\n public async moveAbsolute(\n position: number,\n unit: Length | Angle | Native = Units.NATIVE,\n options: Device.MoveAbsoluteOptions = {}\n ): Promise<number> {\n const {\n timeout = Device.DEFAULT_MOVEMENT_TIMEOUT,\n } = options;\n const request: requests.BinaryDeviceMoveRequest & gateway.Message = {\n ...requests.BinaryDeviceMoveRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n type: requests.AxisMoveType.ABS,\n arg: position,\n unit: unit,\n timeout: timeout,\n toBinary() {\n return requests.BinaryDeviceMoveRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/move',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Move device to position relative to current position.\n * @param position Relative position.\n * @param [unit=Units.NATIVE] Unit for the provided position as well as position returned by the device.\n * @param [options.timeout=Device.DEFAULT_MOVEMENT_TIMEOUT] Number of seconds to wait for response from the device chain (defaults to 60s).\n * @returns Current position that has been converted to the provided unit.\n */\n public async moveRelative(\n position: number,\n unit: Length | Angle | Native = Units.NATIVE,\n options: Device.MoveRelativeOptions = {}\n ): Promise<number> {\n const {\n timeout = Device.DEFAULT_MOVEMENT_TIMEOUT,\n } = options;\n const request: requests.BinaryDeviceMoveRequest & gateway.Message = {\n ...requests.BinaryDeviceMoveRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n type: requests.AxisMoveType.REL,\n arg: position,\n unit: unit,\n timeout: timeout,\n toBinary() {\n return requests.BinaryDeviceMoveRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/move',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Begins to move device at specified speed.\n * @param velocity Movement velocity.\n * @param [unit=Units.NATIVE] Unit to convert returned velocity to.\n * @returns Device velocity that has been converted to the provided unit.\n */\n public async moveVelocity(\n velocity: number,\n unit: Velocity | AngularVelocity | Native = Units.NATIVE\n ): Promise<number> {\n const request: requests.BinaryDeviceMoveRequest & gateway.Message = {\n ...requests.BinaryDeviceMoveRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n type: requests.AxisMoveType.VEL,\n arg: velocity,\n unit: unit,\n toBinary() {\n return requests.BinaryDeviceMoveRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/move',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Waits until device stops moving.\n */\n public async waitUntilIdle(): Promise<void> {\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 await gateway.callAsync('binary/device/wait_until_idle', request);\n }\n\n /**\n * Check whether the device is moving.\n * @returns True if the device is currently executing a motion command.\n */\n public async isBusy(): Promise<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 = await gateway.callAsync<requests.BoolResponse>(\n 'binary/device/is_busy',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\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 'binary/device/identify',\n request,\n DeviceIdentity.fromBinary);\n return response;\n }\n\n /**\n * Parks the axis.\n * Motor drivers remain enabled and hold current continues to be applied until the device is powered off.\n * It can later be unparked and moved without first having to home it.\n * Requires at least Firmware 6.06.\n */\n public async park(): Promise<void> {\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 await gateway.callAsync('binary/device/park', request);\n }\n\n /**\n * Unparks axis. Axis will now be able to move.\n * Requires at least Firmware 6.06.\n */\n public async unpark(): Promise<void> {\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 await gateway.callAsync('binary/device/unpark', request);\n }\n\n /**\n * Returns bool indicating whether the axis is parked or not.\n * Requires at least Firmware 6.06.\n * @returns True if the axis is currently parked. False otherwise.\n */\n public async isParked(): Promise<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 = await gateway.callAsync<requests.BoolResponse>(\n 'binary/device/is_parked',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Returns current device 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.BinaryDeviceGetSettingRequest & gateway.Message = {\n ...requests.BinaryDeviceGetSettingRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n setting: BinarySettings.CURRENT_POSITION,\n unit: unit,\n toBinary() {\n return requests.BinaryDeviceGetSettingRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/get_setting',\n request,\n requests.DoubleResponse.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.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.StringResponse>(\n 'binary/device/device_to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\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 'binary/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 'binary/device/get_is_identified',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace Device {\n export interface GenericCommandOptions {\n /**\n * Number of seconds to wait for a response from the device. 0 or negative defaults to 0.5s.\n */\n timeout?: number;\n /**\n * Controls whether to throw an exception when the device rejects the command.\n */\n checkErrors?: boolean;\n }\n export interface GenericCommandWithUnitsOptions {\n /**\n * Number of seconds to wait for a response from the device. 0 or negative defaults to 0.5s.\n */\n timeout?: number;\n }\n export interface HomeOptions {\n /**\n * Unit to convert returned position to.\n */\n unit?: Length | Angle | Native;\n /**\n * Number of seconds to wait for response from the device chain (defaults to 60s).\n */\n timeout?: number;\n }\n export interface StopOptions {\n /**\n * Unit to convert returned position to.\n */\n unit?: Length | Angle | Native;\n /**\n * Number of seconds to wait for response from the device chain (defaults to 60s).\n */\n timeout?: number;\n }\n export interface MoveAbsoluteOptions {\n /**\n * Number of seconds to wait for response from the device chain (defaults to 60s).\n */\n timeout?: number;\n }\n export interface MoveRelativeOptions {\n /**\n * Number of seconds to wait for response from the device chain (defaults to 60s).\n */\n timeout?: number;\n }\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}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translator.d.ts","sourceRoot":"","sources":["../../../src/gcode/translator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAG5E;;;;;GAKG;AACH,qBAAa,UAAU;IACrB;;OAEG;IACH,IAAW,YAAY,IAAI,MAAM,CAEhC;IACD,OAAO,CAAC,aAAa,CAAS;IAE9B;;OAEG;IACH,IAAW,gBAAgB,IAAI,MAAM,CAEpC;gBAEW,YAAY,EAAE,MAAM;IAKhC;;;;;;OAMG;WACiB,KAAK,CACvB,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,gBAAgB,GACxB,OAAO,CAAC,UAAU,CAAC;IAmBtB;;;;;;OAMG;IACU,SAAS,CACpB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,eAAe,CAAC;IAiB3B;;;;;OAKG;IACU,KAAK,CAChB,OAAO,GAAE,UAAU,CAAC,YAAiB,GACpC,OAAO,CAAC,MAAM,EAAE,CAAC;IAoBpB;;;OAGG;IACU,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAY3C;;;;OAIG;IACI,eAAe,CACpB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,Q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AAY,CAAC,CAAC;IACtC,CAAC;CACF;AAxWD,gCAwWC","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 { TranslateResult } from './translate_result';\nimport { TranslatorConfig } from './translator_config';\nimport { Stream } from '../ascii/stream';\nimport { Angle, Length, Native, AngularVelocity, Velocity } from '../units';\nimport { registerForFinalization } from '../finalizer';\n\n/**\n * Represents a live G-Code translator.\n * It allows to stream G-Code blocks to a connected device.\n * It requires a stream to be setup on the device.\n * Requires at least Firmware 7.11.\n */\nexport class Translator {\n /**\n * The ID of the translator that serves to identify native resources.\n */\n public get translatorId(): number {\n return this._translatorId;\n }\n private _translatorId: number;\n\n /**\n * Current coordinate system.\n */\n public get coordinateSystem(): string {\n return this._getCurrentCoordinateSystem();\n }\n\n constructor(translatorId: number) {\n this._translatorId = translatorId;\n registerForFinalization(this, Translator._free.bind(null, translatorId));\n }\n\n /**\n * Sets up the translator on top of a provided stream.\n * @param stream The stream to setup the translator on.\n * The stream must be already setup in a live or a store mode.\n * @param config Configuration of the translator.\n * @returns New instance of translator.\n */\n public static async setup(\n stream: Stream,\n config?: TranslatorConfig\n ): Promise<Translator> {\n const request: requests.TranslatorCreateLiveRequest & gateway.Message = {\n ...requests.TranslatorCreateLiveRequest.DEFAULT,\n device: stream.device.deviceAddress,\n interfaceId: stream.device.connection.interfaceId,\n streamId: stream.streamId,\n config: config,\n toBinary() {\n return requests.TranslatorCreateLiveRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.TranslatorCreateResponse>(\n 'gcode/create_live',\n request,\n requests.TranslatorCreateResponse.fromBinary);\n return new Translator(response.translatorId);\n }\n\n /**\n * Translates a single block (line) of G-code.\n * The commands are queued in the underlying stream to ensure smooth continues movement.\n * Returning of this method indicates that the commands are queued (not necessarily executed).\n * @param block Block (line) of G-code.\n * @returns Result of translation containing the commands sent to the device.\n */\n public async translate(\n block: string\n ): Promise<TranslateResult> {\n const request: requests.TranslatorTranslateRequest & gateway.Message = {\n ...requests.TranslatorTranslateRequest.DEFAULT,\n translatorId: this.translatorId,\n block: block,\n toBinary() {\n return requests.TranslatorTranslateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<TranslateResult>(\n 'gcode/translate_live',\n request,\n TranslateResult.fromBinary);\n return response;\n }\n\n /**\n * Flushes the remaining stream commands waiting in optimization buffer into the underlying stream.\n * The flush is also performed by M2 and M30 codes.\n * @param [options.waitUntilIdle=true] Determines whether to wait for the stream to finish all the movements.\n * @returns The remaining stream commands.\n */\n public async flush(\n options: Translator.FlushOptions = {}\n ): Promise<string[]> {\n const {\n waitUntilIdle = true,\n } = options;\n const request: requests.TranslatorFlushLiveRequest & gateway.Message = {\n ...requests.TranslatorFlushLiveRequest.DEFAULT,\n translatorId: this.translatorId,\n waitUntilIdle: waitUntilIdle,\n toBinary() {\n return requests.TranslatorFlushLiveRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.TranslatorFlushResponse>(\n 'gcode/flush_live',\n request,\n requests.TranslatorFlushResponse.fromBinary);\n return response.commands;\n }\n\n /**\n * Resets position of the translator from the underlying stream.\n * Call this method after performing a movement outside of translator.\n */\n public async resetPosition(): Promise<void> {\n const request: requests.TranslatorEmptyRequest & gateway.Message = {\n ...requests.TranslatorEmptyRequest.DEFAULT,\n translatorId: this.translatorId,\n toBinary() {\n return requests.TranslatorEmptyRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('gcode/reset_position_from_stream', request);\n }\n\n /**\n * Sets the speed at which the device moves when traversing (G0).\n * @param traverseRate The traverse rate.\n * @param unit Units of the traverse rate.\n */\n public setTraverseRate(\n traverseRate: number,\n unit: Velocity | AngularVelocity | Native\n ): void {\n const request: requests.TranslatorSetTraverseRateRequest & gateway.Message = {\n ...requests.TranslatorSetTraverseRateRequest.DEFAULT,\n translatorId: this.translatorId,\n traverseRate: traverseRate,\n unit: unit,\n toBinary() {\n return requests.TranslatorSetTraverseRateRequest.toBinary(this);\n },\n };\n\n gateway.callSync('gcode/set_traverse_rate', request);\n }\n\n /**\n * Sets position of translator's axis.\n * Use this method to set position after performing movement outside of the translator.\n * This method does not cause any movement.\n * @param axis Letter of the axis.\n * @param position The position.\n * @param unit Units of position.\n */\n public setAxisPosition(\n axis: string,\n position: number,\n unit: Length | Angle | Native\n ): void {\n const request: requests.TranslatorSetAxisPositionRequest & gateway.Message = {\n ...requests.TranslatorSetAxisPositionRequest.DEFAULT,\n translatorId: this.translatorId,\n axis: axis,\n position: position,\n unit: unit,\n toBinary() {\n return requests.TranslatorSetAxisPositionRequest.toBinary(this);\n },\n };\n\n gateway.callSync('gcode/set_axis_position', request);\n }\n\n /**\n * Gets position of translator's axis.\n * This method does not query device but returns value from translator's state.\n * @param axis Letter of the axis.\n * @param unit Units of position.\n * @returns Position of translator's axis.\n */\n public getAxisPosition(\n axis: string,\n unit: Length | Angle | Native\n ): number {\n const request: requests.TranslatorGetAxisPositionRequest & gateway.Message = {\n ...requests.TranslatorGetAxisPositionRequest.DEFAULT,\n translatorId: this.translatorId,\n axis: axis,\n unit: unit,\n toBinary() {\n return requests.TranslatorGetAxisPositionRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.DoubleResponse>(\n 'gcode/get_axis_position',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sets the home position of translator's axis.\n * This position is used by G28.\n * @param axis Letter of the axis.\n * @param position The home position.\n * @param unit Units of position.\n */\n public setAxisHomePosition(\n axis: string,\n position: number,\n unit: Length | Angle | Native\n ): void {\n const request: requests.TranslatorSetAxisPositionRequest & gateway.Message = {\n ...requests.TranslatorSetAxisPositionRequest.DEFAULT,\n translatorId: this.translatorId,\n axis: axis,\n position: position,\n unit: unit,\n toBinary() {\n return requests.TranslatorSetAxisPositionRequest.toBinary(this);\n },\n };\n\n gateway.callSync('gcode/set_axis_home', request);\n }\n\n /**\n * Sets the secondary home position of translator's axis.\n * This position is used by G30.\n * @param axis Letter of the axis.\n * @param position The home position.\n * @param unit Units of position.\n */\n public setAxisSecondaryHomePosition(\n axis: string,\n position: number,\n unit: Length | Angle | Native\n ): void {\n const request: requests.TranslatorSetAxisPositionRequest & gateway.Message = {\n ...requests.TranslatorSetAxisPositionRequest.DEFAULT,\n translatorId: this.translatorId,\n axis: axis,\n position: position,\n unit: unit,\n toBinary() {\n return requests.TranslatorSetAxisPositionRequest.toBinary(this);\n },\n };\n\n gateway.callSync('gcode/set_axis_secondary_home', request);\n }\n\n /**\n * Gets offset of an axis in a given coordinate system.\n * @param coordinateSystem Coordinate system (e.g. G54).\n * @param axis Letter of the axis.\n * @param unit Units of position.\n * @returns Offset in translator units of the axis.\n */\n public getAxisCoordinateSystemOffset(\n coordinateSystem: string,\n axis: string,\n unit: Length | Angle | Native\n ): number {\n const request: requests.TranslatorGetAxisOffsetRequest & gateway.Message = {\n ...requests.TranslatorGetAxisOffsetRequest.DEFAULT,\n translatorId: this.translatorId,\n coordinateSystem: coordinateSystem,\n axis: axis,\n unit: unit,\n toBinary() {\n return requests.TranslatorGetAxisOffsetRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.DoubleResponse>(\n 'gcode/get_axis_offset',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Resets internal state after device rejected generated command.\n * Axis positions become uninitialized.\n */\n public resetAfterStreamError(): void {\n const request: requests.TranslatorEmptyRequest & gateway.Message = {\n ...requests.TranslatorEmptyRequest.DEFAULT,\n translatorId: this.translatorId,\n toBinary() {\n return requests.TranslatorEmptyRequest.toBinary(this);\n },\n };\n\n gateway.callSync('gcode/reset_after_stream_error', request);\n }\n\n /**\n * Allows to scale feed rate of the translated code by a coefficient.\n * @param coefficient Coefficient of the original feed rate.\n */\n public setFeedRateOverride(\n coefficient: number\n ): void {\n const request: requests.TranslatorSetFeedRateOverrideRequest & gateway.Message = {\n ...requests.TranslatorSetFeedRateOverrideRequest.DEFAULT,\n translatorId: this.translatorId,\n coefficient: coefficient,\n toBinary() {\n return requests.TranslatorSetFeedRateOverrideRequest.toBinary(this);\n },\n };\n\n gateway.callSync('gcode/set_feed_rate_override', request);\n }\n\n /**\n * Releases native resources of a translator.\n * @param translatorId The ID of the translator.\n */\n private static _free(\n translatorId: number\n ): void {\n const request: requests.TranslatorEmptyRequest & gateway.Message = {\n ...requests.TranslatorEmptyRequest.DEFAULT,\n translatorId: translatorId,\n toBinary() {\n return requests.TranslatorEmptyRequest.toBinary(this);\n },\n };\n\n gateway.callSync('gcode/free', request);\n }\n\n /**\n * Gets current coordinate system (e.g. G54).\n * @returns Current coordinate system.\n */\n private _getCurrentCoordinateSystem(): string {\n const request: requests.TranslatorEmptyRequest & gateway.Message = {\n ...requests.TranslatorEmptyRequest.DEFAULT,\n translatorId: this.translatorId,\n toBinary() {\n return requests.TranslatorEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'gcode/get_current_coordinate_system',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Releases the native resources of the translator.\n * Should only be called if your environment does not support FinalizationRegistry.\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n */\n public free(): void {\n Translator._free(this.translatorId);\n }\n}\n\nnamespace Translator {\n export interface FlushOptions {\n waitUntilIdle?: boolean;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"translator.js","sourceRoot":"","sources":["../../../src/gcode/translator.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,sDAAwC;AACxC,yDAAqD;AAIrD,4CAAuD;AAEvD;;;;;GAKG;AACH,MAAa,UAAU;IACrB;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAGD;;OAEG;IACH,IAAW,g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;QAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,qCAAqC,EACrC,OAAO,EACP,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACtC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACI,IAAI;QACT,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACtC,CAAC;CACF;AAxWD,gCAwWC","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 { TranslateResult } from './translate_result';\nimport { TranslatorConfig } from './translator_config';\nimport { Stream } from '../ascii/stream';\nimport { Angle, Length, Native, AngularVelocity, Velocity } from '../units';\nimport { registerForFinalization } from '../finalizer';\n\n/**\n * Represents a live G-Code translator.\n * It allows to stream G-Code blocks to a connected device.\n * It requires a stream to be setup on the device.\n * Requires at least Firmware 7.11.\n */\nexport class Translator {\n /**\n * The ID of the translator that serves to identify native resources.\n */\n public get translatorId(): number {\n return this._translatorId;\n }\n private _translatorId: number;\n\n /**\n * Current coordinate system.\n */\n public get coordinateSystem(): string {\n return this._getCurrentCoordinateSystem();\n }\n\n constructor(translatorId: number) {\n this._translatorId = translatorId;\n registerForFinalization(this, Translator._free.bind(null, translatorId));\n }\n\n /**\n * Sets up the translator on top of a provided stream.\n * @param stream The stream to setup the translator on.\n * The stream must be already setup in a live or a store mode.\n * @param config Configuration of the translator.\n * @returns New instance of translator.\n */\n public static async setup(\n stream: Stream,\n config?: TranslatorConfig\n ): Promise<Translator> {\n const request: requests.TranslatorCreateLiveRequest & gateway.Message = {\n ...requests.TranslatorCreateLiveRequest.DEFAULT,\n device: stream.device.deviceAddress,\n interfaceId: stream.device.connection.interfaceId,\n streamId: stream.streamId,\n config: config,\n toBinary() {\n return requests.TranslatorCreateLiveRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.TranslatorCreateResponse>(\n 'gcode/create_live',\n request,\n requests.TranslatorCreateResponse.fromBinary);\n return new Translator(response.translatorId);\n }\n\n /**\n * Translates a single block (line) of G-code.\n * The commands are queued in the underlying stream to ensure smooth continues movement.\n * Returning of this method indicates that the commands are queued (not necessarily executed).\n * @param block Block (line) of G-code.\n * @returns Result of translation containing the commands sent to the device.\n */\n public async translate(\n block: string\n ): Promise<TranslateResult> {\n const request: requests.TranslatorTranslateRequest & gateway.Message = {\n ...requests.TranslatorTranslateRequest.DEFAULT,\n translatorId: this.translatorId,\n block: block,\n toBinary() {\n return requests.TranslatorTranslateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<TranslateResult>(\n 'gcode/translate_live',\n request,\n TranslateResult.fromBinary);\n return response;\n }\n\n /**\n * Flushes the remaining stream commands waiting in optimization buffer into the underlying stream.\n * The flush is also performed by M2 and M30 codes.\n * @param [options.waitUntilIdle=true] Determines whether to wait for the stream to finish all the movements.\n * @returns The remaining stream commands.\n */\n public async flush(\n options: Translator.FlushOptions = {}\n ): Promise<string[]> {\n const {\n waitUntilIdle = true,\n } = options;\n const request: requests.TranslatorFlushLiveRequest & gateway.Message = {\n ...requests.TranslatorFlushLiveRequest.DEFAULT,\n translatorId: this.translatorId,\n waitUntilIdle: waitUntilIdle,\n toBinary() {\n return requests.TranslatorFlushLiveRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.TranslatorFlushResponse>(\n 'gcode/flush_live',\n request,\n requests.TranslatorFlushResponse.fromBinary);\n return response.commands;\n }\n\n /**\n * Resets position of the translator from the underlying stream.\n * Call this method after performing a movement outside of translator.\n */\n public async resetPosition(): Promise<void> {\n const request: requests.TranslatorEmptyRequest & gateway.Message = {\n ...requests.TranslatorEmptyRequest.DEFAULT,\n translatorId: this.translatorId,\n toBinary() {\n return requests.TranslatorEmptyRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('gcode/reset_position_from_stream', request);\n }\n\n /**\n * Sets the speed at which the device moves when traversing (G0).\n * @param traverseRate The traverse rate.\n * @param unit Units of the traverse rate.\n */\n public setTraverseRate(\n traverseRate: number,\n unit: Velocity | AngularVelocity | Native\n ): void {\n const request: requests.TranslatorSetTraverseRateRequest & gateway.Message = {\n ...requests.TranslatorSetTraverseRateRequest.DEFAULT,\n translatorId: this.translatorId,\n traverseRate: traverseRate,\n unit: unit,\n toBinary() {\n return requests.TranslatorSetTraverseRateRequest.toBinary(this);\n },\n };\n\n gateway.callSync('gcode/set_traverse_rate', request);\n }\n\n /**\n * Sets position of translator's axis.\n * Use this method to set position after performing movement outside of the translator.\n * This method does not cause any movement.\n * @param axis Letter of the axis.\n * @param position The position.\n * @param unit Units of position.\n */\n public setAxisPosition(\n axis: string,\n position: number,\n unit: Length | Angle | Native\n ): void {\n const request: requests.TranslatorSetAxisPositionRequest & gateway.Message = {\n ...requests.TranslatorSetAxisPositionRequest.DEFAULT,\n translatorId: this.translatorId,\n axis: axis,\n position: position,\n unit: unit,\n toBinary() {\n return requests.TranslatorSetAxisPositionRequest.toBinary(this);\n },\n };\n\n gateway.callSync('gcode/set_axis_position', request);\n }\n\n /**\n * Gets position of translator's axis.\n * This method does not query device but returns value from translator's state.\n * @param axis Letter of the axis.\n * @param unit Units of position.\n * @returns Position of translator's axis.\n */\n public getAxisPosition(\n axis: string,\n unit: Length | Angle | Native\n ): number {\n const request: requests.TranslatorGetAxisPositionRequest & gateway.Message = {\n ...requests.TranslatorGetAxisPositionRequest.DEFAULT,\n translatorId: this.translatorId,\n axis: axis,\n unit: unit,\n toBinary() {\n return requests.TranslatorGetAxisPositionRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.DoubleResponse>(\n 'gcode/get_axis_position',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sets the home position of translator's axis.\n * This position is used by G28.\n * @param axis Letter of the axis.\n * @param position The home position.\n * @param unit Units of position.\n */\n public setAxisHomePosition(\n axis: string,\n position: number,\n unit: Length | Angle | Native\n ): void {\n const request: requests.TranslatorSetAxisPositionRequest & gateway.Message = {\n ...requests.TranslatorSetAxisPositionRequest.DEFAULT,\n translatorId: this.translatorId,\n axis: axis,\n position: position,\n unit: unit,\n toBinary() {\n return requests.TranslatorSetAxisPositionRequest.toBinary(this);\n },\n };\n\n gateway.callSync('gcode/set_axis_home', request);\n }\n\n /**\n * Sets the secondary home position of translator's axis.\n * This position is used by G30.\n * @param axis Letter of the axis.\n * @param position The home position.\n * @param unit Units of position.\n */\n public setAxisSecondaryHomePosition(\n axis: string,\n position: number,\n unit: Length | Angle | Native\n ): void {\n const request: requests.TranslatorSetAxisPositionRequest & gateway.Message = {\n ...requests.TranslatorSetAxisPositionRequest.DEFAULT,\n translatorId: this.translatorId,\n axis: axis,\n position: position,\n unit: unit,\n toBinary() {\n return requests.TranslatorSetAxisPositionRequest.toBinary(this);\n },\n };\n\n gateway.callSync('gcode/set_axis_secondary_home', request);\n }\n\n /**\n * Gets offset of an axis in a given coordinate system.\n * @param coordinateSystem Coordinate system (e.g. G54).\n * @param axis Letter of the axis.\n * @param unit Units of position.\n * @returns Offset in translator units of the axis.\n */\n public getAxisCoordinateSystemOffset(\n coordinateSystem: string,\n axis: string,\n unit: Length | Angle | Native\n ): number {\n const request: requests.TranslatorGetAxisOffsetRequest & gateway.Message = {\n ...requests.TranslatorGetAxisOffsetRequest.DEFAULT,\n translatorId: this.translatorId,\n coordinateSystem: coordinateSystem,\n axis: axis,\n unit: unit,\n toBinary() {\n return requests.TranslatorGetAxisOffsetRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.DoubleResponse>(\n 'gcode/get_axis_offset',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Resets internal state after device rejected generated command.\n * Axis positions become uninitialized.\n */\n public resetAfterStreamError(): void {\n const request: requests.TranslatorEmptyRequest & gateway.Message = {\n ...requests.TranslatorEmptyRequest.DEFAULT,\n translatorId: this.translatorId,\n toBinary() {\n return requests.TranslatorEmptyRequest.toBinary(this);\n },\n };\n\n gateway.callSync('gcode/reset_after_stream_error', request);\n }\n\n /**\n * Allows to scale feed rate of the translated code by a coefficient.\n * @param coefficient Coefficient of the original feed rate.\n */\n public setFeedRateOverride(\n coefficient: number\n ): void {\n const request: requests.TranslatorSetFeedRateOverrideRequest & gateway.Message = {\n ...requests.TranslatorSetFeedRateOverrideRequest.DEFAULT,\n translatorId: this.translatorId,\n coefficient: coefficient,\n toBinary() {\n return requests.TranslatorSetFeedRateOverrideRequest.toBinary(this);\n },\n };\n\n gateway.callSync('gcode/set_feed_rate_override', request);\n }\n\n /**\n * Releases native resources of a translator.\n * @param translatorId The ID of the translator.\n */\n private static _free(\n translatorId: number\n ): void {\n const request: requests.TranslatorEmptyRequest & gateway.Message = {\n ...requests.TranslatorEmptyRequest.DEFAULT,\n translatorId: translatorId,\n toBinary() {\n return requests.TranslatorEmptyRequest.toBinary(this);\n },\n };\n\n gateway.callSync('gcode/free', request);\n }\n\n /**\n * Gets current coordinate system (e.g. G54).\n * @returns Current coordinate system.\n */\n private _getCurrentCoordinateSystem(): string {\n const request: requests.TranslatorEmptyRequest & gateway.Message = {\n ...requests.TranslatorEmptyRequest.DEFAULT,\n translatorId: this.translatorId,\n toBinary() {\n return requests.TranslatorEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'gcode/get_current_coordinate_system',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Releases the native resources of the translator.\n * Should only be called if your environment does not support FinalizationRegistry.\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n */\n public free(): void {\n Translator._free(this.translatorId);\n }\n}\n\nnamespace Translator {\n export interface FlushOptions {\n /**\n * Determines whether to wait for the stream to finish all the movements.\n */\n waitUntilIdle?: boolean;\n }\n}\n"]}
|
package/dist/lib/library.js
CHANGED
package/dist/lib/library.js.map
CHANGED
|
@@ -1 +1 @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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.2.
|
|
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,CACx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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.2.3',\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"camera_trigger.d.ts","sourceRoot":"","sources":["../../../src/microscopy/camera_trigger.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAS,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC;;GAEG;AACH,qBAAa,aAAa;IACxB;;OAEG;IACH,IAAW,MAAM,IAAI,MAAM,CAE1B;IACD,OAAO,CAAC,OAAO,C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D,GAAG,QAAQ,CAAC,mBAAmB,CAAC,OAAO;YACvC,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW;YAC/C,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa;YACjC,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,yBAAyB,EACzB,OAAO,EACP,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACtC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;CACF;AA9ED,sCA8EC","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 { Time, Native, Units } from '../units';\nimport { Device } from '../ascii/device';\n\n/**\n * An abstraction over a device and it's digital output channel.\n */\nexport class CameraTrigger {\n /**\n * The device whose digital output triggers the camera.\n */\n public get device(): Device {\n return this._device;\n }\n private _device: Device;\n\n /**\n * The digital output channel that triggers the camera.\n */\n public get channel(): number {\n return this._channel;\n }\n private _channel: number;\n\n /**\n * Creates instance of `CameraTrigger` based on the given device and digital output channel.\n */\n constructor(device: Device, channel: number) {\n this._device = device;\n this._channel = channel;\n }\n\n /**\n * Triggers the camera.\n * Schedules trigger pulse on the digital output channel.\n * By default, the method waits until the trigger pulse is finished.\n * @param pulseWidth The time duration of the trigger pulse.\n * Depending on the camera setting, the argument can be use to specify exposure.\n * @param [unit=Units.NATIVE] Units of time.\n * @param [options.wait=true] If false, the method does not wait until the trigger pulse is finished.\n */\n public async trigger(\n pulseWidth: number,\n unit: Time | Native = Units.NATIVE,\n options: CameraTrigger.TriggerOptions = {}\n ): Promise<void> {\n const {\n wait = true,\n } = options;\n const request: requests.MicroscopeTriggerCameraRequest & gateway.Message = {\n ...requests.MicroscopeTriggerCameraRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n channelNumber: this.channel,\n delay: pulseWidth,\n unit: unit,\n wait: wait,\n toBinary() {\n return requests.MicroscopeTriggerCameraRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('microscope/trigger_camera', request);\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.device.connection.interfaceId,\n device: this.device.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\nnamespace CameraTrigger {\n export interface TriggerOptions {\n wait?: boolean;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"camera_trigger.js","sourceRoot":"","sources":["../../../src/microscopy/camera_trigger.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,sDAAwC;AACxC,oCAA+C;AAG/C;;GAEG;AACH,MAAa,aAAa;IACxB;;OAEG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAGD;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAGD;;OAEG;IACH,YAAY,MAAc,EAAE,OAAe;QACzC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED;;;;;;;;OAQG;IACI,KAAK,CAAC,OAAO,CAClB,UAAkB,EAClB,OAAsB,aAAK,CAAC,MAAM,EAClC,UAAwC,EAAE;QAE1C,MAAM,EACJ,IAAI,GAAG,IAAI,GACZ,GAAG,OAAO,CAAC;QACZ,MAAM,OAAO,GAA8D;YACzE,GAAG,QAAQ,CAAC,8BAA8B,CAAC,OAAO;YAClD,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW;YAC/C,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa;YACjC,aAAa,EAAE,IAAI,CAAC,OAAO;YAC3B,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,IAAI;YACV,QAAQ;gBACN,OAAO,QAAQ,CAAC,8BAA8B,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAChE,CAAC;SACF,CAAC;QAEF,MAAM,OAAO,CAAC,SAAS,CAAC,2BAA2B,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,MAAM,OAAO,GAAmD;YAC9D,GAAG,QAAQ,CAAC,mBAAmB,CAAC,OAAO;YACvC,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW;YAC/C,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa;YACjC,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,yBAAyB,EACzB,OAAO,EACP,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACtC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;CACF;AA9ED,sCA8EC","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 { Time, Native, Units } from '../units';\nimport { Device } from '../ascii/device';\n\n/**\n * An abstraction over a device and it's digital output channel.\n */\nexport class CameraTrigger {\n /**\n * The device whose digital output triggers the camera.\n */\n public get device(): Device {\n return this._device;\n }\n private _device: Device;\n\n /**\n * The digital output channel that triggers the camera.\n */\n public get channel(): number {\n return this._channel;\n }\n private _channel: number;\n\n /**\n * Creates instance of `CameraTrigger` based on the given device and digital output channel.\n */\n constructor(device: Device, channel: number) {\n this._device = device;\n this._channel = channel;\n }\n\n /**\n * Triggers the camera.\n * Schedules trigger pulse on the digital output channel.\n * By default, the method waits until the trigger pulse is finished.\n * @param pulseWidth The time duration of the trigger pulse.\n * Depending on the camera setting, the argument can be use to specify exposure.\n * @param [unit=Units.NATIVE] Units of time.\n * @param [options.wait=true] If false, the method does not wait until the trigger pulse is finished.\n */\n public async trigger(\n pulseWidth: number,\n unit: Time | Native = Units.NATIVE,\n options: CameraTrigger.TriggerOptions = {}\n ): Promise<void> {\n const {\n wait = true,\n } = options;\n const request: requests.MicroscopeTriggerCameraRequest & gateway.Message = {\n ...requests.MicroscopeTriggerCameraRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n channelNumber: this.channel,\n delay: pulseWidth,\n unit: unit,\n wait: wait,\n toBinary() {\n return requests.MicroscopeTriggerCameraRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('microscope/trigger_camera', request);\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.device.connection.interfaceId,\n device: this.device.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\nnamespace CameraTrigger {\n export interface TriggerOptions {\n /**\n * If false, the method does not wait until the trigger pulse is finished.\n */\n wait?: boolean;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"illuminator.d.ts","sourceRoot":"","sources":["../../../src/microscopy/illuminator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;;GAGG;AACH,qBAAa,WAAW;IACtB;;OAEG;IACH,IAAW,MAAM,IAAI,MAAM,CAE1B;IACD,OAAO,CAAC,OAAO,CAAS;IAExB;;OAEG;IACH,IAAW,EAAE,IAAI,QAAQ,CAExB;IACD,OAAO,CAAC,GAAG,CAAW;IAEtB;;;OAGG;gBACS,MAAM,EAAE,MAAM;IAM1B;;;;;OAKG;IACI,UAAU,CACf,aAAa,EAAE,MAAM,GACpB,kBAAkB;IAOrB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAa5B;;;;;;OAMG;WACiB,IAAI,CACtB,UAAU,EAAE,UAAU,EACtB,OAAO,GAAE,WAAW,CAAC,WAAgB,GACpC,OAAO,CAAC,WAAW,CAAC;IAoBvB;;;OAGG;IACI,QAAQ,IAAI,MAAM;CAgB1B;AAED,kBAAU,WAAW,CAAC;IACpB,UAAiB,WAAW;QACxB,aAAa,CAAC,EAAE,MAAM,CAAC;KAC1B;CACF"}
|
|
1
|
+
{"version":3,"file":"illuminator.d.ts","sourceRoot":"","sources":["../../../src/microscopy/illuminator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;;GAGG;AACH,qBAAa,WAAW;IACtB;;OAEG;IACH,IAAW,MAAM,IAAI,MAAM,CAE1B;IACD,OAAO,CAAC,OAAO,CAAS;IAExB;;OAEG;IACH,IAAW,EAAE,IAAI,QAAQ,CAExB;IACD,OAAO,CAAC,GAAG,CAAW;IAEtB;;;OAGG;gBACS,MAAM,EAAE,MAAM;IAM1B;;;;;OAKG;IACI,UAAU,CACf,aAAa,EAAE,MAAM,GACpB,kBAAkB;IAOrB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAa5B;;;;;;OAMG;WACiB,IAAI,CACtB,UAAU,EAAE,UAAU,EACtB,OAAO,GAAE,WAAW,CAAC,WAAgB,GACpC,OAAO,CAAC,WAAW,CAAC;IAoBvB;;;OAGG;IACI,QAAQ,IAAI,MAAM;CAgB1B;AAED,kBAAU,WAAW,CAAC;IACpB,UAAiB,WAAW;QACxB;;WAEG;QACH,aAAa,CAAC,EAAE,MAAM,CAAC;KAC1B;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"illuminator.js","sourceRoot":"","sources":["../../../src/microscopy/illuminator.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,sDAAwC;AACxC,4CAAyC;AACzC,kDAA8C;AAE9C,+DAA2D;AAE3D;;;GAGG;AACH,MAAa,WAAW;IACtB;;OAEG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAGD;;OAEG;IACH,IAAW,EAAE;QACX,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IAGD;;;OAGG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,GAAG,GAAG,IAAI,oBAAQ,CAAC,MAAM,CAAC,CAAC;QAChC,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC9B,CAAC;IAED;;;;;OAKG;IACI,UAAU,CACf,aAAqB;QAErB,IAAI,aAAa,IAAI,CAAC,EAAE,CAAC;Y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CAAC,OAAO;YACvC,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW;YAC/C,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa;YACjC,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,yBAAyB,EACzB,OAAO,EACP,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACtC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;CACF;AA5GD,kCA4GC","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 { Device } from '../ascii/device';\nimport { DeviceIO } from '../ascii/device_io';\nimport { Connection } from '../ascii/connection';\nimport { IlluminatorChannel } from './illuminator_channel';\n\n/**\n * Use to manage an LED controller.\n * Requires at least Firmware 7.09.\n */\nexport class Illuminator {\n /**\n * The base device of this illuminator.\n */\n public get device(): Device {\n return this._device;\n }\n private _device: Device;\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 * Creates instance of `Illuminator` based on the given device.\n * If the device is identified, this constructor will ensure it is an illuminator.\n */\n constructor(device: Device) {\n this._device = device;\n this._io = new DeviceIO(device);\n this._verifyIsIlluminator();\n }\n\n /**\n * Gets an IlluminatorChannel class instance that allows control of a particular channel.\n * Channels are numbered from 1.\n * @param channelNumber Number of channel to control.\n * @returns Illuminator channel instance.\n */\n public getChannel(\n channelNumber: number\n ): IlluminatorChannel {\n if (channelNumber <= 0) {\n throw new TypeError('Invalid value; channels are numbered from 1.');\n }\n return new IlluminatorChannel(this, channelNumber);\n }\n\n /**\n * Checks if this is an illuminator or some other type of device and throws an error if it is not.\n */\n private _verifyIsIlluminator(): void {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n gateway.callSync('illuminator/verify', request);\n }\n\n /**\n * Finds an illuminator on a connection.\n * In case of conflict, specify the optional device address.\n * @param connection Connection on which to detect the illuminator.\n * @param [options.deviceAddress=0] Optional device address of the illuminator.\n * @returns New instance of illuminator.\n */\n public static async find(\n connection: Connection,\n options: Illuminator.FindOptions = {}\n ): Promise<Illuminator> {\n const {\n deviceAddress = 0,\n } = options;\n const request: requests.FindDeviceRequest & gateway.Message = {\n ...requests.FindDeviceRequest.DEFAULT,\n interfaceId: connection.interfaceId,\n deviceAddress: deviceAddress,\n toBinary() {\n return requests.FindDeviceRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.FindDeviceResponse>(\n 'illuminator/detect',\n request,\n requests.FindDeviceResponse.fromBinary);\n return new Illuminator(new Device(connection, response.address));\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.device.connection.interfaceId,\n device: this.device.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\nnamespace Illuminator {\n export interface FindOptions {\n deviceAddress?: number;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"illuminator.js","sourceRoot":"","sources":["../../../src/microscopy/illuminator.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,sDAAwC;AACxC,4CAAyC;AACzC,kDAA8C;AA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AE,UAAU,CAAC,WAAW;YACnC,aAAa,EAAE,aAAa;YAC5B,QAAQ;gBACN,OAAO,QAAQ,CAAC,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACnD,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,oBAAoB,EACpB,OAAO,EACP,QAAQ,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;QAC1C,OAAO,IAAI,WAAW,CAAC,IAAI,eAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IACnE,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,MAAM,OAAO,GAAmD;YAC9D,GAAG,QAAQ,CAAC,mBAAmB,CAAC,OAAO;YACvC,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW;YAC/C,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa;YACjC,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,yBAAyB,EACzB,OAAO,EACP,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACtC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;CACF;AA5GD,kCA4GC","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 { Device } from '../ascii/device';\nimport { DeviceIO } from '../ascii/device_io';\nimport { Connection } from '../ascii/connection';\nimport { IlluminatorChannel } from './illuminator_channel';\n\n/**\n * Use to manage an LED controller.\n * Requires at least Firmware 7.09.\n */\nexport class Illuminator {\n /**\n * The base device of this illuminator.\n */\n public get device(): Device {\n return this._device;\n }\n private _device: Device;\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 * Creates instance of `Illuminator` based on the given device.\n * If the device is identified, this constructor will ensure it is an illuminator.\n */\n constructor(device: Device) {\n this._device = device;\n this._io = new DeviceIO(device);\n this._verifyIsIlluminator();\n }\n\n /**\n * Gets an IlluminatorChannel class instance that allows control of a particular channel.\n * Channels are numbered from 1.\n * @param channelNumber Number of channel to control.\n * @returns Illuminator channel instance.\n */\n public getChannel(\n channelNumber: number\n ): IlluminatorChannel {\n if (channelNumber <= 0) {\n throw new TypeError('Invalid value; channels are numbered from 1.');\n }\n return new IlluminatorChannel(this, channelNumber);\n }\n\n /**\n * Checks if this is an illuminator or some other type of device and throws an error if it is not.\n */\n private _verifyIsIlluminator(): void {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n gateway.callSync('illuminator/verify', request);\n }\n\n /**\n * Finds an illuminator on a connection.\n * In case of conflict, specify the optional device address.\n * @param connection Connection on which to detect the illuminator.\n * @param [options.deviceAddress=0] Optional device address of the illuminator.\n * @returns New instance of illuminator.\n */\n public static async find(\n connection: Connection,\n options: Illuminator.FindOptions = {}\n ): Promise<Illuminator> {\n const {\n deviceAddress = 0,\n } = options;\n const request: requests.FindDeviceRequest & gateway.Message = {\n ...requests.FindDeviceRequest.DEFAULT,\n interfaceId: connection.interfaceId,\n deviceAddress: deviceAddress,\n toBinary() {\n return requests.FindDeviceRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.FindDeviceResponse>(\n 'illuminator/detect',\n request,\n requests.FindDeviceResponse.fromBinary);\n return new Illuminator(new Device(connection, response.address));\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.device.connection.interfaceId,\n device: this.device.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\nnamespace Illuminator {\n export interface FindOptions {\n /**\n * Optional device address of the illuminator.\n */\n deviceAddress?: number;\n }\n}\n"]}
|
|
@@ -116,11 +116,25 @@ export declare class IlluminatorChannel {
|
|
|
116
116
|
}
|
|
117
117
|
declare namespace IlluminatorChannel {
|
|
118
118
|
interface GenericCommandOptions {
|
|
119
|
+
/**
|
|
120
|
+
* Controls whether to throw an exception when the device rejects the command.
|
|
121
|
+
*/
|
|
119
122
|
checkErrors?: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* The timeout, in milliseconds, for a device to respond to the command.
|
|
125
|
+
* Overrides the connection default request timeout.
|
|
126
|
+
*/
|
|
120
127
|
timeout?: number;
|
|
121
128
|
}
|
|
122
129
|
interface GenericCommandMultiResponseOptions {
|
|
130
|
+
/**
|
|
131
|
+
* Controls whether to throw an exception when a device rejects the command.
|
|
132
|
+
*/
|
|
123
133
|
checkErrors?: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* The timeout, in milliseconds, for a device to respond to the command.
|
|
136
|
+
* Overrides the connection default request timeout.
|
|
137
|
+
*/
|
|
124
138
|
timeout?: number;
|
|
125
139
|
}
|
|
126
140
|
}
|
|
@@ -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,E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;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;CACF"}
|
|
@@ -1 +1 @@
|
|
|
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;AAG7C;;;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,CA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AAQ,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;AA5WD,gDA4WC","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';\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 */\n public async setState(\n state: string\n ): Promise<void> {\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 await gateway.callAsync('device/set_state', request);\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 checkErrors?: boolean;\n timeout?: number;\n }\n export interface GenericCommandMultiResponseOptions {\n checkErrors?: boolean;\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;AAG7C;;;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,aAAa,CAAC,CAAC;IACnE,CAAC;IAED;;OAEG;IACI,KAAK,C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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';\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 */\n public async setState(\n state: string\n ): Promise<void> {\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 await gateway.callAsync('device/set_state', request);\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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"microscope.d.ts","sourceRoot":"","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