@zaber/motion 4.6.0 → 4.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/binding/wasm/zaber-motion-lib.wasm +0 -0
- package/dist/lib/ascii/axis.d.ts +10 -0
- package/dist/lib/ascii/axis.js +22 -0
- package/dist/lib/ascii/axis.js.map +1 -1
- package/dist/lib/ascii/connection.d.ts +1 -0
- package/dist/lib/ascii/connection.js +1 -0
- package/dist/lib/ascii/connection.js.map +1 -1
- package/dist/lib/microscopy/microscope.d.ts +5 -0
- package/dist/lib/microscopy/microscope.js +11 -0
- package/dist/lib/microscopy/microscope.js.map +1 -1
- package/dist/lib/microscopy/objective_changer.d.ts +19 -2
- package/dist/lib/microscopy/objective_changer.js +37 -2
- package/dist/lib/microscopy/objective_changer.js.map +1 -1
- package/dist/lib/protobufs/main_pb.d.ts +40 -0
- package/dist/lib/protobufs/main_pb.js +302 -0
- package/dist/lib/protobufs/main_pb.js.map +1 -1
- package/package.json +1 -1
|
Binary file
|
package/dist/lib/ascii/axis.d.ts
CHANGED
|
@@ -274,6 +274,16 @@ export declare class Axis {
|
|
|
274
274
|
* @returns Axis identity.
|
|
275
275
|
*/
|
|
276
276
|
private _retrieveIdentity;
|
|
277
|
+
/**
|
|
278
|
+
* Disables the driver, which prevents current from being sent to the motor or load.
|
|
279
|
+
* If the driver is already disabled, the driver remains disabled.
|
|
280
|
+
*/
|
|
281
|
+
driverDisable(): Promise<void>;
|
|
282
|
+
/**
|
|
283
|
+
* Attempts to enable the driver.
|
|
284
|
+
* If the driver is already enabled, the driver remains enabled.
|
|
285
|
+
*/
|
|
286
|
+
driverEnable(): Promise<void>;
|
|
277
287
|
}
|
|
278
288
|
declare namespace Axis {
|
|
279
289
|
interface HomeOptions {
|
package/dist/lib/ascii/axis.js
CHANGED
|
@@ -574,6 +574,28 @@ class Axis {
|
|
|
574
574
|
const response = gateway.callSync('device/get_axis_identity', request, gateway.AxisIdentity);
|
|
575
575
|
return axis_identity_1.AxisIdentity.fromProtobuf(response.toObject());
|
|
576
576
|
}
|
|
577
|
+
/**
|
|
578
|
+
* Disables the driver, which prevents current from being sent to the motor or load.
|
|
579
|
+
* If the driver is already disabled, the driver remains disabled.
|
|
580
|
+
*/
|
|
581
|
+
async driverDisable() {
|
|
582
|
+
const request = new gateway.AxisEmptyRequest();
|
|
583
|
+
request.setInterfaceId(this.device.connection.interfaceId);
|
|
584
|
+
request.setDevice(this.device.deviceAddress);
|
|
585
|
+
request.setAxis(this.axisNumber);
|
|
586
|
+
await gateway.callAsync('device/driver_disable', request);
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* Attempts to enable the driver.
|
|
590
|
+
* If the driver is already enabled, the driver remains enabled.
|
|
591
|
+
*/
|
|
592
|
+
async driverEnable() {
|
|
593
|
+
const request = new gateway.AxisEmptyRequest();
|
|
594
|
+
request.setInterfaceId(this.device.connection.interfaceId);
|
|
595
|
+
request.setDevice(this.device.deviceAddress);
|
|
596
|
+
request.setAxis(this.axisNumber);
|
|
597
|
+
await gateway.callAsync('device/driver_enable', request);
|
|
598
|
+
}
|
|
577
599
|
}
|
|
578
600
|
exports.Axis = Axis;
|
|
579
601
|
//# sourceMappingURL=axis.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axis.js","sourceRoot":"","sources":["../../../src/ascii/axis.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtD,mDAA+C;AAE/C,yCAAsC;AACtC,mDAA+C;AAC/C,oCAAsH;AACtH,yCAAsC;AACtC,gDAA6C;AAC7C,oDAAsC;AACtC,uCAAwC;AAExC;;GAEG;AACH,MAAa,IAAI;IACf;;OAEG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAGD;;;OAGG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC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;QAC7C,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAEjC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,0BAA0B,EAC1B,OAAO,EACP,OAAO,CAAC,YAAY,CAAC,CAAC;QACxB,OAAO,4BAAY,CAAC,YAAY,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;IACxD,CAAC;CACF;AApuBD,oBAouBC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Device } from './device';\nimport { AxisIdentity } from './axis_identity';\nimport { AxisType } from './axis_type';\nimport { Warnings } from './warnings';\nimport { AxisSettings } from './axis_settings';\nimport { Angle, Length, Native, AngularVelocity, Velocity, Acceleration, AngularAcceleration, Units } from '../units';\nimport { Response } from './response';\nimport { Measurement } from '../measurement';\nimport * as gateway from '../gateway';\nimport { AxisStorage } from './storage';\n\n/**\n * Represents an axis of motion associated with a device.\n */\nexport class Axis {\n /**\n * Device that controls this axis.\n */\n public get device(): Device {\n return this._device;\n }\n private _device: Device;\n\n /**\n * The axis number identifies the axis on the device.\n * The first axis has the number one.\n */\n public get axisNumber(): number {\n return this._axisNumber;\n }\n private _axisNumber: number;\n\n /**\n * Settings and properties of this axis.\n */\n public get settings(): AxisSettings {\n return this._settings;\n }\n private _settings: AxisSettings;\n\n /**\n * Key-value storage of this axis.\n * Requires at least Firmware 7.30.\n */\n public get storage(): AxisStorage {\n return this._storage;\n }\n private _storage: AxisStorage;\n\n /**\n * Warnings and faults of this axis.\n */\n public get warnings(): Warnings {\n return this._warnings;\n }\n private _warnings: Warnings;\n\n /**\n * Identity of the axis.\n */\n public get identity(): AxisIdentity {\n return this._retrieveIdentity();\n }\n\n /**\n * Unique ID of the peripheral hardware.\n */\n public get peripheralId(): number {\n return this.identity.peripheralId;\n }\n\n /**\n * Name of the peripheral.\n */\n public get peripheralName(): string {\n return this.identity.peripheralName;\n }\n\n /**\n * Indicates whether the axis is a peripheral or part of an integrated device.\n */\n public get isPeripheral(): boolean {\n return this.identity.isPeripheral;\n }\n\n /**\n * Determines the type of an axis and units it accepts.\n */\n public get axisType(): AxisType {\n return this.identity.axisType;\n }\n\n /**\n * User-assigned label of the peripheral.\n */\n public get label(): string {\n return this._retrieveLabel();\n }\n\n constructor(device: Device, axisNumber: number) {\n this._device = device;\n this._axisNumber = axisNumber;\n this._settings = new AxisSettings(this);\n this._storage = new AxisStorage(this);\n this._warnings = new Warnings(device, axisNumber);\n }\n\n /**\n * Homes axis. Axis returns to its homing position.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n */\n public async home(\n options: Axis.HomeOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n } = options;\n const request = new gateway.DeviceHomeRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setWaitUntilIdle(waitUntilIdle);\n\n await gateway.callAsync('device/home', request);\n }\n\n /**\n * Stops ongoing axis movement. Decelerates until zero speed.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n */\n public async stop(\n options: Axis.StopOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n } = options;\n const request = new gateway.DeviceStopRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setWaitUntilIdle(waitUntilIdle);\n\n await gateway.callAsync('device/stop', request);\n }\n\n /**\n * Parks the axis in anticipation of turning the power off.\n * It can later be powered on, unparked, and moved without first having to home it.\n */\n public async park(): Promise<void> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n\n await gateway.callAsync('device/park', request);\n }\n\n /**\n * Unparks axis. Axis will now be able to move.\n */\n public async unpark(): Promise<void> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n\n await gateway.callAsync('device/unpark', request);\n }\n\n /**\n * Returns bool indicating whether the axis is parked or not.\n * @returns True if the axis is currently parked. False otherwise.\n */\n public async isParked(): Promise<boolean> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n\n const response = await gateway.callAsync<gateway.BoolResponse>(\n 'device/is_parked',\n request,\n gateway.BoolResponse);\n return response.getValue();\n }\n\n /**\n * Waits until axis stops moving.\n * @param [options.throwErrorOnFault=true] Determines whether to throw error when fault is observed.\n */\n public async waitUntilIdle(\n options: Axis.WaitUntilIdleOptions = {}\n ): Promise<void> {\n const {\n throwErrorOnFault = true,\n } = options;\n const request = new gateway.DeviceWaitUntilIdleRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setThrowErrorOnFault(throwErrorOnFault);\n\n await gateway.callAsync('device/wait_until_idle', request);\n }\n\n /**\n * Returns bool indicating whether the axis is executing a motion command.\n * @returns True if the axis is currently executing a motion command.\n */\n public async isBusy(): Promise<boolean> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n\n const response = await gateway.callAsync<gateway.BoolResponse>(\n 'device/is_busy',\n request,\n gateway.BoolResponse);\n return response.getValue();\n }\n\n /**\n * Returns bool indicating whether the axis has position reference and was homed.\n * @returns True if the axis has position reference and was homed.\n */\n public async isHomed(): Promise<boolean> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n\n const response = await gateway.callAsync<gateway.BoolResponse>(\n 'device/is_homed',\n request,\n gateway.BoolResponse);\n return response.getValue();\n }\n\n /**\n * Move axis to absolute position.\n * @param position Absolute position.\n * @param [unit=Units.NATIVE] Units of position.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n * @param [options.velocity=0] Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.velocityUnit=Units.NATIVE] Units of velocity.\n * @param [options.acceleration=0] Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.accelerationUnit=Units.NATIVE] Units of acceleration.\n */\n public async moveAbsolute(\n position: number,\n unit: Length | Angle | Native = Units.NATIVE,\n options: Axis.MoveAbsoluteOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n velocity = 0,\n velocityUnit = Units.NATIVE,\n acceleration = 0,\n accelerationUnit = Units.NATIVE,\n } = options;\n const request = new gateway.DeviceMoveRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setType(gateway.DeviceMoveRequest.MoveType.ABS);\n request.setArg(position);\n request.setUnit(unit);\n request.setWaitUntilIdle(waitUntilIdle);\n request.setVelocity(velocity);\n request.setVelocityUnit(velocityUnit);\n request.setAcceleration(acceleration);\n request.setAccelerationUnit(accelerationUnit);\n\n await gateway.callAsync('device/move', request);\n }\n\n /**\n * Moves the axis to the maximum position as specified by limit.max.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n * @param [options.velocity=0] Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.velocityUnit=Units.NATIVE] Units of velocity.\n * @param [options.acceleration=0] Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.accelerationUnit=Units.NATIVE] Units of acceleration.\n */\n public async moveMax(\n options: Axis.MoveMaxOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n velocity = 0,\n velocityUnit = Units.NATIVE,\n acceleration = 0,\n accelerationUnit = Units.NATIVE,\n } = options;\n const request = new gateway.DeviceMoveRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setType(gateway.DeviceMoveRequest.MoveType.MAX);\n request.setWaitUntilIdle(waitUntilIdle);\n request.setVelocity(velocity);\n request.setVelocityUnit(velocityUnit);\n request.setAcceleration(acceleration);\n request.setAccelerationUnit(accelerationUnit);\n\n await gateway.callAsync('device/move', request);\n }\n\n /**\n * Moves the axis to the minimum position as specified by limit.min.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n * @param [options.velocity=0] Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.velocityUnit=Units.NATIVE] Units of velocity.\n * @param [options.acceleration=0] Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.accelerationUnit=Units.NATIVE] Units of acceleration.\n */\n public async moveMin(\n options: Axis.MoveMinOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n velocity = 0,\n velocityUnit = Units.NATIVE,\n acceleration = 0,\n accelerationUnit = Units.NATIVE,\n } = options;\n const request = new gateway.DeviceMoveRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setType(gateway.DeviceMoveRequest.MoveType.MIN);\n request.setWaitUntilIdle(waitUntilIdle);\n request.setVelocity(velocity);\n request.setVelocityUnit(velocityUnit);\n request.setAcceleration(acceleration);\n request.setAccelerationUnit(accelerationUnit);\n\n await gateway.callAsync('device/move', request);\n }\n\n /**\n * Move axis to position relative to current position.\n * @param position Relative position.\n * @param [unit=Units.NATIVE] Units of position.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n * @param [options.velocity=0] Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.velocityUnit=Units.NATIVE] Units of velocity.\n * @param [options.acceleration=0] Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.accelerationUnit=Units.NATIVE] Units of acceleration.\n */\n public async moveRelative(\n position: number,\n unit: Length | Angle | Native = Units.NATIVE,\n options: Axis.MoveRelativeOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n velocity = 0,\n velocityUnit = Units.NATIVE,\n acceleration = 0,\n accelerationUnit = Units.NATIVE,\n } = options;\n const request = new gateway.DeviceMoveRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setType(gateway.DeviceMoveRequest.MoveType.REL);\n request.setArg(position);\n request.setUnit(unit);\n request.setWaitUntilIdle(waitUntilIdle);\n request.setVelocity(velocity);\n request.setVelocityUnit(velocityUnit);\n request.setAcceleration(acceleration);\n request.setAccelerationUnit(accelerationUnit);\n\n await gateway.callAsync('device/move', request);\n }\n\n /**\n * Begins to move axis at specified speed.\n * @param velocity Movement velocity.\n * @param [unit=Units.NATIVE] Units of velocity.\n * @param [options.acceleration=0] Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.accelerationUnit=Units.NATIVE] Units of acceleration.\n */\n public async moveVelocity(\n velocity: number,\n unit: Velocity | AngularVelocity | Native = Units.NATIVE,\n options: Axis.MoveVelocityOptions = {}\n ): Promise<void> {\n const {\n acceleration = 0,\n accelerationUnit = Units.NATIVE,\n } = options;\n const request = new gateway.DeviceMoveRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setType(gateway.DeviceMoveRequest.MoveType.VEL);\n request.setArg(velocity);\n request.setUnit(unit);\n request.setAcceleration(acceleration);\n request.setAccelerationUnit(accelerationUnit);\n\n await gateway.callAsync('device/move', request);\n }\n\n /**\n * Returns current axis position.\n * @param [unit=Units.NATIVE] Units of position.\n * @returns Axis position.\n */\n public async getPosition(\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setSetting('pos');\n request.setUnit(unit);\n\n const response = await gateway.callAsync<gateway.DoubleResponse>(\n 'device/get_setting',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Gets number of index positions of the axis.\n * @returns Number of index positions.\n */\n public async getNumberOfIndexPositions(): Promise<number> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n\n const response = await gateway.callAsync<gateway.IntResponse>(\n 'device/get_index_count',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Returns current axis index position.\n * @returns Index position starting from 1 or 0 if the position is not an index position.\n */\n public async getIndexPosition(): Promise<number> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n\n const response = await gateway.callAsync<gateway.IntResponse>(\n 'device/get_index_position',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Moves the axis to index position.\n * @param index Index position. Index positions are numbered from 1.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n * @param [options.velocity=0] Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.velocityUnit=Units.NATIVE] Units of velocity.\n * @param [options.acceleration=0] Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.accelerationUnit=Units.NATIVE] Units of acceleration.\n */\n public async moveIndex(\n index: number,\n options: Axis.MoveIndexOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n velocity = 0,\n velocityUnit = Units.NATIVE,\n acceleration = 0,\n accelerationUnit = Units.NATIVE,\n } = options;\n const request = new gateway.DeviceMoveRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setType(gateway.DeviceMoveRequest.MoveType.INDEX);\n request.setArgInt(index);\n request.setWaitUntilIdle(waitUntilIdle);\n request.setVelocity(velocity);\n request.setVelocityUnit(velocityUnit);\n request.setAcceleration(acceleration);\n request.setAccelerationUnit(accelerationUnit);\n\n await gateway.callAsync('device/move', request);\n }\n\n /**\n * Sends a generic ASCII command to this axis.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns A response to the command.\n */\n public async genericCommand(\n command: string,\n options: Axis.GenericCommandOptions = {}\n ): Promise<Response> {\n const {\n checkErrors = true,\n timeout = 0,\n } = options;\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setCommand(command);\n request.setCheckErrors(checkErrors);\n request.setTimeout(timeout);\n\n const response = await gateway.callAsync<gateway.GenericCommandResponse>(\n 'interface/generic_command',\n request,\n gateway.GenericCommandResponse);\n return Response.fromProtobuf(response.toObject());\n }\n\n /**\n * Sends a generic ASCII command to this axis and expect multiple responses.\n * Responses are returned in order of arrival.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.checkErrors=true] Controls whether to throw an exception when a device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns All responses to the command.\n */\n public async genericCommandMultiResponse(\n command: string,\n options: Axis.GenericCommandMultiResponseOptions = {}\n ): Promise<Response[]> {\n const {\n checkErrors = true,\n timeout = 0,\n } = options;\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setCommand(command);\n request.setCheckErrors(checkErrors);\n request.setTimeout(timeout);\n\n const response = await gateway.callAsync<gateway.GenericCommandResponseCollection>(\n 'interface/generic_command_multi_response',\n request,\n gateway.GenericCommandResponseCollection);\n return response.getResponsesList().map(a => Response.fromProtobuf(a.toObject()));\n }\n\n /**\n * Sends a generic ASCII command to this axis without expecting a response and without adding a message ID\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n */\n public async genericCommandNoResponse(\n command: string\n ): Promise<void> {\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setCommand(command);\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Formats parameters into a command and performs unit conversions.\n * Parameters in the command template are denoted by a question mark.\n * Command returned is only valid for this axis and this device.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param commandTemplate Template of a command to prepare. Parameters are denoted by question marks.\n * @param parameters Variable number of command parameters.\n * @returns Command with converted parameters.\n */\n public prepareCommand(\n commandTemplate: string,\n ...parameters: Measurement[]\n ): string {\n const request = new gateway.PrepareCommandRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setCommandTemplate(commandTemplate);\n request.setParametersList(parameters.map(Measurement.toProtobuf));\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'device/prepare_command',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n\n /**\n * Sets the user-assigned peripheral label.\n * The label is stored on the controller and recognized by other software.\n * @param label Label to set.\n */\n public async setLabel(\n label: string\n ): Promise<void> {\n const request = new gateway.DeviceSetStorageRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setValue(label);\n\n await gateway.callAsync('device/set_label', request);\n }\n\n /**\n * Gets the peripheral name.\n * @returns The label.\n */\n private _retrieveLabel(): string {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'device/get_label',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n\n /**\n * Returns a string that represents the axis.\n * @returns A string that represents the axis.\n */\n public toString(): string {\n const request = new gateway.AxisToStringRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'device/axis_to_string',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n\n /**\n * Returns a serialization of the current axis state that can be saved and reapplied.\n * @returns A serialization of the current state of the axis.\n */\n public async getState(): Promise<string> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n\n const response = await gateway.callAsync<gateway.StringResponse>(\n 'device/get_state',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n\n /**\n * Applies a saved state to this axis.\n * @param state The state object to apply to this axis.\n */\n public async setState(\n state: string\n ): Promise<void> {\n const request = new gateway.SetStateRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setState(state);\n\n await gateway.callAsync('device/set_state', request);\n }\n\n /**\n * Checks if a state can be applied to this axis.\n * This only covers exceptions that can be determined statically such as mismatches of ID or version,\n * the process of applying the state can still fail when running.\n * @param state The state object to check against.\n * @returns An explanation of why this state cannot be set to this axis.\n */\n public async canSetState(\n state: string\n ): Promise<string> {\n const request = new gateway.CanSetStateRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setState(state);\n\n const response = await gateway.callAsync<gateway.CanSetStateAxisResponse>(\n 'device/can_set_axis_state',\n request,\n gateway.CanSetStateAxisResponse);\n return response.getError();\n }\n\n /**\n * Returns identity.\n * @returns Axis identity.\n */\n private _retrieveIdentity(): AxisIdentity {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n\n const response = gateway.callSync<gateway.AxisIdentity>(\n 'device/get_axis_identity',\n request,\n gateway.AxisIdentity);\n return AxisIdentity.fromProtobuf(response.toObject());\n }\n}\n\nnamespace Axis {\n export interface HomeOptions {\n waitUntilIdle?: boolean;\n }\n export interface StopOptions {\n waitUntilIdle?: boolean;\n }\n export interface WaitUntilIdleOptions {\n throwErrorOnFault?: boolean;\n }\n export interface MoveAbsoluteOptions {\n waitUntilIdle?: boolean;\n velocity?: number;\n velocityUnit?: Velocity | AngularVelocity | Native;\n acceleration?: number;\n accelerationUnit?: Acceleration | AngularAcceleration | Native;\n }\n export interface MoveMaxOptions {\n waitUntilIdle?: boolean;\n velocity?: number;\n velocityUnit?: Velocity | AngularVelocity | Native;\n acceleration?: number;\n accelerationUnit?: Acceleration | AngularAcceleration | Native;\n }\n export interface MoveMinOptions {\n waitUntilIdle?: boolean;\n velocity?: number;\n velocityUnit?: Velocity | AngularVelocity | Native;\n acceleration?: number;\n accelerationUnit?: Acceleration | AngularAcceleration | Native;\n }\n export interface MoveRelativeOptions {\n waitUntilIdle?: boolean;\n velocity?: number;\n velocityUnit?: Velocity | AngularVelocity | Native;\n acceleration?: number;\n accelerationUnit?: Acceleration | AngularAcceleration | Native;\n }\n export interface MoveVelocityOptions {\n acceleration?: number;\n accelerationUnit?: Acceleration | AngularAcceleration | Native;\n }\n export interface MoveIndexOptions {\n waitUntilIdle?: boolean;\n velocity?: number;\n velocityUnit?: Velocity | AngularVelocity | Native;\n acceleration?: number;\n accelerationUnit?: Acceleration | AngularAcceleration | Native;\n }\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":"axis.js","sourceRoot":"","sources":["../../../src/ascii/axis.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtD,mDAA+C;AAE/C,yCAAsC;AACtC,mDAA+C;AAC/C,oCAAsH;AACtH,yCAAsC;AACtC,gDAA6C;AAC7C,oDAAsC;AACtC,uCAAwC;AAExC;;GAEG;AACH,MAAa,IAAI;IACf;;OAEG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAGD;;;OAGG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAGD;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAGD;;;OAGG;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;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,QAAQ,CAAC,Y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AAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3D,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAC7C,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAEjC,MAAM,OAAO,CAAC,SAAS,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,YAAY;QACvB,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAC/C,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3D,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAC7C,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAEjC,MAAM,OAAO,CAAC,SAAS,CAAC,sBAAsB,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;CACF;AA9vBD,oBA8vBC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Device } from './device';\nimport { AxisIdentity } from './axis_identity';\nimport { AxisType } from './axis_type';\nimport { Warnings } from './warnings';\nimport { AxisSettings } from './axis_settings';\nimport { Angle, Length, Native, AngularVelocity, Velocity, Acceleration, AngularAcceleration, Units } from '../units';\nimport { Response } from './response';\nimport { Measurement } from '../measurement';\nimport * as gateway from '../gateway';\nimport { AxisStorage } from './storage';\n\n/**\n * Represents an axis of motion associated with a device.\n */\nexport class Axis {\n /**\n * Device that controls this axis.\n */\n public get device(): Device {\n return this._device;\n }\n private _device: Device;\n\n /**\n * The axis number identifies the axis on the device.\n * The first axis has the number one.\n */\n public get axisNumber(): number {\n return this._axisNumber;\n }\n private _axisNumber: number;\n\n /**\n * Settings and properties of this axis.\n */\n public get settings(): AxisSettings {\n return this._settings;\n }\n private _settings: AxisSettings;\n\n /**\n * Key-value storage of this axis.\n * Requires at least Firmware 7.30.\n */\n public get storage(): AxisStorage {\n return this._storage;\n }\n private _storage: AxisStorage;\n\n /**\n * Warnings and faults of this axis.\n */\n public get warnings(): Warnings {\n return this._warnings;\n }\n private _warnings: Warnings;\n\n /**\n * Identity of the axis.\n */\n public get identity(): AxisIdentity {\n return this._retrieveIdentity();\n }\n\n /**\n * Unique ID of the peripheral hardware.\n */\n public get peripheralId(): number {\n return this.identity.peripheralId;\n }\n\n /**\n * Name of the peripheral.\n */\n public get peripheralName(): string {\n return this.identity.peripheralName;\n }\n\n /**\n * Indicates whether the axis is a peripheral or part of an integrated device.\n */\n public get isPeripheral(): boolean {\n return this.identity.isPeripheral;\n }\n\n /**\n * Determines the type of an axis and units it accepts.\n */\n public get axisType(): AxisType {\n return this.identity.axisType;\n }\n\n /**\n * User-assigned label of the peripheral.\n */\n public get label(): string {\n return this._retrieveLabel();\n }\n\n constructor(device: Device, axisNumber: number) {\n this._device = device;\n this._axisNumber = axisNumber;\n this._settings = new AxisSettings(this);\n this._storage = new AxisStorage(this);\n this._warnings = new Warnings(device, axisNumber);\n }\n\n /**\n * Homes axis. Axis returns to its homing position.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n */\n public async home(\n options: Axis.HomeOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n } = options;\n const request = new gateway.DeviceHomeRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setWaitUntilIdle(waitUntilIdle);\n\n await gateway.callAsync('device/home', request);\n }\n\n /**\n * Stops ongoing axis movement. Decelerates until zero speed.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n */\n public async stop(\n options: Axis.StopOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n } = options;\n const request = new gateway.DeviceStopRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setWaitUntilIdle(waitUntilIdle);\n\n await gateway.callAsync('device/stop', request);\n }\n\n /**\n * Parks the axis in anticipation of turning the power off.\n * It can later be powered on, unparked, and moved without first having to home it.\n */\n public async park(): Promise<void> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n\n await gateway.callAsync('device/park', request);\n }\n\n /**\n * Unparks axis. Axis will now be able to move.\n */\n public async unpark(): Promise<void> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n\n await gateway.callAsync('device/unpark', request);\n }\n\n /**\n * Returns bool indicating whether the axis is parked or not.\n * @returns True if the axis is currently parked. False otherwise.\n */\n public async isParked(): Promise<boolean> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n\n const response = await gateway.callAsync<gateway.BoolResponse>(\n 'device/is_parked',\n request,\n gateway.BoolResponse);\n return response.getValue();\n }\n\n /**\n * Waits until axis stops moving.\n * @param [options.throwErrorOnFault=true] Determines whether to throw error when fault is observed.\n */\n public async waitUntilIdle(\n options: Axis.WaitUntilIdleOptions = {}\n ): Promise<void> {\n const {\n throwErrorOnFault = true,\n } = options;\n const request = new gateway.DeviceWaitUntilIdleRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setThrowErrorOnFault(throwErrorOnFault);\n\n await gateway.callAsync('device/wait_until_idle', request);\n }\n\n /**\n * Returns bool indicating whether the axis is executing a motion command.\n * @returns True if the axis is currently executing a motion command.\n */\n public async isBusy(): Promise<boolean> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n\n const response = await gateway.callAsync<gateway.BoolResponse>(\n 'device/is_busy',\n request,\n gateway.BoolResponse);\n return response.getValue();\n }\n\n /**\n * Returns bool indicating whether the axis has position reference and was homed.\n * @returns True if the axis has position reference and was homed.\n */\n public async isHomed(): Promise<boolean> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n\n const response = await gateway.callAsync<gateway.BoolResponse>(\n 'device/is_homed',\n request,\n gateway.BoolResponse);\n return response.getValue();\n }\n\n /**\n * Move axis to absolute position.\n * @param position Absolute position.\n * @param [unit=Units.NATIVE] Units of position.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n * @param [options.velocity=0] Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.velocityUnit=Units.NATIVE] Units of velocity.\n * @param [options.acceleration=0] Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.accelerationUnit=Units.NATIVE] Units of acceleration.\n */\n public async moveAbsolute(\n position: number,\n unit: Length | Angle | Native = Units.NATIVE,\n options: Axis.MoveAbsoluteOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n velocity = 0,\n velocityUnit = Units.NATIVE,\n acceleration = 0,\n accelerationUnit = Units.NATIVE,\n } = options;\n const request = new gateway.DeviceMoveRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setType(gateway.DeviceMoveRequest.MoveType.ABS);\n request.setArg(position);\n request.setUnit(unit);\n request.setWaitUntilIdle(waitUntilIdle);\n request.setVelocity(velocity);\n request.setVelocityUnit(velocityUnit);\n request.setAcceleration(acceleration);\n request.setAccelerationUnit(accelerationUnit);\n\n await gateway.callAsync('device/move', request);\n }\n\n /**\n * Moves the axis to the maximum position as specified by limit.max.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n * @param [options.velocity=0] Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.velocityUnit=Units.NATIVE] Units of velocity.\n * @param [options.acceleration=0] Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.accelerationUnit=Units.NATIVE] Units of acceleration.\n */\n public async moveMax(\n options: Axis.MoveMaxOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n velocity = 0,\n velocityUnit = Units.NATIVE,\n acceleration = 0,\n accelerationUnit = Units.NATIVE,\n } = options;\n const request = new gateway.DeviceMoveRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setType(gateway.DeviceMoveRequest.MoveType.MAX);\n request.setWaitUntilIdle(waitUntilIdle);\n request.setVelocity(velocity);\n request.setVelocityUnit(velocityUnit);\n request.setAcceleration(acceleration);\n request.setAccelerationUnit(accelerationUnit);\n\n await gateway.callAsync('device/move', request);\n }\n\n /**\n * Moves the axis to the minimum position as specified by limit.min.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n * @param [options.velocity=0] Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.velocityUnit=Units.NATIVE] Units of velocity.\n * @param [options.acceleration=0] Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.accelerationUnit=Units.NATIVE] Units of acceleration.\n */\n public async moveMin(\n options: Axis.MoveMinOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n velocity = 0,\n velocityUnit = Units.NATIVE,\n acceleration = 0,\n accelerationUnit = Units.NATIVE,\n } = options;\n const request = new gateway.DeviceMoveRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setType(gateway.DeviceMoveRequest.MoveType.MIN);\n request.setWaitUntilIdle(waitUntilIdle);\n request.setVelocity(velocity);\n request.setVelocityUnit(velocityUnit);\n request.setAcceleration(acceleration);\n request.setAccelerationUnit(accelerationUnit);\n\n await gateway.callAsync('device/move', request);\n }\n\n /**\n * Move axis to position relative to current position.\n * @param position Relative position.\n * @param [unit=Units.NATIVE] Units of position.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n * @param [options.velocity=0] Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.velocityUnit=Units.NATIVE] Units of velocity.\n * @param [options.acceleration=0] Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.accelerationUnit=Units.NATIVE] Units of acceleration.\n */\n public async moveRelative(\n position: number,\n unit: Length | Angle | Native = Units.NATIVE,\n options: Axis.MoveRelativeOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n velocity = 0,\n velocityUnit = Units.NATIVE,\n acceleration = 0,\n accelerationUnit = Units.NATIVE,\n } = options;\n const request = new gateway.DeviceMoveRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setType(gateway.DeviceMoveRequest.MoveType.REL);\n request.setArg(position);\n request.setUnit(unit);\n request.setWaitUntilIdle(waitUntilIdle);\n request.setVelocity(velocity);\n request.setVelocityUnit(velocityUnit);\n request.setAcceleration(acceleration);\n request.setAccelerationUnit(accelerationUnit);\n\n await gateway.callAsync('device/move', request);\n }\n\n /**\n * Begins to move axis at specified speed.\n * @param velocity Movement velocity.\n * @param [unit=Units.NATIVE] Units of velocity.\n * @param [options.acceleration=0] Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.accelerationUnit=Units.NATIVE] Units of acceleration.\n */\n public async moveVelocity(\n velocity: number,\n unit: Velocity | AngularVelocity | Native = Units.NATIVE,\n options: Axis.MoveVelocityOptions = {}\n ): Promise<void> {\n const {\n acceleration = 0,\n accelerationUnit = Units.NATIVE,\n } = options;\n const request = new gateway.DeviceMoveRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setType(gateway.DeviceMoveRequest.MoveType.VEL);\n request.setArg(velocity);\n request.setUnit(unit);\n request.setAcceleration(acceleration);\n request.setAccelerationUnit(accelerationUnit);\n\n await gateway.callAsync('device/move', request);\n }\n\n /**\n * Returns current axis position.\n * @param [unit=Units.NATIVE] Units of position.\n * @returns Axis position.\n */\n public async getPosition(\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setSetting('pos');\n request.setUnit(unit);\n\n const response = await gateway.callAsync<gateway.DoubleResponse>(\n 'device/get_setting',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Gets number of index positions of the axis.\n * @returns Number of index positions.\n */\n public async getNumberOfIndexPositions(): Promise<number> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n\n const response = await gateway.callAsync<gateway.IntResponse>(\n 'device/get_index_count',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Returns current axis index position.\n * @returns Index position starting from 1 or 0 if the position is not an index position.\n */\n public async getIndexPosition(): Promise<number> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n\n const response = await gateway.callAsync<gateway.IntResponse>(\n 'device/get_index_position',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Moves the axis to index position.\n * @param index Index position. Index positions are numbered from 1.\n * @param [options.waitUntilIdle=true] Determines whether function should return after the movement is finished or just started.\n * @param [options.velocity=0] Movement velocity.\n * Default value of 0 indicates that the maxspeed setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.velocityUnit=Units.NATIVE] Units of velocity.\n * @param [options.acceleration=0] Movement acceleration.\n * Default value of 0 indicates that the accel setting is used instead.\n * Requires at least Firmware 7.25.\n * @param [options.accelerationUnit=Units.NATIVE] Units of acceleration.\n */\n public async moveIndex(\n index: number,\n options: Axis.MoveIndexOptions = {}\n ): Promise<void> {\n const {\n waitUntilIdle = true,\n velocity = 0,\n velocityUnit = Units.NATIVE,\n acceleration = 0,\n accelerationUnit = Units.NATIVE,\n } = options;\n const request = new gateway.DeviceMoveRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setType(gateway.DeviceMoveRequest.MoveType.INDEX);\n request.setArgInt(index);\n request.setWaitUntilIdle(waitUntilIdle);\n request.setVelocity(velocity);\n request.setVelocityUnit(velocityUnit);\n request.setAcceleration(acceleration);\n request.setAccelerationUnit(accelerationUnit);\n\n await gateway.callAsync('device/move', request);\n }\n\n /**\n * Sends a generic ASCII command to this axis.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns A response to the command.\n */\n public async genericCommand(\n command: string,\n options: Axis.GenericCommandOptions = {}\n ): Promise<Response> {\n const {\n checkErrors = true,\n timeout = 0,\n } = options;\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setCommand(command);\n request.setCheckErrors(checkErrors);\n request.setTimeout(timeout);\n\n const response = await gateway.callAsync<gateway.GenericCommandResponse>(\n 'interface/generic_command',\n request,\n gateway.GenericCommandResponse);\n return Response.fromProtobuf(response.toObject());\n }\n\n /**\n * Sends a generic ASCII command to this axis and expect multiple responses.\n * Responses are returned in order of arrival.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.checkErrors=true] Controls whether to throw an exception when a device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns All responses to the command.\n */\n public async genericCommandMultiResponse(\n command: string,\n options: Axis.GenericCommandMultiResponseOptions = {}\n ): Promise<Response[]> {\n const {\n checkErrors = true,\n timeout = 0,\n } = options;\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setCommand(command);\n request.setCheckErrors(checkErrors);\n request.setTimeout(timeout);\n\n const response = await gateway.callAsync<gateway.GenericCommandResponseCollection>(\n 'interface/generic_command_multi_response',\n request,\n gateway.GenericCommandResponseCollection);\n return response.getResponsesList().map(a => Response.fromProtobuf(a.toObject()));\n }\n\n /**\n * Sends a generic ASCII command to this axis without expecting a response and without adding a message ID\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n */\n public async genericCommandNoResponse(\n command: string\n ): Promise<void> {\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setCommand(command);\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Formats parameters into a command and performs unit conversions.\n * Parameters in the command template are denoted by a question mark.\n * Command returned is only valid for this axis and this device.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param commandTemplate Template of a command to prepare. Parameters are denoted by question marks.\n * @param parameters Variable number of command parameters.\n * @returns Command with converted parameters.\n */\n public prepareCommand(\n commandTemplate: string,\n ...parameters: Measurement[]\n ): string {\n const request = new gateway.PrepareCommandRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setCommandTemplate(commandTemplate);\n request.setParametersList(parameters.map(Measurement.toProtobuf));\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'device/prepare_command',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n\n /**\n * Sets the user-assigned peripheral label.\n * The label is stored on the controller and recognized by other software.\n * @param label Label to set.\n */\n public async setLabel(\n label: string\n ): Promise<void> {\n const request = new gateway.DeviceSetStorageRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setValue(label);\n\n await gateway.callAsync('device/set_label', request);\n }\n\n /**\n * Gets the peripheral name.\n * @returns The label.\n */\n private _retrieveLabel(): string {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'device/get_label',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n\n /**\n * Returns a string that represents the axis.\n * @returns A string that represents the axis.\n */\n public toString(): string {\n const request = new gateway.AxisToStringRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'device/axis_to_string',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n\n /**\n * Returns a serialization of the current axis state that can be saved and reapplied.\n * @returns A serialization of the current state of the axis.\n */\n public async getState(): Promise<string> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n\n const response = await gateway.callAsync<gateway.StringResponse>(\n 'device/get_state',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n\n /**\n * Applies a saved state to this axis.\n * @param state The state object to apply to this axis.\n */\n public async setState(\n state: string\n ): Promise<void> {\n const request = new gateway.SetStateRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setState(state);\n\n await gateway.callAsync('device/set_state', request);\n }\n\n /**\n * Checks if a state can be applied to this axis.\n * This only covers exceptions that can be determined statically such as mismatches of ID or version,\n * the process of applying the state can still fail when running.\n * @param state The state object to check against.\n * @returns An explanation of why this state cannot be set to this axis.\n */\n public async canSetState(\n state: string\n ): Promise<string> {\n const request = new gateway.CanSetStateRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n request.setState(state);\n\n const response = await gateway.callAsync<gateway.CanSetStateAxisResponse>(\n 'device/can_set_axis_state',\n request,\n gateway.CanSetStateAxisResponse);\n return response.getError();\n }\n\n /**\n * Returns identity.\n * @returns Axis identity.\n */\n private _retrieveIdentity(): AxisIdentity {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n\n const response = gateway.callSync<gateway.AxisIdentity>(\n 'device/get_axis_identity',\n request,\n gateway.AxisIdentity);\n return AxisIdentity.fromProtobuf(response.toObject());\n }\n\n /**\n * Disables the driver, which prevents current from being sent to the motor or load.\n * If the driver is already disabled, the driver remains disabled.\n */\n public async driverDisable(): Promise<void> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n\n await gateway.callAsync('device/driver_disable', request);\n }\n\n /**\n * Attempts to enable the driver.\n * If the driver is already enabled, the driver remains enabled.\n */\n public async driverEnable(): Promise<void> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(this.axisNumber);\n\n await gateway.callAsync('device/driver_enable', request);\n }\n}\n\nnamespace Axis {\n export interface HomeOptions {\n waitUntilIdle?: boolean;\n }\n export interface StopOptions {\n waitUntilIdle?: boolean;\n }\n export interface WaitUntilIdleOptions {\n throwErrorOnFault?: boolean;\n }\n export interface MoveAbsoluteOptions {\n waitUntilIdle?: boolean;\n velocity?: number;\n velocityUnit?: Velocity | AngularVelocity | Native;\n acceleration?: number;\n accelerationUnit?: Acceleration | AngularAcceleration | Native;\n }\n export interface MoveMaxOptions {\n waitUntilIdle?: boolean;\n velocity?: number;\n velocityUnit?: Velocity | AngularVelocity | Native;\n acceleration?: number;\n accelerationUnit?: Acceleration | AngularAcceleration | Native;\n }\n export interface MoveMinOptions {\n waitUntilIdle?: boolean;\n velocity?: number;\n velocityUnit?: Velocity | AngularVelocity | Native;\n acceleration?: number;\n accelerationUnit?: Acceleration | AngularAcceleration | Native;\n }\n export interface MoveRelativeOptions {\n waitUntilIdle?: boolean;\n velocity?: number;\n velocityUnit?: Velocity | AngularVelocity | Native;\n acceleration?: number;\n accelerationUnit?: Acceleration | AngularAcceleration | Native;\n }\n export interface MoveVelocityOptions {\n acceleration?: number;\n accelerationUnit?: Acceleration | AngularAcceleration | Native;\n }\n export interface MoveIndexOptions {\n waitUntilIdle?: boolean;\n velocity?: number;\n velocityUnit?: Velocity | AngularVelocity | Native;\n acceleration?: number;\n accelerationUnit?: Acceleration | AngularAcceleration | Native;\n }\n export interface GenericCommandOptions {\n checkErrors?: boolean;\n timeout?: number;\n }\n export interface GenericCommandMultiResponseOptions {\n checkErrors?: boolean;\n timeout?: number;\n }\n}\n"]}
|
|
@@ -40,6 +40,7 @@ export declare class Connection {
|
|
|
40
40
|
/**
|
|
41
41
|
* The default timeout, in milliseconds, for a device to respond to a request.
|
|
42
42
|
* Setting the timeout to a too low value may cause request timeout exceptions.
|
|
43
|
+
* The initial value is 1000 (one second).
|
|
43
44
|
*/
|
|
44
45
|
get defaultRequestTimeout(): number;
|
|
45
46
|
set defaultRequestTimeout(value: number);
|
|
@@ -47,6 +47,7 @@ class Connection {
|
|
|
47
47
|
/**
|
|
48
48
|
* The default timeout, in milliseconds, for a device to respond to a request.
|
|
49
49
|
* Setting the timeout to a too low value may cause request timeout exceptions.
|
|
50
|
+
* The initial value is 1000 (one second).
|
|
50
51
|
*/
|
|
51
52
|
get defaultRequestTimeout() {
|
|
52
53
|
return this._retrieveTimeout();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/ascii/connection.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,+BAAiD;AACjD,8CAA8D;AAC9D,oDAAsC;AACtC,wCAAiD;AAEjD,qCAAkC;AAClC,yCAAsC;AACtC,qEAAgE;AAChE,+CAA2C;AAG3C;;GAEG;AACH,MAAa,UAAU;IA6BrB;;OAEG;IACH,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAGD;;;OAGG;IACH,IAAW,qBAAqB;QAC9B,OAAO,IAAI,CAAC,gBAAgB,EAAE,CAAC;IACjC,CAAC;IAED,IAAW,qBAAqB,CAAC,KAAa;QAC5C,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,IAAW,eAAe;QACxB,OAAO,IAAI,CAAC,wBAAwB,EAAE,CAAC;IACzC,CAAC;IAED,IAAW,eAAe,CAAC,KAAc;QACvC,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,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,EAAC,CAAC,CAAC,EACP,IAAA,eAAG,EAAC,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,kBAAkB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAC1F,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAClC,CAAC;;AA/iBH,gCAgjBC;AAriBC;;GAEG;AACoB,4BAAiB,GAAW,MAAM,CAAC;AAE1D;;;GAGG;AACoB,yBAAc,GAAW,KAAK,CAAC;AAEtD;;;;GAIG;AACoB,+BAAoB,GAAW,KAAK,CAAC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Observable, ReplaySubject } from 'rxjs';\nimport { map, filter, takeUntil, take } from 'rxjs/operators';\nimport * as gateway from '../gateway';\nimport { events, filterEvent } from '../gateway';\nimport { Transport } from './transport';\nimport { Device } from './device';\nimport { Response } from './response';\nimport { UnknownResponseEvent } from './unknown_response_event';\nimport { AlertEvent } from './alert_event';\nimport { MotionLibException } from '../exceptions';\n\n/**\n * Class representing access to particular connection (serial port, TCP connection).\n */\nexport class Connection {\n /**\n * Event invoked when a response from a device cannot be matched to any known request.\n */\n public unknownResponse!: Observable<UnknownResponseEvent>;\n\n /**\n * Event invoked when an alert is received from a device.\n */\n public alert!: Observable<AlertEvent>;\n\n /**\n * Default baud rate for serial connections.\n */\n public static readonly DEFAULT_BAUD_RATE: number = 115200;\n\n /**\n * Commands send over this port are forwarded to the device chain.\n * The bandwidth may be limited as the commands are forwarded over a serial connection.\n */\n public static readonly TCP_PORT_CHAIN: number = 55550;\n\n /**\n * Commands send over this port are processed only by the device\n * and not forwarded to the rest of the chain.\n * Using this port typically makes the communication faster.\n */\n public static readonly TCP_PORT_DEVICE_ONLY: number = 55551;\n\n /**\n * The interface ID identifies this Connection instance with the underlying library.\n */\n public get interfaceId(): number {\n return this._interfaceId;\n }\n private _interfaceId: number;\n\n /**\n * The default timeout, in milliseconds, for a device to respond to a request.\n * Setting the timeout to a too low value may cause request timeout exceptions.\n */\n public get defaultRequestTimeout(): number {\n return this._retrieveTimeout();\n }\n\n public set defaultRequestTimeout(value: number) {\n this._changeTimeout(value);\n }\n\n /**\n * Controls whether outgoing messages contain checksum.\n */\n public get checksumEnabled(): boolean {\n return this._retrieveChecksumEnabled();\n }\n\n public set checksumEnabled(value: boolean) {\n this._changeChecksumEnabled(value);\n }\n\n constructor(interfaceId: number) {\n this._interfaceId = interfaceId;\n this._subscribe();\n }\n\n /**\n * Opens a serial port, if Zaber Launcher controls the port, the port will be opened through Zaber Launcher.\n * Zaber Launcher allows sharing of the port between multiple applications,\n * If port sharing is not desirable, use the `direct` parameter.\n * @param portName Name of the port to open.\n * @param [options.baudRate=Connection.DEFAULT_BAUD_RATE] Optional baud rate (defaults to 115200).\n * @param [options.direct=false] If true will connect to the serial port directly,\n * failing if the connection is already opened by a message router instance.\n * @returns An object representing the port.\n */\n public static async openSerialPort(\n portName: string,\n options: Connection.OpenSerialPortOptions = {}\n ): Promise<Connection> {\n const {\n baudRate = Connection.DEFAULT_BAUD_RATE,\n direct = false,\n } = options;\n const request = new gateway.OpenInterfaceRequest();\n request.setInterfaceType(gateway.InterfaceType.SERIAL_PORT);\n request.setPortName(portName);\n request.setBaudRate(baudRate);\n request.setRejectRoutedConnection(direct);\n\n const response = await gateway.callAsync<gateway.OpenInterfaceResponse>(\n 'interface/open',\n request,\n gateway.OpenInterfaceResponse);\n return new Connection(response.getInterfaceId());\n }\n\n /**\n * Opens a TCP connection.\n * @param hostName Hostname or IP address.\n * @param [port=Connection.TCP_PORT_CHAIN] Optional port number (defaults to 55550).\n * @returns An object representing the connection.\n */\n public static async openTcp(\n hostName: string,\n port: number = Connection.TCP_PORT_CHAIN\n ): Promise<Connection> {\n const request = new gateway.OpenInterfaceRequest();\n request.setInterfaceType(gateway.InterfaceType.TCP);\n request.setHostName(hostName);\n request.setPort(port);\n\n const response = await gateway.callAsync<gateway.OpenInterfaceResponse>(\n 'interface/open',\n request,\n gateway.OpenInterfaceResponse);\n return new Connection(response.getInterfaceId());\n }\n\n /**\n * Opens a connection using a custom transport.\n * @param transport The custom connection transport.\n * @returns An object representing the connection.\n */\n public static async openCustom(\n transport: Transport\n ): Promise<Connection> {\n const request = new gateway.OpenInterfaceRequest();\n request.setInterfaceType(gateway.InterfaceType.CUSTOM);\n request.setTransport(transport.transportId);\n\n const response = await gateway.callAsync<gateway.OpenInterfaceResponse>(\n 'interface/open',\n request,\n gateway.OpenInterfaceResponse);\n return new Connection(response.getInterfaceId());\n }\n\n /**\n * Opens a secured connection to a cloud connected device chain.\n * Use this method to connect to devices on your account.\n * @param cloudId The cloud ID to connect to.\n * @param [options.token='unauthenticated'] The token to authenticate with. By default the connection will be unauthenticated.\n * @param [options.connectionName=''] The name of the connection to open.\n * Can be left empty to default to the only connection present.\n * Otherwise, use serial port name for serial port connection or hostname:port for TCP connection.\n * @param [options.realm=''] The realm to connect to.\n * Can be left empty for the default account realm.\n * @param [options.api='https://api.zaber.io'] The URL of the API to receive connection info from.\n * @returns An object representing the connection.\n */\n public static async openIot(\n cloudId: string,\n options: Connection.OpenIotOptions = {}\n ): Promise<Connection> {\n const {\n token = 'unauthenticated',\n connectionName = '',\n realm = '',\n api = 'https://api.zaber.io',\n } = options;\n const request = new gateway.OpenInterfaceRequest();\n request.setInterfaceType(gateway.InterfaceType.IOT);\n request.setCloudId(cloudId);\n request.setToken(token);\n request.setConnectionName(connectionName);\n request.setRealm(realm);\n request.setApi(api);\n\n const response = await gateway.callAsync<gateway.OpenInterfaceResponse>(\n 'interface/open',\n request,\n gateway.OpenInterfaceResponse);\n return new Connection(response.getInterfaceId());\n }\n\n /**\n * Opens a connection to Zaber Launcher in your Local Area Network.\n * The connection is not secured.\n * @param hostName Hostname or IP address.\n * @param port Port number.\n * @param [connectionName=''] The name of the connection to open.\n * Can be left empty to default to the only connection present.\n * Otherwise, use serial port name for serial port connection or hostname:port for TCP connection.\n * @returns An object representing the connection.\n */\n public static async openNetworkShare(\n hostName: string,\n port: number,\n connectionName: string = ''\n ): Promise<Connection> {\n const request = new gateway.OpenInterfaceRequest();\n request.setInterfaceType(gateway.InterfaceType.NETWORK_SHARE);\n request.setHostName(hostName);\n request.setPort(port);\n request.setConnectionName(connectionName);\n\n const response = await gateway.callAsync<gateway.OpenInterfaceResponse>(\n 'interface/open',\n request,\n gateway.OpenInterfaceResponse);\n return new Connection(response.getInterfaceId());\n }\n\n /**\n * Sends a generic ASCII command to this connection.\n * For more information refer to the [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.device=0] Optional device address to send the command to.\n * @param [options.axis=0] Optional axis number to send the command to.\n * @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns A response to the command.\n */\n public async genericCommand(\n command: string,\n options: Connection.GenericCommandOptions = {}\n ): Promise<Response> {\n const {\n device = 0,\n axis = 0,\n checkErrors = true,\n timeout = 0,\n } = options;\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.interfaceId);\n request.setCommand(command);\n request.setDevice(device);\n request.setAxis(axis);\n request.setCheckErrors(checkErrors);\n request.setTimeout(timeout);\n\n const response = await gateway.callAsync<gateway.GenericCommandResponse>(\n 'interface/generic_command',\n request,\n gateway.GenericCommandResponse);\n return Response.fromProtobuf(response.toObject());\n }\n\n /**\n * Sends a generic ASCII command to this connection without expecting a response and without adding a message ID.\n * For more information refer to the [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.device=0] Optional device address to send the command to.\n * Specifying -1 omits the number completely.\n * @param [options.axis=0] Optional axis number to send the command to.\n * Specifying -1 omits the number completely.\n */\n public async genericCommandNoResponse(\n command: string,\n options: Connection.GenericCommandNoResponseOptions = {}\n ): Promise<void> {\n const {\n device = 0,\n axis = 0,\n } = options;\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.interfaceId);\n request.setCommand(command);\n request.setDevice(device);\n request.setAxis(axis);\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Sends a generic ASCII command to this connection and expect multiple responses,\n * either from one device or from many devices.\n * Responses are returned in order of arrival.\n * For more information refer to the [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.device=0] Optional device address to send the command to.\n * @param [options.axis=0] Optional axis number to send the command to.\n * @param [options.checkErrors=true] Controls whether to throw an exception when a device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns All responses to the command.\n */\n public async genericCommandMultiResponse(\n command: string,\n options: Connection.GenericCommandMultiResponseOptions = {}\n ): Promise<Response[]> {\n const {\n device = 0,\n axis = 0,\n checkErrors = true,\n timeout = 0,\n } = options;\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.interfaceId);\n request.setCommand(command);\n request.setDevice(device);\n request.setAxis(axis);\n request.setCheckErrors(checkErrors);\n request.setTimeout(timeout);\n\n const response = await gateway.callAsync<gateway.GenericCommandResponseCollection>(\n 'interface/generic_command_multi_response',\n request,\n gateway.GenericCommandResponseCollection);\n return response.getResponsesList().map(a => Response.fromProtobuf(a.toObject()));\n }\n\n /**\n * Enables alerts for all devices on the connection.\n * This will change the \"comm.alert\" setting to 1 on all supported devices.\n */\n public async enableAlerts(): Promise<void> {\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.interfaceId);\n request.setCommand('set comm.alert 1');\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Disables alerts for all devices on the connection.\n * This will change the \"comm.alert\" setting to 0 on all supported devices.\n */\n public async disableAlerts(): Promise<void> {\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.interfaceId);\n request.setCommand('set comm.alert 0');\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Resets ASCII protocol message IDs. Only for testing purposes.\n */\n public resetIds(): void {\n const request = new gateway.InterfaceEmptyRequest();\n request.setInterfaceId(this.interfaceId);\n\n gateway.callSync('interface/reset_ids', request);\n }\n\n /**\n * Close the connection.\n */\n public async close(): Promise<void> {\n const request = new gateway.InterfaceEmptyRequest();\n request.setInterfaceId(this.interfaceId);\n\n await gateway.callAsync('interface/close', request);\n }\n\n /**\n * Gets a Device class instance which allows you to control a particular device on this connection.\n * Devices are numbered from 1.\n * @param deviceAddress Address of device intended to control. Address is configured for each device.\n * @returns Device instance.\n */\n public getDevice(\n deviceAddress: number\n ): Device {\n if (deviceAddress <= 0) {\n throw new TypeError('Invalid value; physical devices are numbered from 1.');\n }\n return new Device(this, deviceAddress);\n }\n\n /**\n * Renumbers devices present on this connection. After renumbering, devices need to be identified again.\n * @param [options.firstAddress=1] This is the address that the device closest to the computer is given.\n * Remaining devices are numbered consecutively.\n * @returns Total number of devices that responded to the renumber.\n */\n public async renumberDevices(\n options: Connection.RenumberDevicesOptions = {}\n ): Promise<number> {\n const {\n firstAddress = 1,\n } = options;\n if (firstAddress <= 0) {\n throw new TypeError('Invalid value; device addresses are numbered from 1.');\n }\n const request = new gateway.DeviceRenumberRequest();\n request.setInterfaceId(this.interfaceId);\n request.setFirstAddress(firstAddress);\n\n const response = await gateway.callAsync<gateway.IntResponse>(\n 'device/renumber',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Attempts to detect any devices present on this connection.\n * @param [options.identifyDevices=true] Determines whether device identification should be performed as well.\n * @returns Array of detected devices.\n */\n public async detectDevices(\n options: Connection.DetectDevicesOptions = {}\n ): Promise<Device[]> {\n const {\n identifyDevices = true,\n } = options;\n const request = new gateway.DeviceDetectRequest();\n request.setInterfaceId(this.interfaceId);\n request.setIdentifyDevices(identifyDevices);\n\n const response = await gateway.callAsync<gateway.DeviceDetectResponse>(\n 'device/detect',\n request,\n gateway.DeviceDetectResponse);\n return response.getDevicesList().map(deviceAddress => this.getDevice(deviceAddress));\n }\n\n /**\n * Stops all of the devices on this connection.\n * @param [options.waitUntilIdle=true] Determines whether the function should return immediately\n * or wait until the devices are stopped.\n * @returns The addresses of the devices that were stopped by this command.\n */\n public async stopAll(\n options: Connection.StopAllOptions = {}\n ): Promise<number[]> {\n const {\n waitUntilIdle = true,\n } = options;\n const request = new gateway.DeviceOnAllRequest();\n request.setInterfaceId(this.interfaceId);\n request.setWaitUntilIdle(waitUntilIdle);\n\n const response = await gateway.callAsync<gateway.DeviceOnAllResponse>(\n 'device/stop_all',\n request,\n gateway.DeviceOnAllResponse);\n return response.getDeviceAddressesList();\n }\n\n /**\n * Homes all of the devices on this connection.\n * @param [options.waitUntilIdle=true] Determines whether the function should return immediately\n * or wait until the devices are homed.\n * @returns The addresses of the devices that were homed by this command.\n */\n public async homeAll(\n options: Connection.HomeAllOptions = {}\n ): Promise<number[]> {\n const {\n waitUntilIdle = true,\n } = options;\n const request = new gateway.DeviceOnAllRequest();\n request.setInterfaceId(this.interfaceId);\n request.setWaitUntilIdle(waitUntilIdle);\n\n const response = await gateway.callAsync<gateway.DeviceOnAllResponse>(\n 'device/home_all',\n request,\n gateway.DeviceOnAllResponse);\n return response.getDeviceAddressesList();\n }\n\n /**\n * Returns a string that represents the connection.\n * @returns A string that represents the connection.\n */\n public toString(): string {\n const request = new gateway.InterfaceEmptyRequest();\n request.setInterfaceId(this.interfaceId);\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'interface/to_string',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n\n /**\n * Returns default request timeout.\n * @returns Default request timeout.\n */\n private _retrieveTimeout(): number {\n const request = new gateway.InterfaceEmptyRequest();\n request.setInterfaceId(this.interfaceId);\n\n const response = gateway.callSync<gateway.IntResponse>(\n 'interface/get_timeout',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Sets default request timeout.\n * @param timeout Default request timeout.\n */\n private _changeTimeout(\n timeout: number\n ): void {\n const request = new gateway.SetInterfaceTimeoutRequest();\n request.setInterfaceId(this.interfaceId);\n request.setTimeout(timeout);\n\n gateway.callSync('interface/set_timeout', request);\n }\n\n /**\n * Returns checksum enabled.\n * @returns Checksum enabled.\n */\n private _retrieveChecksumEnabled(): boolean {\n const request = new gateway.InterfaceEmptyRequest();\n request.setInterfaceId(this.interfaceId);\n\n const response = gateway.callSync<gateway.BoolResponse>(\n 'interface/get_checksum_enabled',\n request,\n gateway.BoolResponse);\n return response.getValue();\n }\n\n /**\n * Sets checksum enabled.\n * @param isEnabled Checksum enabled.\n */\n private _changeChecksumEnabled(\n isEnabled: boolean\n ): void {\n const request = new gateway.SetInterfaceChecksumEnabledRequest();\n request.setInterfaceId(this.interfaceId);\n request.setIsEnabled(isEnabled);\n\n gateway.callSync('interface/set_checksum_enabled', request);\n }\n\n private _disconnected = new ReplaySubject<MotionLibException>();\n\n /**\n * Event invoked when connection is interrupted or closed.\n */\n public get disconnected(): Observable<MotionLibException> {\n return this._disconnected;\n }\n\n private _subscribe(): void {\n this.unknownResponse = events.pipe(\n takeUntil(this._disconnected),\n filterEvent<gateway.UnknownResponseEvent.AsObject>('interface/unknown_response'),\n filter(event => event.interfaceId === this.interfaceId),\n map(event => UnknownResponseEvent.fromProtobuf(event))\n );\n\n this.alert = events.pipe(\n takeUntil(this._disconnected),\n filterEvent<gateway.AlertEvent.AsObject>('interface/alert'),\n filter(event => event.interfaceId === this.interfaceId),\n map(event => AlertEvent.fromProtobuf(event))\n );\n\n events.pipe(\n filterEvent<gateway.DisconnectedEvent.AsObject>('interface/disconnected'),\n filter(event => event.interfaceId === this.interfaceId),\n take(1),\n map(({ errorMessage, errorType }) => gateway.convertToException(errorType, errorMessage))\n ).subscribe(this._disconnected);\n }\n}\n\nnamespace Connection {\n export interface OpenSerialPortOptions {\n baudRate?: number;\n direct?: boolean;\n }\n export interface OpenIotOptions {\n token?: string;\n connectionName?: string;\n realm?: string;\n api?: string;\n }\n export interface GenericCommandOptions {\n device?: number;\n axis?: number;\n checkErrors?: boolean;\n timeout?: number;\n }\n export interface GenericCommandNoResponseOptions {\n device?: number;\n axis?: number;\n }\n export interface GenericCommandMultiResponseOptions {\n device?: number;\n axis?: number;\n checkErrors?: boolean;\n timeout?: number;\n }\n export interface RenumberDevicesOptions {\n firstAddress?: number;\n }\n export interface DetectDevicesOptions {\n identifyDevices?: boolean;\n }\n export interface StopAllOptions {\n waitUntilIdle?: boolean;\n }\n export interface HomeAllOptions {\n waitUntilIdle?: boolean;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/ascii/connection.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,+BAAiD;AACjD,8CAA8D;AAC9D,oDAAsC;AACtC,wCAAiD;AAEjD,qCAAkC;AAClC,yCAAsC;AACtC,qEAAgE;AAChE,+CAA2C;AAG3C;;GAEG;AACH,MAAa,UAAU;IA6BrB;;OAEG;IACH,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAGD;;;;OAIG;IACH,IAAW,qBAAqB;QAC9B,OAAO,IAAI,CAAC,gBAAgB,EAAE,CAAC;IACjC,CAAC;IAED,IAAW,qBAAqB,CAAC,KAAa;QAC5C,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,IAAW,eAAe;QACxB,OAAO,IAAI,CAAC,wBAAwB,EAAE,CAAC;IACzC,CAAC;IAED,IAAW,eAAe,CAAC,KAAc;QACvC,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,YAAY,WAAmB;QAqdvB,kBAAa,GAAG,IAAI,oBAAa,EAAsB,CAAC;QApd9D,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,UAAU,EA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AE,YAAY,CAAC,CAAC,CAC1F,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAClC,CAAC;;AAhjBH,gCAijBC;AAtiBC;;GAEG;AACoB,4BAAiB,GAAW,MAAM,CAAC;AAE1D;;;GAGG;AACoB,yBAAc,GAAW,KAAK,CAAC;AAEtD;;;;GAIG;AACoB,+BAAoB,GAAW,KAAK,CAAC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Observable, ReplaySubject } from 'rxjs';\nimport { map, filter, takeUntil, take } from 'rxjs/operators';\nimport * as gateway from '../gateway';\nimport { events, filterEvent } from '../gateway';\nimport { Transport } from './transport';\nimport { Device } from './device';\nimport { Response } from './response';\nimport { UnknownResponseEvent } from './unknown_response_event';\nimport { AlertEvent } from './alert_event';\nimport { MotionLibException } from '../exceptions';\n\n/**\n * Class representing access to particular connection (serial port, TCP connection).\n */\nexport class Connection {\n /**\n * Event invoked when a response from a device cannot be matched to any known request.\n */\n public unknownResponse!: Observable<UnknownResponseEvent>;\n\n /**\n * Event invoked when an alert is received from a device.\n */\n public alert!: Observable<AlertEvent>;\n\n /**\n * Default baud rate for serial connections.\n */\n public static readonly DEFAULT_BAUD_RATE: number = 115200;\n\n /**\n * Commands send over this port are forwarded to the device chain.\n * The bandwidth may be limited as the commands are forwarded over a serial connection.\n */\n public static readonly TCP_PORT_CHAIN: number = 55550;\n\n /**\n * Commands send over this port are processed only by the device\n * and not forwarded to the rest of the chain.\n * Using this port typically makes the communication faster.\n */\n public static readonly TCP_PORT_DEVICE_ONLY: number = 55551;\n\n /**\n * The interface ID identifies this Connection instance with the underlying library.\n */\n public get interfaceId(): number {\n return this._interfaceId;\n }\n private _interfaceId: number;\n\n /**\n * The default timeout, in milliseconds, for a device to respond to a request.\n * Setting the timeout to a too low value may cause request timeout exceptions.\n * The initial value is 1000 (one second).\n */\n public get defaultRequestTimeout(): number {\n return this._retrieveTimeout();\n }\n\n public set defaultRequestTimeout(value: number) {\n this._changeTimeout(value);\n }\n\n /**\n * Controls whether outgoing messages contain checksum.\n */\n public get checksumEnabled(): boolean {\n return this._retrieveChecksumEnabled();\n }\n\n public set checksumEnabled(value: boolean) {\n this._changeChecksumEnabled(value);\n }\n\n constructor(interfaceId: number) {\n this._interfaceId = interfaceId;\n this._subscribe();\n }\n\n /**\n * Opens a serial port, if Zaber Launcher controls the port, the port will be opened through Zaber Launcher.\n * Zaber Launcher allows sharing of the port between multiple applications,\n * If port sharing is not desirable, use the `direct` parameter.\n * @param portName Name of the port to open.\n * @param [options.baudRate=Connection.DEFAULT_BAUD_RATE] Optional baud rate (defaults to 115200).\n * @param [options.direct=false] If true will connect to the serial port directly,\n * failing if the connection is already opened by a message router instance.\n * @returns An object representing the port.\n */\n public static async openSerialPort(\n portName: string,\n options: Connection.OpenSerialPortOptions = {}\n ): Promise<Connection> {\n const {\n baudRate = Connection.DEFAULT_BAUD_RATE,\n direct = false,\n } = options;\n const request = new gateway.OpenInterfaceRequest();\n request.setInterfaceType(gateway.InterfaceType.SERIAL_PORT);\n request.setPortName(portName);\n request.setBaudRate(baudRate);\n request.setRejectRoutedConnection(direct);\n\n const response = await gateway.callAsync<gateway.OpenInterfaceResponse>(\n 'interface/open',\n request,\n gateway.OpenInterfaceResponse);\n return new Connection(response.getInterfaceId());\n }\n\n /**\n * Opens a TCP connection.\n * @param hostName Hostname or IP address.\n * @param [port=Connection.TCP_PORT_CHAIN] Optional port number (defaults to 55550).\n * @returns An object representing the connection.\n */\n public static async openTcp(\n hostName: string,\n port: number = Connection.TCP_PORT_CHAIN\n ): Promise<Connection> {\n const request = new gateway.OpenInterfaceRequest();\n request.setInterfaceType(gateway.InterfaceType.TCP);\n request.setHostName(hostName);\n request.setPort(port);\n\n const response = await gateway.callAsync<gateway.OpenInterfaceResponse>(\n 'interface/open',\n request,\n gateway.OpenInterfaceResponse);\n return new Connection(response.getInterfaceId());\n }\n\n /**\n * Opens a connection using a custom transport.\n * @param transport The custom connection transport.\n * @returns An object representing the connection.\n */\n public static async openCustom(\n transport: Transport\n ): Promise<Connection> {\n const request = new gateway.OpenInterfaceRequest();\n request.setInterfaceType(gateway.InterfaceType.CUSTOM);\n request.setTransport(transport.transportId);\n\n const response = await gateway.callAsync<gateway.OpenInterfaceResponse>(\n 'interface/open',\n request,\n gateway.OpenInterfaceResponse);\n return new Connection(response.getInterfaceId());\n }\n\n /**\n * Opens a secured connection to a cloud connected device chain.\n * Use this method to connect to devices on your account.\n * @param cloudId The cloud ID to connect to.\n * @param [options.token='unauthenticated'] The token to authenticate with. By default the connection will be unauthenticated.\n * @param [options.connectionName=''] The name of the connection to open.\n * Can be left empty to default to the only connection present.\n * Otherwise, use serial port name for serial port connection or hostname:port for TCP connection.\n * @param [options.realm=''] The realm to connect to.\n * Can be left empty for the default account realm.\n * @param [options.api='https://api.zaber.io'] The URL of the API to receive connection info from.\n * @returns An object representing the connection.\n */\n public static async openIot(\n cloudId: string,\n options: Connection.OpenIotOptions = {}\n ): Promise<Connection> {\n const {\n token = 'unauthenticated',\n connectionName = '',\n realm = '',\n api = 'https://api.zaber.io',\n } = options;\n const request = new gateway.OpenInterfaceRequest();\n request.setInterfaceType(gateway.InterfaceType.IOT);\n request.setCloudId(cloudId);\n request.setToken(token);\n request.setConnectionName(connectionName);\n request.setRealm(realm);\n request.setApi(api);\n\n const response = await gateway.callAsync<gateway.OpenInterfaceResponse>(\n 'interface/open',\n request,\n gateway.OpenInterfaceResponse);\n return new Connection(response.getInterfaceId());\n }\n\n /**\n * Opens a connection to Zaber Launcher in your Local Area Network.\n * The connection is not secured.\n * @param hostName Hostname or IP address.\n * @param port Port number.\n * @param [connectionName=''] The name of the connection to open.\n * Can be left empty to default to the only connection present.\n * Otherwise, use serial port name for serial port connection or hostname:port for TCP connection.\n * @returns An object representing the connection.\n */\n public static async openNetworkShare(\n hostName: string,\n port: number,\n connectionName: string = ''\n ): Promise<Connection> {\n const request = new gateway.OpenInterfaceRequest();\n request.setInterfaceType(gateway.InterfaceType.NETWORK_SHARE);\n request.setHostName(hostName);\n request.setPort(port);\n request.setConnectionName(connectionName);\n\n const response = await gateway.callAsync<gateway.OpenInterfaceResponse>(\n 'interface/open',\n request,\n gateway.OpenInterfaceResponse);\n return new Connection(response.getInterfaceId());\n }\n\n /**\n * Sends a generic ASCII command to this connection.\n * For more information refer to the [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.device=0] Optional device address to send the command to.\n * @param [options.axis=0] Optional axis number to send the command to.\n * @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns A response to the command.\n */\n public async genericCommand(\n command: string,\n options: Connection.GenericCommandOptions = {}\n ): Promise<Response> {\n const {\n device = 0,\n axis = 0,\n checkErrors = true,\n timeout = 0,\n } = options;\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.interfaceId);\n request.setCommand(command);\n request.setDevice(device);\n request.setAxis(axis);\n request.setCheckErrors(checkErrors);\n request.setTimeout(timeout);\n\n const response = await gateway.callAsync<gateway.GenericCommandResponse>(\n 'interface/generic_command',\n request,\n gateway.GenericCommandResponse);\n return Response.fromProtobuf(response.toObject());\n }\n\n /**\n * Sends a generic ASCII command to this connection without expecting a response and without adding a message ID.\n * For more information refer to the [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.device=0] Optional device address to send the command to.\n * Specifying -1 omits the number completely.\n * @param [options.axis=0] Optional axis number to send the command to.\n * Specifying -1 omits the number completely.\n */\n public async genericCommandNoResponse(\n command: string,\n options: Connection.GenericCommandNoResponseOptions = {}\n ): Promise<void> {\n const {\n device = 0,\n axis = 0,\n } = options;\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.interfaceId);\n request.setCommand(command);\n request.setDevice(device);\n request.setAxis(axis);\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Sends a generic ASCII command to this connection and expect multiple responses,\n * either from one device or from many devices.\n * Responses are returned in order of arrival.\n * For more information refer to the [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.device=0] Optional device address to send the command to.\n * @param [options.axis=0] Optional axis number to send the command to.\n * @param [options.checkErrors=true] Controls whether to throw an exception when a device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns All responses to the command.\n */\n public async genericCommandMultiResponse(\n command: string,\n options: Connection.GenericCommandMultiResponseOptions = {}\n ): Promise<Response[]> {\n const {\n device = 0,\n axis = 0,\n checkErrors = true,\n timeout = 0,\n } = options;\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.interfaceId);\n request.setCommand(command);\n request.setDevice(device);\n request.setAxis(axis);\n request.setCheckErrors(checkErrors);\n request.setTimeout(timeout);\n\n const response = await gateway.callAsync<gateway.GenericCommandResponseCollection>(\n 'interface/generic_command_multi_response',\n request,\n gateway.GenericCommandResponseCollection);\n return response.getResponsesList().map(a => Response.fromProtobuf(a.toObject()));\n }\n\n /**\n * Enables alerts for all devices on the connection.\n * This will change the \"comm.alert\" setting to 1 on all supported devices.\n */\n public async enableAlerts(): Promise<void> {\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.interfaceId);\n request.setCommand('set comm.alert 1');\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Disables alerts for all devices on the connection.\n * This will change the \"comm.alert\" setting to 0 on all supported devices.\n */\n public async disableAlerts(): Promise<void> {\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.interfaceId);\n request.setCommand('set comm.alert 0');\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Resets ASCII protocol message IDs. Only for testing purposes.\n */\n public resetIds(): void {\n const request = new gateway.InterfaceEmptyRequest();\n request.setInterfaceId(this.interfaceId);\n\n gateway.callSync('interface/reset_ids', request);\n }\n\n /**\n * Close the connection.\n */\n public async close(): Promise<void> {\n const request = new gateway.InterfaceEmptyRequest();\n request.setInterfaceId(this.interfaceId);\n\n await gateway.callAsync('interface/close', request);\n }\n\n /**\n * Gets a Device class instance which allows you to control a particular device on this connection.\n * Devices are numbered from 1.\n * @param deviceAddress Address of device intended to control. Address is configured for each device.\n * @returns Device instance.\n */\n public getDevice(\n deviceAddress: number\n ): Device {\n if (deviceAddress <= 0) {\n throw new TypeError('Invalid value; physical devices are numbered from 1.');\n }\n return new Device(this, deviceAddress);\n }\n\n /**\n * Renumbers devices present on this connection. After renumbering, devices need to be identified again.\n * @param [options.firstAddress=1] This is the address that the device closest to the computer is given.\n * Remaining devices are numbered consecutively.\n * @returns Total number of devices that responded to the renumber.\n */\n public async renumberDevices(\n options: Connection.RenumberDevicesOptions = {}\n ): Promise<number> {\n const {\n firstAddress = 1,\n } = options;\n if (firstAddress <= 0) {\n throw new TypeError('Invalid value; device addresses are numbered from 1.');\n }\n const request = new gateway.DeviceRenumberRequest();\n request.setInterfaceId(this.interfaceId);\n request.setFirstAddress(firstAddress);\n\n const response = await gateway.callAsync<gateway.IntResponse>(\n 'device/renumber',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Attempts to detect any devices present on this connection.\n * @param [options.identifyDevices=true] Determines whether device identification should be performed as well.\n * @returns Array of detected devices.\n */\n public async detectDevices(\n options: Connection.DetectDevicesOptions = {}\n ): Promise<Device[]> {\n const {\n identifyDevices = true,\n } = options;\n const request = new gateway.DeviceDetectRequest();\n request.setInterfaceId(this.interfaceId);\n request.setIdentifyDevices(identifyDevices);\n\n const response = await gateway.callAsync<gateway.DeviceDetectResponse>(\n 'device/detect',\n request,\n gateway.DeviceDetectResponse);\n return response.getDevicesList().map(deviceAddress => this.getDevice(deviceAddress));\n }\n\n /**\n * Stops all of the devices on this connection.\n * @param [options.waitUntilIdle=true] Determines whether the function should return immediately\n * or wait until the devices are stopped.\n * @returns The addresses of the devices that were stopped by this command.\n */\n public async stopAll(\n options: Connection.StopAllOptions = {}\n ): Promise<number[]> {\n const {\n waitUntilIdle = true,\n } = options;\n const request = new gateway.DeviceOnAllRequest();\n request.setInterfaceId(this.interfaceId);\n request.setWaitUntilIdle(waitUntilIdle);\n\n const response = await gateway.callAsync<gateway.DeviceOnAllResponse>(\n 'device/stop_all',\n request,\n gateway.DeviceOnAllResponse);\n return response.getDeviceAddressesList();\n }\n\n /**\n * Homes all of the devices on this connection.\n * @param [options.waitUntilIdle=true] Determines whether the function should return immediately\n * or wait until the devices are homed.\n * @returns The addresses of the devices that were homed by this command.\n */\n public async homeAll(\n options: Connection.HomeAllOptions = {}\n ): Promise<number[]> {\n const {\n waitUntilIdle = true,\n } = options;\n const request = new gateway.DeviceOnAllRequest();\n request.setInterfaceId(this.interfaceId);\n request.setWaitUntilIdle(waitUntilIdle);\n\n const response = await gateway.callAsync<gateway.DeviceOnAllResponse>(\n 'device/home_all',\n request,\n gateway.DeviceOnAllResponse);\n return response.getDeviceAddressesList();\n }\n\n /**\n * Returns a string that represents the connection.\n * @returns A string that represents the connection.\n */\n public toString(): string {\n const request = new gateway.InterfaceEmptyRequest();\n request.setInterfaceId(this.interfaceId);\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'interface/to_string',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n\n /**\n * Returns default request timeout.\n * @returns Default request timeout.\n */\n private _retrieveTimeout(): number {\n const request = new gateway.InterfaceEmptyRequest();\n request.setInterfaceId(this.interfaceId);\n\n const response = gateway.callSync<gateway.IntResponse>(\n 'interface/get_timeout',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Sets default request timeout.\n * @param timeout Default request timeout.\n */\n private _changeTimeout(\n timeout: number\n ): void {\n const request = new gateway.SetInterfaceTimeoutRequest();\n request.setInterfaceId(this.interfaceId);\n request.setTimeout(timeout);\n\n gateway.callSync('interface/set_timeout', request);\n }\n\n /**\n * Returns checksum enabled.\n * @returns Checksum enabled.\n */\n private _retrieveChecksumEnabled(): boolean {\n const request = new gateway.InterfaceEmptyRequest();\n request.setInterfaceId(this.interfaceId);\n\n const response = gateway.callSync<gateway.BoolResponse>(\n 'interface/get_checksum_enabled',\n request,\n gateway.BoolResponse);\n return response.getValue();\n }\n\n /**\n * Sets checksum enabled.\n * @param isEnabled Checksum enabled.\n */\n private _changeChecksumEnabled(\n isEnabled: boolean\n ): void {\n const request = new gateway.SetInterfaceChecksumEnabledRequest();\n request.setInterfaceId(this.interfaceId);\n request.setIsEnabled(isEnabled);\n\n gateway.callSync('interface/set_checksum_enabled', request);\n }\n\n private _disconnected = new ReplaySubject<MotionLibException>();\n\n /**\n * Event invoked when connection is interrupted or closed.\n */\n public get disconnected(): Observable<MotionLibException> {\n return this._disconnected;\n }\n\n private _subscribe(): void {\n this.unknownResponse = events.pipe(\n takeUntil(this._disconnected),\n filterEvent<gateway.UnknownResponseEvent.AsObject>('interface/unknown_response'),\n filter(event => event.interfaceId === this.interfaceId),\n map(event => UnknownResponseEvent.fromProtobuf(event))\n );\n\n this.alert = events.pipe(\n takeUntil(this._disconnected),\n filterEvent<gateway.AlertEvent.AsObject>('interface/alert'),\n filter(event => event.interfaceId === this.interfaceId),\n map(event => AlertEvent.fromProtobuf(event))\n );\n\n events.pipe(\n filterEvent<gateway.DisconnectedEvent.AsObject>('interface/disconnected'),\n filter(event => event.interfaceId === this.interfaceId),\n take(1),\n map(({ errorMessage, errorType }) => gateway.convertToException(errorType, errorMessage))\n ).subscribe(this._disconnected);\n }\n}\n\nnamespace Connection {\n export interface OpenSerialPortOptions {\n baudRate?: number;\n direct?: boolean;\n }\n export interface OpenIotOptions {\n token?: string;\n connectionName?: string;\n realm?: string;\n api?: string;\n }\n export interface GenericCommandOptions {\n device?: number;\n axis?: number;\n checkErrors?: boolean;\n timeout?: number;\n }\n export interface GenericCommandNoResponseOptions {\n device?: number;\n axis?: number;\n }\n export interface GenericCommandMultiResponseOptions {\n device?: number;\n axis?: number;\n checkErrors?: boolean;\n timeout?: number;\n }\n export interface RenumberDevicesOptions {\n firstAddress?: number;\n }\n export interface DetectDevicesOptions {\n identifyDevices?: boolean;\n }\n export interface StopAllOptions {\n waitUntilIdle?: boolean;\n }\n export interface HomeAllOptions {\n waitUntilIdle?: boolean;\n }\n}\n"]}
|
|
@@ -69,6 +69,11 @@ export declare class Microscope {
|
|
|
69
69
|
* Homes all axes, filter changer, and objective changer.
|
|
70
70
|
*/
|
|
71
71
|
initialize(): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Checks whether the microscope is initialized.
|
|
74
|
+
* @returns True, when the microscope is initialized. False, otherwise.
|
|
75
|
+
*/
|
|
76
|
+
isInitialized(): Promise<boolean>;
|
|
72
77
|
/**
|
|
73
78
|
* Returns a string that represents the microscope.
|
|
74
79
|
* @returns A string that represents the microscope.
|
|
@@ -126,6 +126,17 @@ class Microscope {
|
|
|
126
126
|
request.setConfig(microscope_config_1.MicroscopeConfig.toProtobuf(this._config));
|
|
127
127
|
await gateway.callAsync('microscope/initialize', request);
|
|
128
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* Checks whether the microscope is initialized.
|
|
131
|
+
* @returns True, when the microscope is initialized. False, otherwise.
|
|
132
|
+
*/
|
|
133
|
+
async isInitialized() {
|
|
134
|
+
const request = new gateway.MicroscopeEmptyRequest();
|
|
135
|
+
request.setInterfaceId(this.connection.interfaceId);
|
|
136
|
+
request.setConfig(microscope_config_1.MicroscopeConfig.toProtobuf(this._config));
|
|
137
|
+
const response = await gateway.callAsync('microscope/is_initialized', request, gateway.BoolResponse);
|
|
138
|
+
return response.getValue();
|
|
139
|
+
}
|
|
129
140
|
/**
|
|
130
141
|
* Returns a string that represents the microscope.
|
|
131
142
|
* @returns A string that represents the microscope.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"microscope.js","sourceRoot":"","sources":["../../../src/microscop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rD,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACpD,OAAO,CAAC,SAAS,CAAC,oCAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAE7D,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,2BAA2B,EAC3B,OAAO,EACP,OAAO,CAAC,YAAY,CAAC,CAAC;QACxB,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,sBAAsB,EAAE,CAAC;QACrD,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACpD,OAAO,CAAC,SAAS,CAAC,oCAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAE7D,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,sBAAsB,EACtB,OAAO,EACP,OAAO,CAAC,cAAc,CAAC,CAAC;QAC1B,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;CACF;AAhJD,gCAgJC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport { Axis } from '../ascii/axis';\nimport { AxisGroup } from '../ascii/axis_group';\nimport { Device } from '../ascii/device';\nimport { Connection } from '../ascii/connection';\nimport { Illuminator } from './illuminator';\nimport { ObjectiveChanger } from './objective_changer';\nimport { MicroscopeConfig } from './microscope_config';\nimport { FilterChanger } from './filter_changer';\n\n/**\n * Represent a microscope.\n * It is subject to breaking changes without warning until further notice.\n * Parts of the microscope may or may not be instantiated depending on the configuration.\n * Requires at least Firmware 7.34.\n */\nexport class Microscope {\n /**\n * Connection of the microscope.\n */\n public get connection(): Connection {\n return this._connection;\n }\n private _connection: Connection;\n\n private _config: MicroscopeConfig;\n\n /**\n * The illuminator.\n */\n public get illuminator(): Illuminator | undefined {\n return this._illuminator;\n }\n private _illuminator: Illuminator | undefined;\n\n /**\n * The focus axis.\n */\n public get focusAxis(): Axis | undefined {\n return this._focusAxis;\n }\n private _focusAxis: Axis | undefined;\n\n /**\n * The X axis.\n */\n public get xAxis(): Axis | undefined {\n return this._xAxis;\n }\n private _xAxis: Axis | undefined;\n\n /**\n * The Y axis.\n */\n public get yAxis(): Axis | undefined {\n return this._yAxis;\n }\n private _yAxis: Axis | undefined;\n\n /**\n * Axis group consisting of X and Y axes representing the plate of the microscope.\n */\n public get plate(): AxisGroup | undefined {\n return this._plate;\n }\n private _plate: AxisGroup | undefined;\n\n /**\n * The objective changer.\n */\n public get objectiveChanger(): ObjectiveChanger | undefined {\n return this._objectiveChanger;\n }\n private _objectiveChanger: ObjectiveChanger | undefined;\n\n /**\n * The filter changer.\n */\n public get filterChanger(): FilterChanger | undefined {\n return this._filterChanger;\n }\n private _filterChanger: FilterChanger | undefined;\n\n /**\n * Creates instance of `Microscope` from the given config.\n * Parts are instantiated depending on device addresses in the config.\n */\n constructor(connection: Connection, config: MicroscopeConfig) {\n this._connection = connection;\n this._config = MicroscopeConfig.fromProtobuf(MicroscopeConfig.toProtobuf(config).toObject());\n this._illuminator = config.illuminator ? new Illuminator(new Device(connection, config.illuminator)) : undefined;\n this._focusAxis = config.focusAxis?.device ? new Axis(new Device(connection, config.focusAxis.device), config.focusAxis.axis) : undefined;\n this._xAxis = config.xAxis?.device ? new Axis(new Device(connection, config.xAxis.device), config.xAxis.axis) : undefined;\n this._yAxis = config.yAxis?.device ? new Axis(new Device(connection, config.yAxis.device), config.yAxis.axis) : undefined;\n this._plate = this._xAxis && this._yAxis ? new AxisGroup([this._xAxis, this._yAxis]) : undefined;\n this._objectiveChanger = config.objectiveChanger && this._focusAxis ? new ObjectiveChanger(new Device(connection, config.objectiveChanger), this._focusAxis) : undefined;\n this._filterChanger = config.filterChanger ? new FilterChanger(new Device(connection, config.filterChanger)) : undefined;\n }\n\n /**\n * Finds a microscope on a connection.\n * @param connection Connection on which to detect the microscope.\n * @returns New instance of microscope.\n */\n public static async find(\n connection: Connection\n ): Promise<Microscope> {\n const request = new gateway.InterfaceEmptyRequest();\n request.setInterfaceId(connection.interfaceId);\n\n const response = await gateway.callAsync<gateway.MicroscopeConfig>(\n 'microscope/detect',\n request,\n gateway.MicroscopeConfig);\n return new Microscope(connection, MicroscopeConfig.fromProtobuf(response.toObject()));\n }\n\n /**\n * Initializes the microscope.\n * Homes all axes, filter changer, and objective changer.\n */\n public async initialize(): Promise<void> {\n const request = new gateway.MicroscopeEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setConfig(MicroscopeConfig.toProtobuf(this._config));\n\n await gateway.callAsync('microscope/initialize', request);\n }\n\n /**\n * Checks whether the microscope is initialized.\n * @returns True, when the microscope is initialized. False, otherwise.\n */\n public async isInitialized(): Promise<boolean> {\n const request = new gateway.MicroscopeEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setConfig(MicroscopeConfig.toProtobuf(this._config));\n\n const response = await gateway.callAsync<gateway.BoolResponse>(\n 'microscope/is_initialized',\n request,\n gateway.BoolResponse);\n return response.getValue();\n }\n\n /**\n * Returns a string that represents the microscope.\n * @returns A string that represents the microscope.\n */\n public toString(): string {\n const request = new gateway.MicroscopeEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setConfig(MicroscopeConfig.toProtobuf(this._config));\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'microscope/to_string',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n}\n\nnamespace Microscope {\n}\n"]}
|
|
@@ -2,6 +2,7 @@ import { Connection } from '../ascii/connection';
|
|
|
2
2
|
import { Device } from '../ascii/device';
|
|
3
3
|
import { Axis } from '../ascii/axis';
|
|
4
4
|
import { Measurement } from '../measurement';
|
|
5
|
+
import { Angle, Length, Native } from '../units';
|
|
5
6
|
/**
|
|
6
7
|
* Represents an objective changer of a microscope.
|
|
7
8
|
* Unstable. Expect breaking changes in future releases.
|
|
@@ -36,9 +37,9 @@ export declare class ObjectiveChanger {
|
|
|
36
37
|
/**
|
|
37
38
|
* Changes the objective.
|
|
38
39
|
* Runs a sequence of movements switching from the current objective to the new one.
|
|
40
|
+
* The focus stage moves to the focus datum after the objective change.
|
|
39
41
|
* @param objective Objective number starting from 1.
|
|
40
|
-
* @param options.focusOffset Optional
|
|
41
|
-
* If specified, the focus stage will move to the designated offset.
|
|
42
|
+
* @param options.focusOffset Optional offset from the focus datum.
|
|
42
43
|
*/
|
|
43
44
|
change(objective: number, options?: ObjectiveChanger.ChangeOptions): Promise<void>;
|
|
44
45
|
/**
|
|
@@ -56,6 +57,22 @@ export declare class ObjectiveChanger {
|
|
|
56
57
|
* @returns Number of positions.
|
|
57
58
|
*/
|
|
58
59
|
getNumberOfObjectives(): Promise<number>;
|
|
60
|
+
/**
|
|
61
|
+
* Gets the focus datum.
|
|
62
|
+
* The focus datum is the position that the focus stage moves to after an objective change.
|
|
63
|
+
* It is backed by the limit.home.offset setting.
|
|
64
|
+
* @param [unit=Units.NATIVE] Units of datum.
|
|
65
|
+
* @returns The datum.
|
|
66
|
+
*/
|
|
67
|
+
getFocusDatum(unit?: Length | Angle | Native): Promise<number>;
|
|
68
|
+
/**
|
|
69
|
+
* Sets the focus datum.
|
|
70
|
+
* The focus datum is the position that the focus stage moves to after an objective change.
|
|
71
|
+
* It is backed by the limit.home.offset setting.
|
|
72
|
+
* @param datum Value of datum.
|
|
73
|
+
* @param [unit=Units.NATIVE] Units of datum.
|
|
74
|
+
*/
|
|
75
|
+
setFocusDatum(datum: number, unit?: Length | Angle | Native): Promise<void>;
|
|
59
76
|
/**
|
|
60
77
|
* Checks if this is a objective changer and throws an error if it is not.
|
|
61
78
|
*/
|