@zaber/motion 7.14.0 → 7.15.0-beta.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.
@@ -29,6 +29,10 @@ export declare class Illuminator {
29
29
  * @returns Illuminator channel instance.
30
30
  */
31
31
  getChannel(channelNumber: number): IlluminatorChannel;
32
+ /**
33
+ * Turns all channels off.
34
+ */
35
+ turnOff(): Promise<void>;
32
36
  /**
33
37
  * Checks if this is an illuminator or some other type of device and throws an error if it is not.
34
38
  */
@@ -1 +1 @@
1
- {"version":3,"file":"illuminator.d.ts","sourceRoot":"","sources":["../../../src/microscopy/illuminator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;;GAGG;AACH,qBAAa,WAAW;IACtB;;OAEG;IACH,IAAW,MAAM,IAAI,MAAM,CAE1B;IACD,OAAO,CAAC,OAAO,CAAS;IAExB;;OAEG;IACH,IAAW,EAAE,IAAI,QAAQ,CAExB;IACD,OAAO,CAAC,GAAG,CAAW;IAEtB;;;OAGG;gBACS,MAAM,EAAE,MAAM;IAM1B;;;;;OAKG;IACI,UAAU,CACf,aAAa,EAAE,MAAM,GACpB,kBAAkB;IAOrB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAa5B;;;;;;OAMG;WACiB,IAAI,CACtB,UAAU,EAAE,UAAU,EACtB,OAAO,GAAE,WAAW,CAAC,WAAgB,GACpC,OAAO,CAAC,WAAW,CAAC;IAoBvB;;;OAGG;IACI,QAAQ,IAAI,MAAM;CAgB1B;AAED,kBAAU,WAAW,CAAC;IACpB,UAAiB,WAAW;QACxB;;WAEG;QACH,aAAa,CAAC,EAAE,MAAM,CAAC;KAC1B;CACF"}
1
+ {"version":3,"file":"illuminator.d.ts","sourceRoot":"","sources":["../../../src/microscopy/illuminator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;;GAGG;AACH,qBAAa,WAAW;IACtB;;OAEG;IACH,IAAW,MAAM,IAAI,MAAM,CAE1B;IACD,OAAO,CAAC,OAAO,CAAS;IAExB;;OAEG;IACH,IAAW,EAAE,IAAI,QAAQ,CAExB;IACD,OAAO,CAAC,GAAG,CAAW;IAEtB;;;OAGG;gBACS,MAAM,EAAE,MAAM;IAM1B;;;;;OAKG;IACI,UAAU,CACf,aAAa,EAAE,MAAM,GACpB,kBAAkB;IAOrB;;OAEG;IACU,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAarC;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAa5B;;;;;;OAMG;WACiB,IAAI,CACtB,UAAU,EAAE,UAAU,EACtB,OAAO,GAAE,WAAW,CAAC,WAAgB,GACpC,OAAO,CAAC,WAAW,CAAC;IAoBvB;;;OAGG;IACI,QAAQ,IAAI,MAAM;CAgB1B;AAED,kBAAU,WAAW,CAAC;IACpB,UAAiB,WAAW;QACxB;;WAEG;QACH,aAAa,CAAC,EAAE,MAAM,CAAC;KAC1B;CACF"}
@@ -69,6 +69,20 @@ class Illuminator {
69
69
  }
70
70
  return new illuminator_channel_1.IlluminatorChannel(this, channelNumber);
71
71
  }
72
+ /**
73
+ * Turns all channels off.
74
+ */
75
+ async turnOff() {
76
+ const request = {
77
+ ...requests.DeviceEmptyRequest.DEFAULT,
78
+ interfaceId: this.device.connection.interfaceId,
79
+ device: this.device.deviceAddress,
80
+ toBinary() {
81
+ return requests.DeviceEmptyRequest.toBinary(this);
82
+ },
83
+ };
84
+ await gateway.callAsync('illuminator/all_off', request);
85
+ }
72
86
  /**
73
87
  * Checks if this is an illuminator or some other type of device and throws an error if it is not.
74
88
  */
@@ -1 +1 @@
1
- {"version":3,"file":"illuminator.js","sourceRoot":"","sources":["../../../src/microscopy/illuminator.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,sDAAwC;AACxC,4CAAyC;AACzC,kDAA8C;AAE9C,+DAA2D;AAE3D;;;GAGG;AACH,MAAa,WAAW;IACtB;;OAEG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAGD;;OAEG;IACH,IAAW,EAAE;QACX,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IAGD;;;OAGG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,GAAG,GAAG,IAAI,oBAAQ,CAAC,MAAM,CAAC,CAAC;QAChC,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC9B,CAAC;IAED;;;;;OAKG;IACI,UAAU,CACf,aAAqB;QAErB,IAAI,aAAa,IAAI,CAAC,EAAE,CAAC;YACvB,MAAM,IAAI,SAAS,CAAC,8CAA8C,CAAC,CAAC;QACtE,CAAC;QACD,OAAO,IAAI,wCAAkB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IACrD,CAAC;IAED;;OAEG;IACK,oBAAoB;QAC1B,MAAM,OAAO,GAAkD;YAC7D,GAAG,QAAQ,CAAC,kBAAkB,CAAC,OAAO;YACtC,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW;YAC/C,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa;YACjC,QAAQ;gBACN,OAAO,QAAQ,CAAC,kBAAkB,CAAC,QAAQ,CAAC,IAAI,CAAC,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cesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { Device } from '../ascii/device';\nimport { DeviceIO } from '../ascii/device_io';\nimport { Connection } from '../ascii/connection';\nimport { IlluminatorChannel } from './illuminator_channel';\n\n/**\n * Use to manage an LED controller.\n * Requires at least Firmware 7.09.\n */\nexport class Illuminator {\n /**\n * The base device of this illuminator.\n */\n public get device(): Device {\n return this._device;\n }\n private _device: Device;\n\n /**\n * I/O channels of this device.\n */\n public get io(): DeviceIO {\n return this._io;\n }\n private _io: DeviceIO;\n\n /**\n * Creates instance of `Illuminator` based on the given device.\n * If the device is identified, this constructor will ensure it is an illuminator.\n */\n constructor(device: Device) {\n this._device = device;\n this._io = new DeviceIO(device);\n this._verifyIsIlluminator();\n }\n\n /**\n * Gets an IlluminatorChannel class instance that allows control of a particular channel.\n * Channels are numbered from 1.\n * @param channelNumber Number of channel to control.\n * @returns Illuminator channel instance.\n */\n public getChannel(\n channelNumber: number\n ): IlluminatorChannel {\n if (channelNumber <= 0) {\n throw new TypeError('Invalid value; channels are numbered from 1.');\n }\n return new IlluminatorChannel(this, channelNumber);\n }\n\n /**\n * Checks if this is an illuminator or some other type of device and throws an error if it is not.\n */\n private _verifyIsIlluminator(): void {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n gateway.callSync('illuminator/verify', request);\n }\n\n /**\n * Finds an illuminator on a connection.\n * In case of conflict, specify the optional device address.\n * @param connection Connection on which to detect the illuminator.\n * @param [options.deviceAddress=0] Optional device address of the illuminator.\n * @returns New instance of illuminator.\n */\n public static async find(\n connection: Connection,\n options: Illuminator.FindOptions = {}\n ): Promise<Illuminator> {\n const {\n deviceAddress = 0,\n } = options;\n const request: requests.FindDeviceRequest & gateway.Message = {\n ...requests.FindDeviceRequest.DEFAULT,\n interfaceId: connection.interfaceId,\n deviceAddress: deviceAddress,\n toBinary() {\n return requests.FindDeviceRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.FindDeviceResponse>(\n 'illuminator/detect',\n request,\n requests.FindDeviceResponse.fromBinary);\n return new Illuminator(new Device(connection, response.address));\n }\n\n /**\n * Returns a string that represents the device.\n * @returns A string that represents the device.\n */\n public toString(): string {\n const request: requests.AxisToStringRequest & gateway.Message = {\n ...requests.AxisToStringRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n toBinary() {\n return requests.AxisToStringRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/device_to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace Illuminator {\n export interface FindOptions {\n /**\n * Optional device address of the illuminator.\n */\n deviceAddress?: number;\n }\n}\n"]}
1
+ {"version":3,"file":"illuminator.js","sourceRoot":"","sources":["../../../src/microscopy/illuminator.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,sDAAwC;AACxC,4CAAyC;AACzC,kDAA8C;AAE9C,+DAA2D;AAE3D;;;GAGG;AACH,MAAa,WAAW;IACtB;;OAEG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAGD;;OAEG;IACH,IAAW,EAAE;QACX,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IAGD;;;OAGG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,GAAG,GAAG,IAAI,oBAAQ,CAAC,MAAM,CAAC,CAAC;QAChC,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC9B,CAAC;IAED;;;;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,EAAE,UAAU,CAAC,WAAW;YACnC,aAAa,EAAE,aAAa;YAC5B,QAAQ;gBACN,OAAO,QAAQ,CAAC,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACnD,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,oBAAoB,EACpB,OAAO,EACP,QAAQ,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;QAC1C,OAAO,IAAI,WAAW,CAAC,IAAI,eAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IACnE,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,MAAM,OAAO,GAAmD;YAC9D,GAAG,QAAQ,CAAC,mBAAmB,CAAC,OAAO;YACvC,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW;YAC/C,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa;YACjC,QAAQ;gBACN,OAAO,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACrD,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,yBAAyB,EACzB,OAAO,EACP,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACtC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;CACF;AA5HD,kCA4HC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { Device } from '../ascii/device';\nimport { DeviceIO } from '../ascii/device_io';\nimport { Connection } from '../ascii/connection';\nimport { IlluminatorChannel } from './illuminator_channel';\n\n/**\n * Use to manage an LED controller.\n * Requires at least Firmware 7.09.\n */\nexport class Illuminator {\n /**\n * The base device of this illuminator.\n */\n public get device(): Device {\n return this._device;\n }\n private _device: Device;\n\n /**\n * I/O channels of this device.\n */\n public get io(): DeviceIO {\n return this._io;\n }\n private _io: DeviceIO;\n\n /**\n * Creates instance of `Illuminator` based on the given device.\n * If the device is identified, this constructor will ensure it is an illuminator.\n */\n constructor(device: Device) {\n this._device = device;\n this._io = new DeviceIO(device);\n this._verifyIsIlluminator();\n }\n\n /**\n * Gets an IlluminatorChannel class instance that allows control of a particular channel.\n * Channels are numbered from 1.\n * @param channelNumber Number of channel to control.\n * @returns Illuminator channel instance.\n */\n public getChannel(\n channelNumber: number\n ): IlluminatorChannel {\n if (channelNumber <= 0) {\n throw new TypeError('Invalid value; channels are numbered from 1.');\n }\n return new IlluminatorChannel(this, channelNumber);\n }\n\n /**\n * Turns all channels off.\n */\n public async turnOff(): Promise<void> {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('illuminator/all_off', request);\n }\n\n /**\n * Checks if this is an illuminator or some other type of device and throws an error if it is not.\n */\n private _verifyIsIlluminator(): void {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n gateway.callSync('illuminator/verify', request);\n }\n\n /**\n * Finds an illuminator on a connection.\n * In case of conflict, specify the optional device address.\n * @param connection Connection on which to detect the illuminator.\n * @param [options.deviceAddress=0] Optional device address of the illuminator.\n * @returns New instance of illuminator.\n */\n public static async find(\n connection: Connection,\n options: Illuminator.FindOptions = {}\n ): Promise<Illuminator> {\n const {\n deviceAddress = 0,\n } = options;\n const request: requests.FindDeviceRequest & gateway.Message = {\n ...requests.FindDeviceRequest.DEFAULT,\n interfaceId: connection.interfaceId,\n deviceAddress: deviceAddress,\n toBinary() {\n return requests.FindDeviceRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.FindDeviceResponse>(\n 'illuminator/detect',\n request,\n requests.FindDeviceResponse.fromBinary);\n return new Illuminator(new Device(connection, response.address));\n }\n\n /**\n * Returns a string that represents the device.\n * @returns A string that represents the device.\n */\n public toString(): string {\n const request: requests.AxisToStringRequest & gateway.Message = {\n ...requests.AxisToStringRequest.DEFAULT,\n interfaceId: this.device.connection.interfaceId,\n device: this.device.deviceAddress,\n toBinary() {\n return requests.AxisToStringRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/device_to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace Illuminator {\n export interface FindOptions {\n /**\n * Optional device address of the illuminator.\n */\n deviceAddress?: number;\n }\n}\n"]}
@@ -5,6 +5,7 @@ import { Response } from '../ascii/response';
5
5
  import type { Illuminator } from './illuminator';
6
6
  import { SetStateAxisResponse } from '../ascii';
7
7
  import { FirmwareVersion } from '../firmware_version';
8
+ import { Measurement } from '../measurement';
8
9
  /**
9
10
  * Use to control a channel (LED lamp) on an illuminator.
10
11
  * Requires at least Firmware 7.09.
@@ -39,8 +40,10 @@ export declare class IlluminatorChannel {
39
40
  constructor(illuminator: Illuminator, channelNumber: number);
40
41
  /**
41
42
  * Turns this channel on.
43
+ * @param duration Duration for which to turn the channel on.
44
+ * If not specified, the channel remains on until turned off.
42
45
  */
43
- on(): Promise<void>;
46
+ on(duration?: Measurement): Promise<void>;
44
47
  /**
45
48
  * Turns this channel off.
46
49
  */
@@ -1 +1 @@
1
- {"version":3,"file":"illuminator_channel.d.ts","sourceRoot":"","sources":["../../../src/microscopy/illuminator_channel.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MA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O,CAAC,QAAQ,CAAC;IAyBpB;;;;;;;;;OASG;IACU,2BAA2B,CACtC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,kBAAkB,CAAC,kCAAuC,GAClE,OAAO,CAAC,QAAQ,EAAE,CAAC;IAyBtB;;;;OAIG;IACU,wBAAwB,CACnC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC;IAehB;;;OAGG;IACU,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;IAkBxC;;;;OAIG;IACU,QAAQ,CACnB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,oBAAoB,CAAC;IAmBhC;;;;;;;;OAQG;IACU,WAAW,CACtB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,kBAAkB,CAAC,kBAAuB,GAClD,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAuBzB;;;OAGG;IACI,QAAQ,IAAI,MAAM;CAkB1B;AAED,kBAAU,kBAAkB,CAAC;IAC3B,UAAiB,qBAAqB;QAClC;;WAEG;QACH,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB;;;WAGG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KACpB;IACD,UAAiB,kCAAkC;QAC/C;;WAEG;QACH,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB;;;WAGG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KACpB;IACD,UAAiB,kBAAkB;QAC/B;;;WAGG;QACH,eAAe,CAAC,EAAE,eAAe,CAAC;KACrC;CACF"}
1
+ {"version":3,"file":"illuminator_channel.d.ts","sourceRoot":"","sources":["../../../src/microscopy/illuminator_channel.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;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A0B,GACrD,OAAO,CAAC,QAAQ,CAAC;IAyBpB;;;;;;;;;OASG;IACU,2BAA2B,CACtC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,kBAAkB,CAAC,kCAAuC,GAClE,OAAO,CAAC,QAAQ,EAAE,CAAC;IAyBtB;;;;OAIG;IACU,wBAAwB,CACnC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC;IAehB;;;OAGG;IACU,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;IAkBxC;;;;OAIG;IACU,QAAQ,CACnB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,oBAAoB,CAAC;IAmBhC;;;;;;;;OAQG;IACU,WAAW,CACtB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,kBAAkB,CAAC,kBAAuB,GAClD,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAuBzB;;;OAGG;IACI,QAAQ,IAAI,MAAM;CAkB1B;AAED,kBAAU,kBAAkB,CAAC;IAC3B,UAAiB,qBAAqB;QAClC;;WAEG;QACH,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB;;;WAGG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KACpB;IACD,UAAiB,kCAAkC;QAC/C;;WAEG;QACH,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB;;;WAGG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KACpB;IACD,UAAiB,kBAAkB;QAC/B;;;WAGG;QACH,eAAe,CAAC,EAAE,eAAe,CAAC;KACrC;CACF"}
@@ -79,14 +79,17 @@ class IlluminatorChannel {
79
79
  }
80
80
  /**
81
81
  * Turns this channel on.
82
+ * @param duration Duration for which to turn the channel on.
83
+ * If not specified, the channel remains on until turned off.
82
84
  */
83
- async on() {
85
+ async on(duration) {
84
86
  const request = {
85
87
  ...requests.ChannelOn.DEFAULT,
86
88
  interfaceId: this.illuminator.device.connection.interfaceId,
87
89
  device: this.illuminator.device.deviceAddress,
88
90
  axis: this.channelNumber,
89
91
  on: true,
92
+ duration: duration,
90
93
  toBinary() {
91
94
  return requests.ChannelOn.toBinary(this);
92
95
  },
@@ -1 +1 @@
1
- {"version":3,"file":"illuminator_channel.js","sourceRoot":"","sources":["../../../src/microscopy/illuminator_channel.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,sDAAwC;AACxC,wCAAqC;AACrC,8CAA+C;AAC/C,0DAAsD;AACtD,gDAA6C;AAC7C,gDAA6C;AAE7C,oCAAgD;AAGhD;;;GAGG;AACH,MAAa,kBAAkB;IAC7B;;OAEG;IACH,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAGD;;OAEG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAKD;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAGD;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAGD;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAGD,YAAY,WAAwB,EAAE,aAAqB;QACzD,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,IAAI,WAAI,CAAC,WAAW,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QACzD,IAAI,CAAC,SAAS,GAAG,IAAI,4BAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC9C,IAAI,CAAC,QAAQ,GAAG,IAAI,qBAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5C,IAAI,CAAC,SAAS,GAAG,IAAI,mBAAQ,CAAC,WAAW,CAAC,MAAM,EAA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C,QAAQ,CAC/B,uBAAuB,EACvB,OAAO,EACP,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACtC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;CACF;AAxXD,gDAwXC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { Axis } from '../ascii/axis';\nimport { AxisStorage } from '../ascii/storage';\nimport { AxisSettings } from '../ascii/axis_settings';\nimport { Warnings } from '../ascii/warnings';\nimport { Response } from '../ascii/response';\nimport type { Illuminator } from './illuminator';\nimport { SetStateAxisResponse } from '../ascii';\nimport { FirmwareVersion } from '../firmware_version';\n\n/**\n * Use to control a channel (LED lamp) on an illuminator.\n * Requires at least Firmware 7.09.\n */\nexport class IlluminatorChannel {\n /**\n * Illuminator of this channel.\n */\n public get illuminator(): Illuminator {\n return this._illuminator;\n }\n private _illuminator: Illuminator;\n\n /**\n * The channel number identifies the channel on the illuminator.\n */\n public get channelNumber(): number {\n return this._channelNumber;\n }\n private _channelNumber: number;\n\n private _axis: Axis;\n\n /**\n * Settings and properties of this channel.\n */\n public get settings(): AxisSettings {\n return this._settings;\n }\n private _settings: AxisSettings;\n\n /**\n * Key-value storage of this channel.\n */\n public get storage(): AxisStorage {\n return this._storage;\n }\n private _storage: AxisStorage;\n\n /**\n * Warnings and faults of this channel.\n */\n public get warnings(): Warnings {\n return this._warnings;\n }\n private _warnings: Warnings;\n\n constructor(illuminator: Illuminator, channelNumber: number) {\n this._illuminator = illuminator;\n this._channelNumber = channelNumber;\n this._axis = new Axis(illuminator.device, channelNumber);\n this._settings = new AxisSettings(this._axis);\n this._storage = new AxisStorage(this._axis);\n this._warnings = new Warnings(illuminator.device, channelNumber);\n }\n\n /**\n * Turns this channel on.\n */\n public async on(): Promise<void> {\n const request: requests.ChannelOn & gateway.Message = {\n ...requests.ChannelOn.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n on: true,\n toBinary() {\n return requests.ChannelOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('illuminator/on', request);\n }\n\n /**\n * Turns this channel off.\n */\n public async off(): Promise<void> {\n const request: requests.ChannelOn & gateway.Message = {\n ...requests.ChannelOn.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n on: false,\n toBinary() {\n return requests.ChannelOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('illuminator/on', request);\n }\n\n /**\n * Turns this channel on or off.\n * @param on True to turn channel on, false to turn it off.\n */\n public async setOn(\n on: boolean\n ): Promise<void> {\n const request: requests.ChannelOn & gateway.Message = {\n ...requests.ChannelOn.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n on: on,\n toBinary() {\n return requests.ChannelOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('illuminator/on', request);\n }\n\n /**\n * Checks if this channel is on.\n * @returns True if channel is on, false otherwise.\n */\n public async isOn(): Promise<boolean> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.BoolResponse>(\n 'illuminator/is_on',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sets channel intensity as a fraction of the maximum flux.\n * @param intensity Fraction of intensity to set (between 0 and 1).\n */\n public async setIntensity(\n intensity: number\n ): Promise<void> {\n const request: requests.ChannelSetIntensity & gateway.Message = {\n ...requests.ChannelSetIntensity.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n intensity: intensity,\n toBinary() {\n return requests.ChannelSetIntensity.toBinary(this);\n },\n };\n\n await gateway.callAsync('illuminator/set_intensity', request);\n }\n\n /**\n * Gets the current intensity of this channel.\n * @returns Current intensity as fraction of maximum flux.\n */\n public async getIntensity(): Promise<number> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'illuminator/get_intensity',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sends a generic ASCII command to this channel.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns A response to the command.\n */\n public async genericCommand(\n command: string,\n options: IlluminatorChannel.GenericCommandOptions = {}\n ): Promise<Response> {\n const {\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n command: command,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<Response>(\n 'interface/generic_command',\n request,\n Response.fromBinary);\n return response;\n }\n\n /**\n * Sends a generic ASCII command to this channel and expects multiple responses.\n * Responses are returned in order of arrival.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.checkErrors=true] Controls whether to throw an exception when a device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns All responses to the command.\n */\n public async genericCommandMultiResponse(\n command: string,\n options: IlluminatorChannel.GenericCommandMultiResponseOptions = {}\n ): Promise<Response[]> {\n const {\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n command: command,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.GenericCommandResponseCollection>(\n 'interface/generic_command_multi_response',\n request,\n requests.GenericCommandResponseCollection.fromBinary);\n return response.responses;\n }\n\n /**\n * Sends a generic ASCII command to this channel without expecting a response and without adding a message ID\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n */\n public async genericCommandNoResponse(\n command: string\n ): Promise<void> {\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n command: command,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Returns a serialization of the current channel state that can be saved and reapplied.\n * @returns A serialization of the current state of the channel.\n */\n public async getState(): Promise<string> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.StringResponse>(\n 'device/get_state',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Applies a saved state to this channel.\n * @param state The state object to apply to this channel.\n * @returns Reports of any issues that were handled, but caused the state to not be exactly restored.\n */\n public async setState(\n state: string\n ): Promise<SetStateAxisResponse> {\n const request: requests.SetStateRequest & gateway.Message = {\n ...requests.SetStateRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n state: state,\n toBinary() {\n return requests.SetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<SetStateAxisResponse>(\n 'device/set_axis_state',\n request,\n SetStateAxisResponse.fromBinary);\n return response;\n }\n\n /**\n * Checks if a state can be applied to this channel.\n * This only covers exceptions that can be determined statically such as mismatches of ID or version,\n * the process of applying the state can still fail when running.\n * @param state The state object to check against.\n * @param options.firmwareVersion The firmware version of the device to apply the state to.\n * Use this to ensure the state will still be compatible after an update.\n * @returns An explanation of why this state cannot be set to this channel.\n */\n public async canSetState(\n state: string,\n options: IlluminatorChannel.CanSetStateOptions = {}\n ): Promise<string | null> {\n const {\n firmwareVersion,\n } = options;\n const request: requests.CanSetStateRequest & gateway.Message = {\n ...requests.CanSetStateRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n state: state,\n firmwareVersion: firmwareVersion,\n toBinary() {\n return requests.CanSetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.CanSetStateAxisResponse>(\n 'device/can_set_axis_state',\n request,\n requests.CanSetStateAxisResponse.fromBinary);\n return response.error ?? null;\n }\n\n /**\n * Returns a string that represents the channel.\n * @returns A string that represents the channel.\n */\n public toString(): string {\n const request: requests.AxisToStringRequest & gateway.Message = {\n ...requests.AxisToStringRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n typeOverride: 'Channel',\n toBinary() {\n return requests.AxisToStringRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/axis_to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace IlluminatorChannel {\n export interface GenericCommandOptions {\n /**\n * Controls whether to throw an exception when the device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface GenericCommandMultiResponseOptions {\n /**\n * Controls whether to throw an exception when a device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface CanSetStateOptions {\n /**\n * The firmware version of the device to apply the state to.\n * Use this to ensure the state will still be compatible after an update.\n */\n firmwareVersion?: FirmwareVersion;\n }\n}\n"]}
1
+ {"version":3,"file":"illuminator_channel.js","sourceRoot":"","sources":["../../../src/microscopy/illuminator_channel.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,sDAAwC;AACxC,wCAAqC;AACrC,8CAA+C;AAC/C,0DAAsD;AACtD,gDAA6C;AAC7C,gDAA6C;AAE7C,oCAAgD;AAIhD;;;GAGG;AACH,MAAa,kBAAkB;IAC7B;;OAEG;IACH,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAGD;;OAEG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAKD;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAGD;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAGD;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAA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AC;QAC/C,OAAO,QAAQ,CAAC,KAAK,IAAI,IAAI,CAAC;IAChC,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,MAAM,OAAO,GAAmD;YAC9D,GAAG,QAAQ,CAAC,mBAAmB,CAAC,OAAO;YACvC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW;YAC3D,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,aAAa;YAC7C,IAAI,EAAE,IAAI,CAAC,aAAa;YACxB,YAAY,EAAE,SAAS;YACvB,QAAQ;gBACN,OAAO,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACrD,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,uBAAuB,EACvB,OAAO,EACP,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACtC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;CACF;AA7XD,gDA6XC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { Axis } from '../ascii/axis';\nimport { AxisStorage } from '../ascii/storage';\nimport { AxisSettings } from '../ascii/axis_settings';\nimport { Warnings } from '../ascii/warnings';\nimport { Response } from '../ascii/response';\nimport type { Illuminator } from './illuminator';\nimport { SetStateAxisResponse } from '../ascii';\nimport { FirmwareVersion } from '../firmware_version';\nimport { Measurement } from '../measurement';\n\n/**\n * Use to control a channel (LED lamp) on an illuminator.\n * Requires at least Firmware 7.09.\n */\nexport class IlluminatorChannel {\n /**\n * Illuminator of this channel.\n */\n public get illuminator(): Illuminator {\n return this._illuminator;\n }\n private _illuminator: Illuminator;\n\n /**\n * The channel number identifies the channel on the illuminator.\n */\n public get channelNumber(): number {\n return this._channelNumber;\n }\n private _channelNumber: number;\n\n private _axis: Axis;\n\n /**\n * Settings and properties of this channel.\n */\n public get settings(): AxisSettings {\n return this._settings;\n }\n private _settings: AxisSettings;\n\n /**\n * Key-value storage of this channel.\n */\n public get storage(): AxisStorage {\n return this._storage;\n }\n private _storage: AxisStorage;\n\n /**\n * Warnings and faults of this channel.\n */\n public get warnings(): Warnings {\n return this._warnings;\n }\n private _warnings: Warnings;\n\n constructor(illuminator: Illuminator, channelNumber: number) {\n this._illuminator = illuminator;\n this._channelNumber = channelNumber;\n this._axis = new Axis(illuminator.device, channelNumber);\n this._settings = new AxisSettings(this._axis);\n this._storage = new AxisStorage(this._axis);\n this._warnings = new Warnings(illuminator.device, channelNumber);\n }\n\n /**\n * Turns this channel on.\n * @param duration Duration for which to turn the channel on.\n * If not specified, the channel remains on until turned off.\n */\n public async on(\n duration?: Measurement\n ): Promise<void> {\n const request: requests.ChannelOn & gateway.Message = {\n ...requests.ChannelOn.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n on: true,\n duration: duration,\n toBinary() {\n return requests.ChannelOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('illuminator/on', request);\n }\n\n /**\n * Turns this channel off.\n */\n public async off(): Promise<void> {\n const request: requests.ChannelOn & gateway.Message = {\n ...requests.ChannelOn.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n on: false,\n toBinary() {\n return requests.ChannelOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('illuminator/on', request);\n }\n\n /**\n * Turns this channel on or off.\n * @param on True to turn channel on, false to turn it off.\n */\n public async setOn(\n on: boolean\n ): Promise<void> {\n const request: requests.ChannelOn & gateway.Message = {\n ...requests.ChannelOn.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n on: on,\n toBinary() {\n return requests.ChannelOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('illuminator/on', request);\n }\n\n /**\n * Checks if this channel is on.\n * @returns True if channel is on, false otherwise.\n */\n public async isOn(): Promise<boolean> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.BoolResponse>(\n 'illuminator/is_on',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sets channel intensity as a fraction of the maximum flux.\n * @param intensity Fraction of intensity to set (between 0 and 1).\n */\n public async setIntensity(\n intensity: number\n ): Promise<void> {\n const request: requests.ChannelSetIntensity & gateway.Message = {\n ...requests.ChannelSetIntensity.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n intensity: intensity,\n toBinary() {\n return requests.ChannelSetIntensity.toBinary(this);\n },\n };\n\n await gateway.callAsync('illuminator/set_intensity', request);\n }\n\n /**\n * Gets the current intensity of this channel.\n * @returns Current intensity as fraction of maximum flux.\n */\n public async getIntensity(): Promise<number> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'illuminator/get_intensity',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sends a generic ASCII command to this channel.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns A response to the command.\n */\n public async genericCommand(\n command: string,\n options: IlluminatorChannel.GenericCommandOptions = {}\n ): Promise<Response> {\n const {\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n command: command,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<Response>(\n 'interface/generic_command',\n request,\n Response.fromBinary);\n return response;\n }\n\n /**\n * Sends a generic ASCII command to this channel and expects multiple responses.\n * Responses are returned in order of arrival.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.checkErrors=true] Controls whether to throw an exception when a device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns All responses to the command.\n */\n public async genericCommandMultiResponse(\n command: string,\n options: IlluminatorChannel.GenericCommandMultiResponseOptions = {}\n ): Promise<Response[]> {\n const {\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n command: command,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.GenericCommandResponseCollection>(\n 'interface/generic_command_multi_response',\n request,\n requests.GenericCommandResponseCollection.fromBinary);\n return response.responses;\n }\n\n /**\n * Sends a generic ASCII command to this channel without expecting a response and without adding a message ID\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n */\n public async genericCommandNoResponse(\n command: string\n ): Promise<void> {\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n command: command,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Returns a serialization of the current channel state that can be saved and reapplied.\n * @returns A serialization of the current state of the channel.\n */\n public async getState(): Promise<string> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.StringResponse>(\n 'device/get_state',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Applies a saved state to this channel.\n * @param state The state object to apply to this channel.\n * @returns Reports of any issues that were handled, but caused the state to not be exactly restored.\n */\n public async setState(\n state: string\n ): Promise<SetStateAxisResponse> {\n const request: requests.SetStateRequest & gateway.Message = {\n ...requests.SetStateRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n state: state,\n toBinary() {\n return requests.SetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<SetStateAxisResponse>(\n 'device/set_axis_state',\n request,\n SetStateAxisResponse.fromBinary);\n return response;\n }\n\n /**\n * Checks if a state can be applied to this channel.\n * This only covers exceptions that can be determined statically such as mismatches of ID or version,\n * the process of applying the state can still fail when running.\n * @param state The state object to check against.\n * @param options.firmwareVersion The firmware version of the device to apply the state to.\n * Use this to ensure the state will still be compatible after an update.\n * @returns An explanation of why this state cannot be set to this channel.\n */\n public async canSetState(\n state: string,\n options: IlluminatorChannel.CanSetStateOptions = {}\n ): Promise<string | null> {\n const {\n firmwareVersion,\n } = options;\n const request: requests.CanSetStateRequest & gateway.Message = {\n ...requests.CanSetStateRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n state: state,\n firmwareVersion: firmwareVersion,\n toBinary() {\n return requests.CanSetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.CanSetStateAxisResponse>(\n 'device/can_set_axis_state',\n request,\n requests.CanSetStateAxisResponse.fromBinary);\n return response.error ?? null;\n }\n\n /**\n * Returns a string that represents the channel.\n * @returns A string that represents the channel.\n */\n public toString(): string {\n const request: requests.AxisToStringRequest & gateway.Message = {\n ...requests.AxisToStringRequest.DEFAULT,\n interfaceId: this.illuminator.device.connection.interfaceId,\n device: this.illuminator.device.deviceAddress,\n axis: this.channelNumber,\n typeOverride: 'Channel',\n toBinary() {\n return requests.AxisToStringRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/axis_to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace IlluminatorChannel {\n export interface GenericCommandOptions {\n /**\n * Controls whether to throw an exception when the device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface GenericCommandMultiResponseOptions {\n /**\n * Controls whether to throw an exception when a device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface CanSetStateOptions {\n /**\n * The firmware version of the device to apply the state to.\n * Use this to ensure the state will still be compatible after an update.\n */\n firmwareVersion?: FirmwareVersion;\n }\n}\n"]}
@@ -1,9 +1,11 @@
1
1
  import { BSON } from 'bson';
2
+ import { Measurement } from '../measurement';
2
3
  export interface ChannelOn {
3
4
  interfaceId: number;
4
5
  device: number;
5
6
  axis: number;
6
7
  on: boolean;
8
+ duration?: (Measurement | null);
7
9
  }
8
10
  export declare const ChannelOn: {
9
11
  fromBinary: (buffer: Uint8Array) => ChannelOn;
@@ -1 +1 @@
1
- {"version":3,"file":"channel_on.d.ts","sourceRoot":"","sources":["../../../src/requests/channel_on.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B,MAAM,WAAW,SAAS;IACxB,WAAW,EAAE,MAAM,CAAC;IAEpB,MAAM,EAAE,MAAM,CAAC;IAEf,IAAI,EAAE,MAAM,CAAC;IAEb,EAAE,EAAE,OAAO,CAAC;CAEb;AAED,eAAO,MAAM,SAAS;yBACC,UAAU,KAAG,SAAS;sBACzB,SAAS,KAAG,UAAU;;sBAOtB,SAAS,KAAG,SAAS;qBAUtB,KAAK,QAAQ,KAAG,SAAS;CAM3C,CAAC"}
1
+ {"version":3,"file":"channel_on.d.ts","sourceRoot":"","sources":["../../../src/requests/channel_on.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,WAAW,SAAS;IACxB,WAAW,EAAE,MAAM,CAAC;IAEpB,MAAM,EAAE,MAAM,CAAC;IAEf,IAAI,EAAE,MAAM,CAAC;IAEb,EAAE,EAAE,OAAO,CAAC;IAEZ,QAAQ,CAAC,EAAE,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CAEjC;AAED,eAAO,MAAM,SAAS;yBACC,UAAU,KAAG,SAAS;sBACzB,SAAS,KAAG,UAAU;;sBAQtB,SAAS,KAAG,SAAS;qBAWtB,KAAK,QAAQ,KAAG,SAAS;CAO3C,CAAC"}
@@ -4,6 +4,7 @@ exports.ChannelOn = void 0;
4
4
  /* This file is generated. Do not modify by hand. */
5
5
  const bson_1 = require("bson");
6
6
  const sanitizer_1 = require("../gateway/sanitizer");
7
+ const measurement_1 = require("../measurement");
7
8
  exports.ChannelOn = {
8
9
  fromBinary: (buffer) => exports.ChannelOn.convert(bson_1.BSON.deserialize(buffer, { useBigInt64: true })),
9
10
  toBinary: (value) => bson_1.BSON.serialize(exports.ChannelOn.sanitize(value)),
@@ -12,6 +13,7 @@ exports.ChannelOn = {
12
13
  device: 0,
13
14
  axis: 0,
14
15
  on: false,
16
+ duration: null,
15
17
  }),
16
18
  sanitize: (value) => {
17
19
  if (value == null) {
@@ -25,6 +27,7 @@ exports.ChannelOn = {
25
27
  device: sanitizer_1.sanitizer.sanitizeInt(value.device, 'device'),
26
28
  axis: sanitizer_1.sanitizer.sanitizeInt(value.axis, 'axis'),
27
29
  on: sanitizer_1.sanitizer.sanitizeBool(value.on, 'on'),
30
+ duration: value.duration != null ? measurement_1.Measurement.sanitize(value.duration) : null,
28
31
  };
29
32
  },
30
33
  convert: (value) => ({
@@ -32,6 +35,7 @@ exports.ChannelOn = {
32
35
  device: value.device,
33
36
  axis: value.axis,
34
37
  on: value.on,
38
+ duration: value.duration,
35
39
  })
36
40
  };
37
41
  //# sourceMappingURL=channel_on.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"channel_on.js","sourceRoot":"","sources":["../../../src/requests/channel_on.ts"],"names":[],"mappings":";;;AAAA,oDAAoD;AACpD,+BAA4B;AAC5B,oDAAiD;AAapC,QAAA,SAAS,GAAG;IACvB,UAAU,EAAE,CAAC,MAAkB,EAAa,EAAE,CAAC,iBAAS,CAAC,OAAO,CAAC,WAAI,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;IACjH,QAAQ,EAAE,CAAC,KAAgB,EAAc,EAAE,CAAC,WAAI,CAAC,SAAS,CAAC,iBAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACrF,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;QACrB,WAAW,EAAE,CAAC;QACd,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,CAAC;QACP,EAAE,EAAE,KAAK;KACV,CAAwB;IACzB,QAAQ,EAAE,CAAC,KAAgB,EAAa,EAAE;QACxC,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAAC,MAAM,IAAI,SAAS,CAAC,sDAAsD,CAAC,CAAA;QAAC,CAAC;QAClG,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAAC,MAAM,IAAI,SAAS,CAAC,qCAAqC,OAAO,KAAK,GAAG,CAAC,CAAA;QAAC,CAAC;QAC5G,OAAO;YACL,WAAW,EAAE,qBAAS,CAAC,WAAW,CAAC,KAAK,CAAC,WAAW,EAAE,aAAa,CAAC;YACpE,MAAM,EAAE,qBAAS,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC;YACrD,IAAI,EAAE,qBAAS,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC;YAC/C,EAAE,EAAE,qBAAS,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC;SAC3C,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,CAAC,KAAoB,EAAa,EAAE,CAAC,CAAC;QAC7C,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,EAAE,EAAE,KAAK,CAAC,EAAE;KACb,CAAC;CACH,CAAC","sourcesContent":["/* This file is generated. Do not modify by hand. */\nimport { BSON } from 'bson';\nimport { sanitizer } from '../gateway/sanitizer';\n\nexport interface ChannelOn {\n interfaceId: number;\n\n device: number;\n\n axis: number;\n\n on: boolean;\n\n}\n\nexport const ChannelOn = {\n fromBinary: (buffer: Uint8Array): ChannelOn => ChannelOn.convert(BSON.deserialize(buffer, { useBigInt64: true })),\n toBinary: (value: ChannelOn): Uint8Array => BSON.serialize(ChannelOn.sanitize(value)),\n DEFAULT: Object.freeze({\n interfaceId: 0,\n device: 0,\n axis: 0,\n on: false,\n }) as Readonly<ChannelOn>,\n sanitize: (value: ChannelOn): ChannelOn => {\n if (value == null) { throw new TypeError('Expected ChannelOn object but got null or undefined.') }\n if (typeof value !== 'object') { throw new TypeError(`Expected ChannelOn object but got ${typeof value}.`) }\n return {\n interfaceId: sanitizer.sanitizeInt(value.interfaceId, 'interfaceId'),\n device: sanitizer.sanitizeInt(value.device, 'device'),\n axis: sanitizer.sanitizeInt(value.axis, 'axis'),\n on: sanitizer.sanitizeBool(value.on, 'on'),\n };\n },\n convert: (value: BSON.Document): ChannelOn => ({\n interfaceId: value.interfaceId,\n device: value.device,\n axis: value.axis,\n on: value.on,\n })\n};\n"]}
1
+ {"version":3,"file":"channel_on.js","sourceRoot":"","sources":["../../../src/requests/channel_on.ts"],"names":[],"mappings":";;;AAAA,oDAAoD;AACpD,+BAA4B;AAC5B,oDAAiD;AACjD,gDAA6C;AAehC,QAAA,SAAS,GAAG;IACvB,UAAU,EAAE,CAAC,MAAkB,EAAa,EAAE,CAAC,iBAAS,CAAC,OAAO,CAAC,WAAI,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;IACjH,QAAQ,EAAE,CAAC,KAAgB,EAAc,EAAE,CAAC,WAAI,CAAC,SAAS,CAAC,iBAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACrF,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;QACrB,WAAW,EAAE,CAAC;QACd,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,CAAC;QACP,EAAE,EAAE,KAAK;QACT,QAAQ,EAAE,IAAI;KACf,CAAwB;IACzB,QAAQ,EAAE,CAAC,KAAgB,EAAa,EAAE;QACxC,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAAC,MAAM,IAAI,SAAS,CAAC,sDAAsD,CAAC,CAAA;QAAC,CAAC;QAClG,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAAC,MAAM,IAAI,SAAS,CAAC,qCAAqC,OAAO,KAAK,GAAG,CAAC,CAAA;QAAC,CAAC;QAC5G,OAAO;YACL,WAAW,EAAE,qBAAS,CAAC,WAAW,CAAC,KAAK,CAAC,WAAW,EAAE,aAAa,CAAC;YACpE,MAAM,EAAE,qBAAS,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC;YACrD,IAAI,EAAE,qBAAS,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC;YAC/C,EAAE,EAAE,qBAAS,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC;YAC1C,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,yBAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI;SAC/E,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,CAAC,KAAoB,EAAa,EAAE,CAAC,CAAC;QAC7C,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,EAAE,EAAE,KAAK,CAAC,EAAE;QACZ,QAAQ,EAAE,KAAK,CAAC,QAAQ;KACzB,CAAC;CACH,CAAC","sourcesContent":["/* This file is generated. Do not modify by hand. */\nimport { BSON } from 'bson';\nimport { sanitizer } from '../gateway/sanitizer';\nimport { Measurement } from '../measurement';\n\nexport interface ChannelOn {\n interfaceId: number;\n\n device: number;\n\n axis: number;\n\n on: boolean;\n\n duration?: (Measurement | null);\n\n}\n\nexport const ChannelOn = {\n fromBinary: (buffer: Uint8Array): ChannelOn => ChannelOn.convert(BSON.deserialize(buffer, { useBigInt64: true })),\n toBinary: (value: ChannelOn): Uint8Array => BSON.serialize(ChannelOn.sanitize(value)),\n DEFAULT: Object.freeze({\n interfaceId: 0,\n device: 0,\n axis: 0,\n on: false,\n duration: null,\n }) as Readonly<ChannelOn>,\n sanitize: (value: ChannelOn): ChannelOn => {\n if (value == null) { throw new TypeError('Expected ChannelOn object but got null or undefined.') }\n if (typeof value !== 'object') { throw new TypeError(`Expected ChannelOn object but got ${typeof value}.`) }\n return {\n interfaceId: sanitizer.sanitizeInt(value.interfaceId, 'interfaceId'),\n device: sanitizer.sanitizeInt(value.device, 'device'),\n axis: sanitizer.sanitizeInt(value.axis, 'axis'),\n on: sanitizer.sanitizeBool(value.on, 'on'),\n duration: value.duration != null ? Measurement.sanitize(value.duration) : null,\n };\n },\n convert: (value: BSON.Document): ChannelOn => ({\n interfaceId: value.interfaceId,\n device: value.device,\n axis: value.axis,\n on: value.on,\n duration: value.duration,\n })\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaber/motion",
3
- "version": "7.14.0",
3
+ "version": "7.15.0-beta.1",
4
4
  "description": "Zaber Motion Library is a multi-platform library used to operate Zaber devices.",
5
5
  "keywords": [],
6
6
  "main": "dist/lib/index.js",