@zaber/motion 4.5.1 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/binding/wasm/zaber-motion-lib.wasm +0 -0
- package/dist/lib/ascii/axis.js +1 -1
- package/dist/lib/ascii/axis.js.map +1 -1
- package/dist/lib/ascii/axis_group.d.ts +62 -0
- package/dist/lib/ascii/axis_group.js +154 -0
- package/dist/lib/ascii/axis_group.js.map +1 -0
- package/dist/lib/ascii/axis_settings.d.ts +15 -0
- package/dist/lib/ascii/axis_settings.js +31 -0
- package/dist/lib/ascii/axis_settings.js.map +1 -1
- package/dist/lib/ascii/device.js +1 -1
- package/dist/lib/ascii/device.js.map +1 -1
- package/dist/lib/ascii/device_settings.d.ts +15 -0
- package/dist/lib/ascii/device_settings.js +29 -0
- package/dist/lib/ascii/device_settings.js.map +1 -1
- package/dist/lib/ascii/get_axis_setting.d.ts +17 -0
- package/dist/lib/ascii/get_axis_setting.js +45 -0
- package/dist/lib/ascii/get_axis_setting.js.map +1 -0
- package/dist/lib/ascii/get_axis_setting_result.d.ts +21 -0
- package/dist/lib/ascii/get_axis_setting_result.js +19 -0
- package/dist/lib/ascii/get_axis_setting_result.js.map +1 -0
- package/dist/lib/ascii/get_setting.d.ts +21 -0
- package/dist/lib/ascii/get_setting.js +47 -0
- package/dist/lib/ascii/get_setting.js.map +1 -0
- package/dist/lib/ascii/get_setting_result.d.ts +21 -0
- package/dist/lib/ascii/get_setting_result.js +19 -0
- package/dist/lib/ascii/get_setting_result.js.map +1 -0
- package/dist/lib/ascii/index.d.ts +5 -0
- package/dist/lib/ascii/index.js +12 -1
- package/dist/lib/ascii/index.js.map +1 -1
- package/dist/lib/ascii/setting_constants.d.ts +116 -0
- package/dist/lib/ascii/setting_constants.js +116 -0
- package/dist/lib/ascii/setting_constants.js.map +1 -1
- package/dist/lib/ascii_ns.d.ts +10 -0
- package/dist/lib/ascii_ns.js +5 -0
- package/dist/lib/ascii_ns.js.map +1 -1
- package/dist/lib/axis_address.d.ts +16 -0
- package/dist/lib/axis_address.js +53 -0
- package/dist/lib/axis_address.js.map +1 -0
- package/dist/lib/exceptions/index.d.ts +2 -0
- package/dist/lib/exceptions/index.js +6 -2
- package/dist/lib/exceptions/index.js.map +1 -1
- package/dist/lib/exceptions/operation_failed_exception.d.ts +14 -0
- package/dist/lib/exceptions/operation_failed_exception.js +32 -0
- package/dist/lib/exceptions/operation_failed_exception.js.map +1 -0
- package/dist/lib/exceptions/operation_failed_exception_data.d.ts +24 -0
- package/dist/lib/exceptions/operation_failed_exception_data.js +20 -0
- package/dist/lib/exceptions/operation_failed_exception_data.js.map +1 -0
- package/dist/lib/gateway/convert_exceptions.js +1 -0
- package/dist/lib/gateway/convert_exceptions.js.map +1 -1
- package/dist/lib/gcode/axis_transformation.js +1 -0
- package/dist/lib/gcode/axis_transformation.js.map +1 -1
- package/dist/lib/gcode/device_definition.js +1 -0
- package/dist/lib/gcode/device_definition.js.map +1 -1
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +3 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/microscopy/filter_changer.d.ts +36 -0
- package/dist/lib/microscopy/filter_changer.js +98 -0
- package/dist/lib/microscopy/filter_changer.js.map +1 -0
- package/dist/lib/microscopy/illuminator.d.ts +56 -0
- package/dist/lib/microscopy/illuminator.js +109 -0
- package/dist/lib/microscopy/illuminator.js.map +1 -0
- package/dist/lib/microscopy/illuminator_channel.d.ts +128 -0
- package/dist/lib/microscopy/illuminator_channel.js +260 -0
- package/dist/lib/microscopy/illuminator_channel.js.map +1 -0
- package/dist/lib/microscopy/index.d.ts +5 -0
- package/dist/lib/microscopy/index.js +11 -1
- package/dist/lib/microscopy/index.js.map +1 -1
- package/dist/lib/microscopy/microscope.d.ts +77 -0
- package/dist/lib/microscopy/microscope.js +142 -0
- package/dist/lib/microscopy/microscope.js.map +1 -0
- package/dist/lib/microscopy/microscope_config.d.ts +34 -0
- package/dist/lib/microscopy/microscope_config.js +65 -0
- package/dist/lib/microscopy/microscope_config.js.map +1 -0
- package/dist/lib/microscopy/objective_changer.d.ts +23 -14
- package/dist/lib/microscopy/objective_changer.js +58 -31
- package/dist/lib/microscopy/objective_changer.js.map +1 -1
- package/dist/lib/microscopy_ns.d.ts +8 -0
- package/dist/lib/microscopy_ns.js +4 -0
- package/dist/lib/microscopy_ns.js.map +1 -1
- package/dist/lib/product/process.d.ts +5 -0
- package/dist/lib/product/process.js +13 -0
- package/dist/lib/product/process.js.map +1 -1
- package/dist/lib/product/process_controller.d.ts +6 -1
- package/dist/lib/product/process_controller.js +12 -1
- package/dist/lib/product/process_controller.js.map +1 -1
- package/dist/lib/protobufs/main_pb.d.ts +520 -3
- package/dist/lib/protobufs/main_pb.js +10314 -6233
- package/dist/lib/protobufs/main_pb.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //
|
|
3
|
+
// ============= DO NOT EDIT DIRECTLY ============= //
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
16
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
17
|
+
}) : function(o, v) {
|
|
18
|
+
o["default"] = v;
|
|
19
|
+
});
|
|
20
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
21
|
+
if (mod && mod.__esModule) return mod;
|
|
22
|
+
var result = {};
|
|
23
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
24
|
+
__setModuleDefault(result, mod);
|
|
25
|
+
return result;
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.Microscope = void 0;
|
|
29
|
+
const gateway = __importStar(require("../gateway"));
|
|
30
|
+
const axis_1 = require("../ascii/axis");
|
|
31
|
+
const axis_group_1 = require("../ascii/axis_group");
|
|
32
|
+
const device_1 = require("../ascii/device");
|
|
33
|
+
const illuminator_1 = require("./illuminator");
|
|
34
|
+
const objective_changer_1 = require("./objective_changer");
|
|
35
|
+
const microscope_config_1 = require("./microscope_config");
|
|
36
|
+
const filter_changer_1 = require("./filter_changer");
|
|
37
|
+
/**
|
|
38
|
+
* Represent a microscope.
|
|
39
|
+
* It is subject to breaking changes without warning until further notice.
|
|
40
|
+
* Parts of the microscope may or may not be instantiated depending on the configuration.
|
|
41
|
+
* Requires at least Firmware 7.34.
|
|
42
|
+
*/
|
|
43
|
+
class Microscope {
|
|
44
|
+
/**
|
|
45
|
+
* Connection of the microscope.
|
|
46
|
+
*/
|
|
47
|
+
get connection() {
|
|
48
|
+
return this._connection;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The illuminator.
|
|
52
|
+
*/
|
|
53
|
+
get illuminator() {
|
|
54
|
+
return this._illuminator;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The focus axis.
|
|
58
|
+
*/
|
|
59
|
+
get focusAxis() {
|
|
60
|
+
return this._focusAxis;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The X axis.
|
|
64
|
+
*/
|
|
65
|
+
get xAxis() {
|
|
66
|
+
return this._xAxis;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The Y axis.
|
|
70
|
+
*/
|
|
71
|
+
get yAxis() {
|
|
72
|
+
return this._yAxis;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Axis group consisting of X and Y axes representing the plate of the microscope.
|
|
76
|
+
*/
|
|
77
|
+
get plate() {
|
|
78
|
+
return this._plate;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The objective changer.
|
|
82
|
+
*/
|
|
83
|
+
get objectiveChanger() {
|
|
84
|
+
return this._objectiveChanger;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The filter changer.
|
|
88
|
+
*/
|
|
89
|
+
get filterChanger() {
|
|
90
|
+
return this._filterChanger;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Creates instance of `Microscope` from the given config.
|
|
94
|
+
* Parts are instantiated depending on device addresses in the config.
|
|
95
|
+
*/
|
|
96
|
+
constructor(connection, config) {
|
|
97
|
+
var _a, _b, _c;
|
|
98
|
+
this._connection = connection;
|
|
99
|
+
this._config = microscope_config_1.MicroscopeConfig.fromProtobuf(microscope_config_1.MicroscopeConfig.toProtobuf(config).toObject());
|
|
100
|
+
this._illuminator = config.illuminator ? new illuminator_1.Illuminator(new device_1.Device(connection, config.illuminator)) : undefined;
|
|
101
|
+
this._focusAxis = ((_a = config.focusAxis) === null || _a === void 0 ? void 0 : _a.device) ? new axis_1.Axis(new device_1.Device(connection, config.focusAxis.device), config.focusAxis.axis) : undefined;
|
|
102
|
+
this._xAxis = ((_b = config.xAxis) === null || _b === void 0 ? void 0 : _b.device) ? new axis_1.Axis(new device_1.Device(connection, config.xAxis.device), config.xAxis.axis) : undefined;
|
|
103
|
+
this._yAxis = ((_c = config.yAxis) === null || _c === void 0 ? void 0 : _c.device) ? new axis_1.Axis(new device_1.Device(connection, config.yAxis.device), config.yAxis.axis) : undefined;
|
|
104
|
+
this._plate = this._xAxis && this._yAxis ? new axis_group_1.AxisGroup([this._xAxis, this._yAxis]) : undefined;
|
|
105
|
+
this._objectiveChanger = config.objectiveChanger && this._focusAxis ? new objective_changer_1.ObjectiveChanger(new device_1.Device(connection, config.objectiveChanger), this._focusAxis) : undefined;
|
|
106
|
+
this._filterChanger = config.filterChanger ? new filter_changer_1.FilterChanger(new device_1.Device(connection, config.filterChanger)) : undefined;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Finds a microscope on a connection.
|
|
110
|
+
* @param connection Connection on which to detect the microscope.
|
|
111
|
+
* @returns New instance of microscope.
|
|
112
|
+
*/
|
|
113
|
+
static async find(connection) {
|
|
114
|
+
const request = new gateway.InterfaceEmptyRequest();
|
|
115
|
+
request.setInterfaceId(connection.interfaceId);
|
|
116
|
+
const response = await gateway.callAsync('microscope/detect', request, gateway.MicroscopeConfig);
|
|
117
|
+
return new Microscope(connection, microscope_config_1.MicroscopeConfig.fromProtobuf(response.toObject()));
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Initializes the microscope.
|
|
121
|
+
* Homes all axes, filter changer, and objective changer.
|
|
122
|
+
*/
|
|
123
|
+
async initialize() {
|
|
124
|
+
const request = new gateway.MicroscopeEmptyRequest();
|
|
125
|
+
request.setInterfaceId(this.connection.interfaceId);
|
|
126
|
+
request.setConfig(microscope_config_1.MicroscopeConfig.toProtobuf(this._config));
|
|
127
|
+
await gateway.callAsync('microscope/initialize', request);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Returns a string that represents the microscope.
|
|
131
|
+
* @returns A string that represents the microscope.
|
|
132
|
+
*/
|
|
133
|
+
toString() {
|
|
134
|
+
const request = new gateway.MicroscopeEmptyRequest();
|
|
135
|
+
request.setInterfaceId(this.connection.interfaceId);
|
|
136
|
+
request.setConfig(microscope_config_1.MicroscopeConfig.toProtobuf(this._config));
|
|
137
|
+
const response = gateway.callSync('microscope/to_string', request, gateway.StringResponse);
|
|
138
|
+
return response.getValue();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
exports.Microscope = Microscope;
|
|
142
|
+
//# sourceMappingURL=microscope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"microscope.js","sourceRoot":"","sources":["../../../src/microscopy/microscope.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,wCAAqC;AACrC,oDAAgD;AAChD,4CAAyC;AAEzC,+CAA4C;AAC5C,2DAAuD;AACvD,2DAAuD;AACvD,qDAAiD;AAEjD;;;;;GAKG;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;;;OAGG;IACH,YAAY,UAAsB,EAAE,MAAwB;;QAC1D,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,oCAAgB,CAAC,YAAY,CAAC,oCAAgB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,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,WAAW,CAAC,CAAC;QACpD,OAAO,CAAC,SAAS,CAAC,oCAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAE7D,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,sBAAsB,EACtB,OAAO,EACP,OAAO,CAAC,cAAc,CAAC,CAAC;QAC1B,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;CACF;AAhID,gCAgIC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport { Axis } from '../ascii/axis';\nimport { AxisGroup } from '../ascii/axis_group';\nimport { Device } from '../ascii/device';\nimport { Connection } from '../ascii/connection';\nimport { Illuminator } from './illuminator';\nimport { ObjectiveChanger } from './objective_changer';\nimport { MicroscopeConfig } from './microscope_config';\nimport { FilterChanger } from './filter_changer';\n\n/**\n * Represent a microscope.\n * It is subject to breaking changes without warning until further notice.\n * Parts of the microscope may or may not be instantiated depending on the configuration.\n * Requires at least Firmware 7.34.\n */\nexport class Microscope {\n /**\n * Connection of the microscope.\n */\n public get connection(): Connection {\n return this._connection;\n }\n private _connection: Connection;\n\n private _config: MicroscopeConfig;\n\n /**\n * The illuminator.\n */\n public get illuminator(): Illuminator | undefined {\n return this._illuminator;\n }\n private _illuminator: Illuminator | undefined;\n\n /**\n * The focus axis.\n */\n public get focusAxis(): Axis | undefined {\n return this._focusAxis;\n }\n private _focusAxis: Axis | undefined;\n\n /**\n * The X axis.\n */\n public get xAxis(): Axis | undefined {\n return this._xAxis;\n }\n private _xAxis: Axis | undefined;\n\n /**\n * The Y axis.\n */\n public get yAxis(): Axis | undefined {\n return this._yAxis;\n }\n private _yAxis: Axis | undefined;\n\n /**\n * Axis group consisting of X and Y axes representing the plate of the microscope.\n */\n public get plate(): AxisGroup | undefined {\n return this._plate;\n }\n private _plate: AxisGroup | undefined;\n\n /**\n * The objective changer.\n */\n public get objectiveChanger(): ObjectiveChanger | undefined {\n return this._objectiveChanger;\n }\n private _objectiveChanger: ObjectiveChanger | undefined;\n\n /**\n * The filter changer.\n */\n public get filterChanger(): FilterChanger | undefined {\n return this._filterChanger;\n }\n private _filterChanger: FilterChanger | undefined;\n\n /**\n * Creates instance of `Microscope` from the given config.\n * Parts are instantiated depending on device addresses in the config.\n */\n constructor(connection: Connection, config: MicroscopeConfig) {\n this._connection = connection;\n this._config = MicroscopeConfig.fromProtobuf(MicroscopeConfig.toProtobuf(config).toObject());\n this._illuminator = config.illuminator ? new Illuminator(new Device(connection, config.illuminator)) : undefined;\n this._focusAxis = config.focusAxis?.device ? new Axis(new Device(connection, config.focusAxis.device), config.focusAxis.axis) : undefined;\n this._xAxis = config.xAxis?.device ? new Axis(new Device(connection, config.xAxis.device), config.xAxis.axis) : undefined;\n this._yAxis = config.yAxis?.device ? new Axis(new Device(connection, config.yAxis.device), config.yAxis.axis) : undefined;\n this._plate = this._xAxis && this._yAxis ? new AxisGroup([this._xAxis, this._yAxis]) : undefined;\n this._objectiveChanger = config.objectiveChanger && this._focusAxis ? new ObjectiveChanger(new Device(connection, config.objectiveChanger), this._focusAxis) : undefined;\n this._filterChanger = config.filterChanger ? new FilterChanger(new Device(connection, config.filterChanger)) : undefined;\n }\n\n /**\n * Finds a microscope on a connection.\n * @param connection Connection on which to detect the microscope.\n * @returns New instance of microscope.\n */\n public static async find(\n connection: Connection\n ): Promise<Microscope> {\n const request = new gateway.InterfaceEmptyRequest();\n request.setInterfaceId(connection.interfaceId);\n\n const response = await gateway.callAsync<gateway.MicroscopeConfig>(\n 'microscope/detect',\n request,\n gateway.MicroscopeConfig);\n return new Microscope(connection, MicroscopeConfig.fromProtobuf(response.toObject()));\n }\n\n /**\n * Initializes the microscope.\n * Homes all axes, filter changer, and objective changer.\n */\n public async initialize(): Promise<void> {\n const request = new gateway.MicroscopeEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setConfig(MicroscopeConfig.toProtobuf(this._config));\n\n await gateway.callAsync('microscope/initialize', request);\n }\n\n /**\n * Returns a string that represents the microscope.\n * @returns A string that represents the microscope.\n */\n public toString(): string {\n const request = new gateway.MicroscopeEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setConfig(MicroscopeConfig.toProtobuf(this._config));\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'microscope/to_string',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n}\n\nnamespace Microscope {\n}\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { AxisAddress } from '../axis_address';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration representing a microscope setup.
|
|
4
|
+
* Device address of value 0 means that the part is not present.
|
|
5
|
+
*/
|
|
6
|
+
export interface MicroscopeConfig {
|
|
7
|
+
/**
|
|
8
|
+
* Focus axis of the microscope.
|
|
9
|
+
*/
|
|
10
|
+
focusAxis?: AxisAddress;
|
|
11
|
+
/**
|
|
12
|
+
* X axis of the microscope.
|
|
13
|
+
*/
|
|
14
|
+
xAxis?: AxisAddress;
|
|
15
|
+
/**
|
|
16
|
+
* Y axis of the microscope.
|
|
17
|
+
*/
|
|
18
|
+
yAxis?: AxisAddress;
|
|
19
|
+
/**
|
|
20
|
+
* Illuminator device address.
|
|
21
|
+
*/
|
|
22
|
+
illuminator?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Filter changer device address.
|
|
25
|
+
*/
|
|
26
|
+
filterChanger?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Objective changer device address.
|
|
29
|
+
*/
|
|
30
|
+
objectiveChanger?: number;
|
|
31
|
+
}
|
|
32
|
+
export declare namespace MicroscopeConfig {
|
|
33
|
+
const __type = "MicroscopeConfig";
|
|
34
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //
|
|
3
|
+
// ============= DO NOT EDIT DIRECTLY ============= //
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
16
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
17
|
+
}) : function(o, v) {
|
|
18
|
+
o["default"] = v;
|
|
19
|
+
});
|
|
20
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
21
|
+
if (mod && mod.__esModule) return mod;
|
|
22
|
+
var result = {};
|
|
23
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
24
|
+
__setModuleDefault(result, mod);
|
|
25
|
+
return result;
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.MicroscopeConfig = void 0;
|
|
29
|
+
const gateway = __importStar(require("../gateway"));
|
|
30
|
+
const axis_address_1 = require("../axis_address");
|
|
31
|
+
var MicroscopeConfig;
|
|
32
|
+
(function (MicroscopeConfig) {
|
|
33
|
+
MicroscopeConfig.__type = 'MicroscopeConfig';
|
|
34
|
+
/** @internal */
|
|
35
|
+
function fromProtobuf(pbData) {
|
|
36
|
+
return {
|
|
37
|
+
focusAxis: pbData.focusAxis != null ? axis_address_1.AxisAddress.fromProtobuf(pbData.focusAxis) : undefined,
|
|
38
|
+
xAxis: pbData.xAxis != null ? axis_address_1.AxisAddress.fromProtobuf(pbData.xAxis) : undefined,
|
|
39
|
+
yAxis: pbData.yAxis != null ? axis_address_1.AxisAddress.fromProtobuf(pbData.yAxis) : undefined,
|
|
40
|
+
illuminator: pbData.illuminator,
|
|
41
|
+
filterChanger: pbData.filterChanger,
|
|
42
|
+
objectiveChanger: pbData.objectiveChanger,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
MicroscopeConfig.fromProtobuf = fromProtobuf;
|
|
46
|
+
/** @internal */
|
|
47
|
+
function toProtobuf(source) {
|
|
48
|
+
const pbData = new gateway.MicroscopeConfig();
|
|
49
|
+
if (source == null) {
|
|
50
|
+
pbData.setFocusAxis(axis_address_1.AxisAddress.toProtobuf(null));
|
|
51
|
+
pbData.setXAxis(axis_address_1.AxisAddress.toProtobuf(null));
|
|
52
|
+
pbData.setYAxis(axis_address_1.AxisAddress.toProtobuf(null));
|
|
53
|
+
return pbData;
|
|
54
|
+
}
|
|
55
|
+
pbData.setFocusAxis(axis_address_1.AxisAddress.toProtobuf(source.focusAxis));
|
|
56
|
+
pbData.setXAxis(axis_address_1.AxisAddress.toProtobuf(source.xAxis));
|
|
57
|
+
pbData.setYAxis(axis_address_1.AxisAddress.toProtobuf(source.yAxis));
|
|
58
|
+
pbData.setIlluminator(source.illuminator);
|
|
59
|
+
pbData.setFilterChanger(source.filterChanger);
|
|
60
|
+
pbData.setObjectiveChanger(source.objectiveChanger);
|
|
61
|
+
return pbData;
|
|
62
|
+
}
|
|
63
|
+
MicroscopeConfig.toProtobuf = toProtobuf;
|
|
64
|
+
})(MicroscopeConfig = exports.MicroscopeConfig || (exports.MicroscopeConfig = {}));
|
|
65
|
+
//# sourceMappingURL=microscope_config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"microscope_config.js","sourceRoot":"","sources":["../../../src/microscopy/microscope_config.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;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AAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;QAC9D,MAAM,CAAC,QAAQ,CAAC,0BAAW,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACtD,MAAM,CAAC,QAAQ,CAAC,0BAAW,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACtD,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,WAAY,CAAC,CAAC;QAC3C,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,aAAc,CAAC,CAAC;QAC/C,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,gBAAiB,CAAC,CAAC;QACrD,OAAO,MAAM,CAAC;IAChB,CAAC;IAhBe,2BAAU,aAgBzB,CAAA;AACH,CAAC,EAhCgB,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAgChC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport { AxisAddress } from '../axis_address';\n\n/**\n * Configuration representing a microscope setup.\n * Device address of value 0 means that the part is not present.\n */\nexport interface MicroscopeConfig {\n /**\n * Focus axis of the microscope.\n */\n focusAxis?: AxisAddress;\n\n /**\n * X axis of the microscope.\n */\n xAxis?: AxisAddress;\n\n /**\n * Y axis of the microscope.\n */\n yAxis?: AxisAddress;\n\n /**\n * Illuminator device address.\n */\n illuminator?: number;\n\n /**\n * Filter changer device address.\n */\n filterChanger?: number;\n\n /**\n * Objective changer device address.\n */\n objectiveChanger?: number;\n\n}\n\nexport namespace MicroscopeConfig {\n export const __type = 'MicroscopeConfig';\n\n /** @internal */\n export function fromProtobuf(pbData: gateway.MicroscopeConfig.AsObject): MicroscopeConfig {\n return {\n focusAxis: pbData.focusAxis != null ? AxisAddress.fromProtobuf(pbData.focusAxis) : undefined,\n xAxis: pbData.xAxis != null ? AxisAddress.fromProtobuf(pbData.xAxis) : undefined,\n yAxis: pbData.yAxis != null ? AxisAddress.fromProtobuf(pbData.yAxis) : undefined,\n illuminator: pbData.illuminator,\n filterChanger: pbData.filterChanger,\n objectiveChanger: pbData.objectiveChanger,\n };\n }\n /** @internal */\n export function toProtobuf(source: MicroscopeConfig | null | undefined): gateway.MicroscopeConfig {\n const pbData = new gateway.MicroscopeConfig();\n if (source == null) {\n pbData.setFocusAxis(AxisAddress.toProtobuf(null));\n pbData.setXAxis(AxisAddress.toProtobuf(null));\n pbData.setYAxis(AxisAddress.toProtobuf(null));\n return pbData;\n }\n\n pbData.setFocusAxis(AxisAddress.toProtobuf(source.focusAxis));\n pbData.setXAxis(AxisAddress.toProtobuf(source.xAxis));\n pbData.setYAxis(AxisAddress.toProtobuf(source.yAxis));\n pbData.setIlluminator(source.illuminator!);\n pbData.setFilterChanger(source.filterChanger!);\n pbData.setObjectiveChanger(source.objectiveChanger!);\n return pbData;\n }\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Connection } from '../ascii/connection';
|
|
2
|
+
import { Device } from '../ascii/device';
|
|
2
3
|
import { Axis } from '../ascii/axis';
|
|
3
4
|
import { Measurement } from '../measurement';
|
|
4
5
|
/**
|
|
@@ -7,27 +8,21 @@ import { Measurement } from '../measurement';
|
|
|
7
8
|
* Requires at least Firmware 7.32.
|
|
8
9
|
*/
|
|
9
10
|
export declare class ObjectiveChanger {
|
|
10
|
-
/**
|
|
11
|
-
* Connection of this device.
|
|
12
|
-
*/
|
|
13
|
-
get connection(): Connection;
|
|
14
|
-
private _connection;
|
|
15
11
|
/**
|
|
16
12
|
* Device address of the turret.
|
|
17
13
|
*/
|
|
18
|
-
get
|
|
19
|
-
private
|
|
20
|
-
/**
|
|
21
|
-
* Device address of the focus.
|
|
22
|
-
*/
|
|
23
|
-
get focusAddress(): number;
|
|
24
|
-
private _focusAddress;
|
|
14
|
+
get turret(): Device;
|
|
15
|
+
private _turret;
|
|
25
16
|
/**
|
|
26
17
|
* The focus axis.
|
|
27
18
|
*/
|
|
28
19
|
get focusAxis(): Axis;
|
|
29
20
|
private _focusAxis;
|
|
30
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Creates instance of `ObjectiveChanger` based on the given device.
|
|
23
|
+
* If the device is identified, this constructor will ensure it is an objective changer.
|
|
24
|
+
*/
|
|
25
|
+
constructor(turret: Device, focusAxis: Axis);
|
|
31
26
|
/**
|
|
32
27
|
* Finds an objective changer on a connection.
|
|
33
28
|
* In case of conflict, specify the optional device addresses.
|
|
@@ -41,7 +36,7 @@ export declare class ObjectiveChanger {
|
|
|
41
36
|
/**
|
|
42
37
|
* Changes the objective.
|
|
43
38
|
* Runs a sequence of movements switching from the current objective to the new one.
|
|
44
|
-
* @param objective Objective number starting from
|
|
39
|
+
* @param objective Objective number starting from 1.
|
|
45
40
|
* @param options.focusOffset Optional focus offset from the datum.
|
|
46
41
|
* If specified, the focus stage will move to the designated offset.
|
|
47
42
|
*/
|
|
@@ -56,6 +51,20 @@ export declare class ObjectiveChanger {
|
|
|
56
51
|
* @returns Current objective number starting from 1 or 0 if not applicable.
|
|
57
52
|
*/
|
|
58
53
|
getCurrentObjective(): Promise<number>;
|
|
54
|
+
/**
|
|
55
|
+
* Gets number of objectives that the turret can accommodate.
|
|
56
|
+
* @returns Number of positions.
|
|
57
|
+
*/
|
|
58
|
+
getNumberOfObjectives(): Promise<number>;
|
|
59
|
+
/**
|
|
60
|
+
* Checks if this is a objective changer and throws an error if it is not.
|
|
61
|
+
*/
|
|
62
|
+
private _verifyIsChanger;
|
|
63
|
+
/**
|
|
64
|
+
* Returns a string that represents the device.
|
|
65
|
+
* @returns A string that represents the device.
|
|
66
|
+
*/
|
|
67
|
+
toString(): string;
|
|
59
68
|
}
|
|
60
69
|
declare namespace ObjectiveChanger {
|
|
61
70
|
interface FindOptions {
|
|
@@ -36,23 +36,11 @@ const measurement_1 = require("../measurement");
|
|
|
36
36
|
* Requires at least Firmware 7.32.
|
|
37
37
|
*/
|
|
38
38
|
class ObjectiveChanger {
|
|
39
|
-
/**
|
|
40
|
-
* Connection of this device.
|
|
41
|
-
*/
|
|
42
|
-
get connection() {
|
|
43
|
-
return this._connection;
|
|
44
|
-
}
|
|
45
39
|
/**
|
|
46
40
|
* Device address of the turret.
|
|
47
41
|
*/
|
|
48
|
-
get
|
|
49
|
-
return this.
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Device address of the focus.
|
|
53
|
-
*/
|
|
54
|
-
get focusAddress() {
|
|
55
|
-
return this._focusAddress;
|
|
42
|
+
get turret() {
|
|
43
|
+
return this._turret;
|
|
56
44
|
}
|
|
57
45
|
/**
|
|
58
46
|
* The focus axis.
|
|
@@ -60,11 +48,14 @@ class ObjectiveChanger {
|
|
|
60
48
|
get focusAxis() {
|
|
61
49
|
return this._focusAxis;
|
|
62
50
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Creates instance of `ObjectiveChanger` based on the given device.
|
|
53
|
+
* If the device is identified, this constructor will ensure it is an objective changer.
|
|
54
|
+
*/
|
|
55
|
+
constructor(turret, focusAxis) {
|
|
56
|
+
this._turret = turret;
|
|
57
|
+
this._focusAxis = focusAxis;
|
|
58
|
+
this._verifyIsChanger();
|
|
68
59
|
}
|
|
69
60
|
/**
|
|
70
61
|
* Finds an objective changer on a connection.
|
|
@@ -82,21 +73,22 @@ class ObjectiveChanger {
|
|
|
82
73
|
request.setTurretAddress(turretAddress);
|
|
83
74
|
request.setFocusAddress(focusAddress);
|
|
84
75
|
const response = await gateway.callAsync('objective_changer/detect', request, gateway.ObjectiveChangerCreateResponse);
|
|
85
|
-
return new ObjectiveChanger(connection, response.getTurret(), response.
|
|
76
|
+
return new ObjectiveChanger(new device_1.Device(connection, response.getTurret()), new axis_1.Axis(new device_1.Device(connection, response.getFocusAddress()), response.getFocusAxis()));
|
|
86
77
|
}
|
|
87
78
|
/**
|
|
88
79
|
* Changes the objective.
|
|
89
80
|
* Runs a sequence of movements switching from the current objective to the new one.
|
|
90
|
-
* @param objective Objective number starting from
|
|
81
|
+
* @param objective Objective number starting from 1.
|
|
91
82
|
* @param options.focusOffset Optional focus offset from the datum.
|
|
92
83
|
* If specified, the focus stage will move to the designated offset.
|
|
93
84
|
*/
|
|
94
85
|
async change(objective, options = {}) {
|
|
95
86
|
const { focusOffset, } = options;
|
|
96
87
|
const request = new gateway.ObjectiveChangerChangeRequest();
|
|
97
|
-
request.setInterfaceId(this.connection.interfaceId);
|
|
98
|
-
request.setTurretAddress(this.
|
|
99
|
-
request.setFocusAddress(this.
|
|
88
|
+
request.setInterfaceId(this.turret.connection.interfaceId);
|
|
89
|
+
request.setTurretAddress(this.turret.deviceAddress);
|
|
90
|
+
request.setFocusAddress(this.focusAxis.device.deviceAddress);
|
|
91
|
+
request.setFocusAxis(this.focusAxis.axisNumber);
|
|
100
92
|
request.setObjective(objective);
|
|
101
93
|
request.setFocusOffset(measurement_1.Measurement.toProtobuf(focusOffset));
|
|
102
94
|
await gateway.callAsync('objective_changer/change', request);
|
|
@@ -106,9 +98,10 @@ class ObjectiveChanger {
|
|
|
106
98
|
*/
|
|
107
99
|
async release() {
|
|
108
100
|
const request = new gateway.ObjectiveChangerRequest();
|
|
109
|
-
request.setInterfaceId(this.connection.interfaceId);
|
|
110
|
-
request.setTurretAddress(this.
|
|
111
|
-
request.setFocusAddress(this.
|
|
101
|
+
request.setInterfaceId(this.turret.connection.interfaceId);
|
|
102
|
+
request.setTurretAddress(this.turret.deviceAddress);
|
|
103
|
+
request.setFocusAddress(this.focusAxis.device.deviceAddress);
|
|
104
|
+
request.setFocusAxis(this.focusAxis.axisNumber);
|
|
112
105
|
await gateway.callAsync('objective_changer/release', request);
|
|
113
106
|
}
|
|
114
107
|
/**
|
|
@@ -117,11 +110,45 @@ class ObjectiveChanger {
|
|
|
117
110
|
* @returns Current objective number starting from 1 or 0 if not applicable.
|
|
118
111
|
*/
|
|
119
112
|
async getCurrentObjective() {
|
|
113
|
+
const request = new gateway.AxisEmptyRequest();
|
|
114
|
+
request.setInterfaceId(this.turret.connection.interfaceId);
|
|
115
|
+
request.setDevice(this.turret.deviceAddress);
|
|
116
|
+
request.setAxis(1);
|
|
117
|
+
const response = await gateway.callAsync('device/get_index_position', request, gateway.IntResponse);
|
|
118
|
+
return response.getValue();
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Gets number of objectives that the turret can accommodate.
|
|
122
|
+
* @returns Number of positions.
|
|
123
|
+
*/
|
|
124
|
+
async getNumberOfObjectives() {
|
|
125
|
+
const request = new gateway.AxisEmptyRequest();
|
|
126
|
+
request.setInterfaceId(this.turret.connection.interfaceId);
|
|
127
|
+
request.setDevice(this.turret.deviceAddress);
|
|
128
|
+
request.setAxis(1);
|
|
129
|
+
const response = await gateway.callAsync('device/get_index_count', request, gateway.IntResponse);
|
|
130
|
+
return response.getValue();
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Checks if this is a objective changer and throws an error if it is not.
|
|
134
|
+
*/
|
|
135
|
+
_verifyIsChanger() {
|
|
120
136
|
const request = new gateway.ObjectiveChangerRequest();
|
|
121
|
-
request.setInterfaceId(this.connection.interfaceId);
|
|
122
|
-
request.setTurretAddress(this.
|
|
123
|
-
request.setFocusAddress(this.
|
|
124
|
-
|
|
137
|
+
request.setInterfaceId(this.turret.connection.interfaceId);
|
|
138
|
+
request.setTurretAddress(this.turret.deviceAddress);
|
|
139
|
+
request.setFocusAddress(this.focusAxis.device.deviceAddress);
|
|
140
|
+
request.setFocusAxis(this.focusAxis.axisNumber);
|
|
141
|
+
gateway.callSync('objective_changer/verify', request);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Returns a string that represents the device.
|
|
145
|
+
* @returns A string that represents the device.
|
|
146
|
+
*/
|
|
147
|
+
toString() {
|
|
148
|
+
const request = new gateway.AxisToStringRequest();
|
|
149
|
+
request.setInterfaceId(this.turret.connection.interfaceId);
|
|
150
|
+
request.setDevice(this.turret.deviceAddress);
|
|
151
|
+
const response = gateway.callSync('device/device_to_string', request, gateway.StringResponse);
|
|
125
152
|
return response.getValue();
|
|
126
153
|
}
|
|
127
154
|
}
|
|
@@ -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;AACrC,gDAA6C;AAE7C;;;;GAIG;AACH,MAAa,gBAAgB;IAC3B;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAGD;;OAEG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAGD;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAGD;;OAEG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAGD,YAAY,UAAsB,EAAE,aAAqB,EAAE,YAAoB;QAC7E,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;QACpC,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;QAClC,IAAI,CAAC,UAAU,GAAG,IAAI,WAAI,CAAC,IAAI,eAAM,CAAC,UAAU,EAAE,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;;;OAQG;IACI,MAAM,CAAC,KAAK,CAAC,IAAI,CACtB,UAAsB,EACtB,UAAwC,EAAE;QAE1C,MAAM,EACJ,aAAa,GAAG,CAAC,EACjB,YAAY,GAAG,CAAC,GACjB,GAAG,OAAO,CAAC;QACZ,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,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AAa,CAAC,CAAC;QAC7C,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAE3C,MAAM,OAAO,CAAC,SAAS,CAAC,2BAA2B,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,mBAAmB;QAC9B,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,uBAAuB,EAAE,CAAC;QACtD,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACpD,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC7C,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAE3C,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,yCAAyC,EACzC,OAAO,EACP,OAAO,CAAC,kCAAkC,CAAC,CAAC;QAC9C,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;CACF;AA1HD,4CA0HC","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';\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 * Connection of this device.\n */\n public get connection(): Connection {\n return this._connection;\n }\n private _connection: Connection;\n\n /**\n * Device address of the turret.\n */\n public get turretAddress(): number {\n return this._turretAddress;\n }\n private _turretAddress: number;\n\n /**\n * Device address of the focus.\n */\n public get focusAddress(): number {\n return this._focusAddress;\n }\n private _focusAddress: number;\n\n /**\n * The focus axis.\n */\n public get focusAxis(): Axis {\n return this._focusAxis;\n }\n private _focusAxis: Axis;\n\n constructor(connection: Connection, turretAddress: number, focusAddress: number) {\n this._connection = connection;\n this._turretAddress = turretAddress;\n this._focusAddress = focusAddress;\n this._focusAxis = new Axis(new Device(connection, focusAddress), 1);\n }\n\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 = new gateway.ObjectiveChangerRequest();\n request.setInterfaceId(connection.interfaceId);\n request.setTurretAddress(turretAddress);\n request.setFocusAddress(focusAddress);\n\n const response = await gateway.callAsync<gateway.ObjectiveChangerCreateResponse>(\n 'objective_changer/detect',\n request,\n gateway.ObjectiveChangerCreateResponse);\n return new ObjectiveChanger(connection, response.getTurret(), response.getFocus());\n }\n\n /**\n * Changes the objective.\n * Runs a sequence of movements switching from the current objective to the new one.\n * @param objective Objective number starting from one.\n * @param options.focusOffset Optional focus offset from the datum.\n * If specified, the focus stage will move to the designated offset.\n */\n public async change(\n objective: number,\n options: ObjectiveChanger.ChangeOptions = {}\n ): Promise<void> {\n const {\n focusOffset,\n } = options;\n const request = new gateway.ObjectiveChangerChangeRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setTurretAddress(this.turretAddress);\n request.setFocusAddress(this.focusAddress);\n request.setObjective(objective);\n request.setFocusOffset(Measurement.toProtobuf(focusOffset));\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 = new gateway.ObjectiveChangerRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setTurretAddress(this.turretAddress);\n request.setFocusAddress(this.focusAddress);\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 = new gateway.ObjectiveChangerRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setTurretAddress(this.turretAddress);\n request.setFocusAddress(this.focusAddress);\n\n const response = await gateway.callAsync<gateway.ObjectiveChangerGetCurrentResponse>(\n 'objective_changer/get_current_objective',\n request,\n gateway.ObjectiveChangerGetCurrentResponse);\n return response.getValue();\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;AAEtC,4CAAyC;AACzC,wCAAqC;AACrC,gDAA6C;AAE7C;;;;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;;;;;;;;OAQG;IACI,MAAM,CAAC,KAAK,CAAC,IAAI,CACtB,UAAsB,EACtB,UAAwC,EAAE;QAE1C,MAAM,EACJ,aAAa,GAAG,CAAC,EACjB,YAAY,GAAG,CAAC,GACjB,GAAG,OAAO,CAAC;QACZ,MAAM,OAAO,GAAG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============= 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';\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 * 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 = new gateway.ObjectiveChangerRequest();\n request.setInterfaceId(connection.interfaceId);\n request.setTurretAddress(turretAddress);\n request.setFocusAddress(focusAddress);\n\n const response = await gateway.callAsync<gateway.ObjectiveChangerCreateResponse>(\n 'objective_changer/detect',\n request,\n gateway.ObjectiveChangerCreateResponse);\n return new ObjectiveChanger(new Device(connection, response.getTurret()), new Axis(new Device(connection, response.getFocusAddress()), response.getFocusAxis()));\n }\n\n /**\n * Changes the objective.\n * Runs a sequence of movements switching from the current objective to the new one.\n * @param objective Objective number starting from 1.\n * @param options.focusOffset Optional focus offset from the datum.\n * If specified, the focus stage will move to the designated offset.\n */\n public async change(\n objective: number,\n options: ObjectiveChanger.ChangeOptions = {}\n ): Promise<void> {\n const {\n focusOffset,\n } = options;\n const request = new gateway.ObjectiveChangerChangeRequest();\n request.setInterfaceId(this.turret.connection.interfaceId);\n request.setTurretAddress(this.turret.deviceAddress);\n request.setFocusAddress(this.focusAxis.device.deviceAddress);\n request.setFocusAxis(this.focusAxis.axisNumber);\n request.setObjective(objective);\n request.setFocusOffset(Measurement.toProtobuf(focusOffset));\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 = new gateway.ObjectiveChangerRequest();\n request.setInterfaceId(this.turret.connection.interfaceId);\n request.setTurretAddress(this.turret.deviceAddress);\n request.setFocusAddress(this.focusAxis.device.deviceAddress);\n request.setFocusAxis(this.focusAxis.axisNumber);\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 = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.turret.connection.interfaceId);\n request.setDevice(this.turret.deviceAddress);\n request.setAxis(1);\n\n const response = await gateway.callAsync<gateway.IntResponse>(\n 'device/get_index_position',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Gets number of objectives that the turret can accommodate.\n * @returns Number of positions.\n */\n public async getNumberOfObjectives(): Promise<number> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.turret.connection.interfaceId);\n request.setDevice(this.turret.deviceAddress);\n request.setAxis(1);\n\n const response = await gateway.callAsync<gateway.IntResponse>(\n 'device/get_index_count',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Checks if this is a objective changer and throws an error if it is not.\n */\n private _verifyIsChanger(): void {\n const request = new gateway.ObjectiveChangerRequest();\n request.setInterfaceId(this.turret.connection.interfaceId);\n request.setTurretAddress(this.turret.deviceAddress);\n request.setFocusAddress(this.focusAxis.device.deviceAddress);\n request.setFocusAxis(this.focusAxis.axisNumber);\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 = new gateway.AxisToStringRequest();\n request.setInterfaceId(this.turret.connection.interfaceId);\n request.setDevice(this.turret.deviceAddress);\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'device/device_to_string',\n request,\n gateway.StringResponse);\n return response.getValue();\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"]}
|
|
@@ -2,4 +2,12 @@ import * as microscopyImport from './microscopy';
|
|
|
2
2
|
export declare namespace microscopy {
|
|
3
3
|
const ObjectiveChanger: typeof microscopyImport.ObjectiveChanger;
|
|
4
4
|
type ObjectiveChanger = microscopyImport.ObjectiveChanger;
|
|
5
|
+
const Illuminator: typeof microscopyImport.Illuminator;
|
|
6
|
+
type Illuminator = microscopyImport.Illuminator;
|
|
7
|
+
const Microscope: typeof microscopyImport.Microscope;
|
|
8
|
+
type Microscope = microscopyImport.Microscope;
|
|
9
|
+
const MicroscopeConfig: typeof microscopyImport.MicroscopeConfig;
|
|
10
|
+
type MicroscopeConfig = microscopyImport.MicroscopeConfig;
|
|
11
|
+
const FilterChanger: typeof microscopyImport.FilterChanger;
|
|
12
|
+
type FilterChanger = microscopyImport.FilterChanger;
|
|
5
13
|
}
|
|
@@ -28,5 +28,9 @@ const microscopyImport = __importStar(require("./microscopy"));
|
|
|
28
28
|
var microscopy;
|
|
29
29
|
(function (microscopy) {
|
|
30
30
|
microscopy.ObjectiveChanger = microscopyImport.ObjectiveChanger;
|
|
31
|
+
microscopy.Illuminator = microscopyImport.Illuminator;
|
|
32
|
+
microscopy.Microscope = microscopyImport.Microscope;
|
|
33
|
+
microscopy.MicroscopeConfig = microscopyImport.MicroscopeConfig;
|
|
34
|
+
microscopy.FilterChanger = microscopyImport.FilterChanger;
|
|
31
35
|
})(microscopy = exports.microscopy || (exports.microscopy = {}));
|
|
32
36
|
//# sourceMappingURL=microscopy_ns.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"microscopy_ns.js","sourceRoot":"","sources":["../../src/microscopy_ns.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAAiD;AAEjD,IAAiB,UAAU,
|
|
1
|
+
{"version":3,"file":"microscopy_ns.js","sourceRoot":"","sources":["../../src/microscopy_ns.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAAiD;AAEjD,IAAiB,UAAU,CAW1B;AAXD,WAAiB,UAAU;IACZ,2BAAgB,GAAG,gBAAgB,CAAC,gBAAgB,CAAC;IAErD,sBAAW,GAAG,gBAAgB,CAAC,WAAW,CAAC;IAE3C,qBAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC;IAEzC,2BAAgB,GAAG,gBAAgB,CAAC,gBAAgB,CAAC;IAErD,wBAAa,GAAG,gBAAgB,CAAC,aAAa,CAAC;AAE9D,CAAC,EAXgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAW1B","sourcesContent":["import * as microscopyImport from './microscopy';\n\nexport namespace microscopy {\n export const ObjectiveChanger = microscopyImport.ObjectiveChanger;\n export type ObjectiveChanger = microscopyImport.ObjectiveChanger;\n export const Illuminator = microscopyImport.Illuminator;\n export type Illuminator = microscopyImport.Illuminator;\n export const Microscope = microscopyImport.Microscope;\n export type Microscope = microscopyImport.Microscope;\n export const MicroscopeConfig = microscopyImport.MicroscopeConfig;\n export type MicroscopeConfig = microscopyImport.MicroscopeConfig;\n export const FilterChanger = microscopyImport.FilterChanger;\n export type FilterChanger = microscopyImport.FilterChanger;\n}\n"]}
|
|
@@ -136,6 +136,11 @@ export declare class Process {
|
|
|
136
136
|
* @returns An explanation of why this state cannot be set to this process.
|
|
137
137
|
*/
|
|
138
138
|
canSetState(state: string): Promise<string>;
|
|
139
|
+
/**
|
|
140
|
+
* Returns a string that represents the process.
|
|
141
|
+
* @returns A string that represents the process.
|
|
142
|
+
*/
|
|
143
|
+
toString(): string;
|
|
139
144
|
}
|
|
140
145
|
declare namespace Process {
|
|
141
146
|
interface GenericCommandOptions {
|
|
@@ -306,6 +306,19 @@ class Process {
|
|
|
306
306
|
const response = await gateway.callAsync('device/can_set_axis_state', request, gateway.CanSetStateAxisResponse);
|
|
307
307
|
return response.getError();
|
|
308
308
|
}
|
|
309
|
+
/**
|
|
310
|
+
* Returns a string that represents the process.
|
|
311
|
+
* @returns A string that represents the process.
|
|
312
|
+
*/
|
|
313
|
+
toString() {
|
|
314
|
+
const request = new gateway.AxisToStringRequest();
|
|
315
|
+
request.setInterfaceId(this.controller.device.connection.interfaceId);
|
|
316
|
+
request.setDevice(this.controller.device.deviceAddress);
|
|
317
|
+
request.setAxis(this.processNumber);
|
|
318
|
+
request.setTypeOverride('Process');
|
|
319
|
+
const response = gateway.callSync('device/axis_to_string', request, gateway.StringResponse);
|
|
320
|
+
return response.getValue();
|
|
321
|
+
}
|
|
309
322
|
}
|
|
310
323
|
exports.Process = Process;
|
|
311
324
|
//# sourceMappingURL=process.js.map
|