// Auto-generated. Do not edit!

// (in-package ika_plate_rct_digital_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 IKAReading {
  constructor(initObj={}) {
    if (initObj === null) {
      // initObj === null is a special case for deserialization where we don't initialize fields
      this.bedTemp = null;
      this.extTemp = null;
      this.stirSpeed = null;
      this.viscTrend = null;
    }
    else {
      if (initObj.hasOwnProperty('bedTemp')) {
        this.bedTemp = initObj.bedTemp
      }
      else {
        this.bedTemp = 0.0;
      }
      if (initObj.hasOwnProperty('extTemp')) {
        this.extTemp = initObj.extTemp
      }
      else {
        this.extTemp = 0.0;
      }
      if (initObj.hasOwnProperty('stirSpeed')) {
        this.stirSpeed = initObj.stirSpeed
      }
      else {
        this.stirSpeed = 0.0;
      }
      if (initObj.hasOwnProperty('viscTrend')) {
        this.viscTrend = initObj.viscTrend
      }
      else {
        this.viscTrend = 0.0;
      }
    }
  }

  static serialize(obj, buffer, bufferOffset) {
    // Serializes a message object of type IKAReading
    // Serialize message field [bedTemp]
    bufferOffset = _serializer.float32(obj.bedTemp, buffer, bufferOffset);
    // Serialize message field [extTemp]
    bufferOffset = _serializer.float32(obj.extTemp, buffer, bufferOffset);
    // Serialize message field [stirSpeed]
    bufferOffset = _serializer.float32(obj.stirSpeed, buffer, bufferOffset);
    // Serialize message field [viscTrend]
    bufferOffset = _serializer.float32(obj.viscTrend, buffer, bufferOffset);
    return bufferOffset;
  }

  static deserialize(buffer, bufferOffset=[0]) {
    //deserializes a message object of type IKAReading
    let len;
    let data = new IKAReading(null);
    // Deserialize message field [bedTemp]
    data.bedTemp = _deserializer.float32(buffer, bufferOffset);
    // Deserialize message field [extTemp]
    data.extTemp = _deserializer.float32(buffer, bufferOffset);
    // Deserialize message field [stirSpeed]
    data.stirSpeed = _deserializer.float32(buffer, bufferOffset);
    // Deserialize message field [viscTrend]
    data.viscTrend = _deserializer.float32(buffer, bufferOffset);
    return data;
  }

  static getMessageSize(object) {
    return 16;
  }

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

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

  static messageDefinition() {
    // Returns full string definition for message
    return `
    float32 bedTemp
    float32 extTemp
    float32 stirSpeed
    float32 viscTrend
    
    `;
  }

  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 IKAReading(null);
    if (msg.bedTemp !== undefined) {
      resolved.bedTemp = msg.bedTemp;
    }
    else {
      resolved.bedTemp = 0.0
    }

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

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

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

    return resolved;
    }
};

module.exports = IKAReading;
