// Auto-generated. Do not edit!

// (in-package mettler_toledo_quantos_q2_msgs.msg)


"use strict";

const _serializer = _ros_msg_utils.Serialize;
const _arraySerializer = _serializer.Array;
const _deserializer = _ros_msg_utils.Deserialize;
const _arrayDeserializer = _deserializer.Array;
const _finder = _ros_msg_utils.Find;
const _getByteLength = _ros_msg_utils.getByteLength;

//-----------------------------------------------------------

class QuantosResponse {
  constructor(initObj={}) {
    if (initObj === null) {
      // initObj === null is a special case for deserialization where we don't initialize fields
      this.frontDoorPos = null;
      this.samplerPos = null;
    }
    else {
      if (initObj.hasOwnProperty('frontDoorPos')) {
        this.frontDoorPos = initObj.frontDoorPos
      }
      else {
        this.frontDoorPos = 0;
      }
      if (initObj.hasOwnProperty('samplerPos')) {
        this.samplerPos = initObj.samplerPos
      }
      else {
        this.samplerPos = 0;
      }
    }
  }

  static serialize(obj, buffer, bufferOffset) {
    // Serializes a message object of type QuantosResponse
    // Serialize message field [frontDoorPos]
    bufferOffset = _serializer.int32(obj.frontDoorPos, buffer, bufferOffset);
    // Serialize message field [samplerPos]
    bufferOffset = _serializer.int32(obj.samplerPos, buffer, bufferOffset);
    return bufferOffset;
  }

  static deserialize(buffer, bufferOffset=[0]) {
    //deserializes a message object of type QuantosResponse
    let len;
    let data = new QuantosResponse(null);
    // Deserialize message field [frontDoorPos]
    data.frontDoorPos = _deserializer.int32(buffer, bufferOffset);
    // Deserialize message field [samplerPos]
    data.samplerPos = _deserializer.int32(buffer, bufferOffset);
    return data;
  }

  static getMessageSize(object) {
    return 8;
  }

  static datatype() {
    // Returns string type for a message object
    return 'mettler_toledo_quantos_q2_msgs/QuantosResponse';
  }

  static md5sum() {
    //Returns md5sum for a message object
    return '3036ed050e1a6e7e48e7144fc5fa0890';
  }

  static messageDefinition() {
    // Returns full string definition for message
    return `
    int32 frontDoorPos
    int32 samplerPos
    
    `;
  }

  static Resolve(msg) {
    // deep-construct a valid message object instance of whatever was passed in
    if (typeof msg !== 'object' || msg === null) {
      msg = {};
    }
    const resolved = new QuantosResponse(null);
    if (msg.frontDoorPos !== undefined) {
      resolved.frontDoorPos = msg.frontDoorPos;
    }
    else {
      resolved.frontDoorPos = 0
    }

    if (msg.samplerPos !== undefined) {
      resolved.samplerPos = msg.samplerPos;
    }
    else {
      resolved.samplerPos = 0
    }

    return resolved;
    }
};

module.exports = QuantosResponse;
