@zaber/motion 5.1.4 → 5.1.5

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.
@@ -66,9 +66,10 @@ export declare class Microscope {
66
66
  static find(connection: Connection): Promise<Microscope>;
67
67
  /**
68
68
  * Initializes the microscope.
69
- * Homes all axes, filter changer, and objective changer.
69
+ * Homes all axes, filter changer, and objective changer if they require it.
70
+ * @param [options.force=false] Forces all devices to home even when not required.
70
71
  */
71
- initialize(): Promise<void>;
72
+ initialize(options?: Microscope.InitializeOptions): Promise<void>;
72
73
  /**
73
74
  * Checks whether the microscope is initialized.
74
75
  * @returns True, when the microscope is initialized. False, otherwise.
@@ -80,3 +81,9 @@ export declare class Microscope {
80
81
  */
81
82
  toString(): string;
82
83
  }
84
+ declare namespace Microscope {
85
+ interface InitializeOptions {
86
+ force?: boolean;
87
+ }
88
+ }
89
+ export {};
@@ -118,12 +118,15 @@ class Microscope {
118
118
  }
119
119
  /**
120
120
  * Initializes the microscope.
121
- * Homes all axes, filter changer, and objective changer.
121
+ * Homes all axes, filter changer, and objective changer if they require it.
122
+ * @param [options.force=false] Forces all devices to home even when not required.
122
123
  */
123
- async initialize() {
124
- const request = new gateway.MicroscopeEmptyRequest();
124
+ async initialize(options = {}) {
125
+ const { force = false, } = options;
126
+ const request = new gateway.MicroscopeInitRequest();
125
127
  request.setInterfaceId(this.connection.interfaceId);
126
128
  request.setConfig(microscope_config_1.MicroscopeConfig.toProtobuf(this._config));
129
+ request.setForce(force);
127
130
  await gateway.callAsync('microscope/initialize', request);
128
131
  }
129
132
  /**
@@ -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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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 is initialized.\n * @returns True, when the microscope is initialized. False, otherwise.\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"]}
1
+ {"version":3,"file":"microscope.js","sourceRoot":"","sources":["../../../src/microscopy/microscope.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,wCAAqC;AACrC,oDAAgD;AAChD,4CAAyC;AAEzC,+CAA4C;AAC5C,2DAAuD;AACvD,2DAAuD;AACvD,qDAAiD;AAEjD;;;;;GAKG;AACH,MAAa,UAAU;IACrB;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAKD;;OAEG;IACH,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAGD;;OAEG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAGD;;OA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AC,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;AAvJD,gCAuJC","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 if they require it.\n * @param [options.force=false] Forces all devices to home even when not required.\n */\n public async initialize(\n options: Microscope.InitializeOptions = {}\n ): Promise<void> {\n const {\n force = false,\n } = options;\n const request = new gateway.MicroscopeInitRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setConfig(MicroscopeConfig.toProtobuf(this._config));\n request.setForce(force);\n\n await gateway.callAsync('microscope/initialize', request);\n }\n\n /**\n * Checks whether the microscope is initialized.\n * @returns True, when the microscope is initialized. False, otherwise.\n */\n public async isInitialized(): Promise<boolean> {\n const request = 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 export interface InitializeOptions {\n force?: boolean;\n }\n}\n"]}
@@ -7846,6 +7846,36 @@ export namespace MicroscopeEmptyRequest {
7846
7846
  }
7847
7847
  }
7848
7848
 
