@zaber/motion 4.6.0 → 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.
@@ -69,6 +69,11 @@ export declare class Microscope {
69
69
  * Homes all axes, filter changer, and objective changer.
70
70
  */
71
71
  initialize(): Promise<void>;
72
+ /**
73
+ * Checks whether the microscope needs initialization.
74
+ * @returns True, when the microscope needs initialization.
75
+ */
76
+ isInitialized(): Promise<boolean>;
72
77
  /**
73
78
  * Returns a string that represents the microscope.
74
79
  * @returns A string that represents the microscope.
@@ -126,6 +126,17 @@ class Microscope {
126
126
  request.setConfig(microscope_config_1.MicroscopeConfig.toProtobuf(this._config));
127
127
  await gateway.callAsync('microscope/initialize', request);
128
128
  }
129
+ /**
130
+ * Checks whether the microscope 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
+ }
129
140
  /**
130
141
  * Returns a string that represents the microscope.
131
142
  * @returns A string that represents the microscope.
@@ -1 +1 @@
1
- {"version":3,"file":"microscope.js","sourceRoot":"","sources":["../../../src/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,YAA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AAG,MAAM,OAAO,CAAC,SAAS,CACtC,mBAAmB,EACnB,OAAO,EACP,OAAO,CAAC,gBAAgB,CAAC,CAAC;QAC5B,OAAO,IAAI,UAAU,CAAC,UAAU,EAAE,oCAAgB,CAAC,YAAY,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IACxF,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,UAAU;QACrB,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,OAAO,CAAC,SAAS,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;IAC5D,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;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"]}
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,+CAA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;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"]}
@@ -2,6 +2,7 @@ import { Connection } from '../ascii/connection';
2
2
  import { Device } from '../ascii/device';
3
3
  import { Axis } from '../ascii/axis';
4
4
  import { Measurement } from '../measurement';
5
+ import { Angle, Length, Native } from '../units';
5
6
  /**
6
7
  * Represents an objective changer of a microscope.
7
8
  * Unstable. Expect breaking changes in future releases.
@@ -36,9 +37,9 @@ export declare class ObjectiveChanger {
36
37
  /**
37
38
  * Changes the objective.
38
39
  * Runs a sequence of movements switching from the current objective to the new one.
40
+ * The focus stage moves to the focus datum after the objective change.
39
41
  * @param objective Objective number starting from 1.
40
- * @param options.focusOffset Optional focus offset from the datum.
41
- * If specified, the focus stage will move to the designated offset.
42
+ * @param options.focusOffset Optional offset from the focus datum.
42
43
  */
43
44
  change(objective: number, options?: ObjectiveChanger.ChangeOptions): Promise<void>;
44
45
  /**
@@ -56,6 +57,22 @@ export declare class ObjectiveChanger {
56
57
  * @returns Number of positions.
57
58
  */
58
59
  getNumberOfObjectives(): Promise<number>;
60
+ /**
61
+ * Gets the focus datum.
62
+ * The focus datum is the position that the focus stage moves to after an objective change.
63
+ * It is backed by the limit.home.offset setting.
64
+ * @param [unit=Units.NATIVE] Units of datum.
65
+ * @returns The datum.
66
+ */
67
+ getFocusDatum(unit?: Length | Angle | Native): Promise<number>;
68
+ /**
69
+ * Sets the focus datum.
70
+ * The focus datum is the position that the focus stage moves to after an objective change.
71
+ * It is backed by the limit.home.offset setting.
72
+ * @param datum Value of datum.
73
+ * @param [unit=Units.NATIVE] Units of datum.
74
+ */
75
+ setFocusDatum(datum: number, unit?: Length | Angle | Native): Promise<void>;
59
76
  /**
60
77
  * Checks if this is a objective changer and throws an error if it is not.
61
78
  */
@@ -30,6 +30,7 @@ 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.
@@ -78,9 +79,9 @@ class ObjectiveChanger {
78
79
  /**
79
80
  * Changes the objective.
80
81
  * Runs a sequence of movements switching from the current objective to the new one.
82
+ * The focus stage moves to the focus datum after the objective change.
81
83
  * @param objective Objective number starting from 1.
82
- * @param options.focusOffset Optional focus offset from the datum.
83
- * If specified, the focus stage will move to the designated offset.
84
+ * @param options.focusOffset Optional offset from the focus datum.
84
85
  */
85
86
  async change(objective, options = {}) {
86
87
  const { focusOffset, } = options;
@@ -129,6 +130,40 @@ class ObjectiveChanger {
129
130
  const response = await gateway.callAsync('device/get_index_count', request, gateway.IntResponse);
130
131
  return response.getValue();
131
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
+ }
132
167
  /**
133
168
  * Checks if this is a objective changer and throws an error if it is not.
134
169
  */
@@ -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,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAGD;;OAEG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;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,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3D,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAE7C,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,yBAAyB,EACzB,OAAO,EACP,OAAO,CAAC,cAAc,CAAC,CAAC;QAC1B,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;CACF;AA7JD,4CA6JC","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 * 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"]}
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;AAC7C,oCAAwD;AAExD;;;;GAIG;AACH,MAAa,gBAAgB;IAC3B;;OAEG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAGD;;OAEG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAGD;;;OAG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AO,GAAG,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;QAClD,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3D,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAE7C,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,yBAAyB,EACzB,OAAO,EACP,OAAO,CAAC,cAAc,CAAC,CAAC;QAC1B,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;CACF;AA3MD,4CA2MC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport { Connection } from '../ascii/connection';\nimport { Device } from '../ascii/device';\nimport { Axis } from '../ascii/axis';\nimport { Measurement } from '../measurement';\nimport { Angle, Length, Native, Units } from '../units';\n\n/**\n * Represents an objective changer of a microscope.\n * Unstable. Expect breaking changes in future releases.\n * Requires at least Firmware 7.32.\n */\nexport class ObjectiveChanger {\n /**\n * Device address of the turret.\n */\n public get turret(): Device {\n return this._turret;\n }\n private _turret: Device;\n\n /**\n * The focus axis.\n */\n public get focusAxis(): Axis {\n return this._focusAxis;\n }\n private _focusAxis: Axis;\n\n /**\n * Creates instance of `ObjectiveChanger` based on the given device.\n * If the device is identified, this constructor will ensure it is an objective changer.\n */\n constructor(turret: Device, focusAxis: Axis) {\n this._turret = turret;\n this._focusAxis = focusAxis;\n this._verifyIsChanger();\n }\n\n /**\n * 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 * The focus stage moves to the focus datum after the objective change.\n * @param objective Objective number starting from 1.\n * @param options.focusOffset Optional offset from the focus datum.\n */\n public async change(\n objective: number,\n options: ObjectiveChanger.ChangeOptions = {}\n ): Promise<void> {\n const {\n focusOffset,\n } = options;\n const request = 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 * Gets the focus datum.\n * The focus datum is the position that the focus stage moves to after an objective change.\n * It is backed by the limit.home.offset setting.\n * @param [unit=Units.NATIVE] Units of datum.\n * @returns The datum.\n */\n public async getFocusDatum(\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<number> {\n const request = new gateway.ObjectiveChangerSetRequest();\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.setUnit(unit);\n\n const response = await gateway.callAsync<gateway.DoubleResponse>(\n 'objective_changer/get_datum',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Sets the focus datum.\n * The focus datum is the position that the focus stage moves to after an objective change.\n * It is backed by the limit.home.offset setting.\n * @param datum Value of datum.\n * @param [unit=Units.NATIVE] Units of datum.\n */\n public async setFocusDatum(\n datum: number,\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<void> {\n const request = new gateway.ObjectiveChangerSetRequest();\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.setValue(datum);\n request.setUnit(unit);\n\n await gateway.callAsync('objective_changer/set_datum', request);\n }\n\n /**\n * Checks if this is a objective changer and throws an error if it is not.\n */\n private _verifyIsChanger(): void {\n const request = 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"]}
@@ -6736,6 +6736,46 @@ export namespace ObjectiveChangerGetCurrentResponse {
6736
6736
  }
6737
6737
  }
6738
6738
 
6739
+ export class ObjectiveChangerSetRequest extends jspb.Message {
6740
+ getInterfaceId(): number;
6741
+ setInterfaceId(value: number): void;
6742
+
6743
+ getTurretAddress(): number;
6744
+ setTurretAddress(value: number): void;
6745
+
6746
+ getFocusAddress(): number;
6747
+ setFocusAddress(value: number): void;
6748
+
6749
+ getFocusAxis(): number;
6750
+ setFocusAxis(value: number): void;
6751
+
6752
+ getValue(): number;
6753
+ setValue(value: number): void;
6754
+
6755
+ getUnit(): string;
6756
+ setUnit(value: string): void;
6757
+
6758
+ serializeBinary(): Uint8Array;
6759
+ toObject(includeInstance?: boolean): ObjectiveChangerSetRequest.AsObject;
6760
+ static toObject(includeInstance: boolean, msg: ObjectiveChangerSetRequest): ObjectiveChangerSetRequest.AsObject;
6761
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
6762
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
6763
+ static serializeBinaryToWriter(message: ObjectiveChangerSetRequest, writer: jspb.BinaryWriter): void;
6764
+ static deserializeBinary(bytes: Uint8Array): ObjectiveChangerSetRequest;
6765
+ static deserializeBinaryFromReader(message: ObjectiveChangerSetRequest, reader: jspb.BinaryReader): ObjectiveChangerSetRequest;
6766
+ }
6767
+
6768
+ export namespace ObjectiveChangerSetRequest {
6769
+ export type AsObject = {
6770
+ interfaceId: number,
6771
+ turretAddress: number,
6772
+ focusAddress: number,
6773
+ focusAxis: number,
6774
+ value: number,
6775
+ unit: string,
6776
+ }
6777
+ }
6778
+
6739
6779
  export class ProcessOn extends jspb.Message {
6740
6780
  getInterfaceId(): number;
6741
6781
  setInterfaceId(value: number): void;
@@ -142,6 +142,7 @@ goog.exportSymbol('zaber.motion.protobufs.ObjectiveChangerChangeRequest', null,
142
142
  goog.exportSymbol('zaber.motion.protobufs.ObjectiveChangerCreateResponse', null, proto);
143
143
  goog.exportSymbol('zaber.motion.protobufs.ObjectiveChangerGetCurrentResponse', null, proto);
144
144
  goog.exportSymbol('zaber.motion.protobufs.ObjectiveChangerRequest', null, proto);
145
+ goog.exportSymbol('zaber.motion.protobufs.ObjectiveChangerSetRequest', null, proto);
145
146
  goog.exportSymbol('zaber.motion.protobufs.OpenBinaryInterfaceRequest', null, proto);
146
147
  goog.exportSymbol('zaber.motion.protobufs.OpenInterfaceRequest', null, proto);
147
148
  goog.exportSymbol('zaber.motion.protobufs.OpenInterfaceResponse', null, proto);
@@ -4710,6 +4711,27 @@ if (goog.DEBUG && !COMPILED) {
4710
4711
  */
4711
4712
  proto.zaber.motion.protobufs.ObjectiveChangerGetCurrentResponse.displayName = 'proto.zaber.motion.protobufs.ObjectiveChangerGetCurrentResponse';
4712
4713
  }
4714
+ /**
4715
+ * Generated by JsPbCodeGenerator.
4716
+ * @param {Array=} opt_data Optional initial data array, typically from a
4717
+ * server response, or constructed directly in Javascript. The array is used
4718
+ * in place and becomes part of the constructed object. It is not cloned.
4719
+ * If no data is provided, the constructed object will be empty, but still
4720
+ * valid.
4721
+ * @extends {jspb.Message}
4722
+ * @constructor
4723
+ */
4724
+ proto.zaber.motion.protobufs.ObjectiveChangerSetRequest = function(opt_data) {
4725
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
4726
+ };
4727
+ goog.inherits(proto.zaber.motion.protobufs.ObjectiveChangerSetRequest, jspb.Message);
4728
+ if (goog.DEBUG && !COMPILED) {
4729
+ /**
4730
+ * @public
4731
+ * @override
4732
+ */
4733
+ proto.zaber.motion.protobufs.ObjectiveChangerSetRequest.displayName = 'proto.zaber.motion.protobufs.ObjectiveChangerSetRequest';
4734
+ }
4713
4735
  /**
4714
4736
  * Generated by JsPbCodeGenerator.
4715
4737
  * @param {Array=} opt_data Optional initial data array, typically from a
@@ -51871,6 +51893,286 @@ proto.zaber.motion.protobufs.ObjectiveChangerGetCurrentResponse.prototype.setVal
51871
51893
 
51872
51894
 
51873
51895
 
51896
+ if (jspb.Message.GENERATE_TO_OBJECT) {
51897
+ /**
51898
+ * Creates an object representation of this proto.
51899
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
51900
+ * Optional fields that are not set will be set to undefined.
51901
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
51902
+ * For the list of reserved names please see:
51903
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
51904
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
51905
+ * JSPB instance for transitional soy proto support:
51906
+ * http://goto/soy-param-migration
51907
+ * @return {!Object}
51908
+ */
51909
+ proto.zaber.motion.protobufs.ObjectiveChangerSetRequest.prototype.toObject = function(opt_includeInstance) {
51910
+ return proto.zaber.motion.protobufs.ObjectiveChangerSetRequest.toObject(opt_includeInstance, this);
51911
+ };
51912
+
51913
+
51914
+ /**
51915
+ * Static version of the {@see toObject} method.
51916
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
51917
+ * the JSPB instance for transitional soy proto support:
51918
+ * http://goto/soy-param-migration
51919
+ * @param {!proto.zaber.motion.protobufs.ObjectiveChangerSetRequest} msg The msg instance to transform.
51920
+ * @return {!Object}
51921
+ * @suppress {unusedLocalVariables} f is only used for nested messages
51922
+ */
51923
+ proto.zaber.motion.protobufs.ObjectiveChangerSetRequest.toObject = function(includeInstance, msg) {
51924
+ var f, obj = {
51925
+ interfaceId: jspb.Message.getFieldWithDefault(msg, 1, 0),
51926
+ turretAddress: jspb.Message.getFieldWithDefault(msg, 2, 0),
51927
+ focusAddress: jspb.Message.getFieldWithDefault(msg, 3, 0),
51928
+ focusAxis: jspb.Message.getFieldWithDefault(msg, 4, 0),
51929
+ value: jspb.Message.getFloatingPointFieldWithDefault(msg, 5, 0.0),
51930
+ unit: jspb.Message.getFieldWithDefault(msg, 6, "")
51931
+ };
51932
+
51933
+ if (includeInstance) {
51934
+ obj.$jspbMessageInstance = msg;
51935
+ }
51936
+ return obj;
51937
+ };
51938
+ }
51939
+
51940
+
51941
+ /**
51942
+ * Deserializes binary data (in protobuf wire format).
51943
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
51944
+ * @return {!proto.zaber.motion.protobufs.ObjectiveChangerSetRequest}
51945
+ */
51946
+ proto.zaber.motion.protobufs.ObjectiveChangerSetRequest.deserializeBinary = function(bytes) {
51947
+ var reader = new jspb.BinaryReader(bytes);
51948
+ var msg = new proto.zaber.motion.protobufs.ObjectiveChangerSetRequest;
51949
+ return proto.zaber.motion.protobufs.ObjectiveChangerSetRequest.deserializeBinaryFromReader(msg, reader);
51950
+ };
51951
+
51952
+
51953
+ /**
51954
+ * Deserializes binary data (in protobuf wire format) from the
51955
+ * given reader into the given message object.
51956
+ * @param {!proto.zaber.motion.protobufs.ObjectiveChangerSetRequest} msg The message object to deserialize into.
51957
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
51958
+ * @return {!proto.zaber.motion.protobufs.ObjectiveChangerSetRequest}
51959
+ */
51960
+ proto.zaber.motion.protobufs.ObjectiveChangerSetRequest.deserializeBinaryFromReader = function(msg, reader) {
51961
+ while (reader.nextField()) {
51962
+ if (reader.isEndGroup()) {
51963
+ break;
51964
+ }
51965
+ var field = reader.getFieldNumber();
51966
+ switch (field) {
51967
+ case 1:
51968
+ var value = /** @type {number} */ (reader.readInt32());
51969
+ msg.setInterfaceId(value);
51970
+ break;
51971
+ case 2:
51972
+ var value = /** @type {number} */ (reader.readInt32());
51973
+ msg.setTurretAddress(value);
51974
+ break;
51975
+ case 3:
51976
+ var value = /** @type {number} */ (reader.readInt32());
51977
+ msg.setFocusAddress(value);
51978
+ break;
51979
+ case 4:
51980
+ var value = /** @type {number} */ (reader.readInt32());
51981
+ msg.setFocusAxis(value);
51982
+ break;
51983
+ case 5:
51984
+ var value = /** @type {number} */ (reader.readDouble());
51985
+ msg.setValue(value);
51986
+ break;
51987
+ case 6:
51988
+ var value = /** @type {string} */ (reader.readString());
51989
+ msg.setUnit(value);
51990
+ break;
51991
+ default:
51992
+ reader.skipField();
51993
+ break;
51994
+ }
51995
+ }
51996
+ return msg;
51997
+ };
51998
+
51999
+
52000
+ /**
52001
+ * Serializes the message to binary data (in protobuf wire format).
52002
+ * @return {!Uint8Array}
52003
+ */
52004
+ proto.zaber.motion.protobufs.ObjectiveChangerSetRequest.prototype.serializeBinary = function() {
52005
+ var writer = new jspb.BinaryWriter();
52006
+ proto.zaber.motion.protobufs.ObjectiveChangerSetRequest.serializeBinaryToWriter(this, writer);
52007
+ return writer.getResultBuffer();
52008
+ };
52009
+
52010
+
52011
+ /**
52012
+ * Serializes the given message to binary data (in protobuf wire
52013
+ * format), writing to the given BinaryWriter.
52014
+ * @param {!proto.zaber.motion.protobufs.ObjectiveChangerSetRequest} message
52015
+ * @param {!jspb.BinaryWriter} writer
52016
+ * @suppress {unusedLocalVariables} f is only used for nested messages
52017
+ */
52018
+ proto.zaber.motion.protobufs.ObjectiveChangerSetRequest.serializeBinaryToWriter = function(message, writer) {
52019
+ var f = undefined;
52020
+ f = message.getInterfaceId();
52021
+ if (f !== 0) {
52022
+ writer.writeInt32(
52023
+ 1,
52024
+ f
52025
+ );
52026
+ }
52027
+ f = message.getTurretAddress();
52028
+ if (f !== 0) {
52029
+ writer.writeInt32(
52030
+ 2,
52031
+ f
52032
+ );
52033
+ }
52034
+ f = message.getFocusAddress();
52035
+ if (f !== 0) {
52036
+ writer.writeInt32(
52037
+ 3,
52038
+ f
52039
+ );
52040
+ }
52041
+ f = message.getFocusAxis();
52042
+ if (f !== 0) {
52043
+ writer.writeInt32(
52044
+ 4,
52045
+ f
52046
+ );
52047
+ }
52048
+ f = message.getValue();
52049
+ if (f !== 0.0) {
52050
+ writer.writeDouble(
52051
+ 5,
52052
+ f
52053
+ );
52054
+ }
52055
+ f = message.getUnit();
52056
+ if (f.length > 0) {
52057
+ writer.writeString(
52058
+ 6,
52059
+ f
52060
+ );
52061
+ }
52062
+ };
52063
+
52064
+
52065
+ /**
52066
+ * optional int32 interface_id = 1;
52067
+ * @return {number}
52068
+ */
52069
+ proto.zaber.motion.protobufs.ObjectiveChangerSetRequest.prototype.getInterfaceId = function() {
52070
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
52071
+ };
52072
+
52073
+
52074
+ /**
52075
+ * @param {number} value
52076
+ * @return {!proto.zaber.motion.protobufs.ObjectiveChangerSetRequest} returns this
52077
+ */
52078
+ proto.zaber.motion.protobufs.ObjectiveChangerSetRequest.prototype.setInterfaceId = function(value) {
52079
+ return jspb.Message.setProto3IntField(this, 1, value);
52080
+ };
52081
+
52082
+
52083
+ /**
52084
+ * optional int32 turret_address = 2;
52085
+ * @return {number}
52086
+ */
52087
+ proto.zaber.motion.protobufs.ObjectiveChangerSetRequest.prototype.getTurretAddress = function() {
52088
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
52089
+ };
52090
+
52091
+
52092
+ /**
52093
+ * @param {number} value
52094
+ * @return {!proto.zaber.motion.protobufs.ObjectiveChangerSetRequest} returns this
52095
+ */
52096
+ proto.zaber.motion.protobufs.ObjectiveChangerSetRequest.prototype.setTurretAddress = function(value) {
52097
+ return jspb.Message.setProto3IntField(this, 2, value);
52098
+ };
52099
+
52100
+
52101
+ /**
52102
+ * optional int32 focus_address = 3;
52103
+ * @return {number}
52104
+ */
52105
+ proto.zaber.motion.protobufs.ObjectiveChangerSetRequest.prototype.getFocusAddress = function() {
52106
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
52107
+ };
52108
+
52109
+
52110
+ /**
52111
+ * @param {number} value
52112
+ * @return {!proto.zaber.motion.protobufs.ObjectiveChangerSetRequest} returns this
52113
+ */
52114
+ proto.zaber.motion.protobufs.ObjectiveChangerSetRequest.prototype.setFocusAddress = function(value) {
52115
+ return jspb.Message.setProto3IntField(this, 3, value);
52116
+ };
52117
+
52118
+
52119
+ /**
52120
+ * optional int32 focus_axis = 4;
52121
+ * @return {number}
52122
+ */
52123
+ proto.zaber.motion.protobufs.ObjectiveChangerSetRequest.prototype.getFocusAxis = function() {
52124
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
52125
+ };
52126
+
52127
+
52128
+ /**
52129
+ * @param {number} value
52130
+ * @return {!proto.zaber.motion.protobufs.ObjectiveChangerSetRequest} returns this
52131
+ */
52132
+ proto.zaber.motion.protobufs.ObjectiveChangerSetRequest.prototype.setFocusAxis = function(value) {
52133
+ return jspb.Message.setProto3IntField(this, 4, value);
52134
+ };
52135
+
52136
+
52137
+ /**
52138
+ * optional double value = 5;
52139
+ * @return {number}
52140
+ */
52141
+ proto.zaber.motion.protobufs.ObjectiveChangerSetRequest.prototype.getValue = function() {
52142
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 5, 0.0));
52143
+ };
52144
+
52145
+
52146
+ /**
52147
+ * @param {number} value
52148
+ * @return {!proto.zaber.motion.protobufs.ObjectiveChangerSetRequest} returns this
52149
+ */
52150
+ proto.zaber.motion.protobufs.ObjectiveChangerSetRequest.prototype.setValue = function(value) {
52151
+ return jspb.Message.setProto3FloatField(this, 5, value);
52152
+ };
52153
+
52154
+
52155
+ /**
52156
+ * optional string unit = 6;
52157
+ * @return {string}
52158
+ */
52159
+ proto.zaber.motion.protobufs.ObjectiveChangerSetRequest.prototype.getUnit = function() {
52160
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
52161
+ };
52162
+
52163
+
52164
+ /**
52165
+ * @param {string} value
52166
+ * @return {!proto.zaber.motion.protobufs.ObjectiveChangerSetRequest} returns this
52167
+ */
52168
+ proto.zaber.motion.protobufs.ObjectiveChangerSetRequest.prototype.setUnit = function(value) {
52169
+ return jspb.Message.setProto3StringField(this, 6, value);
52170
+ };
52171
+
52172
+
52173
+
52174
+
52175
+
51874
52176
  if (jspb.Message.GENERATE_TO_OBJECT) {
51875
52177
  /**
51876
52178
  * Creates an object representation of this proto.