// Auto-generated. Do not edit!

// (in-package fisherbrand_pps4102_balance_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 BalanceCommand {
  constructor(initObj={}) {
    if (initObj === null) {
      // initObj === null is a special case for deserialization where we don't initialize fields
      this.balance_command = null;
    }
    else {
      if (initObj.hasOwnProperty('balance_command')) {
        this.balance_command = initObj.balance_command
      }
      else {
        this.balance_command = 0;
      }
    }
  }

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

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

  static getMessageSize(object) {
    return 4;
  }

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

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

  static messageDefinition() {
    // Returns full string definition for message
    return `
    # Available commands to use the Fisher Scientific PPS4102 Top Pan balance 
    int32 ZERO = 0
    int32 BALANCE_ON = 1
    int32 BALANCE_OFF = 2
    int32 WEIGHT_STABLE = 3
    int32 WEIGHT_NOW = 4
    
    int32 balance_command 
    
    `;
  }

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

    return resolved;
    }
};

// Constants for message
BalanceCommand.Constants = {
  ZERO: 0,
  BALANCE_ON: 1,
  BALANCE_OFF: 2,
  WEIGHT_STABLE: 3,
  WEIGHT_NOW: 4,
}

module.exports = BalanceCommand;
