package nomadgui.Telemetry;

import distinct.rpc.*;

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

public class bodDerivedState implements XDRType {
  public int actLeftSteerDist;
  public int actRightSteerDist;
  public int[] actWheelVelocity = new int[4];
  public int[] servoState = new int[2];
  public int[] brakeState = new int[2];
  public int[] actWheelCurrent = new int[4];
  public int actLeftSteerCurrent;
  public int actRightSteerCurrent;
  public int bogieAngle;
  public int msecs;
  public int week;

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

public bodDerivedState()
{}

/**
 * Creates an object of class bodDerivedState.
 * @param     arg_actLeftSteerDist The value of the actLeftSteerDist component.
 * @param     arg_actRightSteerDist The value of the actRightSteerDist component.
 * @param     arg_actWheelVelocity The value of the actWheelVelocity component.
 * @param     arg_servoState The value of the servoState component.
 * @param     arg_brakeState The value of the brakeState component.
 * @param     arg_actWheelCurrent The value of the actWheelCurrent component.
 * @param     arg_actLeftSteerCurrent The value of the actLeftSteerCurrent component.
 * @param     arg_actRightSteerCurrent The value of the actRightSteerCurrent component.
 * @param     arg_bogieAngle The value of the bogieAngle component.
 * @param     arg_msecs The value of the msecs component.
 * @param     arg_week The value of the week component.
 */

public bodDerivedState(int arg_actLeftSteerDist, int arg_actRightSteerDist, int[] arg_actWheelVelocity, int[] arg_servoState, int[] arg_brakeState, int[] arg_actWheelCurrent, int arg_actLeftSteerCurrent, int arg_actRightSteerCurrent, int arg_bogieAngle, int arg_msecs, int arg_week)
{
  actLeftSteerDist = arg_actLeftSteerDist;
  actRightSteerDist = arg_actRightSteerDist;
  actWheelVelocity = arg_actWheelVelocity;
  servoState = arg_servoState;
  brakeState = arg_brakeState;
  actWheelCurrent = arg_actWheelCurrent;
  actLeftSteerCurrent = arg_actLeftSteerCurrent;
  actRightSteerCurrent = arg_actRightSteerCurrent;
  bogieAngle = arg_bogieAngle;
  msecs = arg_msecs;
  week = arg_week;
}

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

public void xdr_encode(XDRStream xdrs)
{
  xdrs.xdr_encode_int(actLeftSteerDist);
  xdrs.xdr_encode_int(actRightSteerDist);
  for (int i_v = 0; i_v < 4; i_v++){
    xdrs.xdr_encode_int(actWheelVelocity[i_v]);
  }
  for (int i_v = 0; i_v < 2; i_v++){
    xdrs.xdr_encode_int(servoState[i_v]);
  }
  for (int i_v = 0; i_v < 2; i_v++){
    xdrs.xdr_encode_int(brakeState[i_v]);
  }
  for (int i_v = 0; i_v < 4; i_v++){
    xdrs.xdr_encode_int(actWheelCurrent[i_v]);
  }
  xdrs.xdr_encode_int(actLeftSteerCurrent);
  xdrs.xdr_encode_int(actRightSteerCurrent);
  xdrs.xdr_encode_int(bogieAngle);
  xdrs.xdr_encode_int(msecs);
  xdrs.xdr_encode_int(week);
}

/**
 * Decodes an object of class bodDerivedState 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
{
  actLeftSteerDist = xdrs.xdr_decode_int();
  actRightSteerDist = 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();
  }
  servoState = new int[2];
  for (int i_v = 0; i_v < 2; i_v++){
    servoState[i_v] = xdrs.xdr_decode_int();
  }
  brakeState = new int[2];
  for (int i_v = 0; i_v < 2; i_v++){
    brakeState[i_v] = xdrs.xdr_decode_int();
  }
  actWheelCurrent = new int[4];
  for (int i_v = 0; i_v < 4; i_v++){
    actWheelCurrent[i_v] = xdrs.xdr_decode_int();
  }
  actLeftSteerCurrent = xdrs.xdr_decode_int();
  actRightSteerCurrent = xdrs.xdr_decode_int();
  bogieAngle = xdrs.xdr_decode_int();
  msecs = xdrs.xdr_decode_int();
  week = xdrs.xdr_decode_int();
}
}
