// 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 QuantosCommand {
  constructor(initObj={}) {
    if (initObj === null) {
      // initObj === null is a special case for deserialization where we don't initialize fields
      this.quantos_command = null;
      this.quantos_ID = null;
      this.quantos_bool = null;
      this.quantos_float = null;
      this.quantos_int = null;
    }
    else {
      if (initObj.hasOwnProperty('quantos_command')) {
        this.quantos_command = initObj.quantos_command
      }
      else {
        this.quantos_command = 0;
      }
      if (initObj.hasOwnProperty('quantos_ID')) {
        this.quantos_ID = initObj.quantos_ID
      }
      else {
        this.quantos_ID = '';
      }
      if (initObj.hasOwnProperty('quantos_bool')) {
        this.quantos_bool = initObj.quantos_bool
      }
      else {
        this.quantos_bool = false;
      }
      if (initObj.hasOwnProperty('quantos_float')) {
        this.quantos_float = initObj.quantos_float
      }
      else {
        this.quantos_float = 0.0;
      }
      if (initObj.hasOwnProperty('quantos_int')) {
        this.quantos_int = initObj.quantos_int
      }
      else {
        this.quantos_int = 0;
      }
    }
  }

  static serialize(obj, buffer, bufferOffset) {
    // Serializes a message object of type QuantosCommand
    // Serialize message field [quantos_command]
    bufferOffset = _serializer.int32(obj.quantos_command, buffer, bufferOffset);
    // Serialize message field [quantos_ID]
    bufferOffset = _serializer.string(obj.quantos_ID, buffer, bufferOffset);
    // Serialize message field [quantos_bool]
    bufferOffset = _serializer.bool(obj.quantos_bool, buffer, bufferOffset);
    // Serialize message field [quantos_float]
    bufferOffset = _serializer.float32(obj.quantos_float, buffer, bufferOffset);
    // Serialize message field [quantos_int]
    bufferOffset = _serializer.int32(obj.quantos_int, buffer, bufferOffset);
    return bufferOffset;
  }

  static deserialize(buffer, bufferOffset=[0]) {
    //deserializes a message object of type QuantosCommand
    let len;
    let data = new QuantosCommand(null);
    // Deserialize message field [quantos_command]
    data.quantos_command = _deserializer.int32(buffer, bufferOffset);
    // Deserialize message field [quantos_ID]
    data.quantos_ID = _deserializer.string(buffer, bufferOffset);
    // Deserialize message field [quantos_bool]
    data.quantos_bool = _deserializer.bool(buffer, bufferOffset);
    // Deserialize message field [quantos_float]
    data.quantos_float = _deserializer.float32(buffer, bufferOffset);
    // Deserialize message field [quantos_int]
    data.quantos_int = _deserializer.int32(buffer, bufferOffset);
    return data;
  }

  static getMessageSize(object) {
    let length = 0;
    length += _getByteLength(object.quantos_ID);
    return length + 17;
  }

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

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

  static messageDefinition() {
    // Returns full string definition for message
    return `
    # Available commands to use the MT Quantos System
    int32 STARTDOSE = 0
    int32 STOPDOSE = 1
    int32 GETDOORPOS = 2
    int32 GETSAMPLEPOS = 3
    int32 GETHEAD = 4
    int32 GETSAMPLE = 5
    int32 MOVEPIN = 6
    int32 MOVEDOOR = 7
    int32 SETSAMPLEPOS = 8
    int32 SETTAPBEFORE = 9
    int32 SETTAPDURING = 10
    int32 SETTAPINT = 11
    int32 SETTAPDURATION = 12
    int32 SETTARGET = 13
    int32 SETTOL = 14
    int32 SETTOLMODE = 15
    int32 SETSAMPLEID = 16
    int32 SETPANOFF = 17
    int32 SETALGO = 18
    int32 SETAS = 19
    int32 DISPENSESOLID = 20
    
    int32 quantos_command
    string quantos_ID
    bool quantos_bool
    float32 quantos_float
    int32 quantos_int
    
    `;
  }

  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 QuantosCommand(null);
    if (msg.quantos_command !== undefined) {
      resolved.quantos_command = msg.quantos_command;
    }
    else {
      resolved.quantos_command = 0
    }

    if (msg.quantos_ID !== undefined) {
      resolved.quantos_ID = msg.quantos_ID;
    }
    else {
      resolved.quantos_ID = ''
    }

    if (msg.quantos_bool !== undefined) {
      resolved.quantos_bool = msg.quantos_bool;
    }
    else {
      resolved.quantos_bool = false
    }

    if (msg.quantos_float !== undefined) {
      resolved.quantos_float = msg.quantos_float;
    }
    else {
      resolved.quantos_float = 0.0
    }

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

    return resolved;
    }
};

// Constants for message
QuantosCommand.Constants = {
  STARTDOSE: 0,
  STOPDOSE: 1,
  GETDOORPOS: 2,
  GETSAMPLEPOS: 3,
  GETHEAD: 4,
  GETSAMPLE: 5,
  MOVEPIN: 6,
  MOVEDOOR: 7,
  SETSAMPLEPOS: 8,
  SETTAPBEFORE: 9,
  SETTAPDURING: 10,
  SETTAPINT: 11,
  SETTAPDURATION: 12,
  SETTARGET: 13,
  SETTOL: 14,
  SETTOLMODE: 15,
  SETSAMPLEID: 16,
  SETPANOFF: 17,
  SETALGO: 18,
  SETAS: 19,
  DISPENSESOLID: 20,
}

module.exports = QuantosCommand;
