@zaber/motion 7.2.1 → 7.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/binding/wasm/zaber-motion-core.wasm +0 -0
- package/dist/lib/ascii/all_axes.d.ts +9 -0
- package/dist/lib/ascii/all_axes.d.ts.map +1 -1
- package/dist/lib/ascii/all_axes.js.map +1 -1
- package/dist/lib/ascii/axis.d.ts +137 -0
- package/dist/lib/ascii/axis.d.ts.map +1 -1
- package/dist/lib/ascii/axis.js.map +1 -1
- package/dist/lib/ascii/connection.d.ts +71 -0
- package/dist/lib/ascii/connection.d.ts.map +1 -1
- package/dist/lib/ascii/connection.js.map +1 -1
- package/dist/lib/ascii/device.d.ts +32 -0
- package/dist/lib/ascii/device.d.ts.map +1 -1
- package/dist/lib/ascii/device.js.map +1 -1
- package/dist/lib/ascii/lockstep.d.ts +108 -0
- package/dist/lib/ascii/lockstep.d.ts.map +1 -1
- package/dist/lib/ascii/lockstep.js.map +1 -1
- package/dist/lib/ascii/pvt_sequence.d.ts +3 -0
- package/dist/lib/ascii/pvt_sequence.d.ts.map +1 -1
- package/dist/lib/ascii/pvt_sequence.js.map +1 -1
- package/dist/lib/ascii/servo_tuner.d.ts +9 -1
- package/dist/lib/ascii/servo_tuner.d.ts.map +1 -1
- package/dist/lib/ascii/servo_tuner.js +4 -1
- package/dist/lib/ascii/servo_tuner.js.map +1 -1
- package/dist/lib/ascii/storage.d.ts +24 -0
- package/dist/lib/ascii/storage.d.ts.map +1 -1
- package/dist/lib/ascii/storage.js.map +1 -1
- package/dist/lib/ascii/stream.d.ts +3 -0
- package/dist/lib/ascii/stream.d.ts.map +1 -1
- package/dist/lib/ascii/stream.js.map +1 -1
- package/dist/lib/binary/connection.d.ts +26 -0
- package/dist/lib/binary/connection.d.ts.map +1 -1
- package/dist/lib/binary/connection.js.map +1 -1
- package/dist/lib/binary/device.d.ts +39 -1
- package/dist/lib/binary/device.d.ts.map +1 -1
- package/dist/lib/binary/device.js +8 -3
- package/dist/lib/binary/device.js.map +1 -1
- package/dist/lib/gcode/translator.d.ts +3 -0
- package/dist/lib/gcode/translator.d.ts.map +1 -1
- package/dist/lib/gcode/translator.js.map +1 -1
- package/dist/lib/library.js +1 -1
- package/dist/lib/library.js.map +1 -1
- package/dist/lib/microscopy/camera_trigger.d.ts +3 -0
- package/dist/lib/microscopy/camera_trigger.d.ts.map +1 -1
- package/dist/lib/microscopy/camera_trigger.js.map +1 -1
- package/dist/lib/microscopy/illuminator.d.ts +3 -0
- package/dist/lib/microscopy/illuminator.d.ts.map +1 -1
- package/dist/lib/microscopy/illuminator.js.map +1 -1
- package/dist/lib/microscopy/illuminator_channel.d.ts +14 -0
- package/dist/lib/microscopy/illuminator_channel.d.ts.map +1 -1
- package/dist/lib/microscopy/illuminator_channel.js.map +1 -1
- package/dist/lib/microscopy/microscope.d.ts +3 -0
- package/dist/lib/microscopy/microscope.d.ts.map +1 -1
- package/dist/lib/microscopy/microscope.js.map +1 -1
- package/dist/lib/microscopy/objective_changer.d.ts +9 -0
- package/dist/lib/microscopy/objective_changer.d.ts.map +1 -1
- package/dist/lib/microscopy/objective_changer.js.map +1 -1
- package/dist/lib/microscopy/wdi_autofocus_provider.d.ts +15 -0
- package/dist/lib/microscopy/wdi_autofocus_provider.d.ts.map +1 -1
- package/dist/lib/microscopy/wdi_autofocus_provider.js.map +1 -1
- package/dist/lib/product/process.d.ts +14 -0
- package/dist/lib/product/process.d.ts.map +1 -1
- package/dist/lib/product/process.js.map +1 -1
- package/dist/lib/requests/set_servo_tuning_request.d.ts +1 -0
- package/dist/lib/requests/set_servo_tuning_request.d.ts.map +1 -1
- package/dist/lib/requests/set_servo_tuning_request.js +2 -0
- package/dist/lib/requests/set_servo_tuning_request.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"microscope.js","sourceRoot":"","sources":["../../../src/microscopy/microscope.ts"],"names":[],"mappings":";AAAA,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,OAAO;YACpB,QAAQ;gBACN,OAAO,QAAQ,CAAC,sBAAsB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACxD,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,sBAAsB,EACtB,OAAO,EACP,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACtC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;CACF;AAhMD,gCAgMC","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 { 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';\nimport { Autofocus } from './autofocus';\nimport { CameraTrigger } from './camera_trigger';\nimport { ThirdPartyComponents } from './third_party_components';\n\n/**\n * Represent a microscope.\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 * The autofocus feature.\n */\n public get autofocus(): Autofocus | undefined {\n return this._autofocus;\n }\n private _autofocus: Autofocus | undefined;\n\n /**\n * The camera trigger.\n */\n public get cameraTrigger(): CameraTrigger | undefined {\n return this._cameraTrigger;\n }\n private _cameraTrigger: CameraTrigger | 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.fromBinary(MicroscopeConfig.toBinary(config));\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 this._autofocus = config.autofocus && this._focusAxis ? new Autofocus(config.autofocus, this._focusAxis, this._objectiveChanger?.turret) : undefined;\n this._cameraTrigger = config.cameraTrigger?.device ? new CameraTrigger(new Device(connection, config.cameraTrigger.device), config.cameraTrigger.channel) : undefined;\n }\n\n /**\n * Finds a microscope on a connection.\n * @param connection Connection on which to detect the microscope.\n * @param thirdPartyComponents Third party components of the microscope that cannot be found on the connection.\n * @returns New instance of microscope.\n */\n public static async find(\n connection: Connection,\n thirdPartyComponents?: ThirdPartyComponents\n ): Promise<Microscope> {\n const request: requests.MicroscopeFindRequest & gateway.Message = {\n ...requests.MicroscopeFindRequest.DEFAULT,\n interfaceId: connection.interfaceId,\n thirdParty: thirdPartyComponents,\n toBinary() {\n return requests.MicroscopeFindRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.MicroscopeConfigResponse>(\n 'microscope/detect',\n request,\n requests.MicroscopeConfigResponse.fromBinary);\n return new Microscope(connection, response.config);\n }\n\n /**\n * Initializes the microscope.\n * Homes all axes, filter changer, and objective changer if they require it.\n * @param [options.force=false] Forces all devices to home even when not required.\n */\n public async initialize(\n options: Microscope.InitializeOptions = {}\n ): Promise<void> {\n const {\n force = false,\n } = options;\n const request: requests.MicroscopeInitRequest & gateway.Message = {\n ...requests.MicroscopeInitRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n config: this._config,\n force: force,\n toBinary() {\n return requests.MicroscopeInitRequest.toBinary(this);\n },\n };\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: requests.MicroscopeEmptyRequest & gateway.Message = {\n ...requests.MicroscopeEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n config: this._config,\n toBinary() {\n return requests.MicroscopeEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.BoolResponse>(\n 'microscope/is_initialized',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\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: requests.MicroscopeEmptyRequest & gateway.Message = {\n ...requests.MicroscopeEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n config: this._config,\n toBinary() {\n return requests.MicroscopeEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'microscope/to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace Microscope {\n export interface InitializeOptions {\n force?: boolean;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"microscope.js","sourceRoot":"","sources":["../../../src/microscopy/microscope.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,sDAAwC;AACxC,wCAAqC;AACrC,oDAAgD;AAChD,4CAAyC;AAEzC,+CAA4C;AAC5C,2DAAuD;AACvD,2DAAuD;AACvD,qDAAiD;AACjD,2CAAwC;AACxC,qDAAiD;AAGjD;;;;GAIG;AACH,MAAa,UAAU;IACrB;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAKD;;OAEG;IACH,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAGD;;OAEG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAGD;;OAEG;IACH,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAGD;;OAEG;IACH,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAGD;;OAEG;IACH,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAGD;;OAEG;IACH,IAAW,gBAAgB;QACzB,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAChC,CAAC;IAGD;;OAEG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAGD;;OAEG;IACH,IAAW,SAAS;QAClB,OAAO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,CAAC,SAAS,CACtC,2BAA2B,EAC3B,OAAO,EACP,QAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QACpC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,MAAM,OAAO,GAAsD;YACjE,GAAG,QAAQ,CAAC,sBAAsB,CAAC,OAAO;YAC1C,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,WAAW;YACxC,MAAM,EAAE,IAAI,CAAC,OAAO;YACpB,QAAQ;gBACN,OAAO,QAAQ,CAAC,sBAAsB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACxD,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,sBAAsB,EACtB,OAAO,EACP,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACtC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;CACF;AAhMD,gCAgMC","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 { 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';\nimport { Autofocus } from './autofocus';\nimport { CameraTrigger } from './camera_trigger';\nimport { ThirdPartyComponents } from './third_party_components';\n\n/**\n * Represent a microscope.\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 * The autofocus feature.\n */\n public get autofocus(): Autofocus | undefined {\n return this._autofocus;\n }\n private _autofocus: Autofocus | undefined;\n\n /**\n * The camera trigger.\n */\n public get cameraTrigger(): CameraTrigger | undefined {\n return this._cameraTrigger;\n }\n private _cameraTrigger: CameraTrigger | 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.fromBinary(MicroscopeConfig.toBinary(config));\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 this._autofocus = config.autofocus && this._focusAxis ? new Autofocus(config.autofocus, this._focusAxis, this._objectiveChanger?.turret) : undefined;\n this._cameraTrigger = config.cameraTrigger?.device ? new CameraTrigger(new Device(connection, config.cameraTrigger.device), config.cameraTrigger.channel) : undefined;\n }\n\n /**\n * Finds a microscope on a connection.\n * @param connection Connection on which to detect the microscope.\n * @param thirdPartyComponents Third party components of the microscope that cannot be found on the connection.\n * @returns New instance of microscope.\n */\n public static async find(\n connection: Connection,\n thirdPartyComponents?: ThirdPartyComponents\n ): Promise<Microscope> {\n const request: requests.MicroscopeFindRequest & gateway.Message = {\n ...requests.MicroscopeFindRequest.DEFAULT,\n interfaceId: connection.interfaceId,\n thirdParty: thirdPartyComponents,\n toBinary() {\n return requests.MicroscopeFindRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.MicroscopeConfigResponse>(\n 'microscope/detect',\n request,\n requests.MicroscopeConfigResponse.fromBinary);\n return new Microscope(connection, response.config);\n }\n\n /**\n * Initializes the microscope.\n * Homes all axes, filter changer, and objective changer if they require it.\n * @param [options.force=false] Forces all devices to home even when not required.\n */\n public async initialize(\n options: Microscope.InitializeOptions = {}\n ): Promise<void> {\n const {\n force = false,\n } = options;\n const request: requests.MicroscopeInitRequest & gateway.Message = {\n ...requests.MicroscopeInitRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n config: this._config,\n force: force,\n toBinary() {\n return requests.MicroscopeInitRequest.toBinary(this);\n },\n };\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: requests.MicroscopeEmptyRequest & gateway.Message = {\n ...requests.MicroscopeEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n config: this._config,\n toBinary() {\n return requests.MicroscopeEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.BoolResponse>(\n 'microscope/is_initialized',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\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: requests.MicroscopeEmptyRequest & gateway.Message = {\n ...requests.MicroscopeEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n config: this._config,\n toBinary() {\n return requests.MicroscopeEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'microscope/to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace Microscope {\n export interface InitializeOptions {\n /**\n * Forces all devices to home even when not required.\n */\n force?: boolean;\n }\n}\n"]}
|
|
@@ -87,10 +87,19 @@ export declare class ObjectiveChanger {
|
|
|
87
87
|
}
|
|
88
88
|
declare namespace ObjectiveChanger {
|
|
89
89
|
interface FindOptions {
|
|
90
|
+
/**
|
|
91
|
+
* Optional device address of the turret device (X-MOR).
|
|
92
|
+
*/
|
|
90
93
|
turretAddress?: number;
|
|
94
|
+
/**
|
|
95
|
+
* Optional device address of the focus device (X-LDA).
|
|
96
|
+
*/
|
|
91
97
|
focusAddress?: number;
|
|
92
98
|
}
|
|
93
99
|
interface ChangeOptions {
|
|
100
|
+
/**
|
|
101
|
+
* Optional offset from the focus datum.
|
|
102
|
+
*/
|
|
94
103
|
focusOffset?: Measurement;
|
|
95
104
|
}
|
|
96
105
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objective_changer.d.ts","sourceRoot":"","sources":["../../../src/microscopy/objective_changer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,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WAAW;QACxB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,YAAY,CAAC,EAAE,MAAM,CAAC;KACzB;IACD,UAAiB,aAAa;QAC1B,WAAW,CAAC,EAAE,WAAW,CAAC;KAC7B;CACF"}
|
|
1
|
+
{"version":3,"file":"objective_changer.d.ts","sourceRoot":"","sources":["../../../src/microscopy/objective_changer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAS,MAAM,UAAU,CAAC;AAExD;;;;GAIG;AACH,qBAAa,gBAAgB;IAC3B;;OAEG;IACH,IAAW,MAAM,IAAI,MAAM,CAE1B;IACD,OAAO,CAAC,OAAO,CAAS;IAExB;;OAEG;IACH,IAAW,SAAS,IAAI,IAAI,CAE3B;IACD,OAAO,CAAC,UAAU,CAAO;IAEzB;;;OAGG;gBACS,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI;IAM3C;;;;;;;;;;OAUG;WACiB,IAAI,CACtB,UAAU,EAAE,UAAU,EACtB,OAAO,GAAE,gBAAgB,CAAC,WAAgB,GACzC,OAAO,CAAC,gBAAgB,CAAC;IAsB5B;;;;;;OAMG;IACU,MAAM,CACjB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,gBAAgB,CAAC,aAAkB,GAC3C,OAAO,CAAC,IAAI,CAAC;IAoBhB;;OAEG;IACU,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAerC;;;;OAIG;IACU,mBAAmB,IAAI,OAAO,CAAC,MAAM,CAAC;IAkBnD;;;OAGG;IACU,qBAAqB,IAAI,OAAO,CAAC,MAAM,CAAC;IAkBrD;;;;;;OAMG;IACU,aAAa,CACxB,IAAI,GAAE,MAAM,GAAG,KAAK,GAAG,MAAqB,GAC3C,OAAO,CAAC,MAAM,CAAC;IAoBlB;;;;;;OAMG;IACU,aAAa,CACxB,KAAK,EAAE,MAAM,EACb,IAAI,GAAE,MAAM,GAAG,KAAK,GAAG,MAAqB,GAC3C,OAAO,CAAC,IAAI,CAAC;IAiBhB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAexB;;;OAGG;IACI,QAAQ,IAAI,MAAM;CAgB1B;AAED,kBAAU,gBAAgB,CAAC;IACzB,UAAiB,WAAW;QACxB;;WAEG;QACH,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB;;WAEG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC;KACzB;IACD,UAAiB,aAAa;QAC1B;;WAEG;QACH,WAAW,CAAC,EAAE,WAAW,CAAC;KAC7B;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objective_changer.js","sourceRoot":"","sources":["../../../src/microscopy/objective_changer.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AAEtC,4CAAyC;AACzC,wCAAqC;AAErC,sDAAwC;AACxC,oCAAwD;AAExD;;;;GAIG;AACH,MAAa,gBAAgB;IAC3B;;OAEG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAGD;;OAEG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAGD;;;OAGG;IACH,YAAY,MAAc,EAAE,SAAe;QACzC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAED;;;;;;;;;;OAUG;IACI,MAAM,CAAC,KAAK,CAAC,IAAI,CACtB,UAAsB,EACtB,U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AO,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;AA1PD,4CA0PC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport { Connection } from '../ascii/connection';\nimport { Device } from '../ascii/device';\nimport { Axis } from '../ascii/axis';\nimport { Measurement } from '../measurement';\nimport * as requests from '../requests';\nimport { Angle, Length, Native, Units } from '../units';\n\n/**\n * Represents an objective changer of a microscope.\n * Unstable. Expect breaking changes in future releases.\n * Requires at least Firmware 7.32.\n */\nexport class ObjectiveChanger {\n /**\n * Device address of the turret.\n */\n public get turret(): Device {\n return this._turret;\n }\n private _turret: Device;\n\n /**\n * The focus axis.\n */\n public get focusAxis(): Axis {\n return this._focusAxis;\n }\n private _focusAxis: Axis;\n\n /**\n * Creates instance of `ObjectiveChanger` based on the given device.\n * If the device is identified, this constructor will ensure it is an objective changer.\n */\n constructor(turret: Device, focusAxis: Axis) {\n this._turret = turret;\n this._focusAxis = focusAxis;\n this._verifyIsChanger();\n }\n\n /**\n * @deprecated Use microscope's `Find` method instead or instantiate manually.\n *\n * Finds an objective changer on a connection.\n * In case of conflict, specify the optional device addresses.\n * Devices on the connection must be identified.\n * @param connection Connection on which to detect the objective changer.\n * @param [options.turretAddress=0] Optional device address of the turret device (X-MOR).\n * @param [options.focusAddress=0] Optional device address of the focus device (X-LDA).\n * @returns New instance of objective changer.\n */\n public static async find(\n connection: Connection,\n options: ObjectiveChanger.FindOptions = {}\n ): Promise<ObjectiveChanger> {\n const {\n turretAddress = 0,\n focusAddress = 0,\n } = options;\n const request: requests.ObjectiveChangerRequest & gateway.Message = {\n ...requests.ObjectiveChangerRequest.DEFAULT,\n interfaceId: connection.interfaceId,\n turretAddress: turretAddress,\n focusAddress: focusAddress,\n toBinary() {\n return requests.ObjectiveChangerRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.ObjectiveChangerCreateResponse>(\n 'objective_changer/detect',\n request,\n requests.ObjectiveChangerCreateResponse.fromBinary);\n return new ObjectiveChanger(new Device(connection, response.turret), new Axis(new Device(connection, response.focusAddress), response.focusAxis));\n }\n\n /**\n * Changes the objective.\n * Runs a sequence of movements switching from the current objective to the new one.\n * The focus stage moves to the focus datum after the objective change.\n * @param objective Objective number starting from 1.\n * @param options.focusOffset Optional offset from the focus datum.\n */\n public async change(\n objective: number,\n options: ObjectiveChanger.ChangeOptions = {}\n ): Promise<void> {\n const {\n focusOffset,\n } = options;\n const request: requests.ObjectiveChangerChangeRequest & gateway.Message = {\n ...requests.ObjectiveChangerChangeRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n turretAddress: this.turret.deviceAddress,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n objective: objective,\n focusOffset: focusOffset,\n toBinary() {\n return requests.ObjectiveChangerChangeRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('objective_changer/change', request);\n }\n\n /**\n * Moves the focus stage out of the turret releasing the current objective.\n */\n public async release(): Promise<void> {\n const request: requests.ObjectiveChangerRequest & gateway.Message = {\n ...requests.ObjectiveChangerRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n turretAddress: this.turret.deviceAddress,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n toBinary() {\n return requests.ObjectiveChangerRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('objective_changer/release', request);\n }\n\n /**\n * Returns current objective number starting from 1.\n * The value of 0 indicates that the position is either unknown or between two objectives.\n * @returns Current objective number starting from 1 or 0 if not applicable.\n */\n public async getCurrentObjective(): Promise<number> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n device: this.turret.deviceAddress,\n axis: 1,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntResponse>(\n 'device/get_index_position',\n request,\n requests.IntResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Gets number of objectives that the turret can accommodate.\n * @returns Number of positions.\n */\n public async getNumberOfObjectives(): Promise<number> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n device: this.turret.deviceAddress,\n axis: 1,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntResponse>(\n 'device/get_index_count',\n request,\n requests.IntResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Gets the focus datum.\n * The focus datum is the position that the focus stage moves to after an objective change.\n * It is backed by the limit.home.offset setting.\n * @param [unit=Units.NATIVE] Units of datum.\n * @returns The datum.\n */\n public async getFocusDatum(\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<number> {\n const request: requests.ObjectiveChangerSetRequest & gateway.Message = {\n ...requests.ObjectiveChangerSetRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n turretAddress: this.turret.deviceAddress,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n unit: unit,\n toBinary() {\n return requests.ObjectiveChangerSetRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'objective_changer/get_datum',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sets the focus datum.\n * The focus datum is the position that the focus stage moves to after an objective change.\n * It is backed by the limit.home.offset setting.\n * @param datum Value of datum.\n * @param [unit=Units.NATIVE] Units of datum.\n */\n public async setFocusDatum(\n datum: number,\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<void> {\n const request: requests.ObjectiveChangerSetRequest & gateway.Message = {\n ...requests.ObjectiveChangerSetRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n turretAddress: this.turret.deviceAddress,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n value: datum,\n unit: unit,\n toBinary() {\n return requests.ObjectiveChangerSetRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('objective_changer/set_datum', request);\n }\n\n /**\n * Checks if this is a objective changer and throws an error if it is not.\n */\n private _verifyIsChanger(): void {\n const request: requests.ObjectiveChangerRequest & gateway.Message = {\n ...requests.ObjectiveChangerRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n turretAddress: this.turret.deviceAddress,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n toBinary() {\n return requests.ObjectiveChangerRequest.toBinary(this);\n },\n };\n\n gateway.callSync('objective_changer/verify', request);\n }\n\n /**\n * Returns a string that represents the device.\n * @returns A string that represents the device.\n */\n public toString(): string {\n const request: requests.AxisToStringRequest & gateway.Message = {\n ...requests.AxisToStringRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n device: this.turret.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 ObjectiveChanger {\n export interface FindOptions {\n turretAddress?: number;\n focusAddress?: number;\n }\n export interface ChangeOptions {\n focusOffset?: Measurement;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"objective_changer.js","sourceRoot":"","sources":["../../../src/microscopy/objective_changer.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;A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EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,aAAa;YACjD,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU;YACpC,QAAQ;gBACN,OAAO,QAAQ,CAAC,uBAAuB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACzD,CAAC;SACF,CAAC;QAEF,OAAO,CAAC,QAAQ,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC;IACxD,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;AA1PD,4CA0PC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport { Connection } from '../ascii/connection';\nimport { Device } from '../ascii/device';\nimport { Axis } from '../ascii/axis';\nimport { Measurement } from '../measurement';\nimport * as requests from '../requests';\nimport { Angle, Length, Native, Units } from '../units';\n\n/**\n * Represents an objective changer of a microscope.\n * Unstable. Expect breaking changes in future releases.\n * Requires at least Firmware 7.32.\n */\nexport class ObjectiveChanger {\n /**\n * Device address of the turret.\n */\n public get turret(): Device {\n return this._turret;\n }\n private _turret: Device;\n\n /**\n * The focus axis.\n */\n public get focusAxis(): Axis {\n return this._focusAxis;\n }\n private _focusAxis: Axis;\n\n /**\n * Creates instance of `ObjectiveChanger` based on the given device.\n * If the device is identified, this constructor will ensure it is an objective changer.\n */\n constructor(turret: Device, focusAxis: Axis) {\n this._turret = turret;\n this._focusAxis = focusAxis;\n this._verifyIsChanger();\n }\n\n /**\n * @deprecated Use microscope's `Find` method instead or instantiate manually.\n *\n * Finds an objective changer on a connection.\n * In case of conflict, specify the optional device addresses.\n * Devices on the connection must be identified.\n * @param connection Connection on which to detect the objective changer.\n * @param [options.turretAddress=0] Optional device address of the turret device (X-MOR).\n * @param [options.focusAddress=0] Optional device address of the focus device (X-LDA).\n * @returns New instance of objective changer.\n */\n public static async find(\n connection: Connection,\n options: ObjectiveChanger.FindOptions = {}\n ): Promise<ObjectiveChanger> {\n const {\n turretAddress = 0,\n focusAddress = 0,\n } = options;\n const request: requests.ObjectiveChangerRequest & gateway.Message = {\n ...requests.ObjectiveChangerRequest.DEFAULT,\n interfaceId: connection.interfaceId,\n turretAddress: turretAddress,\n focusAddress: focusAddress,\n toBinary() {\n return requests.ObjectiveChangerRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.ObjectiveChangerCreateResponse>(\n 'objective_changer/detect',\n request,\n requests.ObjectiveChangerCreateResponse.fromBinary);\n return new ObjectiveChanger(new Device(connection, response.turret), new Axis(new Device(connection, response.focusAddress), response.focusAxis));\n }\n\n /**\n * Changes the objective.\n * Runs a sequence of movements switching from the current objective to the new one.\n * The focus stage moves to the focus datum after the objective change.\n * @param objective Objective number starting from 1.\n * @param options.focusOffset Optional offset from the focus datum.\n */\n public async change(\n objective: number,\n options: ObjectiveChanger.ChangeOptions = {}\n ): Promise<void> {\n const {\n focusOffset,\n } = options;\n const request: requests.ObjectiveChangerChangeRequest & gateway.Message = {\n ...requests.ObjectiveChangerChangeRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n turretAddress: this.turret.deviceAddress,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n objective: objective,\n focusOffset: focusOffset,\n toBinary() {\n return requests.ObjectiveChangerChangeRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('objective_changer/change', request);\n }\n\n /**\n * Moves the focus stage out of the turret releasing the current objective.\n */\n public async release(): Promise<void> {\n const request: requests.ObjectiveChangerRequest & gateway.Message = {\n ...requests.ObjectiveChangerRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n turretAddress: this.turret.deviceAddress,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n toBinary() {\n return requests.ObjectiveChangerRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('objective_changer/release', request);\n }\n\n /**\n * Returns current objective number starting from 1.\n * The value of 0 indicates that the position is either unknown or between two objectives.\n * @returns Current objective number starting from 1 or 0 if not applicable.\n */\n public async getCurrentObjective(): Promise<number> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n device: this.turret.deviceAddress,\n axis: 1,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntResponse>(\n 'device/get_index_position',\n request,\n requests.IntResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Gets number of objectives that the turret can accommodate.\n * @returns Number of positions.\n */\n public async getNumberOfObjectives(): Promise<number> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n device: this.turret.deviceAddress,\n axis: 1,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntResponse>(\n 'device/get_index_count',\n request,\n requests.IntResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Gets the focus datum.\n * The focus datum is the position that the focus stage moves to after an objective change.\n * It is backed by the limit.home.offset setting.\n * @param [unit=Units.NATIVE] Units of datum.\n * @returns The datum.\n */\n public async getFocusDatum(\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<number> {\n const request: requests.ObjectiveChangerSetRequest & gateway.Message = {\n ...requests.ObjectiveChangerSetRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n turretAddress: this.turret.deviceAddress,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n unit: unit,\n toBinary() {\n return requests.ObjectiveChangerSetRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'objective_changer/get_datum',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sets the focus datum.\n * The focus datum is the position that the focus stage moves to after an objective change.\n * It is backed by the limit.home.offset setting.\n * @param datum Value of datum.\n * @param [unit=Units.NATIVE] Units of datum.\n */\n public async setFocusDatum(\n datum: number,\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<void> {\n const request: requests.ObjectiveChangerSetRequest & gateway.Message = {\n ...requests.ObjectiveChangerSetRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n turretAddress: this.turret.deviceAddress,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n value: datum,\n unit: unit,\n toBinary() {\n return requests.ObjectiveChangerSetRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('objective_changer/set_datum', request);\n }\n\n /**\n * Checks if this is a objective changer and throws an error if it is not.\n */\n private _verifyIsChanger(): void {\n const request: requests.ObjectiveChangerRequest & gateway.Message = {\n ...requests.ObjectiveChangerRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n turretAddress: this.turret.deviceAddress,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n toBinary() {\n return requests.ObjectiveChangerRequest.toBinary(this);\n },\n };\n\n gateway.callSync('objective_changer/verify', request);\n }\n\n /**\n * Returns a string that represents the device.\n * @returns A string that represents the device.\n */\n public toString(): string {\n const request: requests.AxisToStringRequest & gateway.Message = {\n ...requests.AxisToStringRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n device: this.turret.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 ObjectiveChanger {\n export interface FindOptions {\n /**\n * Optional device address of the turret device (X-MOR).\n */\n turretAddress?: number;\n /**\n * Optional device address of the focus device (X-LDA).\n */\n focusAddress?: number;\n }\n export interface ChangeOptions {\n /**\n * Optional offset from the focus datum.\n */\n focusOffset?: Measurement;\n }\n}\n"]}
|
|
@@ -64,12 +64,27 @@ export declare class WdiAutofocusProvider {
|
|
|
64
64
|
}
|
|
65
65
|
declare namespace WdiAutofocusProvider {
|
|
66
66
|
interface GenericReadOptions {
|
|
67
|
+
/**
|
|
68
|
+
* Number of values to read (defaults to 1).
|
|
69
|
+
*/
|
|
67
70
|
count?: number;
|
|
71
|
+
/**
|
|
72
|
+
* Offset within the register (defaults to 0).
|
|
73
|
+
*/
|
|
68
74
|
offset?: number;
|
|
75
|
+
/**
|
|
76
|
+
* Register bank letter (defaults to U for user bank).
|
|
77
|
+
*/
|
|
69
78
|
registerBank?: string;
|
|
70
79
|
}
|
|
71
80
|
interface GenericWriteOptions {
|
|
81
|
+
/**
|
|
82
|
+
* Offset within the register (defaults to 0).
|
|
83
|
+
*/
|
|
72
84
|
offset?: number;
|
|
85
|
+
/**
|
|
86
|
+
* Register bank letter (defaults to U for user bank).
|
|
87
|
+
*/
|
|
73
88
|
registerBank?: string;
|
|
74
89
|
}
|
|
75
90
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wdi_autofocus_provider.d.ts","sourceRoot":"","sources":["../../../src/microscopy/wdi_autofocus_provider.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC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CAAC;QAEF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,gBAAgB,EAChB,OAAO,EACP,QAAQ,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;QAC5C,OAAO,QAAQ,CAAC,MAAM,CAAC;IACzB,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,MAAM,OAAO,GAAqD;YAChE,GAAG,QAAQ,CAAC,qBAAqB,CAAC,OAAO;YACzC,WAAW,EAAE,IAAI,CAAC,UAAU;YAC5B,QAAQ;gBACN,OAAO,QAAQ,CAAC,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACvD,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,eAAe,EACf,OAAO,EACP,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACtC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;;AA3MH,oDA4MC;AA3MC;;GAEG;AACoB,qCAAgB,GAAW,EAAE,CAAC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { WdiAutofocusProviderStatus } from './wdi_autofocus_provider_status';\n\n/**\n * Class representing access to WDI Autofocus connection.\n */\nexport class WdiAutofocusProvider {\n /**\n * Default port number for TCP connections to WDI autofocus.\n */\n public static readonly DEFAULT_TCP_PORT: number = 27;\n\n /**\n * The ID identifies the autofocus with the underlying library.\n */\n public get providerId(): number {\n return this._providerId;\n }\n private _providerId: number;\n\n constructor(providerId: number) {\n this._providerId = providerId;\n }\n\n /**\n * Opens a TCP connection to WDI autofocus.\n * @param hostName Hostname or IP address.\n * @param [port=WdiAutofocusProvider.DEFAULT_TCP_PORT] Optional port number (defaults to 27).\n * @returns An object representing the autofocus connection.\n */\n public static async openTcp(\n hostName: string,\n port: number = WdiAutofocusProvider.DEFAULT_TCP_PORT\n ): Promise<WdiAutofocusProvider> {\n const request: requests.OpenInterfaceRequest & gateway.Message = {\n ...requests.OpenInterfaceRequest.DEFAULT,\n interfaceType: requests.InterfaceType.TCP,\n hostName: hostName,\n port: port,\n toBinary() {\n return requests.OpenInterfaceRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntResponse>(\n 'wdi/open',\n request,\n requests.IntResponse.fromBinary);\n return new WdiAutofocusProvider(response.value);\n }\n\n /**\n * Close the connection.\n */\n public async close(): Promise<void> {\n const request: requests.InterfaceEmptyRequest & gateway.Message = {\n ...requests.InterfaceEmptyRequest.DEFAULT,\n interfaceId: this.providerId,\n toBinary() {\n return requests.InterfaceEmptyRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('wdi/close', request);\n }\n\n /**\n * Generic read operation.\n * @param registerId Register address to read from.\n * @param size Data size to read. Valid values are (1,2,4). Determines the data type (Byte, Word, DWord).\n * @param [options.count=1] Number of values to read (defaults to 1).\n * @param [options.offset=0] Offset within the register (defaults to 0).\n * @param [options.registerBank='U'] Register bank letter (defaults to U for user bank).\n * @returns Array of integers read from the device.\n */\n public async genericRead(\n registerId: number,\n size: number,\n options: WdiAutofocusProvider.GenericReadOptions = {}\n ): Promise<number[]> {\n const {\n count = 1,\n offset = 0,\n registerBank = 'U',\n } = options;\n const request: requests.WdiGenericRequest & gateway.Message = {\n ...requests.WdiGenericRequest.DEFAULT,\n interfaceId: this.providerId,\n registerId: registerId,\n size: size,\n count: count,\n offset: offset,\n registerBank: registerBank,\n toBinary() {\n return requests.WdiGenericRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntArrayResponse>(\n 'wdi/read',\n request,\n requests.IntArrayResponse.fromBinary);\n return response.values;\n }\n\n /**\n * Generic write operation.\n * @param registerId Register address to read from.\n * @param [size=0] Data size to write. Valid values are (0,1,2,4). Determines the data type (Nil, Byte, Word, DWord).\n * @param [data=[]] Array of values to write to the register. Empty array is allowed.\n * @param [options.offset=0] Offset within the register (defaults to 0).\n * @param [options.registerBank='U'] Register bank letter (defaults to U for user bank).\n */\n public async genericWrite(\n registerId: number,\n size: number = 0,\n data: number[] = [],\n options: WdiAutofocusProvider.GenericWriteOptions = {}\n ): Promise<void> {\n const {\n offset = 0,\n registerBank = 'U',\n } = options;\n const request: requests.WdiGenericRequest & gateway.Message = {\n ...requests.WdiGenericRequest.DEFAULT,\n interfaceId: this.providerId,\n registerId: registerId,\n size: size,\n data: data,\n offset: offset,\n registerBank: registerBank,\n toBinary() {\n return requests.WdiGenericRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('wdi/write', request);\n }\n\n /**\n * Enables the laser.\n */\n public async enableLaser(): Promise<void> {\n const request: requests.WdiGenericRequest & gateway.Message = {\n ...requests.WdiGenericRequest.DEFAULT,\n interfaceId: this.providerId,\n registerId: 1,\n toBinary() {\n return requests.WdiGenericRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('wdi/write', request);\n }\n\n /**\n * Disables the laser.\n */\n public async disableLaser(): Promise<void> {\n const request: requests.WdiGenericRequest & gateway.Message = {\n ...requests.WdiGenericRequest.DEFAULT,\n interfaceId: this.providerId,\n registerId: 2,\n toBinary() {\n return requests.WdiGenericRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('wdi/write', request);\n }\n\n /**\n * Gets the status of the autofocus.\n * @returns The status of the autofocus.\n */\n public async getStatus(): Promise<WdiAutofocusProviderStatus> {\n const request: requests.InterfaceEmptyRequest & gateway.Message = {\n ...requests.InterfaceEmptyRequest.DEFAULT,\n interfaceId: this.providerId,\n toBinary() {\n return requests.InterfaceEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.WdiGetStatusResponse>(\n 'wdi/get_status',\n request,\n requests.WdiGetStatusResponse.fromBinary);\n return response.status;\n }\n\n /**\n * Returns a string that represents the autofocus connection.\n * @returns A string that represents the connection.\n */\n public toString(): string {\n const request: requests.InterfaceEmptyRequest & gateway.Message = {\n ...requests.InterfaceEmptyRequest.DEFAULT,\n interfaceId: this.providerId,\n toBinary() {\n return requests.InterfaceEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'wdi/to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace WdiAutofocusProvider {\n export interface GenericReadOptions {\n count?: number;\n offset?: number;\n registerBank?: string;\n }\n export interface GenericWriteOptions {\n offset?: number;\n registerBank?: string;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"wdi_autofocus_provider.js","sourceRoot":"","sources":["../../../src/microscopy/wdi_autofocus_provider.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,sDAAwC;AAGxC;;GAEG;AACH,MAAa,oBAAoB;IAM/B;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAGD,YAAY,UAAkB;QAC5B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,KAAK,CAAC,OAAO,CACzB,QAAgB,EAChB,OAAe,oBAAoB,CAAC,gBAAgB;QAEpD,MAAM,OAAO,GAAoD;YAC/D,GAAG,QAAQ,CAAC,oBAAoB,CAAC,OAAO;YACxC,aAAa,EAAE,QAAQ,CAAC,aAAa,CAAC,GAAG;YACzC,QAAQ,EAAE,QAAQ;YAClB,IAAI,EAAE,IAAI;YACV,QAAQ;gBACN,OAAO,QAAQ,CAAC,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACtD,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,UAAU,EACV,OAAO,EACP,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QACnC,OAAO,IAAI,oBAAoB,CAAC,QAAQ,CAAC,KAAK,CA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OAAO;YACzC,WAAW,EAAE,IAAI,CAAC,UAAU;YAC5B,QAAQ;gBACN,OAAO,QAAQ,CAAC,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACvD,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,gBAAgB,EAChB,OAAO,EACP,QAAQ,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;QAC5C,OAAO,QAAQ,CAAC,MAAM,CAAC;IACzB,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,MAAM,OAAO,GAAqD;YAChE,GAAG,QAAQ,CAAC,qBAAqB,CAAC,OAAO;YACzC,WAAW,EAAE,IAAI,CAAC,UAAU;YAC5B,QAAQ;gBACN,OAAO,QAAQ,CAAC,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACvD,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,eAAe,EACf,OAAO,EACP,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACtC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;;AA3MH,oDA4MC;AA3MC;;GAEG;AACoB,qCAAgB,GAAW,EAAE,CAAC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { WdiAutofocusProviderStatus } from './wdi_autofocus_provider_status';\n\n/**\n * Class representing access to WDI Autofocus connection.\n */\nexport class WdiAutofocusProvider {\n /**\n * Default port number for TCP connections to WDI autofocus.\n */\n public static readonly DEFAULT_TCP_PORT: number = 27;\n\n /**\n * The ID identifies the autofocus with the underlying library.\n */\n public get providerId(): number {\n return this._providerId;\n }\n private _providerId: number;\n\n constructor(providerId: number) {\n this._providerId = providerId;\n }\n\n /**\n * Opens a TCP connection to WDI autofocus.\n * @param hostName Hostname or IP address.\n * @param [port=WdiAutofocusProvider.DEFAULT_TCP_PORT] Optional port number (defaults to 27).\n * @returns An object representing the autofocus connection.\n */\n public static async openTcp(\n hostName: string,\n port: number = WdiAutofocusProvider.DEFAULT_TCP_PORT\n ): Promise<WdiAutofocusProvider> {\n const request: requests.OpenInterfaceRequest & gateway.Message = {\n ...requests.OpenInterfaceRequest.DEFAULT,\n interfaceType: requests.InterfaceType.TCP,\n hostName: hostName,\n port: port,\n toBinary() {\n return requests.OpenInterfaceRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntResponse>(\n 'wdi/open',\n request,\n requests.IntResponse.fromBinary);\n return new WdiAutofocusProvider(response.value);\n }\n\n /**\n * Close the connection.\n */\n public async close(): Promise<void> {\n const request: requests.InterfaceEmptyRequest & gateway.Message = {\n ...requests.InterfaceEmptyRequest.DEFAULT,\n interfaceId: this.providerId,\n toBinary() {\n return requests.InterfaceEmptyRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('wdi/close', request);\n }\n\n /**\n * Generic read operation.\n * @param registerId Register address to read from.\n * @param size Data size to read. Valid values are (1,2,4). Determines the data type (Byte, Word, DWord).\n * @param [options.count=1] Number of values to read (defaults to 1).\n * @param [options.offset=0] Offset within the register (defaults to 0).\n * @param [options.registerBank='U'] Register bank letter (defaults to U for user bank).\n * @returns Array of integers read from the device.\n */\n public async genericRead(\n registerId: number,\n size: number,\n options: WdiAutofocusProvider.GenericReadOptions = {}\n ): Promise<number[]> {\n const {\n count = 1,\n offset = 0,\n registerBank = 'U',\n } = options;\n const request: requests.WdiGenericRequest & gateway.Message = {\n ...requests.WdiGenericRequest.DEFAULT,\n interfaceId: this.providerId,\n registerId: registerId,\n size: size,\n count: count,\n offset: offset,\n registerBank: registerBank,\n toBinary() {\n return requests.WdiGenericRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntArrayResponse>(\n 'wdi/read',\n request,\n requests.IntArrayResponse.fromBinary);\n return response.values;\n }\n\n /**\n * Generic write operation.\n * @param registerId Register address to read from.\n * @param [size=0] Data size to write. Valid values are (0,1,2,4). Determines the data type (Nil, Byte, Word, DWord).\n * @param [data=[]] Array of values to write to the register. Empty array is allowed.\n * @param [options.offset=0] Offset within the register (defaults to 0).\n * @param [options.registerBank='U'] Register bank letter (defaults to U for user bank).\n */\n public async genericWrite(\n registerId: number,\n size: number = 0,\n data: number[] = [],\n options: WdiAutofocusProvider.GenericWriteOptions = {}\n ): Promise<void> {\n const {\n offset = 0,\n registerBank = 'U',\n } = options;\n const request: requests.WdiGenericRequest & gateway.Message = {\n ...requests.WdiGenericRequest.DEFAULT,\n interfaceId: this.providerId,\n registerId: registerId,\n size: size,\n data: data,\n offset: offset,\n registerBank: registerBank,\n toBinary() {\n return requests.WdiGenericRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('wdi/write', request);\n }\n\n /**\n * Enables the laser.\n */\n public async enableLaser(): Promise<void> {\n const request: requests.WdiGenericRequest & gateway.Message = {\n ...requests.WdiGenericRequest.DEFAULT,\n interfaceId: this.providerId,\n registerId: 1,\n toBinary() {\n return requests.WdiGenericRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('wdi/write', request);\n }\n\n /**\n * Disables the laser.\n */\n public async disableLaser(): Promise<void> {\n const request: requests.WdiGenericRequest & gateway.Message = {\n ...requests.WdiGenericRequest.DEFAULT,\n interfaceId: this.providerId,\n registerId: 2,\n toBinary() {\n return requests.WdiGenericRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('wdi/write', request);\n }\n\n /**\n * Gets the status of the autofocus.\n * @returns The status of the autofocus.\n */\n public async getStatus(): Promise<WdiAutofocusProviderStatus> {\n const request: requests.InterfaceEmptyRequest & gateway.Message = {\n ...requests.InterfaceEmptyRequest.DEFAULT,\n interfaceId: this.providerId,\n toBinary() {\n return requests.InterfaceEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.WdiGetStatusResponse>(\n 'wdi/get_status',\n request,\n requests.WdiGetStatusResponse.fromBinary);\n return response.status;\n }\n\n /**\n * Returns a string that represents the autofocus connection.\n * @returns A string that represents the connection.\n */\n public toString(): string {\n const request: requests.InterfaceEmptyRequest & gateway.Message = {\n ...requests.InterfaceEmptyRequest.DEFAULT,\n interfaceId: this.providerId,\n toBinary() {\n return requests.InterfaceEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'wdi/to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace WdiAutofocusProvider {\n export interface GenericReadOptions {\n /**\n * Number of values to read (defaults to 1).\n */\n count?: number;\n /**\n * Offset within the register (defaults to 0).\n */\n offset?: number;\n /**\n * Register bank letter (defaults to U for user bank).\n */\n registerBank?: string;\n }\n export interface GenericWriteOptions {\n /**\n * Offset within the register (defaults to 0).\n */\n offset?: number;\n /**\n * Register bank letter (defaults to U for user bank).\n */\n registerBank?: string;\n }\n}\n"]}
|
|
@@ -146,11 +146,25 @@ export declare class Process {
|
|
|
146
146
|
}
|
|
147
147
|
declare namespace Process {
|
|
148
148
|
interface GenericCommandOptions {
|
|
149
|
+
/**
|
|
150
|
+
* Controls whether to throw an exception when the device rejects the command.
|
|
151
|
+
*/
|
|
149
152
|
checkErrors?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* The timeout, in milliseconds, for a device to respond to the command.
|
|
155
|
+
* Overrides the connection default request timeout.
|
|
156
|
+
*/
|
|
150
157
|
timeout?: number;
|
|
151
158
|
}
|
|
152
159
|
interface GenericCommandMultiResponseOptions {
|
|
160
|
+
/**
|
|
161
|
+
* Controls whether to throw an exception when a device rejects the command.
|
|
162
|
+
*/
|
|
153
163
|
checkErrors?: boolean;
|
|
164
|
+
/**
|
|
165
|
+
* The timeout, in milliseconds, for a device to respond to the command.
|
|
166
|
+
* Overrides the connection default request timeout.
|
|
167
|
+
*/
|
|
154
168
|
timeout?: number;
|
|
155
169
|
}
|
|
156
170
|
}
|
|
@@ -1 +1 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CAAC,SAAS,CACtC,2BAA2B,EAC3B,OAAO,EACP,QAAQ,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAC;QAC/C,OAAO,MAAA,QAAQ,CAAC,KAAK,mCAAI,IAAI,CAAC;IAChC,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,MAAM,OAAO,GAAmD;YAC9D,GAAG,QAAQ,CAAC,mBAAmB,CAAC,OAAO;YACvC,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW;YAC1D,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,aAAa;YAC5C,IAAI,EAAE,IAAI,CAAC,aAAa;YACxB,YAAY,EAAE,SAAS;YACvB,QAAQ;gBACN,OAAO,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACrD,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,uBAAuB,EACvB,OAAO,EACP,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACtC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;CACF;AA3dD,0BA2dC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { ProcessController } from './process_controller';\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { Native, Units, Time } from '../units';\nimport { Axis } from '../ascii/axis';\nimport { Response } from '../ascii/response';\nimport { AxisSettings } from '../ascii/axis_settings';\nimport { AxisStorage } from '../ascii/storage';\nimport { Warnings } from '../ascii/warnings';\nimport { ProcessControllerMode } from './process_controller_mode';\nimport { ProcessControllerSource } from './process_controller_source';\nimport { Measurement } from '../measurement';\n\n/**\n * Use to drive voltage for a process such as a heater, valve, Peltier device, etc.\n * Requires at least Firmware 7.35.\n */\nexport class Process {\n /**\n * Controller for this process.\n */\n public get controller(): ProcessController {\n return this._controller;\n }\n private _controller: ProcessController;\n\n /**\n * The process number identifies the process on the controller.\n */\n public get processNumber(): number {\n return this._processNumber;\n }\n private _processNumber: number;\n\n private _axis: Axis;\n\n /**\n * Settings and properties of this process.\n */\n public get settings(): AxisSettings {\n return this._settings;\n }\n private _settings: AxisSettings;\n\n /**\n * Key-value storage of this process.\n */\n public get storage(): AxisStorage {\n return this._storage;\n }\n private _storage: AxisStorage;\n\n /**\n * Warnings and faults of this process.\n */\n public get warnings(): Warnings {\n return this._warnings;\n }\n private _warnings: Warnings;\n\n constructor(controller: ProcessController, processNumber: number) {\n this._controller = controller;\n this._processNumber = processNumber;\n this._axis = new Axis(controller.device, processNumber);\n this._settings = new AxisSettings(this._axis);\n this._storage = new AxisStorage(this._axis);\n this._warnings = new Warnings(controller.device, processNumber);\n }\n\n /**\n * Sets the enabled state of the driver.\n * @param [enabled=true] If true (default) enables drive. If false disables.\n */\n public async enable(\n enabled: boolean = true\n ): Promise<void> {\n const request: requests.ProcessOn & gateway.Message = {\n ...requests.ProcessOn.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n on: enabled,\n toBinary() {\n return requests.ProcessOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('process-controller/enable', request);\n }\n\n /**\n * Turns this process on. In manual mode, this supplies voltage; in controlled mode, it starts the control loop.\n * @param [duration=0] How long to leave the process on.\n * @param [unit=Units.NATIVE] Units of time.\n */\n public async on(\n duration: number = 0,\n unit: Time | Native = Units.NATIVE\n ): Promise<void> {\n const request: requests.ProcessOn & gateway.Message = {\n ...requests.ProcessOn.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n on: true,\n duration: duration,\n unit: unit,\n toBinary() {\n return requests.ProcessOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('process-controller/on', request);\n }\n\n /**\n * Turns this process off.\n */\n public async off(): Promise<void> {\n const request: requests.ProcessOn & gateway.Message = {\n ...requests.ProcessOn.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n on: false,\n toBinary() {\n return requests.ProcessOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('process-controller/on', request);\n }\n\n /**\n * Sets the control mode of this process.\n * @param mode Mode to set this process to.\n */\n public async setMode(\n mode: ProcessControllerMode\n ): Promise<void> {\n const request: requests.DeviceSetSettingRequest & gateway.Message = {\n ...requests.DeviceSetSettingRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n setting: 'process.control.mode',\n value: mode,\n toBinary() {\n return requests.DeviceSetSettingRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/set_setting', request);\n }\n\n /**\n * Gets the control mode of this process.\n * @returns Control mode.\n */\n public async getMode(): Promise<ProcessControllerMode> {\n const request: requests.DeviceGetSettingRequest & gateway.Message = {\n ...requests.DeviceGetSettingRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n setting: 'process.control.mode',\n toBinary() {\n return requests.DeviceGetSettingRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'device/get_setting',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Gets the source used to control this process.\n * @returns The source providing feedback for this process.\n */\n public async getSource(): Promise<ProcessControllerSource> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<ProcessControllerSource>(\n 'process_controller/get_source',\n request,\n ProcessControllerSource.fromBinary);\n return response;\n }\n\n /**\n * Sets the source used to control this process.\n * @param source Sets the source that should provide feedback for this process.\n */\n public async setSource(\n source: ProcessControllerSource\n ): Promise<void> {\n const request: requests.SetProcessControllerSource & gateway.Message = {\n ...requests.SetProcessControllerSource.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n source: source,\n toBinary() {\n return requests.SetProcessControllerSource.toBinary(this);\n },\n };\n\n await gateway.callAsync('process_controller/set_source', request);\n }\n\n /**\n * Gets the current value of the source used to control this process.\n * @returns The current value of this process's controlling source.\n */\n public async getInput(): Promise<Measurement> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<Measurement>(\n 'process_controller/get_input',\n request,\n Measurement.fromBinary);\n return response;\n }\n\n /**\n * Creates an H-bridge between this process and its neighbor. This method is only callable on axis 1 and 3.\n */\n public async bridge(): Promise<void> {\n const request: requests.ProcessOn & gateway.Message = {\n ...requests.ProcessOn.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n on: true,\n toBinary() {\n return requests.ProcessOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('process_controller/bridge', request);\n }\n\n /**\n * Breaks the H-bridge between this process and its neighbor, allowing them to be independently controlled.\n * This method is only callable on axis 1 and 3.\n */\n public async unbridge(): Promise<void> {\n const request: requests.ProcessOn & gateway.Message = {\n ...requests.ProcessOn.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n on: false,\n toBinary() {\n return requests.ProcessOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('process_controller/bridge', request);\n }\n\n /**\n * Detects if the given process is in bridging mode.\n * @returns Whether this process is bridged with its neighbor.\n */\n public async isBridge(): Promise<boolean> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.BoolResponse>(\n 'process_controller/is_bridge',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sends a generic ASCII command to this process' underlying axis.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns A response to the command.\n */\n public async genericCommand(\n command: string,\n options: Process.GenericCommandOptions = {}\n ): Promise<Response> {\n const {\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n command: command,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<Response>(\n 'interface/generic_command',\n request,\n Response.fromBinary);\n return response;\n }\n\n /**\n * Sends a generic ASCII command to this process and expect multiple responses.\n * Responses are returned in order of arrival.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.checkErrors=true] Controls whether to throw an exception when a device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns All responses to the command.\n */\n public async genericCommandMultiResponse(\n command: string,\n options: Process.GenericCommandMultiResponseOptions = {}\n ): Promise<Response[]> {\n const {\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n command: command,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.GenericCommandResponseCollection>(\n 'interface/generic_command_multi_response',\n request,\n requests.GenericCommandResponseCollection.fromBinary);\n return response.responses;\n }\n\n /**\n * Sends a generic ASCII command to this process without expecting a response and without adding a message ID\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n */\n public async genericCommandNoResponse(\n command: string\n ): Promise<void> {\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n command: command,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Returns a serialization of the current process state that can be saved and reapplied.\n * @returns A serialization of the current state of the process.\n */\n public async getState(): Promise<string> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.StringResponse>(\n 'device/get_state',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Applies a saved state to this process.\n * @param state The state object to apply to this process.\n */\n public async setState(\n state: string\n ): Promise<void> {\n const request: requests.SetStateRequest & gateway.Message = {\n ...requests.SetStateRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n state: state,\n toBinary() {\n return requests.SetStateRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/set_state', request);\n }\n\n /**\n * Checks if a state can be applied to this process.\n * This only covers exceptions that can be determined statically such as mismatches of ID or version,\n * the process of applying the state can still fail when running.\n * @param state The state object to check against.\n * @returns An explanation of why this state cannot be set to this process.\n */\n public async canSetState(\n state: string\n ): Promise<string | null> {\n const request: requests.CanSetStateRequest & gateway.Message = {\n ...requests.CanSetStateRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n state: state,\n toBinary() {\n return requests.CanSetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.CanSetStateAxisResponse>(\n 'device/can_set_axis_state',\n request,\n requests.CanSetStateAxisResponse.fromBinary);\n return response.error ?? null;\n }\n\n /**\n * Returns a string that represents the process.\n * @returns A string that represents the process.\n */\n public toString(): string {\n const request: requests.AxisToStringRequest & gateway.Message = {\n ...requests.AxisToStringRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n typeOverride: 'Process',\n toBinary() {\n return requests.AxisToStringRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/axis_to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace Process {\n export interface GenericCommandOptions {\n checkErrors?: boolean;\n timeout?: number;\n }\n export interface GenericCommandMultiResponseOptions {\n checkErrors?: boolean;\n timeout?: number;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"process.js","sourceRoot":"","sources":["../../../src/product/process.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtD,oDAAsC;AACtC,sDAAwC;AACxC,oCAA+C;AAC/C,wCAAqC;AACrC,gDAA6C;AAC7C,0DAAsD;AACtD,8CAA+C;AAC/C,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DIT DIRECTLY ============= //\n\nimport { ProcessController } from './process_controller';\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { Native, Units, Time } from '../units';\nimport { Axis } from '../ascii/axis';\nimport { Response } from '../ascii/response';\nimport { AxisSettings } from '../ascii/axis_settings';\nimport { AxisStorage } from '../ascii/storage';\nimport { Warnings } from '../ascii/warnings';\nimport { ProcessControllerMode } from './process_controller_mode';\nimport { ProcessControllerSource } from './process_controller_source';\nimport { Measurement } from '../measurement';\n\n/**\n * Use to drive voltage for a process such as a heater, valve, Peltier device, etc.\n * Requires at least Firmware 7.35.\n */\nexport class Process {\n /**\n * Controller for this process.\n */\n public get controller(): ProcessController {\n return this._controller;\n }\n private _controller: ProcessController;\n\n /**\n * The process number identifies the process on the controller.\n */\n public get processNumber(): number {\n return this._processNumber;\n }\n private _processNumber: number;\n\n private _axis: Axis;\n\n /**\n * Settings and properties of this process.\n */\n public get settings(): AxisSettings {\n return this._settings;\n }\n private _settings: AxisSettings;\n\n /**\n * Key-value storage of this process.\n */\n public get storage(): AxisStorage {\n return this._storage;\n }\n private _storage: AxisStorage;\n\n /**\n * Warnings and faults of this process.\n */\n public get warnings(): Warnings {\n return this._warnings;\n }\n private _warnings: Warnings;\n\n constructor(controller: ProcessController, processNumber: number) {\n this._controller = controller;\n this._processNumber = processNumber;\n this._axis = new Axis(controller.device, processNumber);\n this._settings = new AxisSettings(this._axis);\n this._storage = new AxisStorage(this._axis);\n this._warnings = new Warnings(controller.device, processNumber);\n }\n\n /**\n * Sets the enabled state of the driver.\n * @param [enabled=true] If true (default) enables drive. If false disables.\n */\n public async enable(\n enabled: boolean = true\n ): Promise<void> {\n const request: requests.ProcessOn & gateway.Message = {\n ...requests.ProcessOn.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n on: enabled,\n toBinary() {\n return requests.ProcessOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('process-controller/enable', request);\n }\n\n /**\n * Turns this process on. In manual mode, this supplies voltage; in controlled mode, it starts the control loop.\n * @param [duration=0] How long to leave the process on.\n * @param [unit=Units.NATIVE] Units of time.\n */\n public async on(\n duration: number = 0,\n unit: Time | Native = Units.NATIVE\n ): Promise<void> {\n const request: requests.ProcessOn & gateway.Message = {\n ...requests.ProcessOn.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n on: true,\n duration: duration,\n unit: unit,\n toBinary() {\n return requests.ProcessOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('process-controller/on', request);\n }\n\n /**\n * Turns this process off.\n */\n public async off(): Promise<void> {\n const request: requests.ProcessOn & gateway.Message = {\n ...requests.ProcessOn.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n on: false,\n toBinary() {\n return requests.ProcessOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('process-controller/on', request);\n }\n\n /**\n * Sets the control mode of this process.\n * @param mode Mode to set this process to.\n */\n public async setMode(\n mode: ProcessControllerMode\n ): Promise<void> {\n const request: requests.DeviceSetSettingRequest & gateway.Message = {\n ...requests.DeviceSetSettingRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n setting: 'process.control.mode',\n value: mode,\n toBinary() {\n return requests.DeviceSetSettingRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/set_setting', request);\n }\n\n /**\n * Gets the control mode of this process.\n * @returns Control mode.\n */\n public async getMode(): Promise<ProcessControllerMode> {\n const request: requests.DeviceGetSettingRequest & gateway.Message = {\n ...requests.DeviceGetSettingRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n setting: 'process.control.mode',\n toBinary() {\n return requests.DeviceGetSettingRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'device/get_setting',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Gets the source used to control this process.\n * @returns The source providing feedback for this process.\n */\n public async getSource(): Promise<ProcessControllerSource> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<ProcessControllerSource>(\n 'process_controller/get_source',\n request,\n ProcessControllerSource.fromBinary);\n return response;\n }\n\n /**\n * Sets the source used to control this process.\n * @param source Sets the source that should provide feedback for this process.\n */\n public async setSource(\n source: ProcessControllerSource\n ): Promise<void> {\n const request: requests.SetProcessControllerSource & gateway.Message = {\n ...requests.SetProcessControllerSource.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n source: source,\n toBinary() {\n return requests.SetProcessControllerSource.toBinary(this);\n },\n };\n\n await gateway.callAsync('process_controller/set_source', request);\n }\n\n /**\n * Gets the current value of the source used to control this process.\n * @returns The current value of this process's controlling source.\n */\n public async getInput(): Promise<Measurement> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<Measurement>(\n 'process_controller/get_input',\n request,\n Measurement.fromBinary);\n return response;\n }\n\n /**\n * Creates an H-bridge between this process and its neighbor. This method is only callable on axis 1 and 3.\n */\n public async bridge(): Promise<void> {\n const request: requests.ProcessOn & gateway.Message = {\n ...requests.ProcessOn.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n on: true,\n toBinary() {\n return requests.ProcessOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('process_controller/bridge', request);\n }\n\n /**\n * Breaks the H-bridge between this process and its neighbor, allowing them to be independently controlled.\n * This method is only callable on axis 1 and 3.\n */\n public async unbridge(): Promise<void> {\n const request: requests.ProcessOn & gateway.Message = {\n ...requests.ProcessOn.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n on: false,\n toBinary() {\n return requests.ProcessOn.toBinary(this);\n },\n };\n\n await gateway.callAsync('process_controller/bridge', request);\n }\n\n /**\n * Detects if the given process is in bridging mode.\n * @returns Whether this process is bridged with its neighbor.\n */\n public async isBridge(): Promise<boolean> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.BoolResponse>(\n 'process_controller/is_bridge',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sends a generic ASCII command to this process' underlying axis.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns A response to the command.\n */\n public async genericCommand(\n command: string,\n options: Process.GenericCommandOptions = {}\n ): Promise<Response> {\n const {\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n command: command,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<Response>(\n 'interface/generic_command',\n request,\n Response.fromBinary);\n return response;\n }\n\n /**\n * Sends a generic ASCII command to this process and expect multiple responses.\n * Responses are returned in order of arrival.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.checkErrors=true] Controls whether to throw an exception when a device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns All responses to the command.\n */\n public async genericCommandMultiResponse(\n command: string,\n options: Process.GenericCommandMultiResponseOptions = {}\n ): Promise<Response[]> {\n const {\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n command: command,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.GenericCommandResponseCollection>(\n 'interface/generic_command_multi_response',\n request,\n requests.GenericCommandResponseCollection.fromBinary);\n return response.responses;\n }\n\n /**\n * Sends a generic ASCII command to this process without expecting a response and without adding a message ID\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n */\n public async genericCommandNoResponse(\n command: string\n ): Promise<void> {\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n command: command,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Returns a serialization of the current process state that can be saved and reapplied.\n * @returns A serialization of the current state of the process.\n */\n public async getState(): Promise<string> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.StringResponse>(\n 'device/get_state',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Applies a saved state to this process.\n * @param state The state object to apply to this process.\n */\n public async setState(\n state: string\n ): Promise<void> {\n const request: requests.SetStateRequest & gateway.Message = {\n ...requests.SetStateRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n state: state,\n toBinary() {\n return requests.SetStateRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/set_state', request);\n }\n\n /**\n * Checks if a state can be applied to this process.\n * This only covers exceptions that can be determined statically such as mismatches of ID or version,\n * the process of applying the state can still fail when running.\n * @param state The state object to check against.\n * @returns An explanation of why this state cannot be set to this process.\n */\n public async canSetState(\n state: string\n ): Promise<string | null> {\n const request: requests.CanSetStateRequest & gateway.Message = {\n ...requests.CanSetStateRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n state: state,\n toBinary() {\n return requests.CanSetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.CanSetStateAxisResponse>(\n 'device/can_set_axis_state',\n request,\n requests.CanSetStateAxisResponse.fromBinary);\n return response.error ?? null;\n }\n\n /**\n * Returns a string that represents the process.\n * @returns A string that represents the process.\n */\n public toString(): string {\n const request: requests.AxisToStringRequest & gateway.Message = {\n ...requests.AxisToStringRequest.DEFAULT,\n interfaceId: this.controller.device.connection.interfaceId,\n device: this.controller.device.deviceAddress,\n axis: this.processNumber,\n typeOverride: 'Process',\n toBinary() {\n return requests.AxisToStringRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/axis_to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace Process {\n export interface GenericCommandOptions {\n /**\n * Controls whether to throw an exception when the device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface GenericCommandMultiResponseOptions {\n /**\n * Controls whether to throw an exception when a device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n}\n"]}
|
|
@@ -6,6 +6,7 @@ export interface SetServoTuningRequest {
|
|
|
6
6
|
axis: number;
|
|
7
7
|
paramset: ServoTuningParamset;
|
|
8
8
|
tuningParams: ServoTuningParam[];
|
|
9
|
+
setUnspecifiedToDefault: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare const SetServoTuningRequest: {
|
|
11
12
|
fromBinary: (buffer: Uint8Array) => SetServoTuningRequest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set_servo_tuning_request.d.ts","sourceRoot":"","sources":["../../../src/requests/set_servo_tuning_request.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;IAEpB,MAAM,EAAE,MAAM,CAAC;IAEf,IAAI,EAAE,MAAM,CAAC;IAEb,QAAQ,EAAE,mBAAmB,CAAC;IAE9B,YAAY,EAAE,gBAAgB,EAAE,CAAC;CAElC;AAED,eAAO,MAAM,qBAAqB;yBACX,UAAU,KAAG,qBAAqB;sBACrC,qBAAqB,KAAG,UAAU;;
|
|
1
|
+
{"version":3,"file":"set_servo_tuning_request.d.ts","sourceRoot":"","sources":["../../../src/requests/set_servo_tuning_request.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;IAEpB,MAAM,EAAE,MAAM,CAAC;IAEf,IAAI,EAAE,MAAM,CAAC;IAEb,QAAQ,EAAE,mBAAmB,CAAC;IAE9B,YAAY,EAAE,gBAAgB,EAAE,CAAC;IAEjC,uBAAuB,EAAE,OAAO,CAAC;CAElC;AAED,eAAO,MAAM,qBAAqB;yBACX,UAAU,KAAG,qBAAqB;sBACrC,qBAAqB,KAAG,UAAU;;sBASlC,qBAAqB,KAAG,qBAAqB;CAYhE,CAAC"}
|
|
@@ -15,6 +15,7 @@ exports.SetServoTuningRequest = {
|
|
|
15
15
|
axis: 0,
|
|
16
16
|
paramset: 0,
|
|
17
17
|
tuningParams: [],
|
|
18
|
+
setUnspecifiedToDefault: false,
|
|
18
19
|
}),
|
|
19
20
|
sanitize: (value) => {
|
|
20
21
|
var _a;
|
|
@@ -30,6 +31,7 @@ exports.SetServoTuningRequest = {
|
|
|
30
31
|
axis: sanitizer_1.sanitizer.sanitizeInt(value.axis, 'axis'),
|
|
31
32
|
paramset: sanitizer_1.sanitizer.sanitizeEnum(value.paramset, 'ServoTuningParamset', servo_tuning_paramset_1.ServoTuningParamset, 'paramset'),
|
|
32
33
|
tuningParams: Array.from((_a = value.tuningParams) !== null && _a !== void 0 ? _a : [], item => servo_tuning_param_1.ServoTuningParam.sanitize(item)),
|
|
34
|
+
setUnspecifiedToDefault: sanitizer_1.sanitizer.sanitizeBool(value.setUnspecifiedToDefault, 'setUnspecifiedToDefault'),
|
|
33
35
|
};
|
|
34
36
|
},
|
|
35
37
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set_servo_tuning_request.js","sourceRoot":"","sources":["../../../src/requests/set_servo_tuning_request.ts"],"names":[],"mappings":";;;AAAA,oDA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qBAAS,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,qBAAqB,EAAE,2CAAmB,EAAE,UAAU,CAAC;YACxG,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,MAAA,KAAK,CAAC,YAAY,mCAAI,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,qCAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC3F,uBAAuB,EAAE,qBAAS,CAAC,YAAY,CAAC,KAAK,CAAC,uBAAuB,EAAE,yBAAyB,CAAC;SAC1G,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["/* This file is generated. Do not modify by hand. */\nimport { BSON } from 'bson';\nimport { sanitizer } from '../gateway/sanitizer';\nimport { ServoTuningParamset } from '../ascii/servo_tuning_paramset';\nimport { ServoTuningParam } from '../ascii/servo_tuning_param';\n\nexport interface SetServoTuningRequest {\n interfaceId: number;\n\n device: number;\n\n axis: number;\n\n paramset: ServoTuningParamset;\n\n tuningParams: ServoTuningParam[];\n\n setUnspecifiedToDefault: boolean;\n\n}\n\nexport const SetServoTuningRequest = {\n fromBinary: (buffer: Uint8Array): SetServoTuningRequest => BSON.deserialize(buffer) as SetServoTuningRequest,\n toBinary: (value: SetServoTuningRequest): Uint8Array => BSON.serialize(SetServoTuningRequest.sanitize(value)),\n DEFAULT: Object.freeze({\n interfaceId: 0,\n device: 0,\n axis: 0,\n paramset: 0 as ServoTuningParamset,\n tuningParams: [],\n setUnspecifiedToDefault: false,\n }) as Readonly<SetServoTuningRequest>,\n sanitize: (value: SetServoTuningRequest): SetServoTuningRequest => {\n if (value == null) { throw new TypeError('Expected SetServoTuningRequest object but got null or undefined.') }\n if (typeof value !== 'object') { throw new TypeError(`Expected SetServoTuningRequest 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 paramset: sanitizer.sanitizeEnum(value.paramset, 'ServoTuningParamset', ServoTuningParamset, 'paramset'),\n tuningParams: Array.from(value.tuningParams ?? [], item => ServoTuningParam.sanitize(item)),\n setUnspecifiedToDefault: sanitizer.sanitizeBool(value.setUnspecifiedToDefault, 'setUnspecifiedToDefault'),\n };\n },\n};\n"]}
|