Minor code dusting

This commit is contained in:
nathanrsxtn
2022-04-29 11:42:43 -06:00
parent 0ec68ed151
commit c29daee3e3
4 changed files with 4 additions and 32 deletions
@@ -18,7 +18,6 @@ import edu.wpi.first.util.sendable.Sendable;
import edu.wpi.first.util.sendable.SendableBuilder;
import edu.wpi.first.util.sendable.SendableRegistry;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.GenericHID;
import edu.wpi.first.wpilibj.PowerDistribution;
import edu.wpi.first.wpilibj.XboxController;
import edu.wpi.first.wpilibj.smartdashboard.SendableBuilderImpl;
@@ -54,7 +53,6 @@ import frc4388.robot.subsystems.Turret;
import frc4388.robot.subsystems.VisionOdometry;
import frc4388.utility.controller.ButtonBox;
import frc4388.utility.controller.DeadbandedXboxController;
import frc4388.utility.controller.XboxControllerPOV;
import frc4388.utility.shuffleboard.CachingSendableChooser;
/**
@@ -377,7 +375,7 @@ public class RobotContainer {
builder.addStringProperty("default", () -> "Low", null);
builder.addStringArrayProperty("options", () -> new String[] {"Low", "High"}, null);
builder.addStringProperty("active", () -> m_robotSwerveDrive.speedAdjust == SwerveDriveConstants.JOYSTICK_TO_METERS_PER_SECOND_SLOW ? "Low" : "High", null);
builder.addStringProperty("selected", null, val -> m_robotSwerveDrive.speedAdjust = val.equals("Low") ? SwerveDriveConstants.JOYSTICK_TO_METERS_PER_SECOND_SLOW : SwerveDriveConstants.JOYSTICK_TO_METERS_PER_SECOND_FAST);
builder.addStringProperty("selected", null, val -> m_robotSwerveDrive.speedAdjust = "Low".equals(val) ? SwerveDriveConstants.JOYSTICK_TO_METERS_PER_SECOND_SLOW : SwerveDriveConstants.JOYSTICK_TO_METERS_PER_SECOND_FAST);
}
});
putData("Accelerometer", new NTSendable() {
@@ -31,7 +31,7 @@ import org.fusesource.jansi.AnsiPrintStream;
import edu.wpi.first.hal.HAL;
public class AnsiLogging {
public final class AnsiLogging {
public static final Level LEVEL = Level.ALL;
private static final AnsiPrintStream ANSI_CONSOLE_STREAM = AnsiConsole.err();
@@ -136,4 +136,4 @@ public class AnsiLogging {
}
}, true);
}
}
}
+1 -2
View File
@@ -25,7 +25,6 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.BiConsumer;
import java.util.function.BinaryOperator;
import java.util.function.Function;
import java.util.function.IntFunction;
import java.util.function.Predicate;
@@ -108,7 +107,7 @@ public class CSV<R> {
*/
@SuppressWarnings("unchecked")
public R[] read(final Path path) throws IOException {
try (final BufferedReader reader = Files.newBufferedReader(path)) {
try (BufferedReader reader = Files.newBufferedReader(path)) {
final BiConsumer<R, String>[] fieldSetters = Stream.of(headerSanitizer(reader.readLine()).split(",")).map(this::nameProcessor).map(setters::get).toArray(BiConsumer[]::new);
final Stream<String> lines = reader.lines();
return lines.filter(Predicate.not(String::isBlank)).map(line -> deserializeRecordString(line, fieldSetters, generator.get())).toArray(arrayGenerator);
@@ -1,25 +0,0 @@
package frc4388.utility.controller;
/** Represents a d-pad angle on an XboxController. */
public enum XboxControllerPOV {
kUp(0),
kUpRight(45),
kRight(90),
kDownRight(135),
kDown(180),
kDownLeft(225),
kLeft(270),
kUpLeft(315);
@SuppressWarnings("MemberName")
public final int value;
XboxControllerPOV(int value) {
this.value = value;
}
@Override
public String toString() {
return this.name().substring(1) + "Button";
}
}