From 5112c361f11edcdebf78d15e7e64f634f0c76e69 Mon Sep 17 00:00:00 2001 From: Sam Carlberg Date: Thu, 13 Jun 2024 21:36:40 -0400 Subject: [PATCH 01/46] Rename unit classes to end in *Unit --- .../wpi/first/wpilibj2/command/Command.java | 4 +- .../wpi/first/wpilibj2/command/Commands.java | 4 +- .../first/wpilibj2/command/WaitCommand.java | 4 +- .../wpilibj2/command/sysid/SysIdRoutine.java | 30 +-- .../command/sysid/SysIdRoutineTest.java | 4 +- .../edu/wpi/first/wpilibj/LEDPattern.java | 22 +-- .../edu/wpi/first/wpilibj/TimedRobot.java | 7 +- .../first/wpilibj/simulation/FlywheelSim.java | 12 +- .../first/wpilibj/sysid/SysIdRoutineLog.java | 28 +-- .../examples/addressableled/Robot.java | 4 +- .../examples/sysid/subsystems/Drive.java | 15 +- .../examples/sysid/subsystems/Shooter.java | 15 +- .../edu/wpi/first/math/geometry/Pose2d.java | 4 +- .../wpi/first/math/geometry/Rotation2d.java | 6 +- .../wpi/first/math/geometry/Transform2d.java | 4 +- .../first/math/geometry/Translation2d.java | 4 +- .../first/math/geometry/Translation3d.java | 4 +- .../first/math/kinematics/ChassisSpeeds.java | 34 ++-- .../DifferentialDriveKinematics.java | 4 +- .../kinematics/DifferentialDriveOdometry.java | 14 +- .../DifferentialDriveWheelPositions.java | 4 +- .../DifferentialDriveWheelSpeeds.java | 8 +- .../MecanumDriveWheelPositions.java | 10 +- .../kinematics/MecanumDriveWheelSpeeds.java | 14 +- .../kinematics/SwerveDriveKinematics.java | 14 +- .../math/kinematics/SwerveModulePosition.java | 4 +- .../math/kinematics/SwerveModuleState.java | 6 +- .../math/trajectory/TrajectoryConfig.java | 12 +- .../math/trajectory/TrapezoidProfile.java | 7 +- .../units/{Angle.java => AngleUnit.java} | 15 +- .../java/edu/wpi/first/units/BaseUnits.java | 22 +-- .../units/{Current.java => CurrentUnit.java} | 14 +- ...ensionless.java => DimensionlessUnit.java} | 9 +- .../{Distance.java => DistanceUnit.java} | 10 +- .../units/{Energy.java => EnergyUnit.java} | 10 +- .../first/units/{Mass.java => MassUnit.java} | 10 +- .../java/edu/wpi/first/units/Measure.java | 24 +-- .../edu/wpi/first/units/MutableMeasure.java | 4 +- .../main/java/edu/wpi/first/units/Per.java | 6 +- .../units/{Power.java => PowerUnit.java} | 10 +- ...{Temperature.java => TemperatureUnit.java} | 8 +- .../first/units/{Time.java => TimeUnit.java} | 10 +- .../main/java/edu/wpi/first/units/Unit.java | 4 +- .../main/java/edu/wpi/first/units/Units.java | 179 +++++++++--------- .../{Velocity.java => VelocityUnit.java} | 62 +++--- .../units/{Voltage.java => VoltageUnit.java} | 14 +- ...{CurrentTest.java => CurrentUnitTest.java} | 4 +- ...istanceTest.java => DistanceUnitTest.java} | 8 +- .../java/edu/wpi/first/units/EncoderTest.java | 12 +- .../java/edu/wpi/first/units/MeasureTest.java | 36 ++-- ...elocityTest.java => VelocityUnitTest.java} | 5 +- ...{VoltageTest.java => VoltageUnitTest.java} | 2 +- 52 files changed, 397 insertions(+), 383 deletions(-) rename wpiunits/src/main/java/edu/wpi/first/units/{Angle.java => AngleUnit.java} (63%) rename wpiunits/src/main/java/edu/wpi/first/units/{Current.java => CurrentUnit.java} (75%) rename wpiunits/src/main/java/edu/wpi/first/units/{Dimensionless.java => DimensionlessUnit.java} (78%) rename wpiunits/src/main/java/edu/wpi/first/units/{Distance.java => DistanceUnit.java} (74%) rename wpiunits/src/main/java/edu/wpi/first/units/{Energy.java => EnergyUnit.java} (75%) rename wpiunits/src/main/java/edu/wpi/first/units/{Mass.java => MassUnit.java} (77%) rename wpiunits/src/main/java/edu/wpi/first/units/{Power.java => PowerUnit.java} (75%) rename wpiunits/src/main/java/edu/wpi/first/units/{Temperature.java => TemperatureUnit.java} (78%) rename wpiunits/src/main/java/edu/wpi/first/units/{Time.java => TimeUnit.java} (76%) rename wpiunits/src/main/java/edu/wpi/first/units/{Velocity.java => VelocityUnit.java} (70%) rename wpiunits/src/main/java/edu/wpi/first/units/{Voltage.java => VoltageUnit.java} (76%) rename wpiunits/src/test/java/edu/wpi/first/units/{CurrentTest.java => CurrentUnitTest.java} (87%) rename wpiunits/src/test/java/edu/wpi/first/units/{DistanceTest.java => DistanceUnitTest.java} (81%) rename wpiunits/src/test/java/edu/wpi/first/units/{VelocityTest.java => VelocityUnitTest.java} (93%) rename wpiunits/src/test/java/edu/wpi/first/units/{VoltageTest.java => VoltageUnitTest.java} (96%) diff --git a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/Command.java b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/Command.java index 7d71676ce41..be778d6c149 100644 --- a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/Command.java +++ b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/Command.java @@ -8,7 +8,7 @@ import static edu.wpi.first.util.ErrorMessages.requireNonNullParam; import edu.wpi.first.units.Measure; -import edu.wpi.first.units.Time; +import edu.wpi.first.units.TimeUnit; import edu.wpi.first.util.function.BooleanConsumer; import edu.wpi.first.util.sendable.Sendable; import edu.wpi.first.util.sendable.SendableBuilder; @@ -179,7 +179,7 @@ public ParallelRaceGroup withTimeout(double seconds) { * @param time the timeout duration * @return the command with the timeout added */ - public ParallelRaceGroup withTimeout(Measure