@zaber/motion 4.5.1 → 4.7.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 +82 -0
- package/dist/lib/microscopy/microscope.js +153 -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 +42 -16
- package/dist/lib/microscopy/objective_changer.js +95 -33
- 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 +560 -3
- package/dist/lib/protobufs/main_pb.js +10544 -6161
- package/dist/lib/protobufs/main_pb.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Axis } from '../ascii/axis';
|
|
2
|
+
import { AxisGroup } from '../ascii/axis_group';
|
|
3
|
+
import { Connection } from '../ascii/connection';
|
|
4
|
+
import { Illuminator } from './illuminator';
|
|
5
|
+
import { ObjectiveChanger } from './objective_changer';
|
|
6
|
+
import { MicroscopeConfig } from './microscope_config';
|
|
7
|
+
import { FilterChanger } from './filter_changer';
|
|
8
|
+
/**
|
|
9
|
+
* Represent a microscope.
|
|
10
|
+
* It is subject to breaking changes without warning until further notice.
|
|
11
|
+
* Parts of the microscope may or may not be instantiated depending on the configuration.
|
|
12
|
+
* Requires at least Firmware 7.34.
|
|
13
|
+
*/
|
|
14
|
+
export declare class Microscope {
|
|
15
|
+
/**
|
|
16
|
+
* Connection of the microscope.
|
|
17
|
+
*/
|
|
18
|
+
get connection(): Connection;
|
|
19
|
+
private _connection;
|
|
20
|
+
private _config;
|
|
21
|
+
/**
|
|
22
|
+
* The illuminator.
|
|
23
|
+
*/
|
|
24
|
+
get illuminator(): Illuminator | undefined;
|
|
25
|
+
private _illuminator;
|
|
26
|
+
/**
|
|
27
|
+
* The focus axis.
|
|
28
|
+
*/
|
|
29
|
+
get focusAxis(): Axis | undefined;
|
|
30
|
+
private _focusAxis;
|
|
31
|
+
/**
|
|
32
|
+
* The X axis.
|
|
33
|
+
*/
|
|
34
|
+
get xAxis(): Axis | undefined;
|
|
35
|
+
private _xAxis;
|
|
36
|
+
/**
|
|
37
|
+
* The Y axis.
|
|
38
|
+
*/
|
|
39
|
+
get yAxis(): Axis | undefined;
|
|
40
|
+
private _yAxis;
|
|
41
|
+
/**
|
|
42
|
+
* Axis group consisting of X and Y axes representing the plate of the microscope.
|
|
43
|
+
*/
|
|
44
|
+
get plate(): AxisGroup | undefined;
|
|
45
|
+
private _plate;
|
|
46
|
+
/**
|
|
47
|
+
* The objective changer.
|
|
48
|
+
*/
|
|
49
|
+
get objectiveChanger(): ObjectiveChanger | undefined;
|
|
50
|
+
private _objectiveChanger;
|
|
51
|
+
/**
|
|
52
|
+
* The filter changer.
|
|
53
|
+
*/
|
|
54
|
+
get filterChanger(): FilterChanger | undefined;
|
|
55
|
+
private _filterChanger;
|
|
56
|
+
/**
|
|
57
|
+
* Creates instance of `Microscope` from the given config.
|
|
58
|
+
* Parts are instantiated depending on device addresses in the config.
|
|
59
|
+
*/
|
|
60
|
+
constructor(connection: Connection, config: MicroscopeConfig);
|
|
61
|
+
/**
|
|
62
|
+
* Finds a microscope on a connection.
|
|
63
|
+
* @param connection Connection on which to detect the microscope.
|
|
64
|
+
* @returns New instance of microscope.
|
|
65
|
+
*/
|
|
66
|
+
static find(connection: Connection): Promise<Microscope>;
|
|
67
|
+
/**
|
|
68
|
+
* Initializes the microscope.
|
|
69
|
+
* Homes all axes, filter changer, and objective changer.
|
|
70
|
+
*/
|
|
71
|
+
initialize(): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Checks whether the microscope needs initialization.
|
|
74
|
+
* @returns True, when the microscope needs initialization.
|
|
75
|
+
*/
|
|
76
|
+
isInitialized(): Promise<boolean>;
|
|
77
|
+
/**
|
|
78
|
+
* Returns a string that represents the microscope.
|
|
79
|
+
* @returns A string that represents the microscope.
|
|
80
|
+
*/
|
|
81
|
+
toString(): string;
|
|
82
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
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
|
+
* Checks whether the microscope needs initialization.
|
|
131
|
+
* @returns True, when the microscope needs initialization.
|
|
132
|
+
*/
|
|
133
|
+
async isInitialized() {
|
|
134
|
+
const request = new gateway.MicroscopeEmptyRequest();
|
|
135
|
+
request.setInterfaceId(this.connection.interfaceId);
|
|
136
|
+
request.setConfig(microscope_config_1.MicroscopeConfig.toProtobuf(this._config));
|
|
137
|
+
const response = await gateway.callAsync('microscope/is_initialized', request, gateway.BoolResponse);
|
|
138
|
+
return response.getValue();
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Returns a string that represents the microscope.
|
|
142
|
+
* @returns A string that represents the microscope.
|
|
143
|
+
*/
|
|
144
|
+
toString() {
|
|
145
|
+
const request = new gateway.MicroscopeEmptyRequest();
|
|
146
|
+
request.setInterfaceId(this.connection.interfaceId);
|
|
147
|
+
request.setConfig(microscope_config_1.MicroscopeConfig.toProtobuf(this._config));
|
|
148
|
+
const response = gateway.callSync('microscope/to_string', request, gateway.StringResponse);
|
|
149
|
+
return response.getValue();
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
exports.Microscope = Microscope;
|
|
153
|
+
//# sourceMappingURL=microscope.js.map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CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAE7D,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,2BAA2B,EAC3B,OAAO,EACP,OAAO,CAAC,YAAY,CAAC,CAAC;QACxB,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,sBAAsB,EAAE,CAAC;QACrD,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACpD,OAAO,CAAC,SAAS,CAAC,oCAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAE7D,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,sBAAsB,EACtB,OAAO,EACP,OAAO,CAAC,cAAc,CAAC,CAAC;QAC1B,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;CACF;AAhJD,gCAgJC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport { Axis } from '../ascii/axis';\nimport { AxisGroup } from '../ascii/axis_group';\nimport { Device } from '../ascii/device';\nimport { Connection } from '../ascii/connection';\nimport { Illuminator } from './illuminator';\nimport { ObjectiveChanger } from './objective_changer';\nimport { MicroscopeConfig } from './microscope_config';\nimport { FilterChanger } from './filter_changer';\n\n/**\n * Represent a microscope.\n * It is subject to breaking changes without warning until further notice.\n * Parts of the microscope may or may not be instantiated depending on the configuration.\n * Requires at least Firmware 7.34.\n */\nexport class Microscope {\n /**\n * Connection of the microscope.\n */\n public get connection(): Connection {\n return this._connection;\n }\n private _connection: Connection;\n\n private _config: MicroscopeConfig;\n\n /**\n * The illuminator.\n */\n public get illuminator(): Illuminator | undefined {\n return this._illuminator;\n }\n private _illuminator: Illuminator | undefined;\n\n /**\n * The focus axis.\n */\n public get focusAxis(): Axis | undefined {\n return this._focusAxis;\n }\n private _focusAxis: Axis | undefined;\n\n /**\n * The X axis.\n */\n public get xAxis(): Axis | undefined {\n return this._xAxis;\n }\n private _xAxis: Axis | undefined;\n\n /**\n * The Y axis.\n */\n public get yAxis(): Axis | undefined {\n return this._yAxis;\n }\n private _yAxis: Axis | undefined;\n\n /**\n * Axis group consisting of X and Y axes representing the plate of the microscope.\n */\n public get plate(): AxisGroup | undefined {\n return this._plate;\n }\n private _plate: AxisGroup | undefined;\n\n /**\n * The objective changer.\n */\n public get objectiveChanger(): ObjectiveChanger | undefined {\n return this._objectiveChanger;\n }\n private _objectiveChanger: ObjectiveChanger | undefined;\n\n /**\n * The filter changer.\n */\n public get filterChanger(): FilterChanger | undefined {\n return this._filterChanger;\n }\n private _filterChanger: FilterChanger | undefined;\n\n /**\n * Creates instance of `Microscope` from the given config.\n * Parts are instantiated depending on device addresses in the config.\n */\n constructor(connection: Connection, config: MicroscopeConfig) {\n this._connection = connection;\n this._config = MicroscopeConfig.fromProtobuf(MicroscopeConfig.toProtobuf(config).toObject());\n this._illuminator = config.illuminator ? new Illuminator(new Device(connection, config.illuminator)) : undefined;\n this._focusAxis = config.focusAxis?.device ? new Axis(new Device(connection, config.focusAxis.device), config.focusAxis.axis) : undefined;\n this._xAxis = config.xAxis?.device ? new Axis(new Device(connection, config.xAxis.device), config.xAxis.axis) : undefined;\n this._yAxis = config.yAxis?.device ? new Axis(new Device(connection, config.yAxis.device), config.yAxis.axis) : undefined;\n this._plate = this._xAxis && this._yAxis ? new AxisGroup([this._xAxis, this._yAxis]) : undefined;\n this._objectiveChanger = config.objectiveChanger && this._focusAxis ? new ObjectiveChanger(new Device(connection, config.objectiveChanger), this._focusAxis) : undefined;\n this._filterChanger = config.filterChanger ? new FilterChanger(new Device(connection, config.filterChanger)) : undefined;\n }\n\n /**\n * Finds a microscope on a connection.\n * @param connection Connection on which to detect the microscope.\n * @returns New instance of microscope.\n */\n public static async find(\n connection: Connection\n ): Promise<Microscope> {\n const request = new gateway.InterfaceEmptyRequest();\n request.setInterfaceId(connection.interfaceId);\n\n const response = await gateway.callAsync<gateway.MicroscopeConfig>(\n 'microscope/detect',\n request,\n gateway.MicroscopeConfig);\n return new Microscope(connection, MicroscopeConfig.fromProtobuf(response.toObject()));\n }\n\n /**\n * Initializes the microscope.\n * Homes all axes, filter changer, and objective changer.\n */\n public async initialize(): Promise<void> {\n const request = new gateway.MicroscopeEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setConfig(MicroscopeConfig.toProtobuf(this._config));\n\n await gateway.callAsync('microscope/initialize', request);\n }\n\n /**\n * Checks whether the microscope needs initialization.\n * @returns True, when the microscope needs initialization.\n */\n public async isInitialized(): Promise<boolean> {\n const request = new gateway.MicroscopeEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setConfig(MicroscopeConfig.toProtobuf(this._config));\n\n const response = await gateway.callAsync<gateway.BoolResponse>(\n 'microscope/is_initialized',\n request,\n gateway.BoolResponse);\n return response.getValue();\n }\n\n /**\n * Returns a string that represents the microscope.\n * @returns A string that represents the microscope.\n */\n public toString(): string {\n const request = new gateway.MicroscopeEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setConfig(MicroscopeConfig.toProtobuf(this._config));\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'microscope/to_string',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n}\n\nnamespace Microscope {\n}\n"]}
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,kDAA8C;AAuC9C,IAAiB,gBAAgB,CAgChC;AAhCD,WAAiB,gBAAgB;IAClB,uBAAM,GAAG,kBAAkB,CAAC;IAEzC,gBAAgB;IAChB,SAAgB,YAAY,CAAC,MAAyC;QACpE,OAAO;YACL,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,0BAAW,CAAC,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS;YAC5F,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,0BAAW,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;YAChF,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,0BAAW,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;YAChF,W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OT 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,33 +1,29 @@
|
|
|
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';
|
|
5
|
+
import { Angle, Length, Native } from '../units';
|
|
4
6
|
/**
|
|
5
7
|
* Represents an objective changer of a microscope.
|
|
6
8
|
* Unstable. Expect breaking changes in future releases.
|
|
7
9
|
* Requires at least Firmware 7.32.
|
|
8
10
|
*/
|
|
9
11
|
export declare class ObjectiveChanger {
|
|
10
|
-
/**
|
|
11
|
-
* Connection of this device.
|
|
12
|
-
*/
|
|
13
|
-
get connection(): Connection;
|
|
14
|
-
private _connection;
|
|
15
12
|
/**
|
|
16
13
|
* Device address of the turret.
|
|
17
14
|
*/
|
|
18
|
-
get
|
|
19
|
-
private
|
|
20
|
-
/**
|
|
21
|
-
* Device address of the focus.
|
|
22
|
-
*/
|
|
23
|
-
get focusAddress(): number;
|
|
24
|
-
private _focusAddress;
|
|
15
|
+
get turret(): Device;
|
|
16
|
+
private _turret;
|
|
25
17
|
/**
|
|
26
18
|
* The focus axis.
|
|
27
19
|
*/
|
|
28
20
|
get focusAxis(): Axis;
|
|
29
21
|
private _focusAxis;
|
|
30
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Creates instance of `ObjectiveChanger` based on the given device.
|
|
24
|
+
* If the device is identified, this constructor will ensure it is an objective changer.
|
|
25
|
+
*/
|
|
26
|
+
constructor(turret: Device, focusAxis: Axis);
|
|
31
27
|
/**
|
|
32
28
|
* Finds an objective changer on a connection.
|
|
33
29
|
* In case of conflict, specify the optional device addresses.
|
|
@@ -41,9 +37,9 @@ export declare class ObjectiveChanger {
|
|
|
41
37
|
/**
|
|
42
38
|
* Changes the objective.
|
|
43
39
|
* Runs a sequence of movements switching from the current objective to the new one.
|
|
44
|
-
*
|
|
45
|
-
* @param
|
|
46
|
-
*
|
|
40
|
+
* The focus stage moves to the focus datum after the objective change.
|
|
41
|
+
* @param objective Objective number starting from 1.
|
|
42
|
+
* @param options.focusOffset Optional offset from the focus datum.
|
|
47
43
|
*/
|
|
48
44
|
change(objective: number, options?: ObjectiveChanger.ChangeOptions): Promise<void>;
|
|
49
45
|
/**
|
|
@@ -56,6 +52,36 @@ export declare class ObjectiveChanger {
|
|
|
56
52
|
* @returns Current objective number starting from 1 or 0 if not applicable.
|
|
57
53
|
*/
|
|
58
54
|
getCurrentObjective(): Promise<number>;
|
|
55
|
+
/**
|
|
56
|
+
* Gets number of objectives that the turret can accommodate.
|
|
57
|
+
* @returns Number of positions.
|
|
58
|
+
*/
|
|
59
|
+
getNumberOfObjectives(): Promise<number>;
|
|
60
|
+
/**
|
|
61
|
+
* Gets the focus datum.
|
|
62
|
+
* The focus datum is the position that the focus stage moves to after an objective change.
|
|
63
|
+
* It is backed by the limit.home.offset setting.
|
|
64
|
+
* @param [unit=Units.NATIVE] Units of datum.
|
|
65
|
+
* @returns The datum.
|
|
66
|
+
*/
|
|
67
|
+
getFocusDatum(unit?: Length | Angle | Native): Promise<number>;
|
|
68
|
+
/**
|
|
69
|
+
* Sets the focus datum.
|
|
70
|
+
* The focus datum is the position that the focus stage moves to after an objective change.
|
|
71
|
+
* It is backed by the limit.home.offset setting.
|
|
72
|
+
* @param datum Value of datum.
|
|
73
|
+
* @param [unit=Units.NATIVE] Units of datum.
|
|
74
|
+
*/
|
|
75
|
+
setFocusDatum(datum: number, unit?: Length | Angle | Native): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Checks if this is a objective changer and throws an error if it is not.
|
|
78
|
+
*/
|
|
79
|
+
private _verifyIsChanger;
|
|
80
|
+
/**
|
|
81
|
+
* Returns a string that represents the device.
|
|
82
|
+
* @returns A string that represents the device.
|
|
83
|
+
*/
|
|
84
|
+
toString(): string;
|
|
59
85
|
}
|
|
60
86
|
declare namespace ObjectiveChanger {
|
|
61
87
|
interface FindOptions {
|
|
@@ -30,29 +30,18 @@ const gateway = __importStar(require("../gateway"));
|
|
|
30
30
|
const device_1 = require("../ascii/device");
|
|
31
31
|
const axis_1 = require("../ascii/axis");
|
|
32
32
|
const measurement_1 = require("../measurement");
|
|
33
|
+
const units_1 = require("../units");
|
|
33
34
|
/**
|
|
34
35
|
* Represents an objective changer of a microscope.
|
|
35
36
|
* Unstable. Expect breaking changes in future releases.
|
|
36
37
|
* Requires at least Firmware 7.32.
|
|
37
38
|
*/
|
|
38
39
|
class ObjectiveChanger {
|
|
39
|
-
/**
|
|
40
|
-
* Connection of this device.
|
|
41
|
-
*/
|
|
42
|
-
get connection() {
|
|
43
|
-
return this._connection;
|
|
44
|
-
}
|
|
45
40
|
/**
|
|
46
41
|
* Device address of the turret.
|
|
47
42
|
*/
|
|
48
|
-
get
|
|
49
|
-
return this.
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Device address of the focus.
|
|
53
|
-
*/
|
|
54
|
-
get focusAddress() {
|
|
55
|
-
return this._focusAddress;
|
|
43
|
+
get turret() {
|
|
44
|
+
return this._turret;
|
|
56
45
|
}
|
|
57
46
|
/**
|
|
58
47
|
* The focus axis.
|
|
@@ -60,11 +49,14 @@ class ObjectiveChanger {
|
|
|
60
49
|
get focusAxis() {
|
|
61
50
|
return this._focusAxis;
|
|
62
51
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Creates instance of `ObjectiveChanger` based on the given device.
|
|
54
|
+
* If the device is identified, this constructor will ensure it is an objective changer.
|
|
55
|
+
*/
|
|
56
|
+
constructor(turret, focusAxis) {
|
|
57
|
+
this._turret = turret;
|
|
58
|
+
this._focusAxis = focusAxis;
|
|
59
|
+
this._verifyIsChanger();
|
|
68
60
|
}
|
|
69
61
|
/**
|
|
70
62
|
* Finds an objective changer on a connection.
|
|
@@ -82,21 +74,22 @@ class ObjectiveChanger {
|
|
|
82
74
|
request.setTurretAddress(turretAddress);
|
|
83
75
|
request.setFocusAddress(focusAddress);
|
|
84
76
|
const response = await gateway.callAsync('objective_changer/detect', request, gateway.ObjectiveChangerCreateResponse);
|
|
85
|
-
return new ObjectiveChanger(connection, response.getTurret(), response.
|
|
77
|
+
return new ObjectiveChanger(new device_1.Device(connection, response.getTurret()), new axis_1.Axis(new device_1.Device(connection, response.getFocusAddress()), response.getFocusAxis()));
|
|
86
78
|
}
|
|
87
79
|
/**
|
|
88
80
|
* Changes the objective.
|
|
89
81
|
* Runs a sequence of movements switching from the current objective to the new one.
|
|
90
|
-
*
|
|
91
|
-
* @param
|
|
92
|
-
*
|
|
82
|
+
* The focus stage moves to the focus datum after the objective change.
|
|
83
|
+
* @param objective Objective number starting from 1.
|
|
84
|
+
* @param options.focusOffset Optional offset from the focus datum.
|
|
93
85
|
*/
|
|
94
86
|
async change(objective, options = {}) {
|
|
95
87
|
const { focusOffset, } = options;
|
|
96
88
|
const request = new gateway.ObjectiveChangerChangeRequest();
|
|
97
|
-
request.setInterfaceId(this.connection.interfaceId);
|
|
98
|
-
request.setTurretAddress(this.
|
|
99
|
-
request.setFocusAddress(this.
|
|
89
|
+
request.setInterfaceId(this.turret.connection.interfaceId);
|
|
90
|
+
request.setTurretAddress(this.turret.deviceAddress);
|
|
91
|
+
request.setFocusAddress(this.focusAxis.device.deviceAddress);
|
|
92
|
+
request.setFocusAxis(this.focusAxis.axisNumber);
|
|
100
93
|
request.setObjective(objective);
|
|
101
94
|
request.setFocusOffset(measurement_1.Measurement.toProtobuf(focusOffset));
|
|
102
95
|
await gateway.callAsync('objective_changer/change', request);
|
|
@@ -106,9 +99,10 @@ class ObjectiveChanger {
|
|
|
106
99
|
*/
|
|
107
100
|
async release() {
|
|
108
101
|
const request = new gateway.ObjectiveChangerRequest();
|
|
109
|
-
request.setInterfaceId(this.connection.interfaceId);
|
|
110
|
-
request.setTurretAddress(this.
|
|
111
|
-
request.setFocusAddress(this.
|
|
102
|
+
request.setInterfaceId(this.turret.connection.interfaceId);
|
|
103
|
+
request.setTurretAddress(this.turret.deviceAddress);
|
|
104
|
+
request.setFocusAddress(this.focusAxis.device.deviceAddress);
|
|
105
|
+
request.setFocusAxis(this.focusAxis.axisNumber);
|
|
112
106
|
await gateway.callAsync('objective_changer/release', request);
|
|
113
107
|
}
|
|
114
108
|
/**
|
|
@@ -117,11 +111,79 @@ class ObjectiveChanger {
|
|
|
117
111
|
* @returns Current objective number starting from 1 or 0 if not applicable.
|
|
118
112
|
*/
|
|
119
113
|
async getCurrentObjective() {
|
|
114
|
+
const request = new gateway.AxisEmptyRequest();
|
|
115
|
+
request.setInterfaceId(this.turret.connection.interfaceId);
|
|
116
|
+
request.setDevice(this.turret.deviceAddress);
|
|
117
|
+
request.setAxis(1);
|
|
118
|
+
const response = await gateway.callAsync('device/get_index_position', request, gateway.IntResponse);
|
|
119
|
+
return response.getValue();
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Gets number of objectives that the turret can accommodate.
|
|
123
|
+
* @returns Number of positions.
|
|
124
|
+
*/
|
|
125
|
+
async getNumberOfObjectives() {
|
|
126
|
+
const request = new gateway.AxisEmptyRequest();
|
|
127
|
+
request.setInterfaceId(this.turret.connection.interfaceId);
|
|
128
|
+
request.setDevice(this.turret.deviceAddress);
|
|
129
|
+
request.setAxis(1);
|
|
130
|
+
const response = await gateway.callAsync('device/get_index_count', request, gateway.IntResponse);
|
|
131
|
+
return response.getValue();
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Gets the focus datum.
|
|
135
|
+
* The focus datum is the position that the focus stage moves to after an objective change.
|
|
136
|
+
* It is backed by the limit.home.offset setting.
|
|
137
|
+
* @param [unit=Units.NATIVE] Units of datum.
|
|
138
|
+
* @returns The datum.
|
|
139
|
+
*/
|
|
140
|
+
async getFocusDatum(unit = units_1.Units.NATIVE) {
|
|
141
|
+
const request = new gateway.ObjectiveChangerSetRequest();
|
|
142
|
+
request.setInterfaceId(this.turret.connection.interfaceId);
|
|
143
|
+
request.setTurretAddress(this.turret.deviceAddress);
|
|
144
|
+
request.setFocusAddress(this.focusAxis.device.deviceAddress);
|
|
145
|
+
request.setFocusAxis(this.focusAxis.axisNumber);
|
|
146
|
+
request.setUnit(unit);
|
|
147
|
+
const response = await gateway.callAsync('objective_changer/get_datum', request, gateway.DoubleResponse);
|
|
148
|
+
return response.getValue();
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Sets the focus datum.
|
|
152
|
+
* The focus datum is the position that the focus stage moves to after an objective change.
|
|
153
|
+
* It is backed by the limit.home.offset setting.
|
|
154
|
+
* @param datum Value of datum.
|
|
155
|
+
* @param [unit=Units.NATIVE] Units of datum.
|
|
156
|
+
*/
|
|
157
|
+
async setFocusDatum(datum, unit = units_1.Units.NATIVE) {
|
|
158
|
+
const request = new gateway.ObjectiveChangerSetRequest();
|
|
159
|
+
request.setInterfaceId(this.turret.connection.interfaceId);
|
|
160
|
+
request.setTurretAddress(this.turret.deviceAddress);
|
|
161
|
+
request.setFocusAddress(this.focusAxis.device.deviceAddress);
|
|
162
|
+
request.setFocusAxis(this.focusAxis.axisNumber);
|
|
163
|
+
request.setValue(datum);
|
|
164
|
+
request.setUnit(unit);
|
|
165
|
+
await gateway.callAsync('objective_changer/set_datum', request);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Checks if this is a objective changer and throws an error if it is not.
|
|
169
|
+
*/
|
|
170
|
+
_verifyIsChanger() {
|
|
120
171
|
const request = new gateway.ObjectiveChangerRequest();
|
|
121
|
-
request.setInterfaceId(this.connection.interfaceId);
|
|
122
|
-
request.setTurretAddress(this.
|
|
123
|
-
request.setFocusAddress(this.
|
|
124
|
-
|
|
172
|
+
request.setInterfaceId(this.turret.connection.interfaceId);
|
|
173
|
+
request.setTurretAddress(this.turret.deviceAddress);
|
|
174
|
+
request.setFocusAddress(this.focusAxis.device.deviceAddress);
|
|
175
|
+
request.setFocusAxis(this.focusAxis.axisNumber);
|
|
176
|
+
gateway.callSync('objective_changer/verify', request);
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Returns a string that represents the device.
|
|
180
|
+
* @returns A string that represents the device.
|
|
181
|
+
*/
|
|
182
|
+
toString() {
|
|
183
|
+
const request = new gateway.AxisToStringRequest();
|
|
184
|
+
request.setInterfaceId(this.turret.connection.interfaceId);
|
|
185
|
+
request.setDevice(this.turret.deviceAddress);
|
|
186
|
+
const response = gateway.callSync('device/device_to_string', request, gateway.StringResponse);
|
|
125
187
|
return response.getValue();
|
|
126
188
|
}
|
|
127
189
|
}
|