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 pivot inputs 010 */ 011public class PivotIOInputsAutoLogged 012 extends PivotIO.PivotIOInputs implements LoggableInputs, Cloneable { 013 @Override 014 public void toLog(LogTable table) { 015 table.put("PivotPositionRot", pivotPositionRot); 016 table.put("PivotVelocityRPS", pivotVelocityRPS); 017 table.put("PivotAppliedVolts", pivotAppliedVolts); 018 table.put("PivotCurrentAmps", pivotCurrentAmps); 019 } 020 021 @Override 022 public void fromLog(LogTable table) { 023 pivotPositionRot = table.get("PivotPositionRot", pivotPositionRot); 024 pivotVelocityRPS = table.get("PivotVelocityRPS", pivotVelocityRPS); 025 pivotAppliedVolts = table.get("PivotAppliedVolts", pivotAppliedVolts); 026 pivotCurrentAmps = table.get("PivotCurrentAmps", pivotCurrentAmps); 027 } 028 029 /** 030 * Returns a copy of PivotIOInputsAutoLogged 031 */ 032 public PivotIOInputsAutoLogged clone() { 033 PivotIOInputsAutoLogged copy = new PivotIOInputsAutoLogged(); 034 copy.pivotPositionRot = this.pivotPositionRot; 035 copy.pivotVelocityRPS = this.pivotVelocityRPS; 036 copy.pivotAppliedVolts = this.pivotAppliedVolts; 037 copy.pivotCurrentAmps = this.pivotCurrentAmps; 038 return copy; 039 } 040}