7849
+ export class MicroscopeInitRequest extends jspb.Message {
7850
+ getInterfaceId(): number;
7851
+ setInterfaceId(value: number): void;
7852
+
7853
+ hasConfig(): boolean;
7854
+ clearConfig(): void;
7855
+ getConfig(): MicroscopeConfig | undefined;
7856
+ setConfig(value?: MicroscopeConfig): void;
7857
+
7858
+ getForce(): boolean;
7859
+ setForce(value: boolean): void;
7860
+
7861
+ serializeBinary(): Uint8Array;
7862
+ toObject(includeInstance?: boolean): MicroscopeInitRequest.AsObject;
7863
+ static toObject(includeInstance: boolean, msg: MicroscopeInitRequest): MicroscopeInitRequest.AsObject;
7864
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
7865
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
7866
+ static serializeBinaryToWriter(message: MicroscopeInitRequest, writer: jspb.BinaryWriter): void;
7867
+ static deserializeBinary(bytes: Uint8Array): MicroscopeInitRequest;
7868
+ static deserializeBinaryFromReader(message: MicroscopeInitRequest, reader: jspb.BinaryReader): MicroscopeInitRequest;
7869
+ }
7870
+
7871
+ export namespace MicroscopeInitRequest {
7872
+ export type AsObject = {
7873
+ interfaceId: number,
7874
+ config?: MicroscopeConfig.AsObject,
7875
+ force: boolean,
7876
+ }
7877
+ }
7878
+
7849
7879
  export class UnitGetSymbolRequest extends jspb.Message {
7850
7880
  getUnit(): string;
7851
7881
  setUnit(value: string): void;
@@ -141,6 +141,7 @@ goog.exportSymbol('zaber.motion.protobufs.Measurement', null, proto);
141
141
  goog.exportSymbol('zaber.motion.protobufs.MessageType', null, proto);
142
142
  goog.exportSymbol('zaber.motion.protobufs.MicroscopeConfig', null, proto);
143
143
  goog.exportSymbol('zaber.motion.protobufs.MicroscopeEmptyRequest', null, proto);
144
+ goog.exportSymbol('zaber.motion.protobufs.MicroscopeInitRequest', null, proto);
144
145
  goog.exportSymbol('zaber.motion.protobufs.MovementFailedExceptionData', null, proto);
145
146
  goog.exportSymbol('zaber.motion.protobufs.MovementInterruptedExceptionData', null, proto);
146
147
  goog.exportSymbol('zaber.motion.protobufs.ObjectiveChangerChangeRequest', null, proto);
@@ -5404,6 +5405,27 @@ if (goog.DEBUG && !COMPILED) {
5404
5405
  */
5405
5406
  proto.zaber.motion.protobufs.MicroscopeEmptyRequest.displayName = 'proto.zaber.motion.protobufs.MicroscopeEmptyRequest';
5406
5407
  }
5408
+ /**
5409
+ * Generated by JsPbCodeGenerator.
5410
+ * @param {Array=} opt_data Optional initial data array, typically from a
5411
+ * server response, or constructed directly in Javascript. The array is used
5412
+ * in place and becomes part of the constructed object. It is not cloned.
5413
+ * If no data is provided, the constructed object will be empty, but still
5414
+ * valid.
5415
+ * @extends {jspb.Message}
5416
+ * @constructor
5417
+ */
5418
+ proto.zaber.motion.protobufs.MicroscopeInitRequest = function(opt_data) {
5419
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
5420
+ };
5421
+ goog.inherits(proto.zaber.motion.protobufs.MicroscopeInitRequest, jspb.Message);
5422
+ if (goog.DEBUG && !COMPILED) {
5423
+ /**
5424
+ * @public
5425
+ * @override
5426
+ */
5427
+ proto.zaber.motion.protobufs.MicroscopeInitRequest.displayName = 'proto.zaber.motion.protobufs.MicroscopeInitRequest';
5428
+ }
5407
5429
  /**
5408
5430
  * Generated by JsPbCodeGenerator.
5409
5431
  * @param {Array=} opt_data Optional initial data array, typically from a
@@ -60171,6 +60193,217 @@ proto.zaber.motion.protobufs.MicroscopeEmptyRequest.prototype.hasConfig = functi
60171
60193
 
60172
60194
 
60173
60195
 
60196
+ if (jspb.Message.GENERATE_TO_OBJECT) {
60197
+ /**
60198
+ * Creates an object representation of this proto.
60199
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
60200
+ * Optional fields that are not set will be set to undefined.
60201
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
60202
+ * For the list of reserved names please see:
60203
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
60204
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
60205
+ * JSPB instance for transitional soy proto support:
60206
+ * http://goto/soy-param-migration
60207
+ * @return {!Object}
60208
+ */
60209
+ proto.zaber.motion.protobufs.MicroscopeInitRequest.prototype.toObject = function(opt_includeInstance) {
60210
+ return proto.zaber.motion.protobufs.MicroscopeInitRequest.toObject(opt_includeInstance, this);
60211
+ };
60212
+
60213
+
60214
+ /**
60215
+ * Static version of the {@see toObject} method.
60216
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
60217
+ * the JSPB instance for transitional soy proto support:
60218
+ * http://goto/soy-param-migration
60219
+ * @param {!proto.zaber.motion.protobufs.MicroscopeInitRequest} msg The msg instance to transform.
60220
+ * @return {!Object}
60221
+ * @suppress {unusedLocalVariables} f is only used for nested messages
60222
+ */
60223
+ proto.zaber.motion.protobufs.MicroscopeInitRequest.toObject = function(includeInstance, msg) {
60224
+ var f, obj = {
60225
+ interfaceId: jspb.Message.getFieldWithDefault(msg, 1, 0),
60226
+ config: (f = msg.getConfig()) && proto.zaber.motion.protobufs.MicroscopeConfig.toObject(includeInstance, f),
60227
+ force: jspb.Message.getBooleanFieldWithDefault(msg, 3, false)
60228
+ };
60229
+
60230
+ if (includeInstance) {
60231
+ obj.$jspbMessageInstance = msg;
60232
+ }
60233
+ return obj;
60234
+ };
60235
+ }
60236
+
60237
+
60238
+ /**
60239
+ * Deserializes binary data (in protobuf wire format).
60240
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
60241
+ * @return {!proto.zaber.motion.protobufs.MicroscopeInitRequest}
60242
+ */
60243
+ proto.zaber.motion.protobufs.MicroscopeInitRequest.deserializeBinary = function(bytes) {
60244
+ var reader = new jspb.BinaryReader(bytes);
60245
+ var msg = new proto.zaber.motion.protobufs.MicroscopeInitRequest;
60246
+ return proto.zaber.motion.protobufs.MicroscopeInitRequest.deserializeBinaryFromReader(msg, reader);
60247
+ };
60248
+
60249
+
60250
+ /**
60251
+ * Deserializes binary data (in protobuf wire format) from the
60252
+ * given reader into the given message object.
60253
+ * @param {!proto.zaber.motion.protobufs.MicroscopeInitRequest} msg The message object to deserialize into.
60254
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
60255
+ * @return {!proto.zaber.motion.protobufs.MicroscopeInitRequest}
60256
+ */
60257
+ proto.zaber.motion.protobufs.MicroscopeInitRequest.deserializeBinaryFromReader = function(msg, reader) {
60258
+ while (reader.nextField()) {
60259
+ if (reader.isEndGroup()) {
60260
+ break;
60261
+ }
60262
+ var field = reader.getFieldNumber();
60263
+ switch (field) {
60264
+ case 1:
60265
+ var value = /** @type {number} */ (reader.readInt32());
60266
+ msg.setInterfaceId(value);
60267
+ break;
60268
+ case 2:
60269
+ var value = new proto.zaber.motion.protobufs.MicroscopeConfig;
60270
+ reader.readMessage(value,proto.zaber.motion.protobufs.MicroscopeConfig.deserializeBinaryFromReader);
60271
+ msg.setConfig(value);
60272
+ break;
60273
+ case 3:
60274
+ var value = /** @type {boolean} */ (reader.readBool());
60275
+ msg.setForce(value);
60276
+ break;
60277
+ default:
60278
+ reader.skipField();
60279
+ break;
60280
+ }
60281
+ }
60282
+ return msg;
60283
+ };
60284
+
60285
+
60286
+ /**
60287
+ * Serializes the message to binary data (in protobuf wire format).
60288
+ * @return {!Uint8Array}
60289
+ */
60290
+ proto.zaber.motion.protobufs.MicroscopeInitRequest.prototype.serializeBinary = function() {
60291
+ var writer = new jspb.BinaryWriter();
60292
+ proto.zaber.motion.protobufs.MicroscopeInitRequest.serializeBinaryToWriter(this, writer);
60293
+ return writer.getResultBuffer();
60294
+ };
60295
+
60296
+
60297
+ /**
60298
+ * Serializes the given message to binary data (in protobuf wire
60299
+ * format), writing to the given BinaryWriter.
60300
+ * @param {!proto.zaber.motion.protobufs.MicroscopeInitRequest} message
60301
+ * @param {!jspb.BinaryWriter} writer
60302
+ * @suppress {unusedLocalVariables} f is only used for nested messages
60303
+ */
60304
+ proto.zaber.motion.protobufs.MicroscopeInitRequest.serializeBinaryToWriter = function(message, writer) {
60305
+ var f = undefined;
60306
+ f = message.getInterfaceId();
60307
+ if (f !== 0) {
60308
+ writer.writeInt32(
60309
+ 1,
60310
+ f
60311
+ );
60312
+ }
60313
+ f = message.getConfig();
60314
+ if (f != null) {
60315
+ writer.writeMessage(
60316
+ 2,
60317
+ f,
60318
+ proto.zaber.motion.protobufs.MicroscopeConfig.serializeBinaryToWriter
60319
+ );
60320
+ }
60321
+ f = message.getForce();
60322
+ if (f) {
60323
+ writer.writeBool(
60324
+ 3,
60325
+ f
60326
+ );
60327
+ }
60328
+ };
60329
+
60330
+
60331
+ /**
60332
+ * optional int32 interface_id = 1;
60333
+ * @return {number}
60334
+ */
60335
+ proto.zaber.motion.protobufs.MicroscopeInitRequest.prototype.getInterfaceId = function() {
60336
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
60337
+ };
60338
+
60339
+
60340
+ /**
60341
+ * @param {number} value
60342
+ * @return {!proto.zaber.motion.protobufs.MicroscopeInitRequest} returns this
60343
+ */
60344
+ proto.zaber.motion.protobufs.MicroscopeInitRequest.prototype.setInterfaceId = function(value) {
60345
+ return jspb.Message.setProto3IntField(this, 1, value);
60346
+ };
60347
+
60348
+
60349
+ /**
60350
+ * optional MicroscopeConfig config = 2;
60351
+ * @return {?proto.zaber.motion.protobufs.MicroscopeConfig}
60352
+ */
60353
+ proto.zaber.motion.protobufs.MicroscopeInitRequest.prototype.getConfig = function() {
60354
+ return /** @type{?proto.zaber.motion.protobufs.MicroscopeConfig} */ (
60355
+ jspb.Message.getWrapperField(this, proto.zaber.motion.protobufs.MicroscopeConfig, 2));
60356
+ };
60357
+
60358
+
60359
+ /**
60360
+ * @param {?proto.zaber.motion.protobufs.MicroscopeConfig|undefined} value
60361
+ * @return {!proto.zaber.motion.protobufs.MicroscopeInitRequest} returns this
60362
+ */
60363
+ proto.zaber.motion.protobufs.MicroscopeInitRequest.prototype.setConfig = function(value) {
60364
+ return jspb.Message.setWrapperField(this, 2, value);
60365
+ };
60366
+
60367
+
60368
+ /**
60369
+ * Clears the message field making it undefined.
60370
+ * @return {!proto.zaber.motion.protobufs.MicroscopeInitRequest} returns this
60371
+ */
60372
+ proto.zaber.motion.protobufs.MicroscopeInitRequest.prototype.clearConfig = function() {
60373
+ return this.setConfig(undefined);
60374
+ };
60375
+
60376
+
60377
+ /**
60378
+ * Returns whether this field is set.
60379
+ * @return {boolean}
60380
+ */
60381
+ proto.zaber.motion.protobufs.MicroscopeInitRequest.prototype.hasConfig = function() {
60382
+ return jspb.Message.getField(this, 2) != null;
60383
+ };
60384
+
60385
+
60386
+ /**
60387
+ * optional bool force = 3;
60388
+ * @return {boolean}
60389
+ */
60390
+ proto.zaber.motion.protobufs.MicroscopeInitRequest.prototype.getForce = function() {
60391
+ return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false));
60392
+ };
60393
+
60394
+
60395
+ /**
60396
+ * @param {boolean} value
60397
+ * @return {!proto.zaber.motion.protobufs.MicroscopeInitRequest} returns this
60398
+ */
60399
+ proto.zaber.motion.protobufs.MicroscopeInitRequest.prototype.setForce = function(value) {
60400
+ return jspb.Message.setProto3BooleanField(this, 3, value);
60401
+ };
60402
+
60403
+
60404
+
60405
+
60406
+
60174
60407
  if (jspb.Message.GENERATE_TO_OBJECT) {
60175
60408
  /**
60176
60409
  * Creates an object representation of this proto.