From e52f40068772cd96546cc97a61b935514ff415a9 Mon Sep 17 00:00:00 2001 From: Sam Carlberg Date: Fri, 17 Jan 2025 02:24:11 -0500 Subject: [PATCH] [wpiunits] Add Measure.per overloads for all known unit types (#7699) Instead of only providing per(TimeUnit) Useful for making conversion factors easier, eg `Inches.of(10).per(Rotation)` vs `Inches.of(10).per(Rotation.one())` Update VelocityUnit.one() and VelocityUnit.zero() to return Velocity objects instead of generic Measure>; VelocityUnit is final, so the wildcard generic is unnecessary, and this makes the generated `per` functions possible for this type --- .../main/java/Measure-interface.java.jinja | 37 ++- .../wpi/first/units/measure/Acceleration.java | 125 +++++++- .../edu/wpi/first/units/measure/Angle.java | 125 +++++++- .../units/measure/AngularAcceleration.java | 125 +++++++- .../first/units/measure/AngularMomentum.java | 125 +++++++- .../first/units/measure/AngularVelocity.java | 125 +++++++- .../edu/wpi/first/units/measure/Current.java | 125 +++++++- .../first/units/measure/Dimensionless.java | 125 +++++++- .../edu/wpi/first/units/measure/Distance.java | 125 +++++++- .../edu/wpi/first/units/measure/Energy.java | 125 +++++++- .../edu/wpi/first/units/measure/Force.java | 125 +++++++- .../wpi/first/units/measure/Frequency.java | 125 +++++++- .../units/measure/LinearAcceleration.java | 125 +++++++- .../first/units/measure/LinearMomentum.java | 125 +++++++- .../first/units/measure/LinearVelocity.java | 125 +++++++- .../edu/wpi/first/units/measure/Mass.java | 125 +++++++- .../first/units/measure/MomentOfInertia.java | 125 +++++++- .../edu/wpi/first/units/measure/Mult.java | 125 +++++++- .../java/edu/wpi/first/units/measure/Per.java | 125 +++++++- .../edu/wpi/first/units/measure/Power.java | 125 +++++++- .../wpi/first/units/measure/Resistance.java | 125 +++++++- .../wpi/first/units/measure/Temperature.java | 125 +++++++- .../edu/wpi/first/units/measure/Time.java | 125 +++++++- .../edu/wpi/first/units/measure/Torque.java | 125 +++++++- .../edu/wpi/first/units/measure/Velocity.java | 125 +++++++- .../edu/wpi/first/units/measure/Voltage.java | 125 +++++++- .../java/edu/wpi/first/units/Measure.java | 275 +++++++++++++++++- .../edu/wpi/first/units/VelocityUnit.java | 8 +- 28 files changed, 3300 insertions(+), 145 deletions(-) diff --git a/wpiunits/src/generate/main/java/Measure-interface.java.jinja b/wpiunits/src/generate/main/java/Measure-interface.java.jinja index 80ffe0a7e09..608900f2b51 100644 --- a/wpiunits/src/generate/main/java/Measure-interface.java.jinja +++ b/wpiunits/src/generate/main/java/Measure-interface.java.jinja @@ -86,11 +86,6 @@ public interface {{ helpers['type_decl'](name) }} extends Measure<{{ helpers['mt default {{ helpers['type_usage'](name) }} divide(double divisor) { return ({{ helpers['type_usage'](name) }}) div(divisor); } - - @Override - default {{ config[name]['divide']['Time'] or "Velocity<{}>".format(helpers['mtou'](name)) }} per(TimeUnit period) { - return div(period.of(1)); - } {% for unit in math_units -%} {% if unit == "Dimensionless" %} @Override @@ -147,6 +142,15 @@ public interface {{ helpers['type_decl'](name) }} extends Measure<{{ helpers['mt default {{ config[name]['divide'][unit] }} divide({{ unit }} divisor) { return div(divisor); } + + @Override + default {{ config[name]['divide'][unit] }} per({{ helpers['mtou'](unit) }} divisorUnit) { +{%- if unit == "Mult" or unit == "Per" %} + return div(divisorUnit.ofNative(1)); +{%- else %} + return div(divisorUnit.one()); +{%- endif %} + } {% elif unit == "Time" %} @Override default Velocity<{{ helpers['mtou'](name) }}> div({{ unit }} divisor) { @@ -164,6 +168,15 @@ public interface {{ helpers['type_decl'](name) }} extends Measure<{{ helpers['mt default Velocity<{{ helpers['mtou'](name) }}> divide({{ unit }} divisor) { return div(divisor); } + + @Override + default Velocity<{{ helpers['mtou'](name) }}> per({{ helpers['mtou'](unit) }} divisorUnit) { +{%- if unit == "Mult" or unit == "Per" %} + return div(divisorUnit.ofNative(1)); +{%- else %} + return div(divisorUnit.one()); +{%- endif %} + } {% elif unit == name %} @Override default Dimensionless div({{ unit }} divisor) { @@ -181,6 +194,11 @@ public interface {{ helpers['type_decl'](name) }} extends Measure<{{ helpers['mt default Dimensionless divide({{ unit }} divisor) { return div(divisor); } + + @Override + default Dimensionless per({{ helpers['mtou'](unit) }} divisorUnit) { + return div(divisorUnit.one()); + } {% else %} @Override default Per<{{ helpers['mtou'](name) }}, {{ helpers['mtou'](unit) }}> div({{ unit }} divisor) { @@ -198,6 +216,15 @@ public interface {{ helpers['type_decl'](name) }} extends Measure<{{ helpers['mt default Per<{{ helpers['mtou'](name) }}, {{ helpers['mtou'](unit) }}> divide({{ unit }} divisor) { return div(divisor); } + + @Override + default Per<{{ helpers['mtou'](name) }}, {{ helpers['mtou'](unit) }}> per({{ helpers['mtou'](unit) }} divisorUnit) { +{%- if unit == "Mult" or unit == "Per" %} + return div(divisorUnit.ofNative(1)); +{%- else %} + return div(divisorUnit.one()); +{%- endif %} + } {% endif -%} {% endif -%} {% endfor -%} diff --git a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Acceleration.java b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Acceleration.java index ac4f6860976..9a007dae74f 100644 --- a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Acceleration.java +++ b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Acceleration.java @@ -87,11 +87,6 @@ default Acceleration divide(double divisor) { return (Acceleration) div(divisor); } - @Override - default Velocity> per(TimeUnit period) { - return div(period.of(1)); - } - @Override default Mult, AccelerationUnit> times(Acceleration multiplier) { @@ -115,6 +110,11 @@ default Per, AccelerationUnit> divide(Acceleration div return div(divisor); } + @Override + default Per, AccelerationUnit> per(AccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, AngleUnit> times(Angle multiplier) { @@ -138,6 +138,11 @@ default Per, AngleUnit> divide(Angle divisor) { return div(divisor); } + @Override + default Per, AngleUnit> per(AngleUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, AngularAccelerationUnit> times(AngularAcceleration multiplier) { @@ -161,6 +166,11 @@ default Per, AngularAccelerationUnit> divide(AngularAccelera return div(divisor); } + @Override + default Per, AngularAccelerationUnit> per(AngularAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, AngularMomentumUnit> times(AngularMomentum multiplier) { @@ -184,6 +194,11 @@ default Per, AngularMomentumUnit> divide(AngularMomentum div return div(divisor); } + @Override + default Per, AngularMomentumUnit> per(AngularMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, AngularVelocityUnit> times(AngularVelocity multiplier) { @@ -207,6 +222,11 @@ default Per, AngularVelocityUnit> divide(AngularVelocity div return div(divisor); } + @Override + default Per, AngularVelocityUnit> per(AngularVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, CurrentUnit> times(Current multiplier) { @@ -230,6 +250,11 @@ default Per, CurrentUnit> divide(Current divisor) { return div(divisor); } + @Override + default Per, CurrentUnit> per(CurrentUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Acceleration div(Dimensionless divisor) { return (Acceleration) unit().of(baseUnitMagnitude() / divisor.baseUnitMagnitude()); @@ -275,6 +300,11 @@ default Per, DistanceUnit> divide(Distance divisor) { return div(divisor); } + @Override + default Per, DistanceUnit> per(DistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, EnergyUnit> times(Energy multiplier) { @@ -298,6 +328,11 @@ default Per, EnergyUnit> divide(Energy divisor) { return div(divisor); } + @Override + default Per, EnergyUnit> per(EnergyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, ForceUnit> times(Force multiplier) { @@ -321,6 +356,11 @@ default Per, ForceUnit> divide(Force divisor) { return div(divisor); } + @Override + default Per, ForceUnit> per(ForceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, FrequencyUnit> times(Frequency multiplier) { @@ -344,6 +384,11 @@ default Per, FrequencyUnit> divide(Frequency divisor) { return div(divisor); } + @Override + default Per, FrequencyUnit> per(FrequencyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, LinearAccelerationUnit> times(LinearAcceleration multiplier) { @@ -367,6 +412,11 @@ default Per, LinearAccelerationUnit> divide(LinearAccelerati return div(divisor); } + @Override + default Per, LinearAccelerationUnit> per(LinearAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, LinearMomentumUnit> times(LinearMomentum multiplier) { @@ -390,6 +440,11 @@ default Per, LinearMomentumUnit> divide(LinearMomentum divis return div(divisor); } + @Override + default Per, LinearMomentumUnit> per(LinearMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, LinearVelocityUnit> times(LinearVelocity multiplier) { @@ -413,6 +468,11 @@ default Per, LinearVelocityUnit> divide(LinearVelocity divis return div(divisor); } + @Override + default Per, LinearVelocityUnit> per(LinearVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, MassUnit> times(Mass multiplier) { @@ -436,6 +496,11 @@ default Per, MassUnit> divide(Mass divisor) { return div(divisor); } + @Override + default Per, MassUnit> per(MassUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, MomentOfInertiaUnit> times(MomentOfInertia multiplier) { @@ -459,6 +524,11 @@ default Per, MomentOfInertiaUnit> divide(MomentOfInertia div return div(divisor); } + @Override + default Per, MomentOfInertiaUnit> per(MomentOfInertiaUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, MultUnit> times(Mult multiplier) { @@ -482,6 +552,11 @@ default Per, MomentOfInertiaUnit> divide(MomentOfInertia div return div(divisor); } + @Override + default Per, MultUnit> per(MultUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult, PerUnit> times(Per multiplier) { @@ -505,6 +580,11 @@ default Per, MomentOfInertiaUnit> divide(MomentOfInertia div return div(divisor); } + @Override + default Per, PerUnit> per(PerUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult, PowerUnit> times(Power multiplier) { @@ -528,6 +608,11 @@ default Per, PowerUnit> divide(Power divisor) { return div(divisor); } + @Override + default Per, PowerUnit> per(PowerUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, ResistanceUnit> times(Resistance multiplier) { @@ -551,6 +636,11 @@ default Per, ResistanceUnit> divide(Resistance divisor) { return div(divisor); } + @Override + default Per, ResistanceUnit> per(ResistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, TemperatureUnit> times(Temperature multiplier) { @@ -574,6 +664,11 @@ default Per, TemperatureUnit> divide(Temperature divisor) { return div(divisor); } + @Override + default Per, TemperatureUnit> per(TemperatureUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, TimeUnit> times(Time multiplier) { @@ -597,6 +692,11 @@ default Velocity> divide(Time divisor) { return div(divisor); } + @Override + default Velocity> per(TimeUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, TorqueUnit> times(Torque multiplier) { @@ -620,6 +720,11 @@ default Per, TorqueUnit> divide(Torque divisor) { return div(divisor); } + @Override + default Per, TorqueUnit> per(TorqueUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, VelocityUnit> times(Velocity multiplier) { @@ -643,6 +748,11 @@ default Per, VelocityUnit> divide(Velocity divisor) { return div(divisor); } + @Override + default Per, VelocityUnit> per(VelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, VoltageUnit> times(Voltage multiplier) { @@ -666,4 +776,9 @@ default Per, VoltageUnit> divide(Voltage divisor) { return div(divisor); } + @Override + default Per, VoltageUnit> per(VoltageUnit divisorUnit) { + return div(divisorUnit.one()); + } + } diff --git a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Angle.java b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Angle.java index 23b99572417..812b239a7ba 100644 --- a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Angle.java +++ b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Angle.java @@ -87,11 +87,6 @@ default Angle divide(double divisor) { return (Angle) div(divisor); } - @Override - default AngularVelocity per(TimeUnit period) { - return div(period.of(1)); - } - @Override default Mult> times(Acceleration multiplier) { @@ -115,6 +110,11 @@ default Per> divide(Acceleration divisor) { return div(divisor); } + @Override + default Per> per(AccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Angle multiplier) { @@ -138,6 +138,11 @@ default Dimensionless divide(Angle divisor) { return div(divisor); } + @Override + default Dimensionless per(AngleUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularAcceleration multiplier) { @@ -161,6 +166,11 @@ default Per divide(AngularAcceleration divis return div(divisor); } + @Override + default Per per(AngularAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularMomentum multiplier) { @@ -184,6 +194,11 @@ default Per divide(AngularMomentum divisor) { return div(divisor); } + @Override + default Per per(AngularMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularVelocity multiplier) { @@ -207,6 +222,11 @@ default Per divide(AngularVelocity divisor) { return div(divisor); } + @Override + default Per per(AngularVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Current multiplier) { @@ -230,6 +250,11 @@ default Per divide(Current divisor) { return div(divisor); } + @Override + default Per per(CurrentUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Angle div(Dimensionless divisor) { return (Angle) Radians.of(baseUnitMagnitude() / divisor.baseUnitMagnitude()); @@ -275,6 +300,11 @@ default Per divide(Distance divisor) { return div(divisor); } + @Override + default Per per(DistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Energy multiplier) { @@ -298,6 +328,11 @@ default Per divide(Energy divisor) { return div(divisor); } + @Override + default Per per(EnergyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Force multiplier) { @@ -321,6 +356,11 @@ default Per divide(Force divisor) { return div(divisor); } + @Override + default Per per(ForceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default AngularVelocity times(Frequency multiplier) { @@ -344,6 +384,11 @@ default Per divide(Frequency divisor) { return div(divisor); } + @Override + default Per per(FrequencyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearAcceleration multiplier) { @@ -367,6 +412,11 @@ default Per divide(LinearAcceleration divisor return div(divisor); } + @Override + default Per per(LinearAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearMomentum multiplier) { @@ -390,6 +440,11 @@ default Per divide(LinearMomentum divisor) { return div(divisor); } + @Override + default Per per(LinearMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearVelocity multiplier) { @@ -413,6 +468,11 @@ default Per divide(LinearVelocity divisor) { return div(divisor); } + @Override + default Per per(LinearVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Mass multiplier) { @@ -436,6 +496,11 @@ default Per divide(Mass divisor) { return div(divisor); } + @Override + default Per per(MassUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(MomentOfInertia multiplier) { @@ -459,6 +524,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per per(MomentOfInertiaUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Mult multiplier) { @@ -482,6 +552,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per> per(MultUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult> times(Per multiplier) { @@ -505,6 +580,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per> per(PerUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult times(Power multiplier) { @@ -528,6 +608,11 @@ default Per divide(Power divisor) { return div(divisor); } + @Override + default Per per(PowerUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Resistance multiplier) { @@ -551,6 +636,11 @@ default Per divide(Resistance divisor) { return div(divisor); } + @Override + default Per per(ResistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Temperature multiplier) { @@ -574,6 +664,11 @@ default Per divide(Temperature divisor) { return div(divisor); } + @Override + default Per per(TemperatureUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Time multiplier) { @@ -597,6 +692,11 @@ default AngularVelocity divide(Time divisor) { return div(divisor); } + @Override + default AngularVelocity per(TimeUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Torque multiplier) { @@ -620,6 +720,11 @@ default Per divide(Torque divisor) { return div(divisor); } + @Override + default Per per(TorqueUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Velocity multiplier) { @@ -643,6 +748,11 @@ default Per> divide(Velocity divisor) { return div(divisor); } + @Override + default Per> per(VelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Voltage multiplier) { @@ -666,4 +776,9 @@ default Per divide(Voltage divisor) { return div(divisor); } + @Override + default Per per(VoltageUnit divisorUnit) { + return div(divisorUnit.one()); + } + } diff --git a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/AngularAcceleration.java b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/AngularAcceleration.java index d5cac08a792..d90cbe2056f 100644 --- a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/AngularAcceleration.java +++ b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/AngularAcceleration.java @@ -87,11 +87,6 @@ default AngularAcceleration divide(double divisor) { return (AngularAcceleration) div(divisor); } - @Override - default Velocity per(TimeUnit period) { - return div(period.of(1)); - } - @Override default Mult> times(Acceleration multiplier) { @@ -115,6 +110,11 @@ default Per> divide(Acceleration return div(divisor); } + @Override + default Per> per(AccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Angle multiplier) { @@ -138,6 +138,11 @@ default Per divide(Angle divisor) { return div(divisor); } + @Override + default Per per(AngleUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularAcceleration multiplier) { @@ -161,6 +166,11 @@ default Dimensionless divide(AngularAcceleration divisor) { return div(divisor); } + @Override + default Dimensionless per(AngularAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularMomentum multiplier) { @@ -184,6 +194,11 @@ default Per divide(AngularMomentum return div(divisor); } + @Override + default Per per(AngularMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularVelocity multiplier) { @@ -207,6 +222,11 @@ default Per divide(AngularVelocity return div(divisor); } + @Override + default Per per(AngularVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Current multiplier) { @@ -230,6 +250,11 @@ default Per divide(Current divisor) { return div(divisor); } + @Override + default Per per(CurrentUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default AngularAcceleration div(Dimensionless divisor) { return (AngularAcceleration) RadiansPerSecondPerSecond.of(baseUnitMagnitude() / divisor.baseUnitMagnitude()); @@ -275,6 +300,11 @@ default Per divide(Distance divisor) { return div(divisor); } + @Override + default Per per(DistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Energy multiplier) { @@ -298,6 +328,11 @@ default Per divide(Energy divisor) { return div(divisor); } + @Override + default Per per(EnergyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Force multiplier) { @@ -321,6 +356,11 @@ default Per divide(Force divisor) { return div(divisor); } + @Override + default Per per(ForceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Frequency multiplier) { @@ -344,6 +384,11 @@ default AngularVelocity divide(Frequency divisor) { return div(divisor); } + @Override + default AngularVelocity per(FrequencyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearAcceleration multiplier) { @@ -367,6 +412,11 @@ default Per divide(LinearAccele return div(divisor); } + @Override + default Per per(LinearAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearMomentum multiplier) { @@ -390,6 +440,11 @@ default Per divide(LinearMomentum d return div(divisor); } + @Override + default Per per(LinearMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearVelocity multiplier) { @@ -413,6 +468,11 @@ default Per divide(LinearVelocity d return div(divisor); } + @Override + default Per per(LinearVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Mass multiplier) { @@ -436,6 +496,11 @@ default Per divide(Mass divisor) { return div(divisor); } + @Override + default Per per(MassUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(MomentOfInertia multiplier) { @@ -459,6 +524,11 @@ default Per divide(MomentOfInertia return div(divisor); } + @Override + default Per per(MomentOfInertiaUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Mult multiplier) { @@ -482,6 +552,11 @@ default Per divide(MomentOfInertia return div(divisor); } + @Override + default Per> per(MultUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult> times(Per multiplier) { @@ -505,6 +580,11 @@ default Per divide(MomentOfInertia return div(divisor); } + @Override + default Per> per(PerUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult times(Power multiplier) { @@ -528,6 +608,11 @@ default Per divide(Power divisor) { return div(divisor); } + @Override + default Per per(PowerUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Resistance multiplier) { @@ -551,6 +636,11 @@ default Per divide(Resistance divisor) return div(divisor); } + @Override + default Per per(ResistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Temperature multiplier) { @@ -574,6 +664,11 @@ default Per divide(Temperature divisor return div(divisor); } + @Override + default Per per(TemperatureUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default AngularVelocity times(Time multiplier) { @@ -597,6 +692,11 @@ default Velocity divide(Time divisor) { return div(divisor); } + @Override + default Velocity per(TimeUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Torque multiplier) { @@ -620,6 +720,11 @@ default Per divide(Torque divisor) { return div(divisor); } + @Override + default Per per(TorqueUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Velocity multiplier) { @@ -643,6 +748,11 @@ default Per> divide(Velocity divisor return div(divisor); } + @Override + default Per> per(VelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Voltage multiplier) { @@ -666,4 +776,9 @@ default Per divide(Voltage divisor) { return div(divisor); } + @Override + default Per per(VoltageUnit divisorUnit) { + return div(divisorUnit.one()); + } + } diff --git a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/AngularMomentum.java b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/AngularMomentum.java index 8d7bc6387e5..ab1b0f15fda 100644 --- a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/AngularMomentum.java +++ b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/AngularMomentum.java @@ -87,11 +87,6 @@ default AngularMomentum divide(double divisor) { return (AngularMomentum) div(divisor); } - @Override - default Velocity per(TimeUnit period) { - return div(period.of(1)); - } - @Override default Mult> times(Acceleration multiplier) { @@ -115,6 +110,11 @@ default Per> divide(Acceleration div return div(divisor); } + @Override + default Per> per(AccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Angle multiplier) { @@ -138,6 +138,11 @@ default Per divide(Angle divisor) { return div(divisor); } + @Override + default Per per(AngleUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularAcceleration multiplier) { @@ -161,6 +166,11 @@ default Per divide(AngularAccelera return div(divisor); } + @Override + default Per per(AngularAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularMomentum multiplier) { @@ -184,6 +194,11 @@ default Dimensionless divide(AngularMomentum divisor) { return div(divisor); } + @Override + default Dimensionless per(AngularMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularVelocity multiplier) { @@ -207,6 +222,11 @@ default MomentOfInertia divide(AngularVelocity divisor) { return div(divisor); } + @Override + default MomentOfInertia per(AngularVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Current multiplier) { @@ -230,6 +250,11 @@ default Per divide(Current divisor) { return div(divisor); } + @Override + default Per per(CurrentUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default AngularMomentum div(Dimensionless divisor) { return (AngularMomentum) KilogramMetersSquaredPerSecond.of(baseUnitMagnitude() / divisor.baseUnitMagnitude()); @@ -275,6 +300,11 @@ default Per divide(Distance divisor) { return div(divisor); } + @Override + default Per per(DistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Energy multiplier) { @@ -298,6 +328,11 @@ default Per divide(Energy divisor) { return div(divisor); } + @Override + default Per per(EnergyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Force multiplier) { @@ -321,6 +356,11 @@ default Per divide(Force divisor) { return div(divisor); } + @Override + default Per per(ForceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Frequency multiplier) { @@ -344,6 +384,11 @@ default Per divide(Frequency divisor) { return div(divisor); } + @Override + default Per per(FrequencyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearAcceleration multiplier) { @@ -367,6 +412,11 @@ default Per divide(LinearAccelerati return div(divisor); } + @Override + default Per per(LinearAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearMomentum multiplier) { @@ -390,6 +440,11 @@ default Per divide(LinearMomentum divis return div(divisor); } + @Override + default Per per(LinearMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearVelocity multiplier) { @@ -413,6 +468,11 @@ default Per divide(LinearVelocity divis return div(divisor); } + @Override + default Per per(LinearVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Mass multiplier) { @@ -436,6 +496,11 @@ default Per divide(Mass divisor) { return div(divisor); } + @Override + default Per per(MassUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(MomentOfInertia multiplier) { @@ -459,6 +524,11 @@ default Per divide(MomentOfInertia div return div(divisor); } + @Override + default Per per(MomentOfInertiaUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Mult multiplier) { @@ -482,6 +552,11 @@ default Per divide(MomentOfInertia div return div(divisor); } + @Override + default Per> per(MultUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult> times(Per multiplier) { @@ -505,6 +580,11 @@ default Per divide(MomentOfInertia div return div(divisor); } + @Override + default Per> per(PerUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult times(Power multiplier) { @@ -528,6 +608,11 @@ default Per divide(Power divisor) { return div(divisor); } + @Override + default Per per(PowerUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Resistance multiplier) { @@ -551,6 +636,11 @@ default Per divide(Resistance divisor) { return div(divisor); } + @Override + default Per per(ResistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Temperature multiplier) { @@ -574,6 +664,11 @@ default Per divide(Temperature divisor) { return div(divisor); } + @Override + default Per per(TemperatureUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Time multiplier) { @@ -597,6 +692,11 @@ default Velocity divide(Time divisor) { return div(divisor); } + @Override + default Velocity per(TimeUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Torque multiplier) { @@ -620,6 +720,11 @@ default Per divide(Torque divisor) { return div(divisor); } + @Override + default Per per(TorqueUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Velocity multiplier) { @@ -643,6 +748,11 @@ default Per> divide(Velocity divisor) { return div(divisor); } + @Override + default Per> per(VelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Voltage multiplier) { @@ -666,4 +776,9 @@ default Per divide(Voltage divisor) { return div(divisor); } + @Override + default Per per(VoltageUnit divisorUnit) { + return div(divisorUnit.one()); + } + } diff --git a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/AngularVelocity.java b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/AngularVelocity.java index 9347eafa8bc..37b4a28d574 100644 --- a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/AngularVelocity.java +++ b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/AngularVelocity.java @@ -87,11 +87,6 @@ default AngularVelocity divide(double divisor) { return (AngularVelocity) div(divisor); } - @Override - default AngularAcceleration per(TimeUnit period) { - return div(period.of(1)); - } - @Override default Mult> times(Acceleration multiplier) { @@ -115,6 +110,11 @@ default Per> divide(Acceleration div return div(divisor); } + @Override + default Per> per(AccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Angle multiplier) { @@ -138,6 +138,11 @@ default Per divide(Angle divisor) { return div(divisor); } + @Override + default Per per(AngleUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularAcceleration multiplier) { @@ -161,6 +166,11 @@ default Per divide(AngularAccelera return div(divisor); } + @Override + default Per per(AngularAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularMomentum multiplier) { @@ -184,6 +194,11 @@ default Per divide(AngularMomentum div return div(divisor); } + @Override + default Per per(AngularMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularVelocity multiplier) { @@ -207,6 +222,11 @@ default Dimensionless divide(AngularVelocity divisor) { return div(divisor); } + @Override + default Dimensionless per(AngularVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Current multiplier) { @@ -230,6 +250,11 @@ default Per divide(Current divisor) { return div(divisor); } + @Override + default Per per(CurrentUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default AngularVelocity div(Dimensionless divisor) { return (AngularVelocity) RadiansPerSecond.of(baseUnitMagnitude() / divisor.baseUnitMagnitude()); @@ -275,6 +300,11 @@ default Per divide(Distance divisor) { return div(divisor); } + @Override + default Per per(DistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Energy multiplier) { @@ -298,6 +328,11 @@ default Per divide(Energy divisor) { return div(divisor); } + @Override + default Per per(EnergyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Force multiplier) { @@ -321,6 +356,11 @@ default Per divide(Force divisor) { return div(divisor); } + @Override + default Per per(ForceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default AngularAcceleration times(Frequency multiplier) { @@ -344,6 +384,11 @@ default Per divide(Frequency divisor) { return div(divisor); } + @Override + default Per per(FrequencyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearAcceleration multiplier) { @@ -367,6 +412,11 @@ default Per divide(LinearAccelerati return div(divisor); } + @Override + default Per per(LinearAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearMomentum multiplier) { @@ -390,6 +440,11 @@ default Per divide(LinearMomentum divis return div(divisor); } + @Override + default Per per(LinearMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearVelocity multiplier) { @@ -413,6 +468,11 @@ default Per divide(LinearVelocity divis return div(divisor); } + @Override + default Per per(LinearVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Mass multiplier) { @@ -436,6 +496,11 @@ default Per divide(Mass divisor) { return div(divisor); } + @Override + default Per per(MassUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(MomentOfInertia multiplier) { @@ -459,6 +524,11 @@ default Per divide(MomentOfInertia div return div(divisor); } + @Override + default Per per(MomentOfInertiaUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Mult multiplier) { @@ -482,6 +552,11 @@ default Per divide(MomentOfInertia div return div(divisor); } + @Override + default Per> per(MultUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult> times(Per multiplier) { @@ -505,6 +580,11 @@ default Per divide(MomentOfInertia div return div(divisor); } + @Override + default Per> per(PerUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult times(Power multiplier) { @@ -528,6 +608,11 @@ default Per divide(Power divisor) { return div(divisor); } + @Override + default Per per(PowerUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Resistance multiplier) { @@ -551,6 +636,11 @@ default Per divide(Resistance divisor) { return div(divisor); } + @Override + default Per per(ResistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Temperature multiplier) { @@ -574,6 +664,11 @@ default Per divide(Temperature divisor) { return div(divisor); } + @Override + default Per per(TemperatureUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Angle times(Time multiplier) { @@ -597,6 +692,11 @@ default AngularAcceleration divide(Time divisor) { return div(divisor); } + @Override + default AngularAcceleration per(TimeUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Torque multiplier) { @@ -620,6 +720,11 @@ default Per divide(Torque divisor) { return div(divisor); } + @Override + default Per per(TorqueUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Velocity multiplier) { @@ -643,6 +748,11 @@ default Per> divide(Velocity divisor) { return div(divisor); } + @Override + default Per> per(VelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Voltage multiplier) { @@ -665,5 +775,10 @@ default Per div(Voltage divisor) { default Per divide(Voltage divisor) { return div(divisor); } + + @Override + default Per per(VoltageUnit divisorUnit) { + return div(divisorUnit.one()); + } default Frequency asFrequency() { return Hertz.of(baseUnitMagnitude()); } } diff --git a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Current.java b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Current.java index 84ae1e04db1..734272a1380 100644 --- a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Current.java +++ b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Current.java @@ -87,11 +87,6 @@ default Current divide(double divisor) { return (Current) div(divisor); } - @Override - default Velocity per(TimeUnit period) { - return div(period.of(1)); - } - @Override default Mult> times(Acceleration multiplier) { @@ -115,6 +110,11 @@ default Per> divide(Acceleration divisor) { return div(divisor); } + @Override + default Per> per(AccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Angle multiplier) { @@ -138,6 +138,11 @@ default Per divide(Angle divisor) { return div(divisor); } + @Override + default Per per(AngleUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularAcceleration multiplier) { @@ -161,6 +166,11 @@ default Per divide(AngularAcceleration div return div(divisor); } + @Override + default Per per(AngularAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularMomentum multiplier) { @@ -184,6 +194,11 @@ default Per divide(AngularMomentum divisor) { return div(divisor); } + @Override + default Per per(AngularMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularVelocity multiplier) { @@ -207,6 +222,11 @@ default Per divide(AngularVelocity divisor) { return div(divisor); } + @Override + default Per per(AngularVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Current multiplier) { @@ -230,6 +250,11 @@ default Dimensionless divide(Current divisor) { return div(divisor); } + @Override + default Dimensionless per(CurrentUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Current div(Dimensionless divisor) { return (Current) Amps.of(baseUnitMagnitude() / divisor.baseUnitMagnitude()); @@ -275,6 +300,11 @@ default Per divide(Distance divisor) { return div(divisor); } + @Override + default Per per(DistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Energy multiplier) { @@ -298,6 +328,11 @@ default Per divide(Energy divisor) { return div(divisor); } + @Override + default Per per(EnergyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Force multiplier) { @@ -321,6 +356,11 @@ default Per divide(Force divisor) { return div(divisor); } + @Override + default Per per(ForceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Frequency multiplier) { @@ -344,6 +384,11 @@ default Per divide(Frequency divisor) { return div(divisor); } + @Override + default Per per(FrequencyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearAcceleration multiplier) { @@ -367,6 +412,11 @@ default Per divide(LinearAcceleration divis return div(divisor); } + @Override + default Per per(LinearAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearMomentum multiplier) { @@ -390,6 +440,11 @@ default Per divide(LinearMomentum divisor) { return div(divisor); } + @Override + default Per per(LinearMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearVelocity multiplier) { @@ -413,6 +468,11 @@ default Per divide(LinearVelocity divisor) { return div(divisor); } + @Override + default Per per(LinearVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Mass multiplier) { @@ -436,6 +496,11 @@ default Per divide(Mass divisor) { return div(divisor); } + @Override + default Per per(MassUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(MomentOfInertia multiplier) { @@ -459,6 +524,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per per(MomentOfInertiaUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Mult multiplier) { @@ -482,6 +552,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per> per(MultUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult> times(Per multiplier) { @@ -505,6 +580,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per> per(PerUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult times(Power multiplier) { @@ -528,6 +608,11 @@ default Per divide(Power divisor) { return div(divisor); } + @Override + default Per per(PowerUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Voltage times(Resistance multiplier) { @@ -551,6 +636,11 @@ default Per divide(Resistance divisor) { return div(divisor); } + @Override + default Per per(ResistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Temperature multiplier) { @@ -574,6 +664,11 @@ default Per divide(Temperature divisor) { return div(divisor); } + @Override + default Per per(TemperatureUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Time multiplier) { @@ -597,6 +692,11 @@ default Velocity divide(Time divisor) { return div(divisor); } + @Override + default Velocity per(TimeUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Torque multiplier) { @@ -620,6 +720,11 @@ default Per divide(Torque divisor) { return div(divisor); } + @Override + default Per per(TorqueUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Velocity multiplier) { @@ -643,6 +748,11 @@ default Per> divide(Velocity divisor) { return div(divisor); } + @Override + default Per> per(VelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Power times(Voltage multiplier) { @@ -666,4 +776,9 @@ default Per divide(Voltage divisor) { return div(divisor); } + @Override + default Per per(VoltageUnit divisorUnit) { + return div(divisorUnit.one()); + } + } diff --git a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Dimensionless.java b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Dimensionless.java index 27e01a77a11..4447c270ee7 100644 --- a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Dimensionless.java +++ b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Dimensionless.java @@ -87,11 +87,6 @@ default Dimensionless divide(double divisor) { return (Dimensionless) div(divisor); } - @Override - default Frequency per(TimeUnit period) { - return div(period.of(1)); - } - @Override default Mult> times(Acceleration multiplier) { @@ -115,6 +110,11 @@ default Per> divide(Acceleration divis return div(divisor); } + @Override + default Per> per(AccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Angle times(Angle multiplier) { @@ -138,6 +138,11 @@ default Per divide(Angle divisor) { return div(divisor); } + @Override + default Per per(AngleUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default AngularAcceleration times(AngularAcceleration multiplier) { @@ -161,6 +166,11 @@ default Per divide(AngularAccelerati return div(divisor); } + @Override + default Per per(AngularAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default AngularMomentum times(AngularMomentum multiplier) { @@ -184,6 +194,11 @@ default Per divide(AngularMomentum divis return div(divisor); } + @Override + default Per per(AngularMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default AngularVelocity times(AngularVelocity multiplier) { @@ -207,6 +222,11 @@ default Per divide(AngularVelocity divis return div(divisor); } + @Override + default Per per(AngularVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Current times(Current multiplier) { @@ -230,6 +250,11 @@ default Per divide(Current divisor) { return div(divisor); } + @Override + default Per per(CurrentUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Dimensionless div(Dimensionless divisor) { return (Dimensionless) Value.of(baseUnitMagnitude() / divisor.baseUnitMagnitude()); @@ -275,6 +300,11 @@ default Per divide(Distance divisor) { return div(divisor); } + @Override + default Per per(DistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Energy times(Energy multiplier) { @@ -298,6 +328,11 @@ default Per divide(Energy divisor) { return div(divisor); } + @Override + default Per per(EnergyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Force times(Force multiplier) { @@ -321,6 +356,11 @@ default Per divide(Force divisor) { return div(divisor); } + @Override + default Per per(ForceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Frequency times(Frequency multiplier) { @@ -344,6 +384,11 @@ default Per divide(Frequency divisor) { return div(divisor); } + @Override + default Per per(FrequencyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default LinearAcceleration times(LinearAcceleration multiplier) { @@ -367,6 +412,11 @@ default Per divide(LinearAcceleration return div(divisor); } + @Override + default Per per(LinearAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default LinearMomentum times(LinearMomentum multiplier) { @@ -390,6 +440,11 @@ default Per divide(LinearMomentum divisor return div(divisor); } + @Override + default Per per(LinearMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default LinearVelocity times(LinearVelocity multiplier) { @@ -413,6 +468,11 @@ default Per divide(LinearVelocity divisor return div(divisor); } + @Override + default Per per(LinearVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mass times(Mass multiplier) { @@ -436,6 +496,11 @@ default Per divide(Mass divisor) { return div(divisor); } + @Override + default Per per(MassUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default MomentOfInertia times(MomentOfInertia multiplier) { @@ -459,6 +524,11 @@ default Per divide(MomentOfInertia divis return div(divisor); } + @Override + default Per per(MomentOfInertiaUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Mult multiplier) { @@ -482,6 +552,11 @@ default Per divide(MomentOfInertia divis return div(divisor); } + @Override + default Per> per(MultUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult> times(Per multiplier) { @@ -505,6 +580,11 @@ default Per divide(MomentOfInertia divis return div(divisor); } + @Override + default Per> per(PerUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Power times(Power multiplier) { @@ -528,6 +608,11 @@ default Per divide(Power divisor) { return div(divisor); } + @Override + default Per per(PowerUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Resistance times(Resistance multiplier) { @@ -551,6 +636,11 @@ default Per divide(Resistance divisor) { return div(divisor); } + @Override + default Per per(ResistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Temperature times(Temperature multiplier) { @@ -574,6 +664,11 @@ default Per divide(Temperature divisor) { return div(divisor); } + @Override + default Per per(TemperatureUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Time times(Time multiplier) { @@ -597,6 +692,11 @@ default Frequency divide(Time divisor) { return div(divisor); } + @Override + default Frequency per(TimeUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Torque times(Torque multiplier) { @@ -620,6 +720,11 @@ default Per divide(Torque divisor) { return div(divisor); } + @Override + default Per per(TorqueUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Velocity multiplier) { @@ -643,6 +748,11 @@ default Per> divide(Velocity divisor) { return div(divisor); } + @Override + default Per> per(VelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Voltage times(Voltage multiplier) { @@ -666,4 +776,9 @@ default Per divide(Voltage divisor) { return div(divisor); } + @Override + default Per per(VoltageUnit divisorUnit) { + return div(divisorUnit.one()); + } + } diff --git a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Distance.java b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Distance.java index 7bfc52f736d..e0f53a620e2 100644 --- a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Distance.java +++ b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Distance.java @@ -87,11 +87,6 @@ default Distance divide(double divisor) { return (Distance) div(divisor); } - @Override - default LinearVelocity per(TimeUnit period) { - return div(period.of(1)); - } - @Override default Mult> times(Acceleration multiplier) { @@ -115,6 +110,11 @@ default Per> divide(Acceleration divisor) { return div(divisor); } + @Override + default Per> per(AccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Angle multiplier) { @@ -138,6 +138,11 @@ default Per divide(Angle divisor) { return div(divisor); } + @Override + default Per per(AngleUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularAcceleration multiplier) { @@ -161,6 +166,11 @@ default Per divide(AngularAcceleration di return div(divisor); } + @Override + default Per per(AngularAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularMomentum multiplier) { @@ -184,6 +194,11 @@ default Per divide(AngularMomentum divisor) { return div(divisor); } + @Override + default Per per(AngularMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularVelocity multiplier) { @@ -207,6 +222,11 @@ default Per divide(AngularVelocity divisor) { return div(divisor); } + @Override + default Per per(AngularVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Current multiplier) { @@ -230,6 +250,11 @@ default Per divide(Current divisor) { return div(divisor); } + @Override + default Per per(CurrentUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Distance div(Dimensionless divisor) { return (Distance) Meters.of(baseUnitMagnitude() / divisor.baseUnitMagnitude()); @@ -275,6 +300,11 @@ default Dimensionless divide(Distance divisor) { return div(divisor); } + @Override + default Dimensionless per(DistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Energy multiplier) { @@ -298,6 +328,11 @@ default Per divide(Energy divisor) { return div(divisor); } + @Override + default Per per(EnergyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Torque times(Force multiplier) { @@ -321,6 +356,11 @@ default Per divide(Force divisor) { return div(divisor); } + @Override + default Per per(ForceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default LinearVelocity times(Frequency multiplier) { @@ -344,6 +384,11 @@ default Per divide(Frequency divisor) { return div(divisor); } + @Override + default Per per(FrequencyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearAcceleration multiplier) { @@ -367,6 +412,11 @@ default Per divide(LinearAcceleration divi return div(divisor); } + @Override + default Per per(LinearAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearMomentum multiplier) { @@ -390,6 +440,11 @@ default Per divide(LinearMomentum divisor) { return div(divisor); } + @Override + default Per per(LinearMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearVelocity multiplier) { @@ -413,6 +468,11 @@ default Time divide(LinearVelocity divisor) { return div(divisor); } + @Override + default Time per(LinearVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Mass multiplier) { @@ -436,6 +496,11 @@ default Per divide(Mass divisor) { return div(divisor); } + @Override + default Per per(MassUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(MomentOfInertia multiplier) { @@ -459,6 +524,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per per(MomentOfInertiaUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Mult multiplier) { @@ -482,6 +552,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per> per(MultUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult> times(Per multiplier) { @@ -505,6 +580,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per> per(PerUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult times(Power multiplier) { @@ -528,6 +608,11 @@ default Per divide(Power divisor) { return div(divisor); } + @Override + default Per per(PowerUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Resistance multiplier) { @@ -551,6 +636,11 @@ default Per divide(Resistance divisor) { return div(divisor); } + @Override + default Per per(ResistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Temperature multiplier) { @@ -574,6 +664,11 @@ default Per divide(Temperature divisor) { return div(divisor); } + @Override + default Per per(TemperatureUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Time multiplier) { @@ -597,6 +692,11 @@ default LinearVelocity divide(Time divisor) { return div(divisor); } + @Override + default LinearVelocity per(TimeUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Torque multiplier) { @@ -620,6 +720,11 @@ default Per divide(Torque divisor) { return div(divisor); } + @Override + default Per per(TorqueUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Velocity multiplier) { @@ -643,6 +748,11 @@ default Per> divide(Velocity divisor) { return div(divisor); } + @Override + default Per> per(VelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Voltage multiplier) { @@ -666,4 +776,9 @@ default Per divide(Voltage divisor) { return div(divisor); } + @Override + default Per per(VoltageUnit divisorUnit) { + return div(divisorUnit.one()); + } + } diff --git a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Energy.java b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Energy.java index ed125befe33..a98f55d5a8d 100644 --- a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Energy.java +++ b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Energy.java @@ -87,11 +87,6 @@ default Energy divide(double divisor) { return (Energy) div(divisor); } - @Override - default Power per(TimeUnit period) { - return div(period.of(1)); - } - @Override default Mult> times(Acceleration multiplier) { @@ -115,6 +110,11 @@ default Per> divide(Acceleration divisor) { return div(divisor); } + @Override + default Per> per(AccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Angle multiplier) { @@ -138,6 +138,11 @@ default Per divide(Angle divisor) { return div(divisor); } + @Override + default Per per(AngleUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularAcceleration multiplier) { @@ -161,6 +166,11 @@ default Per divide(AngularAcceleration divi return div(divisor); } + @Override + default Per per(AngularAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularMomentum multiplier) { @@ -184,6 +194,11 @@ default Per divide(AngularMomentum divisor) { return div(divisor); } + @Override + default Per per(AngularMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularVelocity multiplier) { @@ -207,6 +222,11 @@ default Per divide(AngularVelocity divisor) { return div(divisor); } + @Override + default Per per(AngularVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Current multiplier) { @@ -230,6 +250,11 @@ default Per divide(Current divisor) { return div(divisor); } + @Override + default Per per(CurrentUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Energy div(Dimensionless divisor) { return (Energy) Joules.of(baseUnitMagnitude() / divisor.baseUnitMagnitude()); @@ -275,6 +300,11 @@ default Per divide(Distance divisor) { return div(divisor); } + @Override + default Per per(DistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Energy multiplier) { @@ -298,6 +328,11 @@ default Dimensionless divide(Energy divisor) { return div(divisor); } + @Override + default Dimensionless per(EnergyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Force multiplier) { @@ -321,6 +356,11 @@ default Per divide(Force divisor) { return div(divisor); } + @Override + default Per per(ForceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Power times(Frequency multiplier) { @@ -344,6 +384,11 @@ default Per divide(Frequency divisor) { return div(divisor); } + @Override + default Per per(FrequencyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearAcceleration multiplier) { @@ -367,6 +412,11 @@ default Per divide(LinearAcceleration diviso return div(divisor); } + @Override + default Per per(LinearAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearMomentum multiplier) { @@ -390,6 +440,11 @@ default Per divide(LinearMomentum divisor) { return div(divisor); } + @Override + default Per per(LinearMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearVelocity multiplier) { @@ -413,6 +468,11 @@ default Per divide(LinearVelocity divisor) { return div(divisor); } + @Override + default Per per(LinearVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Mass multiplier) { @@ -436,6 +496,11 @@ default Per divide(Mass divisor) { return div(divisor); } + @Override + default Per per(MassUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(MomentOfInertia multiplier) { @@ -459,6 +524,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per per(MomentOfInertiaUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Mult multiplier) { @@ -482,6 +552,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per> per(MultUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult> times(Per multiplier) { @@ -505,6 +580,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per> per(PerUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult times(Power multiplier) { @@ -528,6 +608,11 @@ default Per divide(Power divisor) { return div(divisor); } + @Override + default Per per(PowerUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Resistance multiplier) { @@ -551,6 +636,11 @@ default Per divide(Resistance divisor) { return div(divisor); } + @Override + default Per per(ResistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Temperature multiplier) { @@ -574,6 +664,11 @@ default Per divide(Temperature divisor) { return div(divisor); } + @Override + default Per per(TemperatureUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Time multiplier) { @@ -597,6 +692,11 @@ default Power divide(Time divisor) { return div(divisor); } + @Override + default Power per(TimeUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Torque multiplier) { @@ -620,6 +720,11 @@ default Per divide(Torque divisor) { return div(divisor); } + @Override + default Per per(TorqueUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Velocity multiplier) { @@ -643,6 +748,11 @@ default Per> divide(Velocity divisor) { return div(divisor); } + @Override + default Per> per(VelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Voltage multiplier) { @@ -666,4 +776,9 @@ default Per divide(Voltage divisor) { return div(divisor); } + @Override + default Per per(VoltageUnit divisorUnit) { + return div(divisorUnit.one()); + } + } diff --git a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Force.java b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Force.java index fa69b143f1a..02337428929 100644 --- a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Force.java +++ b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Force.java @@ -87,11 +87,6 @@ default Force divide(double divisor) { return (Force) div(divisor); } - @Override - default Velocity per(TimeUnit period) { - return div(period.of(1)); - } - @Override default Mult> times(Acceleration multiplier) { @@ -115,6 +110,11 @@ default Per> divide(Acceleration divisor) { return div(divisor); } + @Override + default Per> per(AccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Angle multiplier) { @@ -138,6 +138,11 @@ default Per divide(Angle divisor) { return div(divisor); } + @Override + default Per per(AngleUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularAcceleration multiplier) { @@ -161,6 +166,11 @@ default Per divide(AngularAcceleration divis return div(divisor); } + @Override + default Per per(AngularAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularMomentum multiplier) { @@ -184,6 +194,11 @@ default Per divide(AngularMomentum divisor) { return div(divisor); } + @Override + default Per per(AngularMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularVelocity multiplier) { @@ -207,6 +222,11 @@ default Per divide(AngularVelocity divisor) { return div(divisor); } + @Override + default Per per(AngularVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Current multiplier) { @@ -230,6 +250,11 @@ default Per divide(Current divisor) { return div(divisor); } + @Override + default Per per(CurrentUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Force div(Dimensionless divisor) { return (Force) Newtons.of(baseUnitMagnitude() / divisor.baseUnitMagnitude()); @@ -275,6 +300,11 @@ default Per divide(Distance divisor) { return div(divisor); } + @Override + default Per per(DistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Energy multiplier) { @@ -298,6 +328,11 @@ default Per divide(Energy divisor) { return div(divisor); } + @Override + default Per per(EnergyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Force multiplier) { @@ -321,6 +356,11 @@ default Dimensionless divide(Force divisor) { return div(divisor); } + @Override + default Dimensionless per(ForceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Frequency multiplier) { @@ -344,6 +384,11 @@ default Per divide(Frequency divisor) { return div(divisor); } + @Override + default Per per(FrequencyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearAcceleration multiplier) { @@ -367,6 +412,11 @@ default Mass divide(LinearAcceleration divisor) { return div(divisor); } + @Override + default Mass per(LinearAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearMomentum multiplier) { @@ -390,6 +440,11 @@ default Per divide(LinearMomentum divisor) { return div(divisor); } + @Override + default Per per(LinearMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearVelocity multiplier) { @@ -413,6 +468,11 @@ default Per divide(LinearVelocity divisor) { return div(divisor); } + @Override + default Per per(LinearVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Mass multiplier) { @@ -436,6 +496,11 @@ default LinearAcceleration divide(Mass divisor) { return div(divisor); } + @Override + default LinearAcceleration per(MassUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(MomentOfInertia multiplier) { @@ -459,6 +524,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per per(MomentOfInertiaUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Mult multiplier) { @@ -482,6 +552,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per> per(MultUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult> times(Per multiplier) { @@ -505,6 +580,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per> per(PerUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult times(Power multiplier) { @@ -528,6 +608,11 @@ default Per divide(Power divisor) { return div(divisor); } + @Override + default Per per(PowerUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Resistance multiplier) { @@ -551,6 +636,11 @@ default Per divide(Resistance divisor) { return div(divisor); } + @Override + default Per per(ResistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Temperature multiplier) { @@ -574,6 +664,11 @@ default Per divide(Temperature divisor) { return div(divisor); } + @Override + default Per per(TemperatureUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Time multiplier) { @@ -597,6 +692,11 @@ default Velocity divide(Time divisor) { return div(divisor); } + @Override + default Velocity per(TimeUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Torque multiplier) { @@ -620,6 +720,11 @@ default Per divide(Torque divisor) { return div(divisor); } + @Override + default Per per(TorqueUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Velocity multiplier) { @@ -643,6 +748,11 @@ default Per> divide(Velocity divisor) { return div(divisor); } + @Override + default Per> per(VelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Voltage multiplier) { @@ -666,4 +776,9 @@ default Per divide(Voltage divisor) { return div(divisor); } + @Override + default Per per(VoltageUnit divisorUnit) { + return div(divisorUnit.one()); + } + } diff --git a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Frequency.java b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Frequency.java index 1b69009db5a..d18973a84d7 100644 --- a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Frequency.java +++ b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Frequency.java @@ -87,11 +87,6 @@ default Frequency divide(double divisor) { return (Frequency) div(divisor); } - @Override - default Velocity per(TimeUnit period) { - return div(period.of(1)); - } - @Override default Mult> times(Acceleration multiplier) { @@ -115,6 +110,11 @@ default Per> divide(Acceleration divisor) return div(divisor); } + @Override + default Per> per(AccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default AngularVelocity times(Angle multiplier) { @@ -138,6 +138,11 @@ default Per divide(Angle divisor) { return div(divisor); } + @Override + default Per per(AngleUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularAcceleration multiplier) { @@ -161,6 +166,11 @@ default Per divide(AngularAcceleration d return div(divisor); } + @Override + default Per per(AngularAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularMomentum multiplier) { @@ -184,6 +194,11 @@ default Per divide(AngularMomentum divisor) return div(divisor); } + @Override + default Per per(AngularMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default AngularAcceleration times(AngularVelocity multiplier) { @@ -207,6 +222,11 @@ default Per divide(AngularVelocity divisor) return div(divisor); } + @Override + default Per per(AngularVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Current multiplier) { @@ -230,6 +250,11 @@ default Per divide(Current divisor) { return div(divisor); } + @Override + default Per per(CurrentUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Frequency div(Dimensionless divisor) { return (Frequency) Hertz.of(baseUnitMagnitude() / divisor.baseUnitMagnitude()); @@ -275,6 +300,11 @@ default Per divide(Distance divisor) { return div(divisor); } + @Override + default Per per(DistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Energy multiplier) { @@ -298,6 +328,11 @@ default Per divide(Energy divisor) { return div(divisor); } + @Override + default Per per(EnergyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Force multiplier) { @@ -321,6 +356,11 @@ default Per divide(Force divisor) { return div(divisor); } + @Override + default Per per(ForceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Frequency multiplier) { @@ -344,6 +384,11 @@ default Dimensionless divide(Frequency divisor) { return div(divisor); } + @Override + default Dimensionless per(FrequencyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearAcceleration multiplier) { @@ -367,6 +412,11 @@ default Per divide(LinearAcceleration div return div(divisor); } + @Override + default Per per(LinearAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearMomentum multiplier) { @@ -390,6 +440,11 @@ default Per divide(LinearMomentum divisor) { return div(divisor); } + @Override + default Per per(LinearMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default LinearAcceleration times(LinearVelocity multiplier) { @@ -413,6 +468,11 @@ default Per divide(LinearVelocity divisor) { return div(divisor); } + @Override + default Per per(LinearVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Mass multiplier) { @@ -436,6 +496,11 @@ default Per divide(Mass divisor) { return div(divisor); } + @Override + default Per per(MassUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(MomentOfInertia multiplier) { @@ -459,6 +524,11 @@ default Per divide(MomentOfInertia divisor) return div(divisor); } + @Override + default Per per(MomentOfInertiaUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Mult multiplier) { @@ -482,6 +552,11 @@ default Per divide(MomentOfInertia divisor) return div(divisor); } + @Override + default Per> per(MultUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult> times(Per multiplier) { @@ -505,6 +580,11 @@ default Per divide(MomentOfInertia divisor) return div(divisor); } + @Override + default Per> per(PerUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult times(Power multiplier) { @@ -528,6 +608,11 @@ default Per divide(Power divisor) { return div(divisor); } + @Override + default Per per(PowerUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Resistance multiplier) { @@ -551,6 +636,11 @@ default Per divide(Resistance divisor) { return div(divisor); } + @Override + default Per per(ResistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Temperature multiplier) { @@ -574,6 +664,11 @@ default Per divide(Temperature divisor) { return div(divisor); } + @Override + default Per per(TemperatureUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Dimensionless times(Time multiplier) { @@ -597,6 +692,11 @@ default Velocity divide(Time divisor) { return div(divisor); } + @Override + default Velocity per(TimeUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Torque multiplier) { @@ -620,6 +720,11 @@ default Per divide(Torque divisor) { return div(divisor); } + @Override + default Per per(TorqueUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Velocity multiplier) { @@ -643,6 +748,11 @@ default Per> divide(Velocity divisor) { return div(divisor); } + @Override + default Per> per(VelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Voltage multiplier) { @@ -665,6 +775,11 @@ default Per div(Voltage divisor) { default Per divide(Voltage divisor) { return div(divisor); } + + @Override + default Per per(VoltageUnit divisorUnit) { + return div(divisorUnit.one()); + } /** Converts this frequency to the time period between cycles. */ default Time asPeriod() { return Seconds.of(1 / baseUnitMagnitude()); } } diff --git a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/LinearAcceleration.java b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/LinearAcceleration.java index dc8f6d26b8a..875ef937b1a 100644 --- a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/LinearAcceleration.java +++ b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/LinearAcceleration.java @@ -87,11 +87,6 @@ default LinearAcceleration divide(double divisor) { return (LinearAcceleration) div(divisor); } - @Override - default Velocity per(TimeUnit period) { - return div(period.of(1)); - } - @Override default Mult> times(Acceleration multiplier) { @@ -115,6 +110,11 @@ default Per> divide(Acceleration return div(divisor); } + @Override + default Per> per(AccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Angle multiplier) { @@ -138,6 +138,11 @@ default Per divide(Angle divisor) { return div(divisor); } + @Override + default Per per(AngleUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularAcceleration multiplier) { @@ -161,6 +166,11 @@ default Per divide(AngularAccel return div(divisor); } + @Override + default Per per(AngularAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularMomentum multiplier) { @@ -184,6 +194,11 @@ default Per divide(AngularMomentum return div(divisor); } + @Override + default Per per(AngularMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularVelocity multiplier) { @@ -207,6 +222,11 @@ default Per divide(AngularVelocity return div(divisor); } + @Override + default Per per(AngularVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Current multiplier) { @@ -230,6 +250,11 @@ default Per divide(Current divisor) { return div(divisor); } + @Override + default Per per(CurrentUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default LinearAcceleration div(Dimensionless divisor) { return (LinearAcceleration) MetersPerSecondPerSecond.of(baseUnitMagnitude() / divisor.baseUnitMagnitude()); @@ -275,6 +300,11 @@ default Per divide(Distance divisor) { return div(divisor); } + @Override + default Per per(DistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Energy multiplier) { @@ -298,6 +328,11 @@ default Per divide(Energy divisor) { return div(divisor); } + @Override + default Per per(EnergyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Force multiplier) { @@ -321,6 +356,11 @@ default Per divide(Force divisor) { return div(divisor); } + @Override + default Per per(ForceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Frequency multiplier) { @@ -344,6 +384,11 @@ default LinearVelocity divide(Frequency divisor) { return div(divisor); } + @Override + default LinearVelocity per(FrequencyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearAcceleration multiplier) { @@ -367,6 +412,11 @@ default Dimensionless divide(LinearAcceleration divisor) { return div(divisor); } + @Override + default Dimensionless per(LinearAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearMomentum multiplier) { @@ -390,6 +440,11 @@ default Per divide(LinearMomentum di return div(divisor); } + @Override + default Per per(LinearMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearVelocity multiplier) { @@ -413,6 +468,11 @@ default Per divide(LinearVelocity di return div(divisor); } + @Override + default Per per(LinearVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Mass multiplier) { @@ -436,6 +496,11 @@ default Per divide(Mass divisor) { return div(divisor); } + @Override + default Per per(MassUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(MomentOfInertia multiplier) { @@ -459,6 +524,11 @@ default Per divide(MomentOfInertia return div(divisor); } + @Override + default Per per(MomentOfInertiaUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Mult multiplier) { @@ -482,6 +552,11 @@ default Per divide(MomentOfInertia return div(divisor); } + @Override + default Per> per(MultUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult> times(Per multiplier) { @@ -505,6 +580,11 @@ default Per divide(MomentOfInertia return div(divisor); } + @Override + default Per> per(PerUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult times(Power multiplier) { @@ -528,6 +608,11 @@ default Per divide(Power divisor) { return div(divisor); } + @Override + default Per per(PowerUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Resistance multiplier) { @@ -551,6 +636,11 @@ default Per divide(Resistance divisor) { return div(divisor); } + @Override + default Per per(ResistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Temperature multiplier) { @@ -574,6 +664,11 @@ default Per divide(Temperature divisor) return div(divisor); } + @Override + default Per per(TemperatureUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default LinearVelocity times(Time multiplier) { @@ -597,6 +692,11 @@ default Velocity divide(Time divisor) { return div(divisor); } + @Override + default Velocity per(TimeUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Torque multiplier) { @@ -620,6 +720,11 @@ default Per divide(Torque divisor) { return div(divisor); } + @Override + default Per per(TorqueUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Velocity multiplier) { @@ -643,6 +748,11 @@ default Per> divide(Velocity divisor) return div(divisor); } + @Override + default Per> per(VelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Voltage multiplier) { @@ -666,4 +776,9 @@ default Per divide(Voltage divisor) { return div(divisor); } + @Override + default Per per(VoltageUnit divisorUnit) { + return div(divisorUnit.one()); + } + } diff --git a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/LinearMomentum.java b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/LinearMomentum.java index 2a7ce3341d1..c1bf6d7f117 100644 --- a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/LinearMomentum.java +++ b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/LinearMomentum.java @@ -87,11 +87,6 @@ default LinearMomentum divide(double divisor) { return (LinearMomentum) div(divisor); } - @Override - default Force per(TimeUnit period) { - return div(period.of(1)); - } - @Override default Mult> times(Acceleration multiplier) { @@ -115,6 +110,11 @@ default Per> divide(Acceleration divi return div(divisor); } + @Override + default Per> per(AccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Angle multiplier) { @@ -138,6 +138,11 @@ default Per divide(Angle divisor) { return div(divisor); } + @Override + default Per per(AngleUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularAcceleration multiplier) { @@ -161,6 +166,11 @@ default Per divide(AngularAccelerat return div(divisor); } + @Override + default Per per(AngularAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularMomentum multiplier) { @@ -184,6 +194,11 @@ default Per divide(AngularMomentum divi return div(divisor); } + @Override + default Per per(AngularMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularVelocity multiplier) { @@ -207,6 +222,11 @@ default Per divide(AngularVelocity divi return div(divisor); } + @Override + default Per per(AngularVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Current multiplier) { @@ -230,6 +250,11 @@ default Per divide(Current divisor) { return div(divisor); } + @Override + default Per per(CurrentUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default LinearMomentum div(Dimensionless divisor) { return (LinearMomentum) KilogramMetersPerSecond.of(baseUnitMagnitude() / divisor.baseUnitMagnitude()); @@ -275,6 +300,11 @@ default Per divide(Distance divisor) { return div(divisor); } + @Override + default Per per(DistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Energy multiplier) { @@ -298,6 +328,11 @@ default Per divide(Energy divisor) { return div(divisor); } + @Override + default Per per(EnergyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Force multiplier) { @@ -321,6 +356,11 @@ default Per divide(Force divisor) { return div(divisor); } + @Override + default Per per(ForceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Force times(Frequency multiplier) { @@ -344,6 +384,11 @@ default Per divide(Frequency divisor) { return div(divisor); } + @Override + default Per per(FrequencyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearAcceleration multiplier) { @@ -367,6 +412,11 @@ default Per divide(LinearAcceleratio return div(divisor); } + @Override + default Per per(LinearAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearMomentum multiplier) { @@ -390,6 +440,11 @@ default Dimensionless divide(LinearMomentum divisor) { return div(divisor); } + @Override + default Dimensionless per(LinearMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearVelocity multiplier) { @@ -413,6 +468,11 @@ default Mass divide(LinearVelocity divisor) { return div(divisor); } + @Override + default Mass per(LinearVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Mass multiplier) { @@ -436,6 +496,11 @@ default LinearVelocity divide(Mass divisor) { return div(divisor); } + @Override + default LinearVelocity per(MassUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(MomentOfInertia multiplier) { @@ -459,6 +524,11 @@ default Per divide(MomentOfInertia divi return div(divisor); } + @Override + default Per per(MomentOfInertiaUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Mult multiplier) { @@ -482,6 +552,11 @@ default Per divide(MomentOfInertia divi return div(divisor); } + @Override + default Per> per(MultUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult> times(Per multiplier) { @@ -505,6 +580,11 @@ default Per divide(MomentOfInertia divi return div(divisor); } + @Override + default Per> per(PerUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult times(Power multiplier) { @@ -528,6 +608,11 @@ default Per divide(Power divisor) { return div(divisor); } + @Override + default Per per(PowerUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Resistance multiplier) { @@ -551,6 +636,11 @@ default Per divide(Resistance divisor) { return div(divisor); } + @Override + default Per per(ResistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Temperature multiplier) { @@ -574,6 +664,11 @@ default Per divide(Temperature divisor) { return div(divisor); } + @Override + default Per per(TemperatureUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Time multiplier) { @@ -597,6 +692,11 @@ default Force divide(Time divisor) { return div(divisor); } + @Override + default Force per(TimeUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Torque multiplier) { @@ -620,6 +720,11 @@ default Per divide(Torque divisor) { return div(divisor); } + @Override + default Per per(TorqueUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Velocity multiplier) { @@ -643,6 +748,11 @@ default Per> divide(Velocity divisor) { return div(divisor); } + @Override + default Per> per(VelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Voltage multiplier) { @@ -666,4 +776,9 @@ default Per divide(Voltage divisor) { return div(divisor); } + @Override + default Per per(VoltageUnit divisorUnit) { + return div(divisorUnit.one()); + } + } diff --git a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/LinearVelocity.java b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/LinearVelocity.java index e45aa5474ad..7ed8cc1e5f5 100644 --- a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/LinearVelocity.java +++ b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/LinearVelocity.java @@ -87,11 +87,6 @@ default LinearVelocity divide(double divisor) { return (LinearVelocity) div(divisor); } - @Override - default LinearAcceleration per(TimeUnit period) { - return div(period.of(1)); - } - @Override default Mult> times(Acceleration multiplier) { @@ -115,6 +110,11 @@ default Per> divide(Acceleration divi return div(divisor); } + @Override + default Per> per(AccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Angle multiplier) { @@ -138,6 +138,11 @@ default Per divide(Angle divisor) { return div(divisor); } + @Override + default Per per(AngleUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularAcceleration multiplier) { @@ -161,6 +166,11 @@ default Per divide(AngularAccelerat return div(divisor); } + @Override + default Per per(AngularAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularMomentum multiplier) { @@ -184,6 +194,11 @@ default Per divide(AngularMomentum divi return div(divisor); } + @Override + default Per per(AngularMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularVelocity multiplier) { @@ -207,6 +222,11 @@ default Per divide(AngularVelocity divi return div(divisor); } + @Override + default Per per(AngularVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Current multiplier) { @@ -230,6 +250,11 @@ default Per divide(Current divisor) { return div(divisor); } + @Override + default Per per(CurrentUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default LinearVelocity div(Dimensionless divisor) { return (LinearVelocity) MetersPerSecond.of(baseUnitMagnitude() / divisor.baseUnitMagnitude()); @@ -275,6 +300,11 @@ default Per divide(Distance divisor) { return div(divisor); } + @Override + default Per per(DistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Energy multiplier) { @@ -298,6 +328,11 @@ default Per divide(Energy divisor) { return div(divisor); } + @Override + default Per per(EnergyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Force multiplier) { @@ -321,6 +356,11 @@ default Per divide(Force divisor) { return div(divisor); } + @Override + default Per per(ForceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default LinearAcceleration times(Frequency multiplier) { @@ -344,6 +384,11 @@ default Per divide(Frequency divisor) { return div(divisor); } + @Override + default Per per(FrequencyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearAcceleration multiplier) { @@ -367,6 +412,11 @@ default Per divide(LinearAcceleratio return div(divisor); } + @Override + default Per per(LinearAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearMomentum multiplier) { @@ -390,6 +440,11 @@ default Per divide(LinearMomentum diviso return div(divisor); } + @Override + default Per per(LinearMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearVelocity multiplier) { @@ -413,6 +468,11 @@ default Dimensionless divide(LinearVelocity divisor) { return div(divisor); } + @Override + default Dimensionless per(LinearVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Mass multiplier) { @@ -436,6 +496,11 @@ default Per divide(Mass divisor) { return div(divisor); } + @Override + default Per per(MassUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(MomentOfInertia multiplier) { @@ -459,6 +524,11 @@ default Per divide(MomentOfInertia divi return div(divisor); } + @Override + default Per per(MomentOfInertiaUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Mult multiplier) { @@ -482,6 +552,11 @@ default Per divide(MomentOfInertia divi return div(divisor); } + @Override + default Per> per(MultUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult> times(Per multiplier) { @@ -505,6 +580,11 @@ default Per divide(MomentOfInertia divi return div(divisor); } + @Override + default Per> per(PerUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult times(Power multiplier) { @@ -528,6 +608,11 @@ default Per divide(Power divisor) { return div(divisor); } + @Override + default Per per(PowerUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Resistance multiplier) { @@ -551,6 +636,11 @@ default Per divide(Resistance divisor) { return div(divisor); } + @Override + default Per per(ResistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Temperature multiplier) { @@ -574,6 +664,11 @@ default Per divide(Temperature divisor) { return div(divisor); } + @Override + default Per per(TemperatureUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Distance times(Time multiplier) { @@ -597,6 +692,11 @@ default LinearAcceleration divide(Time divisor) { return div(divisor); } + @Override + default LinearAcceleration per(TimeUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Torque multiplier) { @@ -620,6 +720,11 @@ default Per divide(Torque divisor) { return div(divisor); } + @Override + default Per per(TorqueUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Velocity multiplier) { @@ -643,6 +748,11 @@ default Per> divide(Velocity divisor) { return div(divisor); } + @Override + default Per> per(VelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Voltage multiplier) { @@ -666,4 +776,9 @@ default Per divide(Voltage divisor) { return div(divisor); } + @Override + default Per per(VoltageUnit divisorUnit) { + return div(divisorUnit.one()); + } + } diff --git a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Mass.java b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Mass.java index 81a0f1507f1..507977df5c4 100644 --- a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Mass.java +++ b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Mass.java @@ -87,11 +87,6 @@ default Mass divide(double divisor) { return (Mass) div(divisor); } - @Override - default Velocity per(TimeUnit period) { - return div(period.of(1)); - } - @Override default Mult> times(Acceleration multiplier) { @@ -115,6 +110,11 @@ default Per> divide(Acceleration divisor) { return div(divisor); } + @Override + default Per> per(AccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Angle multiplier) { @@ -138,6 +138,11 @@ default Per divide(Angle divisor) { return div(divisor); } + @Override + default Per per(AngleUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularAcceleration multiplier) { @@ -161,6 +166,11 @@ default Per divide(AngularAcceleration diviso return div(divisor); } + @Override + default Per per(AngularAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularMomentum multiplier) { @@ -184,6 +194,11 @@ default Per divide(AngularMomentum divisor) { return div(divisor); } + @Override + default Per per(AngularMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularVelocity multiplier) { @@ -207,6 +222,11 @@ default Per divide(AngularVelocity divisor) { return div(divisor); } + @Override + default Per per(AngularVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Current multiplier) { @@ -230,6 +250,11 @@ default Per divide(Current divisor) { return div(divisor); } + @Override + default Per per(CurrentUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mass div(Dimensionless divisor) { return (Mass) Kilograms.of(baseUnitMagnitude() / divisor.baseUnitMagnitude()); @@ -275,6 +300,11 @@ default Per divide(Distance divisor) { return div(divisor); } + @Override + default Per per(DistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Energy multiplier) { @@ -298,6 +328,11 @@ default Per divide(Energy divisor) { return div(divisor); } + @Override + default Per per(EnergyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Force multiplier) { @@ -321,6 +356,11 @@ default Per divide(Force divisor) { return div(divisor); } + @Override + default Per per(ForceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Frequency multiplier) { @@ -344,6 +384,11 @@ default Per divide(Frequency divisor) { return div(divisor); } + @Override + default Per per(FrequencyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Force times(LinearAcceleration multiplier) { @@ -367,6 +412,11 @@ default Per divide(LinearAcceleration divisor) return div(divisor); } + @Override + default Per per(LinearAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearMomentum multiplier) { @@ -390,6 +440,11 @@ default Per divide(LinearMomentum divisor) { return div(divisor); } + @Override + default Per per(LinearMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearVelocity multiplier) { @@ -413,6 +468,11 @@ default Per divide(LinearVelocity divisor) { return div(divisor); } + @Override + default Per per(LinearVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Mass multiplier) { @@ -436,6 +496,11 @@ default Dimensionless divide(Mass divisor) { return div(divisor); } + @Override + default Dimensionless per(MassUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(MomentOfInertia multiplier) { @@ -459,6 +524,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per per(MomentOfInertiaUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Mult multiplier) { @@ -482,6 +552,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per> per(MultUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult> times(Per multiplier) { @@ -505,6 +580,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per> per(PerUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult times(Power multiplier) { @@ -528,6 +608,11 @@ default Per divide(Power divisor) { return div(divisor); } + @Override + default Per per(PowerUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Resistance multiplier) { @@ -551,6 +636,11 @@ default Per divide(Resistance divisor) { return div(divisor); } + @Override + default Per per(ResistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Temperature multiplier) { @@ -574,6 +664,11 @@ default Per divide(Temperature divisor) { return div(divisor); } + @Override + default Per per(TemperatureUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Time multiplier) { @@ -597,6 +692,11 @@ default Velocity divide(Time divisor) { return div(divisor); } + @Override + default Velocity per(TimeUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Torque multiplier) { @@ -620,6 +720,11 @@ default Per divide(Torque divisor) { return div(divisor); } + @Override + default Per per(TorqueUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Velocity multiplier) { @@ -643,6 +748,11 @@ default Per> divide(Velocity divisor) { return div(divisor); } + @Override + default Per> per(VelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Voltage multiplier) { @@ -666,4 +776,9 @@ default Per divide(Voltage divisor) { return div(divisor); } + @Override + default Per per(VoltageUnit divisorUnit) { + return div(divisorUnit.one()); + } + } diff --git a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/MomentOfInertia.java b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/MomentOfInertia.java index b831bcffc6b..21f04fbeb73 100644 --- a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/MomentOfInertia.java +++ b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/MomentOfInertia.java @@ -87,11 +87,6 @@ default MomentOfInertia divide(double divisor) { return (MomentOfInertia) div(divisor); } - @Override - default Velocity per(TimeUnit period) { - return div(period.of(1)); - } - @Override default Mult> times(Acceleration multiplier) { @@ -115,6 +110,11 @@ default Per> divide(Acceleration div return div(divisor); } + @Override + default Per> per(AccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Angle multiplier) { @@ -138,6 +138,11 @@ default Per divide(Angle divisor) { return div(divisor); } + @Override + default Per per(AngleUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularAcceleration multiplier) { @@ -161,6 +166,11 @@ default Per divide(AngularAccelera return div(divisor); } + @Override + default Per per(AngularAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularMomentum multiplier) { @@ -184,6 +194,11 @@ default Per divide(AngularMomentum div return div(divisor); } + @Override + default Per per(AngularMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default AngularMomentum times(AngularVelocity multiplier) { @@ -207,6 +222,11 @@ default Per divide(AngularVelocity div return div(divisor); } + @Override + default Per per(AngularVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Current multiplier) { @@ -230,6 +250,11 @@ default Per divide(Current divisor) { return div(divisor); } + @Override + default Per per(CurrentUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default MomentOfInertia div(Dimensionless divisor) { return (MomentOfInertia) KilogramSquareMeters.of(baseUnitMagnitude() / divisor.baseUnitMagnitude()); @@ -275,6 +300,11 @@ default Per divide(Distance divisor) { return div(divisor); } + @Override + default Per per(DistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Energy multiplier) { @@ -298,6 +328,11 @@ default Per divide(Energy divisor) { return div(divisor); } + @Override + default Per per(EnergyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Force multiplier) { @@ -321,6 +356,11 @@ default Per divide(Force divisor) { return div(divisor); } + @Override + default Per per(ForceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Frequency multiplier) { @@ -344,6 +384,11 @@ default Per divide(Frequency divisor) { return div(divisor); } + @Override + default Per per(FrequencyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearAcceleration multiplier) { @@ -367,6 +412,11 @@ default Per divide(LinearAccelerati return div(divisor); } + @Override + default Per per(LinearAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearMomentum multiplier) { @@ -390,6 +440,11 @@ default Per divide(LinearMomentum divis return div(divisor); } + @Override + default Per per(LinearMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearVelocity multiplier) { @@ -413,6 +468,11 @@ default Per divide(LinearVelocity divis return div(divisor); } + @Override + default Per per(LinearVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Mass multiplier) { @@ -436,6 +496,11 @@ default Per divide(Mass divisor) { return div(divisor); } + @Override + default Per per(MassUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(MomentOfInertia multiplier) { @@ -459,6 +524,11 @@ default Dimensionless divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Dimensionless per(MomentOfInertiaUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Mult multiplier) { @@ -482,6 +552,11 @@ default Dimensionless divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per> per(MultUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult> times(Per multiplier) { @@ -505,6 +580,11 @@ default Dimensionless divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per> per(PerUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult times(Power multiplier) { @@ -528,6 +608,11 @@ default Per divide(Power divisor) { return div(divisor); } + @Override + default Per per(PowerUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Resistance multiplier) { @@ -551,6 +636,11 @@ default Per divide(Resistance divisor) { return div(divisor); } + @Override + default Per per(ResistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Temperature multiplier) { @@ -574,6 +664,11 @@ default Per divide(Temperature divisor) { return div(divisor); } + @Override + default Per per(TemperatureUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Time multiplier) { @@ -597,6 +692,11 @@ default Velocity divide(Time divisor) { return div(divisor); } + @Override + default Velocity per(TimeUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Torque multiplier) { @@ -620,6 +720,11 @@ default Per divide(Torque divisor) { return div(divisor); } + @Override + default Per per(TorqueUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Velocity multiplier) { @@ -643,6 +748,11 @@ default Per> divide(Velocity divisor) { return div(divisor); } + @Override + default Per> per(VelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Voltage multiplier) { @@ -666,4 +776,9 @@ default Per divide(Voltage divisor) { return div(divisor); } + @Override + default Per per(VoltageUnit divisorUnit) { + return div(divisorUnit.one()); + } + } diff --git a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Mult.java b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Mult.java index 3b7dcf840c9..5cee72363d6 100644 --- a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Mult.java +++ b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Mult.java @@ -87,11 +87,6 @@ default Mult divide(double divisor) { return (Mult) div(divisor); } - @Override - default Velocity> per(TimeUnit period) { - return div(period.of(1)); - } - @Override default Mult, AccelerationUnit> times(Acceleration multiplier) { @@ -115,6 +110,11 @@ default Per, AccelerationUnit> divide(Acceleration divisor) return div(divisor); } + @Override + default Per, AccelerationUnit> per(AccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, AngleUnit> times(Angle multiplier) { @@ -138,6 +138,11 @@ default Per, AngleUnit> divide(Angle divisor) { return div(divisor); } + @Override + default Per, AngleUnit> per(AngleUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, AngularAccelerationUnit> times(AngularAcceleration multiplier) { @@ -161,6 +166,11 @@ default Per, AngularAccelerationUnit> divide(AngularAcceleration return div(divisor); } + @Override + default Per, AngularAccelerationUnit> per(AngularAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, AngularMomentumUnit> times(AngularMomentum multiplier) { @@ -184,6 +194,11 @@ default Per, AngularMomentumUnit> divide(AngularMomentum divisor) return div(divisor); } + @Override + default Per, AngularMomentumUnit> per(AngularMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, AngularVelocityUnit> times(AngularVelocity multiplier) { @@ -207,6 +222,11 @@ default Per, AngularVelocityUnit> divide(AngularVelocity divisor) return div(divisor); } + @Override + default Per, AngularVelocityUnit> per(AngularVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, CurrentUnit> times(Current multiplier) { @@ -230,6 +250,11 @@ default Per, CurrentUnit> divide(Current divisor) { return div(divisor); } + @Override + default Per, CurrentUnit> per(CurrentUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult div(Dimensionless divisor) { return (Mult) unit().of(baseUnitMagnitude() / divisor.baseUnitMagnitude()); @@ -275,6 +300,11 @@ default Per, DistanceUnit> divide(Distance divisor) { return div(divisor); } + @Override + default Per, DistanceUnit> per(DistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, EnergyUnit> times(Energy multiplier) { @@ -298,6 +328,11 @@ default Per, EnergyUnit> divide(Energy divisor) { return div(divisor); } + @Override + default Per, EnergyUnit> per(EnergyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, ForceUnit> times(Force multiplier) { @@ -321,6 +356,11 @@ default Per, ForceUnit> divide(Force divisor) { return div(divisor); } + @Override + default Per, ForceUnit> per(ForceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, FrequencyUnit> times(Frequency multiplier) { @@ -344,6 +384,11 @@ default Per, FrequencyUnit> divide(Frequency divisor) { return div(divisor); } + @Override + default Per, FrequencyUnit> per(FrequencyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, LinearAccelerationUnit> times(LinearAcceleration multiplier) { @@ -367,6 +412,11 @@ default Per, LinearAccelerationUnit> divide(LinearAcceleration di return div(divisor); } + @Override + default Per, LinearAccelerationUnit> per(LinearAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, LinearMomentumUnit> times(LinearMomentum multiplier) { @@ -390,6 +440,11 @@ default Per, LinearMomentumUnit> divide(LinearMomentum divisor) { return div(divisor); } + @Override + default Per, LinearMomentumUnit> per(LinearMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, LinearVelocityUnit> times(LinearVelocity multiplier) { @@ -413,6 +468,11 @@ default Per, LinearVelocityUnit> divide(LinearVelocity divisor) { return div(divisor); } + @Override + default Per, LinearVelocityUnit> per(LinearVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, MassUnit> times(Mass multiplier) { @@ -436,6 +496,11 @@ default Per, MassUnit> divide(Mass divisor) { return div(divisor); } + @Override + default Per, MassUnit> per(MassUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, MomentOfInertiaUnit> times(MomentOfInertia multiplier) { @@ -459,6 +524,11 @@ default Per, MomentOfInertiaUnit> divide(MomentOfInertia divisor) return div(divisor); } + @Override + default Per, MomentOfInertiaUnit> per(MomentOfInertiaUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, MultUnit> times(Mult multiplier) { @@ -482,6 +552,11 @@ default Per, MomentOfInertiaUnit> divide(MomentOfInertia divisor) return div(divisor); } + @Override + default Per, MultUnit> per(MultUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult, PerUnit> times(Per multiplier) { @@ -505,6 +580,11 @@ default Per, MomentOfInertiaUnit> divide(MomentOfInertia divisor) return div(divisor); } + @Override + default Per, PerUnit> per(PerUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult, PowerUnit> times(Power multiplier) { @@ -528,6 +608,11 @@ default Per, PowerUnit> divide(Power divisor) { return div(divisor); } + @Override + default Per, PowerUnit> per(PowerUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, ResistanceUnit> times(Resistance multiplier) { @@ -551,6 +636,11 @@ default Per, ResistanceUnit> divide(Resistance divisor) { return div(divisor); } + @Override + default Per, ResistanceUnit> per(ResistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, TemperatureUnit> times(Temperature multiplier) { @@ -574,6 +664,11 @@ default Per, TemperatureUnit> divide(Temperature divisor) { return div(divisor); } + @Override + default Per, TemperatureUnit> per(TemperatureUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, TimeUnit> times(Time multiplier) { @@ -597,6 +692,11 @@ default Velocity> divide(Time divisor) { return div(divisor); } + @Override + default Velocity> per(TimeUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, TorqueUnit> times(Torque multiplier) { @@ -620,6 +720,11 @@ default Per, TorqueUnit> divide(Torque divisor) { return div(divisor); } + @Override + default Per, TorqueUnit> per(TorqueUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, VelocityUnit> times(Velocity multiplier) { @@ -643,6 +748,11 @@ default Per, VelocityUnit> divide(Velocity divisor) { return div(divisor); } + @Override + default Per, VelocityUnit> per(VelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, VoltageUnit> times(Voltage multiplier) { @@ -666,4 +776,9 @@ default Per, VoltageUnit> divide(Voltage divisor) { return div(divisor); } + @Override + default Per, VoltageUnit> per(VoltageUnit divisorUnit) { + return div(divisorUnit.one()); + } + } diff --git a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Per.java b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Per.java index e46fb50f89b..2c1af67794d 100644 --- a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Per.java +++ b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Per.java @@ -87,11 +87,6 @@ default Per divide(double divisor) { return (Per) div(divisor); } - @Override - default Velocity> per(TimeUnit period) { - return div(period.of(1)); - } - @Override default Mult, AccelerationUnit> times(Acceleration multiplier) { @@ -115,6 +110,11 @@ default Per, AccelerationUnit> divide(Acceleration return div(divisor); } + @Override + default Per, AccelerationUnit> per(AccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, AngleUnit> times(Angle multiplier) { @@ -138,6 +138,11 @@ default Per, AngleUnit> divide(Angle divisor) { return div(divisor); } + @Override + default Per, AngleUnit> per(AngleUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, AngularAccelerationUnit> times(AngularAcceleration multiplier) { @@ -161,6 +166,11 @@ default Per, AngularAccelerationUnit> divide(AngularA return div(divisor); } + @Override + default Per, AngularAccelerationUnit> per(AngularAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, AngularMomentumUnit> times(AngularMomentum multiplier) { @@ -184,6 +194,11 @@ default Per, AngularMomentumUnit> divide(AngularMomen return div(divisor); } + @Override + default Per, AngularMomentumUnit> per(AngularMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, AngularVelocityUnit> times(AngularVelocity multiplier) { @@ -207,6 +222,11 @@ default Per, AngularVelocityUnit> divide(AngularVeloc return div(divisor); } + @Override + default Per, AngularVelocityUnit> per(AngularVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, CurrentUnit> times(Current multiplier) { @@ -230,6 +250,11 @@ default Per, CurrentUnit> divide(Current divisor) { return div(divisor); } + @Override + default Per, CurrentUnit> per(CurrentUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Per div(Dimensionless divisor) { return (Per) unit().of(baseUnitMagnitude() / divisor.baseUnitMagnitude()); @@ -275,6 +300,11 @@ default Per, DistanceUnit> divide(Distance divisor) { return div(divisor); } + @Override + default Per, DistanceUnit> per(DistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, EnergyUnit> times(Energy multiplier) { @@ -298,6 +328,11 @@ default Per, EnergyUnit> divide(Energy divisor) { return div(divisor); } + @Override + default Per, EnergyUnit> per(EnergyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, ForceUnit> times(Force multiplier) { @@ -321,6 +356,11 @@ default Per, ForceUnit> divide(Force divisor) { return div(divisor); } + @Override + default Per, ForceUnit> per(ForceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, FrequencyUnit> times(Frequency multiplier) { @@ -344,6 +384,11 @@ default Per, FrequencyUnit> divide(Frequency divisor) return div(divisor); } + @Override + default Per, FrequencyUnit> per(FrequencyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, LinearAccelerationUnit> times(LinearAcceleration multiplier) { @@ -367,6 +412,11 @@ default Per, LinearAccelerationUnit> divide(LinearAcc return div(divisor); } + @Override + default Per, LinearAccelerationUnit> per(LinearAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, LinearMomentumUnit> times(LinearMomentum multiplier) { @@ -390,6 +440,11 @@ default Per, LinearMomentumUnit> divide(LinearMomentu return div(divisor); } + @Override + default Per, LinearMomentumUnit> per(LinearMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, LinearVelocityUnit> times(LinearVelocity multiplier) { @@ -413,6 +468,11 @@ default Per, LinearVelocityUnit> divide(LinearVelocit return div(divisor); } + @Override + default Per, LinearVelocityUnit> per(LinearVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, MassUnit> times(Mass multiplier) { @@ -436,6 +496,11 @@ default Per, MassUnit> divide(Mass divisor) { return div(divisor); } + @Override + default Per, MassUnit> per(MassUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, MomentOfInertiaUnit> times(MomentOfInertia multiplier) { @@ -459,6 +524,11 @@ default Per, MomentOfInertiaUnit> divide(MomentOfIner return div(divisor); } + @Override + default Per, MomentOfInertiaUnit> per(MomentOfInertiaUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, MultUnit> times(Mult multiplier) { @@ -482,6 +552,11 @@ default Per, MomentOfInertiaUnit> divide(MomentOfIner return div(divisor); } + @Override + default Per, MultUnit> per(MultUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult, PerUnit> times(Per multiplier) { @@ -505,6 +580,11 @@ default Per, MomentOfInertiaUnit> divide(MomentOfIner return div(divisor); } + @Override + default Per, PerUnit> per(PerUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult, PowerUnit> times(Power multiplier) { @@ -528,6 +608,11 @@ default Per, PowerUnit> divide(Power divisor) { return div(divisor); } + @Override + default Per, PowerUnit> per(PowerUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, ResistanceUnit> times(Resistance multiplier) { @@ -551,6 +636,11 @@ default Per, ResistanceUnit> divide(Resistance diviso return div(divisor); } + @Override + default Per, ResistanceUnit> per(ResistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, TemperatureUnit> times(Temperature multiplier) { @@ -574,6 +664,11 @@ default Per, TemperatureUnit> divide(Temperature divi return div(divisor); } + @Override + default Per, TemperatureUnit> per(TemperatureUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, TimeUnit> times(Time multiplier) { @@ -597,6 +692,11 @@ default Velocity> divide(Time divisor) { return div(divisor); } + @Override + default Velocity> per(TimeUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, TorqueUnit> times(Torque multiplier) { @@ -620,6 +720,11 @@ default Per, TorqueUnit> divide(Torque divisor) { return div(divisor); } + @Override + default Per, TorqueUnit> per(TorqueUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, VelocityUnit> times(Velocity multiplier) { @@ -643,6 +748,11 @@ default Per, VelocityUnit> divide(Velocity divi return div(divisor); } + @Override + default Per, VelocityUnit> per(VelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, VoltageUnit> times(Voltage multiplier) { @@ -665,6 +775,11 @@ default Per, VoltageUnit> div(Voltage divisor) { default Per, VoltageUnit> divide(Voltage divisor) { return div(divisor); } + + @Override + default Per, VoltageUnit> per(VoltageUnit divisorUnit) { + return div(divisorUnit.one()); + } default Measure timesDivisor(Measure multiplier) { return (Measure) baseUnit().numerator().ofBaseUnits(baseUnitMagnitude() * multiplier.baseUnitMagnitude()); } diff --git a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Power.java b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Power.java index a666094881b..d94ddcde389 100644 --- a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Power.java +++ b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Power.java @@ -87,11 +87,6 @@ default Power divide(double divisor) { return (Power) div(divisor); } - @Override - default Velocity per(TimeUnit period) { - return div(period.of(1)); - } - @Override default Mult> times(Acceleration multiplier) { @@ -115,6 +110,11 @@ default Per> divide(Acceleration divisor) { return div(divisor); } + @Override + default Per> per(AccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Angle multiplier) { @@ -138,6 +138,11 @@ default Per divide(Angle divisor) { return div(divisor); } + @Override + default Per per(AngleUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularAcceleration multiplier) { @@ -161,6 +166,11 @@ default Per divide(AngularAcceleration divis return div(divisor); } + @Override + default Per per(AngularAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularMomentum multiplier) { @@ -184,6 +194,11 @@ default Per divide(AngularMomentum divisor) { return div(divisor); } + @Override + default Per per(AngularMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularVelocity multiplier) { @@ -207,6 +222,11 @@ default Per divide(AngularVelocity divisor) { return div(divisor); } + @Override + default Per per(AngularVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Current multiplier) { @@ -230,6 +250,11 @@ default Voltage divide(Current divisor) { return div(divisor); } + @Override + default Voltage per(CurrentUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Power div(Dimensionless divisor) { return (Power) Watts.of(baseUnitMagnitude() / divisor.baseUnitMagnitude()); @@ -275,6 +300,11 @@ default Per divide(Distance divisor) { return div(divisor); } + @Override + default Per per(DistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Energy multiplier) { @@ -298,6 +328,11 @@ default Frequency divide(Energy divisor) { return div(divisor); } + @Override + default Frequency per(EnergyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Force multiplier) { @@ -321,6 +356,11 @@ default Per divide(Force divisor) { return div(divisor); } + @Override + default Per per(ForceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Frequency multiplier) { @@ -344,6 +384,11 @@ default Per divide(Frequency divisor) { return div(divisor); } + @Override + default Per per(FrequencyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearAcceleration multiplier) { @@ -367,6 +412,11 @@ default Per divide(LinearAcceleration divisor return div(divisor); } + @Override + default Per per(LinearAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearMomentum multiplier) { @@ -390,6 +440,11 @@ default Per divide(LinearMomentum divisor) { return div(divisor); } + @Override + default Per per(LinearMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearVelocity multiplier) { @@ -413,6 +468,11 @@ default Per divide(LinearVelocity divisor) { return div(divisor); } + @Override + default Per per(LinearVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Mass multiplier) { @@ -436,6 +496,11 @@ default Per divide(Mass divisor) { return div(divisor); } + @Override + default Per per(MassUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(MomentOfInertia multiplier) { @@ -459,6 +524,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per per(MomentOfInertiaUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Mult multiplier) { @@ -482,6 +552,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per> per(MultUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult> times(Per multiplier) { @@ -505,6 +580,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per> per(PerUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult times(Power multiplier) { @@ -528,6 +608,11 @@ default Dimensionless divide(Power divisor) { return div(divisor); } + @Override + default Dimensionless per(PowerUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Resistance multiplier) { @@ -551,6 +636,11 @@ default Per divide(Resistance divisor) { return div(divisor); } + @Override + default Per per(ResistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Temperature multiplier) { @@ -574,6 +664,11 @@ default Per divide(Temperature divisor) { return div(divisor); } + @Override + default Per per(TemperatureUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Energy times(Time multiplier) { @@ -597,6 +692,11 @@ default Velocity divide(Time divisor) { return div(divisor); } + @Override + default Velocity per(TimeUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Torque multiplier) { @@ -620,6 +720,11 @@ default Per divide(Torque divisor) { return div(divisor); } + @Override + default Per per(TorqueUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Velocity multiplier) { @@ -643,6 +748,11 @@ default Per> divide(Velocity divisor) { return div(divisor); } + @Override + default Per> per(VelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Voltage multiplier) { @@ -666,4 +776,9 @@ default Current divide(Voltage divisor) { return div(divisor); } + @Override + default Current per(VoltageUnit divisorUnit) { + return div(divisorUnit.one()); + } + } diff --git a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Resistance.java b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Resistance.java index 28932b2c70b..52d15b091ae 100644 --- a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Resistance.java +++ b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Resistance.java @@ -87,11 +87,6 @@ default Resistance divide(double divisor) { return (Resistance) div(divisor); } - @Override - default Velocity per(TimeUnit period) { - return div(period.of(1)); - } - @Override default Mult> times(Acceleration multiplier) { @@ -115,6 +110,11 @@ default Per> divide(Acceleration divisor) return div(divisor); } + @Override + default Per> per(AccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Angle multiplier) { @@ -138,6 +138,11 @@ default Per divide(Angle divisor) { return div(divisor); } + @Override + default Per per(AngleUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularAcceleration multiplier) { @@ -161,6 +166,11 @@ default Per divide(AngularAcceleration return div(divisor); } + @Override + default Per per(AngularAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularMomentum multiplier) { @@ -184,6 +194,11 @@ default Per divide(AngularMomentum divisor) return div(divisor); } + @Override + default Per per(AngularMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularVelocity multiplier) { @@ -207,6 +222,11 @@ default Per divide(AngularVelocity divisor) return div(divisor); } + @Override + default Per per(AngularVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Voltage times(Current multiplier) { @@ -230,6 +250,11 @@ default Per divide(Current divisor) { return div(divisor); } + @Override + default Per per(CurrentUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Resistance div(Dimensionless divisor) { return (Resistance) Ohms.of(baseUnitMagnitude() / divisor.baseUnitMagnitude()); @@ -275,6 +300,11 @@ default Per divide(Distance divisor) { return div(divisor); } + @Override + default Per per(DistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Energy multiplier) { @@ -298,6 +328,11 @@ default Per divide(Energy divisor) { return div(divisor); } + @Override + default Per per(EnergyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Force multiplier) { @@ -321,6 +356,11 @@ default Per divide(Force divisor) { return div(divisor); } + @Override + default Per per(ForceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Frequency multiplier) { @@ -344,6 +384,11 @@ default Per divide(Frequency divisor) { return div(divisor); } + @Override + default Per per(FrequencyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearAcceleration multiplier) { @@ -367,6 +412,11 @@ default Per divide(LinearAcceleration di return div(divisor); } + @Override + default Per per(LinearAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearMomentum multiplier) { @@ -390,6 +440,11 @@ default Per divide(LinearMomentum divisor) { return div(divisor); } + @Override + default Per per(LinearMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearVelocity multiplier) { @@ -413,6 +468,11 @@ default Per divide(LinearVelocity divisor) { return div(divisor); } + @Override + default Per per(LinearVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Mass multiplier) { @@ -436,6 +496,11 @@ default Per divide(Mass divisor) { return div(divisor); } + @Override + default Per per(MassUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(MomentOfInertia multiplier) { @@ -459,6 +524,11 @@ default Per divide(MomentOfInertia divisor) return div(divisor); } + @Override + default Per per(MomentOfInertiaUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Mult multiplier) { @@ -482,6 +552,11 @@ default Per divide(MomentOfInertia divisor) return div(divisor); } + @Override + default Per> per(MultUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult> times(Per multiplier) { @@ -505,6 +580,11 @@ default Per divide(MomentOfInertia divisor) return div(divisor); } + @Override + default Per> per(PerUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult times(Power multiplier) { @@ -528,6 +608,11 @@ default Per divide(Power divisor) { return div(divisor); } + @Override + default Per per(PowerUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Resistance multiplier) { @@ -551,6 +636,11 @@ default Dimensionless divide(Resistance divisor) { return div(divisor); } + @Override + default Dimensionless per(ResistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Temperature multiplier) { @@ -574,6 +664,11 @@ default Per divide(Temperature divisor) { return div(divisor); } + @Override + default Per per(TemperatureUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Time multiplier) { @@ -597,6 +692,11 @@ default Velocity divide(Time divisor) { return div(divisor); } + @Override + default Velocity per(TimeUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Torque multiplier) { @@ -620,6 +720,11 @@ default Per divide(Torque divisor) { return div(divisor); } + @Override + default Per per(TorqueUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Velocity multiplier) { @@ -643,6 +748,11 @@ default Per> divide(Velocity divisor) { return div(divisor); } + @Override + default Per> per(VelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Voltage multiplier) { @@ -666,4 +776,9 @@ default Per divide(Voltage divisor) { return div(divisor); } + @Override + default Per per(VoltageUnit divisorUnit) { + return div(divisorUnit.one()); + } + } diff --git a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Temperature.java b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Temperature.java index b10efd810d7..2d7983b8466 100644 --- a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Temperature.java +++ b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Temperature.java @@ -87,11 +87,6 @@ default Temperature divide(double divisor) { return (Temperature) div(divisor); } - @Override - default Velocity per(TimeUnit period) { - return div(period.of(1)); - } - @Override default Mult> times(Acceleration multiplier) { @@ -115,6 +110,11 @@ default Per> divide(Acceleration divisor return div(divisor); } + @Override + default Per> per(AccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Angle multiplier) { @@ -138,6 +138,11 @@ default Per divide(Angle divisor) { return div(divisor); } + @Override + default Per per(AngleUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularAcceleration multiplier) { @@ -161,6 +166,11 @@ default Per divide(AngularAcceleration return div(divisor); } + @Override + default Per per(AngularAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularMomentum multiplier) { @@ -184,6 +194,11 @@ default Per divide(AngularMomentum divisor return div(divisor); } + @Override + default Per per(AngularMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularVelocity multiplier) { @@ -207,6 +222,11 @@ default Per divide(AngularVelocity divisor return div(divisor); } + @Override + default Per per(AngularVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Current multiplier) { @@ -230,6 +250,11 @@ default Per divide(Current divisor) { return div(divisor); } + @Override + default Per per(CurrentUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Temperature div(Dimensionless divisor) { return (Temperature) Kelvin.of(baseUnitMagnitude() / divisor.baseUnitMagnitude()); @@ -275,6 +300,11 @@ default Per divide(Distance divisor) { return div(divisor); } + @Override + default Per per(DistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Energy multiplier) { @@ -298,6 +328,11 @@ default Per divide(Energy divisor) { return div(divisor); } + @Override + default Per per(EnergyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Force multiplier) { @@ -321,6 +356,11 @@ default Per divide(Force divisor) { return div(divisor); } + @Override + default Per per(ForceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Frequency multiplier) { @@ -344,6 +384,11 @@ default Per divide(Frequency divisor) { return div(divisor); } + @Override + default Per per(FrequencyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearAcceleration multiplier) { @@ -367,6 +412,11 @@ default Per divide(LinearAcceleration d return div(divisor); } + @Override + default Per per(LinearAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearMomentum multiplier) { @@ -390,6 +440,11 @@ default Per divide(LinearMomentum divisor) return div(divisor); } + @Override + default Per per(LinearMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearVelocity multiplier) { @@ -413,6 +468,11 @@ default Per divide(LinearVelocity divisor) return div(divisor); } + @Override + default Per per(LinearVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Mass multiplier) { @@ -436,6 +496,11 @@ default Per divide(Mass divisor) { return div(divisor); } + @Override + default Per per(MassUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(MomentOfInertia multiplier) { @@ -459,6 +524,11 @@ default Per divide(MomentOfInertia divisor return div(divisor); } + @Override + default Per per(MomentOfInertiaUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Mult multiplier) { @@ -482,6 +552,11 @@ default Per divide(MomentOfInertia divisor return div(divisor); } + @Override + default Per> per(MultUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult> times(Per multiplier) { @@ -505,6 +580,11 @@ default Per divide(MomentOfInertia divisor return div(divisor); } + @Override + default Per> per(PerUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult times(Power multiplier) { @@ -528,6 +608,11 @@ default Per divide(Power divisor) { return div(divisor); } + @Override + default Per per(PowerUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Resistance multiplier) { @@ -551,6 +636,11 @@ default Per divide(Resistance divisor) { return div(divisor); } + @Override + default Per per(ResistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Temperature multiplier) { @@ -574,6 +664,11 @@ default Dimensionless divide(Temperature divisor) { return div(divisor); } + @Override + default Dimensionless per(TemperatureUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Time multiplier) { @@ -597,6 +692,11 @@ default Velocity divide(Time divisor) { return div(divisor); } + @Override + default Velocity per(TimeUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Torque multiplier) { @@ -620,6 +720,11 @@ default Per divide(Torque divisor) { return div(divisor); } + @Override + default Per per(TorqueUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Velocity multiplier) { @@ -643,6 +748,11 @@ default Per> divide(Velocity divisor) { return div(divisor); } + @Override + default Per> per(VelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Voltage multiplier) { @@ -666,4 +776,9 @@ default Per divide(Voltage divisor) { return div(divisor); } + @Override + default Per per(VoltageUnit divisorUnit) { + return div(divisorUnit.one()); + } + } diff --git a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Time.java b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Time.java index dccfda609d9..4244325a26e 100644 --- a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Time.java +++ b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Time.java @@ -87,11 +87,6 @@ default Time divide(double divisor) { return (Time) div(divisor); } - @Override - default Dimensionless per(TimeUnit period) { - return div(period.of(1)); - } - @Override default Mult> times(Acceleration multiplier) { @@ -115,6 +110,11 @@ default Per> divide(Acceleration divisor) { return div(divisor); } + @Override + default Per> per(AccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Angle multiplier) { @@ -138,6 +138,11 @@ default Per divide(Angle divisor) { return div(divisor); } + @Override + default Per per(AngleUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default AngularVelocity times(AngularAcceleration multiplier) { @@ -161,6 +166,11 @@ default Per divide(AngularAcceleration diviso return div(divisor); } + @Override + default Per per(AngularAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularMomentum multiplier) { @@ -184,6 +194,11 @@ default Per divide(AngularMomentum divisor) { return div(divisor); } + @Override + default Per per(AngularMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Angle times(AngularVelocity multiplier) { @@ -207,6 +222,11 @@ default Per divide(AngularVelocity divisor) { return div(divisor); } + @Override + default Per per(AngularVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Current multiplier) { @@ -230,6 +250,11 @@ default Per divide(Current divisor) { return div(divisor); } + @Override + default Per per(CurrentUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Time div(Dimensionless divisor) { return (Time) Seconds.of(baseUnitMagnitude() / divisor.baseUnitMagnitude()); @@ -275,6 +300,11 @@ default Per divide(Distance divisor) { return div(divisor); } + @Override + default Per per(DistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Energy multiplier) { @@ -298,6 +328,11 @@ default Per divide(Energy divisor) { return div(divisor); } + @Override + default Per per(EnergyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Force multiplier) { @@ -321,6 +356,11 @@ default Per divide(Force divisor) { return div(divisor); } + @Override + default Per per(ForceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Dimensionless times(Frequency multiplier) { @@ -344,6 +384,11 @@ default Per divide(Frequency divisor) { return div(divisor); } + @Override + default Per per(FrequencyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default LinearVelocity times(LinearAcceleration multiplier) { @@ -367,6 +412,11 @@ default Per divide(LinearAcceleration divisor) return div(divisor); } + @Override + default Per per(LinearAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearMomentum multiplier) { @@ -390,6 +440,11 @@ default Per divide(LinearMomentum divisor) { return div(divisor); } + @Override + default Per per(LinearMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Distance times(LinearVelocity multiplier) { @@ -413,6 +468,11 @@ default Per divide(LinearVelocity divisor) { return div(divisor); } + @Override + default Per per(LinearVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Mass multiplier) { @@ -436,6 +496,11 @@ default Per divide(Mass divisor) { return div(divisor); } + @Override + default Per per(MassUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(MomentOfInertia multiplier) { @@ -459,6 +524,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per per(MomentOfInertiaUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Mult multiplier) { @@ -482,6 +552,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per> per(MultUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult> times(Per multiplier) { @@ -505,6 +580,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per> per(PerUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult times(Power multiplier) { @@ -528,6 +608,11 @@ default Per divide(Power divisor) { return div(divisor); } + @Override + default Per per(PowerUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Resistance multiplier) { @@ -551,6 +636,11 @@ default Per divide(Resistance divisor) { return div(divisor); } + @Override + default Per per(ResistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Temperature multiplier) { @@ -574,6 +664,11 @@ default Per divide(Temperature divisor) { return div(divisor); } + @Override + default Per per(TemperatureUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Time multiplier) { @@ -597,6 +692,11 @@ default Dimensionless divide(Time divisor) { return div(divisor); } + @Override + default Dimensionless per(TimeUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Torque multiplier) { @@ -620,6 +720,11 @@ default Per divide(Torque divisor) { return div(divisor); } + @Override + default Per per(TorqueUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Velocity multiplier) { @@ -643,6 +748,11 @@ default Per> divide(Velocity divisor) { return div(divisor); } + @Override + default Per> per(VelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Voltage multiplier) { @@ -665,5 +775,10 @@ default Per div(Voltage divisor) { default Per divide(Voltage divisor) { return div(divisor); } + + @Override + default Per per(VoltageUnit divisorUnit) { + return div(divisorUnit.one()); + } default Frequency asFrequency() { return Hertz.of(1 / baseUnitMagnitude()); } } diff --git a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Torque.java b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Torque.java index e53dbaad941..cc7ac69da57 100644 --- a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Torque.java +++ b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Torque.java @@ -87,11 +87,6 @@ default Torque divide(double divisor) { return (Torque) div(divisor); } - @Override - default Velocity per(TimeUnit period) { - return div(period.of(1)); - } - @Override default Mult> times(Acceleration multiplier) { @@ -115,6 +110,11 @@ default Per> divide(Acceleration divisor) { return div(divisor); } + @Override + default Per> per(AccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Angle multiplier) { @@ -138,6 +138,11 @@ default Per divide(Angle divisor) { return div(divisor); } + @Override + default Per per(AngleUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularAcceleration multiplier) { @@ -161,6 +166,11 @@ default Per divide(AngularAcceleration divi return div(divisor); } + @Override + default Per per(AngularAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularMomentum multiplier) { @@ -184,6 +194,11 @@ default Per divide(AngularMomentum divisor) { return div(divisor); } + @Override + default Per per(AngularMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularVelocity multiplier) { @@ -207,6 +222,11 @@ default Per divide(AngularVelocity divisor) { return div(divisor); } + @Override + default Per per(AngularVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Current multiplier) { @@ -230,6 +250,11 @@ default Per divide(Current divisor) { return div(divisor); } + @Override + default Per per(CurrentUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Torque div(Dimensionless divisor) { return (Torque) NewtonMeters.of(baseUnitMagnitude() / divisor.baseUnitMagnitude()); @@ -275,6 +300,11 @@ default Force divide(Distance divisor) { return div(divisor); } + @Override + default Force per(DistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Energy multiplier) { @@ -298,6 +328,11 @@ default Per divide(Energy divisor) { return div(divisor); } + @Override + default Per per(EnergyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Force multiplier) { @@ -321,6 +356,11 @@ default Distance divide(Force divisor) { return div(divisor); } + @Override + default Distance per(ForceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Frequency multiplier) { @@ -344,6 +384,11 @@ default Per divide(Frequency divisor) { return div(divisor); } + @Override + default Per per(FrequencyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearAcceleration multiplier) { @@ -367,6 +412,11 @@ default Per divide(LinearAcceleration diviso return div(divisor); } + @Override + default Per per(LinearAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearMomentum multiplier) { @@ -390,6 +440,11 @@ default Per divide(LinearMomentum divisor) { return div(divisor); } + @Override + default Per per(LinearMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearVelocity multiplier) { @@ -413,6 +468,11 @@ default Per divide(LinearVelocity divisor) { return div(divisor); } + @Override + default Per per(LinearVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Mass multiplier) { @@ -436,6 +496,11 @@ default Per divide(Mass divisor) { return div(divisor); } + @Override + default Per per(MassUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(MomentOfInertia multiplier) { @@ -459,6 +524,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per per(MomentOfInertiaUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Mult multiplier) { @@ -482,6 +552,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per> per(MultUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult> times(Per multiplier) { @@ -505,6 +580,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per> per(PerUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult times(Power multiplier) { @@ -528,6 +608,11 @@ default Per divide(Power divisor) { return div(divisor); } + @Override + default Per per(PowerUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Resistance multiplier) { @@ -551,6 +636,11 @@ default Per divide(Resistance divisor) { return div(divisor); } + @Override + default Per per(ResistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Temperature multiplier) { @@ -574,6 +664,11 @@ default Per divide(Temperature divisor) { return div(divisor); } + @Override + default Per per(TemperatureUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Time multiplier) { @@ -597,6 +692,11 @@ default Velocity divide(Time divisor) { return div(divisor); } + @Override + default Velocity per(TimeUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Torque multiplier) { @@ -620,6 +720,11 @@ default Dimensionless divide(Torque divisor) { return div(divisor); } + @Override + default Dimensionless per(TorqueUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Velocity multiplier) { @@ -643,6 +748,11 @@ default Per> divide(Velocity divisor) { return div(divisor); } + @Override + default Per> per(VelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Voltage multiplier) { @@ -666,4 +776,9 @@ default Per divide(Voltage divisor) { return div(divisor); } + @Override + default Per per(VoltageUnit divisorUnit) { + return div(divisorUnit.one()); + } + } diff --git a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Velocity.java b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Velocity.java index 056924849e4..ac6df04e1f5 100644 --- a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Velocity.java +++ b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Velocity.java @@ -87,11 +87,6 @@ default Velocity divide(double divisor) { return (Velocity) div(divisor); } - @Override - default Velocity> per(TimeUnit period) { - return div(period.of(1)); - } - @Override default Mult, AccelerationUnit> times(Acceleration multiplier) { @@ -115,6 +110,11 @@ default Per, AccelerationUnit> divide(Acceleration divisor return div(divisor); } + @Override + default Per, AccelerationUnit> per(AccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, AngleUnit> times(Angle multiplier) { @@ -138,6 +138,11 @@ default Per, AngleUnit> divide(Angle divisor) { return div(divisor); } + @Override + default Per, AngleUnit> per(AngleUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, AngularAccelerationUnit> times(AngularAcceleration multiplier) { @@ -161,6 +166,11 @@ default Per, AngularAccelerationUnit> divide(AngularAcceleration return div(divisor); } + @Override + default Per, AngularAccelerationUnit> per(AngularAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, AngularMomentumUnit> times(AngularMomentum multiplier) { @@ -184,6 +194,11 @@ default Per, AngularMomentumUnit> divide(AngularMomentum divisor return div(divisor); } + @Override + default Per, AngularMomentumUnit> per(AngularMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, AngularVelocityUnit> times(AngularVelocity multiplier) { @@ -207,6 +222,11 @@ default Per, AngularVelocityUnit> divide(AngularVelocity divisor return div(divisor); } + @Override + default Per, AngularVelocityUnit> per(AngularVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, CurrentUnit> times(Current multiplier) { @@ -230,6 +250,11 @@ default Per, CurrentUnit> divide(Current divisor) { return div(divisor); } + @Override + default Per, CurrentUnit> per(CurrentUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Velocity div(Dimensionless divisor) { return (Velocity) unit().of(baseUnitMagnitude() / divisor.baseUnitMagnitude()); @@ -275,6 +300,11 @@ default Per, DistanceUnit> divide(Distance divisor) { return div(divisor); } + @Override + default Per, DistanceUnit> per(DistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, EnergyUnit> times(Energy multiplier) { @@ -298,6 +328,11 @@ default Per, EnergyUnit> divide(Energy divisor) { return div(divisor); } + @Override + default Per, EnergyUnit> per(EnergyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, ForceUnit> times(Force multiplier) { @@ -321,6 +356,11 @@ default Per, ForceUnit> divide(Force divisor) { return div(divisor); } + @Override + default Per, ForceUnit> per(ForceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, FrequencyUnit> times(Frequency multiplier) { @@ -344,6 +384,11 @@ default Per, FrequencyUnit> divide(Frequency divisor) { return div(divisor); } + @Override + default Per, FrequencyUnit> per(FrequencyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, LinearAccelerationUnit> times(LinearAcceleration multiplier) { @@ -367,6 +412,11 @@ default Per, LinearAccelerationUnit> divide(LinearAcceleration d return div(divisor); } + @Override + default Per, LinearAccelerationUnit> per(LinearAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, LinearMomentumUnit> times(LinearMomentum multiplier) { @@ -390,6 +440,11 @@ default Per, LinearMomentumUnit> divide(LinearMomentum divisor) return div(divisor); } + @Override + default Per, LinearMomentumUnit> per(LinearMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, LinearVelocityUnit> times(LinearVelocity multiplier) { @@ -413,6 +468,11 @@ default Per, LinearVelocityUnit> divide(LinearVelocity divisor) return div(divisor); } + @Override + default Per, LinearVelocityUnit> per(LinearVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, MassUnit> times(Mass multiplier) { @@ -436,6 +496,11 @@ default Per, MassUnit> divide(Mass divisor) { return div(divisor); } + @Override + default Per, MassUnit> per(MassUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, MomentOfInertiaUnit> times(MomentOfInertia multiplier) { @@ -459,6 +524,11 @@ default Per, MomentOfInertiaUnit> divide(MomentOfInertia divisor return div(divisor); } + @Override + default Per, MomentOfInertiaUnit> per(MomentOfInertiaUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, MultUnit> times(Mult multiplier) { @@ -482,6 +552,11 @@ default Per, MomentOfInertiaUnit> divide(MomentOfInertia divisor return div(divisor); } + @Override + default Per, MultUnit> per(MultUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult, PerUnit> times(Per multiplier) { @@ -505,6 +580,11 @@ default Per, MomentOfInertiaUnit> divide(MomentOfInertia divisor return div(divisor); } + @Override + default Per, PerUnit> per(PerUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult, PowerUnit> times(Power multiplier) { @@ -528,6 +608,11 @@ default Per, PowerUnit> divide(Power divisor) { return div(divisor); } + @Override + default Per, PowerUnit> per(PowerUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, ResistanceUnit> times(Resistance multiplier) { @@ -551,6 +636,11 @@ default Per, ResistanceUnit> divide(Resistance divisor) { return div(divisor); } + @Override + default Per, ResistanceUnit> per(ResistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, TemperatureUnit> times(Temperature multiplier) { @@ -574,6 +664,11 @@ default Per, TemperatureUnit> divide(Temperature divisor) { return div(divisor); } + @Override + default Per, TemperatureUnit> per(TemperatureUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Measure times(Time multiplier) { return (Measure) unit().numerator().ofBaseUnits(baseUnitMagnitude() * multiplier.baseUnitMagnitude()); @@ -596,6 +691,11 @@ default Velocity> divide(Time divisor) { return div(divisor); } + @Override + default Velocity> per(TimeUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, TorqueUnit> times(Torque multiplier) { @@ -619,6 +719,11 @@ default Per, TorqueUnit> divide(Torque divisor) { return div(divisor); } + @Override + default Per, TorqueUnit> per(TorqueUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, VelocityUnit> times(Velocity multiplier) { @@ -642,6 +747,11 @@ default Per, VelocityUnit> divide(Velocity divisor) { return div(divisor); } + @Override + default Per, VelocityUnit> per(VelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult, VoltageUnit> times(Voltage multiplier) { @@ -665,4 +775,9 @@ default Per, VoltageUnit> divide(Voltage divisor) { return div(divisor); } + @Override + default Per, VoltageUnit> per(VoltageUnit divisorUnit) { + return div(divisorUnit.one()); + } + } diff --git a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Voltage.java b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Voltage.java index 98ceecedaa0..33404865fdc 100644 --- a/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Voltage.java +++ b/wpiunits/src/generated/main/java/edu/wpi/first/units/measure/Voltage.java @@ -87,11 +87,6 @@ default Voltage divide(double divisor) { return (Voltage) div(divisor); } - @Override - default Velocity per(TimeUnit period) { - return div(period.of(1)); - } - @Override default Mult> times(Acceleration multiplier) { @@ -115,6 +110,11 @@ default Per> divide(Acceleration divisor) { return div(divisor); } + @Override + default Per> per(AccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Angle multiplier) { @@ -138,6 +138,11 @@ default Per divide(Angle divisor) { return div(divisor); } + @Override + default Per per(AngleUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularAcceleration multiplier) { @@ -161,6 +166,11 @@ default Per divide(AngularAcceleration div return div(divisor); } + @Override + default Per per(AngularAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularMomentum multiplier) { @@ -184,6 +194,11 @@ default Per divide(AngularMomentum divisor) { return div(divisor); } + @Override + default Per per(AngularMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(AngularVelocity multiplier) { @@ -207,6 +222,11 @@ default Per divide(AngularVelocity divisor) { return div(divisor); } + @Override + default Per per(AngularVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Power times(Current multiplier) { @@ -230,6 +250,11 @@ default Resistance divide(Current divisor) { return div(divisor); } + @Override + default Resistance per(CurrentUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Voltage div(Dimensionless divisor) { return (Voltage) Volts.of(baseUnitMagnitude() / divisor.baseUnitMagnitude()); @@ -275,6 +300,11 @@ default Per divide(Distance divisor) { return div(divisor); } + @Override + default Per per(DistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Energy multiplier) { @@ -298,6 +328,11 @@ default Per divide(Energy divisor) { return div(divisor); } + @Override + default Per per(EnergyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Force multiplier) { @@ -321,6 +356,11 @@ default Per divide(Force divisor) { return div(divisor); } + @Override + default Per per(ForceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Frequency multiplier) { @@ -344,6 +384,11 @@ default Per divide(Frequency divisor) { return div(divisor); } + @Override + default Per per(FrequencyUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearAcceleration multiplier) { @@ -367,6 +412,11 @@ default Per divide(LinearAcceleration divis return div(divisor); } + @Override + default Per per(LinearAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearMomentum multiplier) { @@ -390,6 +440,11 @@ default Per divide(LinearMomentum divisor) { return div(divisor); } + @Override + default Per per(LinearMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(LinearVelocity multiplier) { @@ -413,6 +468,11 @@ default Per divide(LinearVelocity divisor) { return div(divisor); } + @Override + default Per per(LinearVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Mass multiplier) { @@ -436,6 +496,11 @@ default Per divide(Mass divisor) { return div(divisor); } + @Override + default Per per(MassUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(MomentOfInertia multiplier) { @@ -459,6 +524,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per per(MomentOfInertiaUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Mult multiplier) { @@ -482,6 +552,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per> per(MultUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult> times(Per multiplier) { @@ -505,6 +580,11 @@ default Per divide(MomentOfInertia divisor) { return div(divisor); } + @Override + default Per> per(PerUnit divisorUnit) { + return div(divisorUnit.ofNative(1)); + } + @Override default Mult times(Power multiplier) { @@ -528,6 +608,11 @@ default Per divide(Power divisor) { return div(divisor); } + @Override + default Per per(PowerUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Resistance multiplier) { @@ -551,6 +636,11 @@ default Current divide(Resistance divisor) { return div(divisor); } + @Override + default Current per(ResistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Temperature multiplier) { @@ -574,6 +664,11 @@ default Per divide(Temperature divisor) { return div(divisor); } + @Override + default Per per(TemperatureUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Time multiplier) { @@ -597,6 +692,11 @@ default Velocity divide(Time divisor) { return div(divisor); } + @Override + default Velocity per(TimeUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Torque multiplier) { @@ -620,6 +720,11 @@ default Per divide(Torque divisor) { return div(divisor); } + @Override + default Per per(TorqueUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult> times(Velocity multiplier) { @@ -643,6 +748,11 @@ default Per> divide(Velocity divisor) { return div(divisor); } + @Override + default Per> per(VelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + @Override default Mult times(Voltage multiplier) { @@ -666,4 +776,9 @@ default Dimensionless divide(Voltage divisor) { return div(divisor); } + @Override + default Dimensionless per(VoltageUnit divisorUnit) { + return div(divisorUnit.one()); + } + } diff --git a/wpiunits/src/main/java/edu/wpi/first/units/Measure.java b/wpiunits/src/main/java/edu/wpi/first/units/Measure.java index 28d6d9614a0..6a436194b7f 100644 --- a/wpiunits/src/main/java/edu/wpi/first/units/Measure.java +++ b/wpiunits/src/main/java/edu/wpi/first/units/Measure.java @@ -1021,6 +1021,270 @@ default Measure div(Resistance divisor) { .ofBaseUnits(baseUnitMagnitude() / divisor.baseUnitMagnitude()); } + /** + * Divides this measure by an acceleration unit and returns the result in the most appropriate + * unit. This is equivalent to {@code div(divisorUnit.of(1))}. + * + * @param divisorUnit the unit to divide by. + * @return the division result + */ + default Measure per(AccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + + /** + * Divides this measure by an angle unit and returns the result in the most appropriate unit. This + * is equivalent to {@code div(divisorUnit.of(1))}. + * + * @param divisorUnit the unit to divide by. + * @return the division result + */ + default Measure per(AngleUnit divisorUnit) { + return div(divisorUnit.one()); + } + + /** + * Divides this measure by an angular acceleration unit and returns the result in the most + * appropriate unit. This is equivalent to {@code div(divisorUnit.of(1))}. + * + * @param divisorUnit the unit to divide by. + * @return the division result + */ + default Measure per(AngularAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + + /** + * Divides this measure by an angular momentum unit and returns the result in the most appropriate + * unit. This is equivalent to {@code div(divisorUnit.of(1))}. + * + * @param divisorUnit the unit to divide by. + * @return the division result + */ + default Measure per(AngularMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + + /** + * Divides this measure by an angular velocity unit and returns the result in the most appropriate + * unit. This is equivalent to {@code div(divisorUnit.of(1))}. + * + * @param divisorUnit the unit to divide by. + * @return the division result + */ + default Measure per(AngularVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + + /** + * Divides this measure by a unit of electric current and returns the result in the most + * appropriate unit. This is equivalent to {@code div(divisorUnit.of(1))}. + * + * @param divisorUnit the unit to divide by. + * @return the division result + */ + default Measure per(CurrentUnit divisorUnit) { + return div(divisorUnit.one()); + } + + /** + * Divides this measure by a distance unit and returns the result in the most appropriate unit. + * This is equivalent to {@code div(divisorUnit.of(1))}. + * + * @param divisorUnit the unit to divide by. + * @return the division result + */ + default Measure per(DistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + + /** + * Divides this measure by an energy unit and returns the result in the most appropriate unit. + * This is equivalent to {@code div(divisorUnit.of(1))}. + * + * @param divisorUnit the unit to divide by. + * @return the division result + */ + default Measure per(EnergyUnit divisorUnit) { + return div(divisorUnit.one()); + } + + /** + * Divides this measure by a force unit and returns the result in the most appropriate unit. This + * is equivalent to {@code div(divisorUnit.of(1))}. + * + * @param divisorUnit the unit to divide by. + * @return the division result + */ + default Measure per(ForceUnit divisorUnit) { + return div(divisorUnit.one()); + } + + /** + * Divides this measure by a frequency unit and returns the result in the most appropriate unit. + * This is equivalent to {@code div(divisorUnit.of(1))}. + * + * @param divisorUnit the unit to divide by. + * @return the division result + */ + default Measure per(FrequencyUnit divisorUnit) { + return div(divisorUnit.one()); + } + + /** + * Divides this measure by a linear acceleration unit and returns the result in the most + * appropriate unit. This is equivalent to {@code div(divisorUnit.of(1))}. + * + * @param divisorUnit the unit to divide by. + * @return the division result + */ + default Measure per(LinearAccelerationUnit divisorUnit) { + return div(divisorUnit.one()); + } + + /** + * Divides this measure by a linear momentum unit and returns the result in the most appropriate + * unit. This is equivalent to {@code div(divisorUnit.of(1))}. + * + * @param divisorUnit the unit to divide by. + * @return the division result + */ + default Measure per(LinearMomentumUnit divisorUnit) { + return div(divisorUnit.one()); + } + + /** + * Divides this measure by a linear velocity unit and returns the result in the most appropriate + * unit. This is equivalent to {@code div(divisorUnit.of(1))}. + * + * @param divisorUnit the unit to divide by. + * @return the division result + */ + default Measure per(LinearVelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + + /** + * Divides this measure by a mass unit and returns the result in the most appropriate unit. This + * is equivalent to {@code div(divisorUnit.of(1))}. + * + * @param divisorUnit the unit to divide by. + * @return the division result + */ + default Measure per(MassUnit divisorUnit) { + return div(divisorUnit.one()); + } + + /** + * Divides this measure by a moment of inertia unit and returns the result in the most appropriate + * unit. This is equivalent to {@code div(divisorUnit.of(1))}. + * + * @param divisorUnit the unit to divide by. + * @return the division result + */ + default Measure per(MomentOfInertiaUnit divisorUnit) { + return div(divisorUnit.one()); + } + + /** + * Divides this measure by a generic compound unit and returns the result in the most appropriate + * unit. This is equivalent to {@code div(divisorUnit.of(1))}. + * + * @param divisorUnit the unit to divide by. + * @return the division result + */ + default Measure per(MultUnit divisorUnit) { + return div(divisorUnit.one()); + } + + /** + * Divides this measure by a power unit and returns the result in the most appropriate unit. This + * is equivalent to {@code div(divisorUnit.of(1))}. + * + * @param divisorUnit the unit to divide by. + * @return the division result + */ + default Measure per(PowerUnit divisorUnit) { + return div(divisorUnit.one()); + } + + /** + * Divides this measure by a generic ratio unit and returns the result in the most appropriate + * unit. This is equivalent to {@code div(divisorUnit.of(1))}. + * + * @param divisorUnit the unit to divide by. + * @return the division result + */ + default Measure per(PerUnit divisorUnit) { + return div(divisorUnit.one()); + } + + /** + * Divides this measure by a temperature unit and returns the result in the most appropriate unit. + * This is equivalent to {@code div(divisorUnit.of(1))}. + * + * @param divisorUnit the unit to divide by. + * @return the division result + */ + default Measure per(TemperatureUnit divisorUnit) { + return div(divisorUnit.one()); + } + + /** + * Divides this measure by a time period and returns the result in the most appropriate unit. This + * is equivalent to {@code div(period.of(1))}. + * + * @param period the time period measurement to divide by. + * @return the division result + */ + default Measure per(TimeUnit period) { + return div(period.of(1)); + } + + /** + * Divides this measure by a torque unit and returns the result in the most appropriate unit. This + * is equivalent to {@code div(divisorUnit.of(1))}. + * + * @param divisorUnit the unit to divide by. + * @return the division result + */ + default Measure per(TorqueUnit divisorUnit) { + return div(divisorUnit.one()); + } + + /** + * Divides this measure by a velocity unit and returns the result in the most appropriate unit. + * This is equivalent to {@code div(divisorUnit.of(1))}. + * + * @param divisorUnit the unit to divide by. + * @return the division result + */ + default Measure per(VelocityUnit divisorUnit) { + return div(divisorUnit.one()); + } + + /** + * Divides this measure by a voltage unit and returns the result in the most appropriate unit. + * This is equivalent to {@code div(divisorUnit.of(1))}. + * + * @param divisorUnit the unit to divide by. + * @return the division result + */ + default Measure per(VoltageUnit divisorUnit) { + return div(divisorUnit.one()); + } + + /** + * Divides this measure by a resistance unit and returns the result in the most appropriate unit. + * This is equivalent to {@code div(divisorUnit.of(1))}. + * + * @param divisorUnit the unit to divide by. + * @return the division result + */ + default Measure per(ResistanceUnit divisorUnit) { + return div(divisorUnit.one()); + } + /** * Divides this measure by a unitless scalar and returns the result. * @@ -1371,17 +1635,6 @@ default Measure divideRatio( baseUnitMagnitude() / divisor.baseUnitMagnitude(), divisor.unit().denominator()); } - /** - * Divides this measure by a time period and returns the result in the most appropriate unit. This - * is equivalent to {@code div(period.of(1))}. - * - * @param period the time period measurement to divide by. - * @return the division result - */ - default Measure per(TimeUnit period) { - return div(period.of(1)); - } - /** * Checks if this measure is near another measure of the same unit. Provide a variance threshold * for use for a +/- scalar, such as 0.05 for +/- 5%. diff --git a/wpiunits/src/main/java/edu/wpi/first/units/VelocityUnit.java b/wpiunits/src/main/java/edu/wpi/first/units/VelocityUnit.java index d954166db4d..45374cd39cd 100644 --- a/wpiunits/src/main/java/edu/wpi/first/units/VelocityUnit.java +++ b/wpiunits/src/main/java/edu/wpi/first/units/VelocityUnit.java @@ -90,14 +90,14 @@ public Velocity ofBaseUnits(double baseUnitMagnitude) { @Override @SuppressWarnings("unchecked") - public Measure> zero() { - return (Measure>) super.zero(); + public Velocity zero() { + return (Velocity) super.zero(); } @Override @SuppressWarnings("unchecked") - public Measure> one() { - return (Measure>) super.one(); + public Velocity one() { + return (Velocity) super.one(); } @Override