001package tagalong.logging;
002
003import java.lang.Cloneable;
004import java.lang.Override;
005import org.littletonrobotics.junction.LogTable;
006import org.littletonrobotics.junction.inputs.LoggableInputs;
007
008/**
009 * Logger for roller inputs
010 */
011public class RollerIOInputsAutoLogged
012    extends RollerIO.RollerIOInputs implements LoggableInputs, Cloneable {
013  @Override
014  public void toLog(LogTable table) {
015    table.put("RollerPositionRot", rollerPositionRot);
016    table.put("RollerVelocityRPS", rollerVelocityRPS);
017    table.put("RollerAppliedVolts", rollerAppliedVolts);
018    table.put("RollerCurrentAmps", rollerCurrentAmps);
019  }
020
021  @Override
022  public void fromLog(LogTable table) {
023    rollerPositionRot = table.get("RollerPositionRot", rollerPositionRot);
024    rollerVelocityRPS = table.get("RollerVelocityRPS", rollerVelocityRPS);
025    rollerAppliedVolts = table.get("RollerAppliedVolts", rollerAppliedVolts);
026    rollerCurrentAmps = table.get("RollerCurrentAmps", rollerCurrentAmps);
027  }
028
029  /**
030   * Returns a copy of RollerIOInputsAutoLogged
031   */
032  public RollerIOInputsAutoLogged clone() {
033    RollerIOInputsAutoLogged copy = new RollerIOInputsAutoLogged();
034    copy.rollerPositionRot = this.rollerPositionRot;
035    copy.rollerVelocityRPS = this.rollerVelocityRPS;
036    copy.rollerAppliedVolts = this.rollerAppliedVolts;
037    copy.rollerCurrentAmps = this.rollerCurrentAmps;
038    return copy;
039  }
040}