package nomadgui.Telemetry;

import distinct.rpc.*;

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

public class electricalDerivedState implements XDRType {
  public float[] cmdCurrent = new float[6]; // amps
  public float[] monitoredCurrent = new float[6]; // amps
  public float[] sensedCurrent = new float[6]; // amps
  public float[] power = new float[6]; // watts
  public float[] speed = new float[6]; // rpm
  public float[] powerSupplyVolts = new float[2]; // volts
  public timeStamp time = new timeStamp();

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

public electricalDerivedState()
{}

/**
 * Creates an object of class electricalDerivedState.
 * @param     arg_cmdCurrent The value of the cmdCurrent component.
 * @param     arg_monitoredCurrent The value of the monitoredCurrent component.
 * @param     arg_sensedCurrent The value of the sensedCurrent component.
 * @param     arg_power The value of the power component.
 * @param     arg_speed The value of the speed component.
 * @param     arg_powerSupplyVolts The value of the powerSupplyVolts component.
 * @param     arg_time The value of the time component.
 */

public electricalDerivedState(float[] arg_cmdCurrent, float[] arg_monitoredCurrent, float[] arg_sensedCurrent, float[] arg_power, float[] arg_speed, float[] arg_powerSupplyVolts, timeStamp arg_time)
{
  cmdCurrent = arg_cmdCurrent;
  monitoredCurrent = arg_monitoredCurrent;
  sensedCurrent = arg_sensedCurrent;
  power = arg_power;
  speed = arg_speed;
  powerSupplyVolts = arg_powerSupplyVolts;
  time = arg_time;
}

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

public void xdr_encode(XDRStream xdrs)
{
  for (int i_v = 0; i_v < 6; i_v++){
    xdrs.xdr_encode_float(cmdCurrent[i_v]);
  }
  for (int i_v = 0; i_v < 6; i_v++){
    xdrs.xdr_encode_float(monitoredCurrent[i_v]);
  }
  for (int i_v = 0; i_v < 6; i_v++){
    xdrs.xdr_encode_float(sensedCurrent[i_v]);
  }
  for (int i_v = 0; i_v < 6; i_v++){
    xdrs.xdr_encode_float(power[i_v]);
  }
  for (int i_v = 0; i_v < 6; i_v++){
    xdrs.xdr_encode_float(speed[i_v]);
  }
  for (int i_v = 0; i_v < 2; i_v++){
    xdrs.xdr_encode_float(powerSupplyVolts[i_v]);
  }
  time.xdr_encode(xdrs);
}

/**
 * Decodes an object of class electricalDerivedState 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
{
  cmdCurrent = new float[6];
  for (int i_v = 0; i_v < 6; i_v++){
    cmdCurrent[i_v] = xdrs.xdr_decode_float();
  }
  monitoredCurrent = new float[6];
  for (int i_v = 0; i_v < 6; i_v++){
    monitoredCurrent[i_v] = xdrs.xdr_decode_float();
  }
  sensedCurrent = new float[6];
  for (int i_v = 0; i_v < 6; i_v++){
    sensedCurrent[i_v] = xdrs.xdr_decode_float();
  }
  power = new float[6];
  for (int i_v = 0; i_v < 6; i_v++){
    power[i_v] = xdrs.xdr_decode_float();
  }
  speed = new float[6];
  for (int i_v = 0; i_v < 6; i_v++){
    speed[i_v] = xdrs.xdr_decode_float();
  }
  powerSupplyVolts = new float[2];
  for (int i_v = 0; i_v < 2; i_v++){
    powerSupplyVolts[i_v] = xdrs.xdr_decode_float();
  }
  time = new timeStamp();
  time.xdr_decode(xdrs);
}
}
