package nomadgui.Telemetry;

import distinct.rpc.*;

/**
 * This class was automatically generated by Jrpcgen from the RPC/XDR file "bodRawState.x".<br>
 * bodRawState: was struct
 */

public class bodRawState implements XDRType {
  public int actLeftSteerCnts;
  public int cmdLeftSteerCnts;
  public int actRightSteerCnts;
  public int cmdRightSteerCnts;
  public int[] wheelCnts = new int[4];
  public int[] actWheelVelocity = new int[4];
  public int[] cmdWheelVelocity = new int[4];
  public int[] actWheelCurrents = new int[4];
  public int[] cmdWheelCurrents = new int[4];
  public int actRightSteerCurrent;
  public int cmdRightSteerCurrent;
  public int actLeftSteerCurrent;
  public int cmdLeftSteerCurrent;
  public int msecs;
  public int week;

/**
 * Default constructor for objects of class bodRawState.
 */

public bodRawState()
{}

/**
 * Creates an object of class bodRawState.
 * @param     arg_actLeftSteerCnts The value of the actLeftSteerCnts component.
 * @param     arg_cmdLeftSteerCnts The value of the cmdLeftSteerCnts component.
 * @param     arg_actRightSteerCnts The value of the actRightSteerCnts component.
 * @param     arg_cmdRightSteerCnts The value of the cmdRightSteerCnts component.
 * @param     arg_wheelCnts The value of the wheelCnts component.
 * @param     arg_actWheelVelocity The value of the actWheelVelocity component.
 * @param     arg_cmdWheelVelocity The value of the cmdWheelVelocity component.
 * @param     arg_actWheelCurrents The value of the actWheelCurrents component.
 * @param     arg_cmdWheelCurrents The value of the cmdWheelCurrents component.
 * @param     arg_actRightSteerCurrent The value of the actRightSteerCurrent component.
 * @param     arg_cmdRightSteerCurrent The value of the cmdRightSteerCurrent component.
 * @param     arg_actLeftSteerCurrent The value of the actLeftSteerCurrent component.
 * @param     arg_cmdLeftSteerCurrent The value of the cmdLeftSteerCurrent component.
 * @param     arg_msecs The value of the msecs component.
 * @param     arg_week The value of the week component.
 */

public bodRawState(int arg_actLeftSteerCnts, int arg_cmdLeftSteerCnts, int arg_actRightSteerCnts, int arg_cmdRightSteerCnts, int[] arg_wheelCnts, int[] arg_actWheelVelocity, int[] arg_cmdWheelVelocity, int[] arg_actWheelCurrents, int[] arg_cmdWheelCurrents, int arg_actRightSteerCurrent, int arg_cmdRightSteerCurrent, int arg_actLeftSteerCurrent, int arg_cmdLeftSteerCurrent, int arg_msecs, int arg_week)
{
  actLeftSteerCnts = arg_actLeftSteerCnts;
  cmdLeftSteerCnts = arg_cmdLeftSteerCnts;
  actRightSteerCnts = arg_actRightSteerCnts;
  cmdRightSteerCnts = arg_cmdRightSteerCnts;
  wheelCnts = arg_wheelCnts;
  actWheelVelocity = arg_actWheelVelocity;
  cmdWheelVelocity = arg_cmdWheelVelocity;
  actWheelCurrents = arg_actWheelCurrents;
  cmdWheelCurrents = arg_cmdWheelCurrents;
  actRightSteerCurrent = arg_actRightSteerCurrent;
  cmdRightSteerCurrent = arg_cmdRightSteerCurrent;
  actLeftSteerCurrent = arg_actLeftSteerCurrent;
  cmdLeftSteerCurrent = arg_cmdLeftSteerCurrent;
  msecs = arg_msecs;
  week = arg_week;
}

/**
 * Encodes an object of class bodRawState in compliance to RFC 1832 (XDR).
 * @param     xdrs The XDR output stream.
 */

public void xdr_encode(XDRStream xdrs)
{
  xdrs.xdr_encode_int(actLeftSteerCnts);
  xdrs.xdr_encode_int(cmdLeftSteerCnts);
  xdrs.xdr_encode_int(actRightSteerCnts);
  xdrs.xdr_encode_int(cmdRightSteerCnts);
  for (int i_v = 0; i_v < 4; i_v++){
    xdrs.xdr_encode_int(wheelCnts[i_v]);
  }
  for (int i_v = 0; i_v < 4; i_v++){
    xdrs.xdr_encode_int(actWheelVelocity[i_v]);
  }
  for (int i_v = 0; i_v < 4; i_v++){
    xdrs.xdr_encode_int(cmdWheelVelocity[i_v]);
  }
  for (int i_v = 0; i_v < 4; i_v++){
    xdrs.xdr_encode_int(actWheelCurrents[i_v]);
  }
  for (int i_v = 0; i_v < 4; i_v++){
    xdrs.xdr_encode_int(cmdWheelCurrents[i_v]);
  }
  xdrs.xdr_encode_int(actRightSteerCurrent);
  xdrs.xdr_encode_int(cmdRightSteerCurrent);
  xdrs.xdr_encode_int(actLeftSteerCurrent);
  xdrs.xdr_encode_int(cmdLeftSteerCurrent);
  xdrs.xdr_encode_int(msecs);
  xdrs.xdr_encode_int(week);
}

/**
 * Decodes an object of class bodRawState in compliance to RFC 1832 (XDR).
 * @param     xdrs The XDR input stream.
 * @exception RPCError When the calls fails for any reason.
 */

public void xdr_decode(XDRStream xdrs) throws RPCError
{
  actLeftSteerCnts = xdrs.xdr_decode_int();
  cmdLeftSteerCnts = xdrs.xdr_decode_int();
  actRightSteerCnts = xdrs.xdr_decode_int();
  cmdRightSteerCnts = xdrs.xdr_decode_int();
  wheelCnts = new int[4];
  for (int i_v = 0; i_v < 4; i_v++){
    wheelCnts[i_v] = xdrs.xdr_decode_int();
  }
  actWheelVelocity = new int[4];
  for (int i_v = 0; i_v < 4; i_v++){
    actWheelVelocity[i_v] = xdrs.xdr_decode_int();
  }
  cmdWheelVelocity = new int[4];
  for (int i_v = 0; i_v < 4; i_v++){
    cmdWheelVelocity[i_v] = xdrs.xdr_decode_int();
  }
  actWheelCurrents = new int[4];
  for (int i_v = 0; i_v < 4; i_v++){
    actWheelCurrents[i_v] = xdrs.xdr_decode_int();
  }
  cmdWheelCurrents = new int[4];
  for (int i_v = 0; i_v < 4; i_v++){
    cmdWheelCurrents[i_v] = xdrs.xdr_decode_int();
  }
  actRightSteerCurrent = xdrs.xdr_decode_int();
  cmdRightSteerCurrent = xdrs.xdr_decode_int();
  actLeftSteerCurrent = xdrs.xdr_decode_int();
  cmdLeftSteerCurrent = xdrs.xdr_decode_int();
  msecs = xdrs.xdr_decode_int();
  week = xdrs.xdr_decode_int();
}
}
