@zaber/motion 4.6.0 → 4.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/binding/wasm/zaber-motion-lib.wasm +0 -0
- package/dist/lib/ascii/axis.d.ts +10 -0
- package/dist/lib/ascii/axis.js +22 -0
- package/dist/lib/ascii/axis.js.map +1 -1
- package/dist/lib/ascii/connection.d.ts +1 -0
- package/dist/lib/ascii/connection.js +1 -0
- package/dist/lib/ascii/connection.js.map +1 -1
- package/dist/lib/microscopy/microscope.d.ts +5 -0
- package/dist/lib/microscopy/microscope.js +11 -0
- package/dist/lib/microscopy/microscope.js.map +1 -1
- package/dist/lib/microscopy/objective_changer.d.ts +19 -2
- package/dist/lib/microscopy/objective_changer.js +37 -2
- package/dist/lib/microscopy/objective_changer.js.map +1 -1
- package/dist/lib/protobufs/main_pb.d.ts +40 -0
- package/dist/lib/protobufs/main_pb.js +302 -0
- package/dist/lib/protobufs/main_pb.js.map +1 -1
- package/package.json +1 -1
|
@@ -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
|
|
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;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,IAAI,OAAO,CAAC,uBAAuB,EAAE,CAAC;QACtD,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC/C,OAAO,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;QACxC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;QAEtC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,0BAA0B,EAC1B,OAAO,EACP,OAAO,CAAC,8BAA8B,CAAC,C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AG,IAAI,OAAO,CAAC,uBAAuB,EAAE,CAAC;QACtD,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3D,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QACpD,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAC7D,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAEhD,OAAO,CAAC,QAAQ,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,MAAM,OAAO,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;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;;;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,IAAI,OAAO,CAAC,uBAAuB,EAAE,CAAC;QACtD,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC/C,OAAO,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;QACxC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;QAEtC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,0BAA0B,EAC1B,OAAO,EACP,OAAO,CAAC,8BAA8B,CAAC,CAAC;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E,OAAO,CAAC,CAAC;IAClE,CAAC;IAED;;OAEG;IACK,gBAAgB;QACtB,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,uBAAuB,EAAE,CAAC;QACtD,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3D,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QACpD,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAC7D,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAEhD,OAAO,CAAC,QAAQ,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,MAAM,OAAO,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.
|