|
RobotCore 1.0
WPILib port to raspberry Pi
|
Public Member Functions | |
| CurrentUnit | getBaseUnit () |
| PowerUnit | mult (VoltageUnit voltage, String name, String symbol) |
| Current | of (double magnitude) |
| Current | ofBaseUnits (double baseUnitMagnitude) |
| Current | zero () |
| Current | one () |
| VelocityUnit< CurrentUnit > | per (TimeUnit time) |
| double | convertFrom (double magnitude, CurrentUnit otherUnit) |
| Public Member Functions inherited from org.wpilib.units.Unit | |
| boolean | isBaseUnit () |
| double | fromBaseUnits (double valueInBaseUnits) |
| double | toBaseUnits (double valueInNativeUnits) |
| UnaryFunction | getConverterToBase () |
| UnaryFunction | getConverterFromBase () |
| boolean | equivalent (Unit other) |
| boolean | equals (Object o) |
| int | hashCode () |
| String | name () |
| String | symbol () |
| String | toString () |
Additional Inherited Members | |
| Protected Member Functions inherited from org.wpilib.units.Unit | |
| Unit (Unit baseUnit, UnaryFunction toBaseConverter, UnaryFunction fromBaseConverter, String name, String symbol) | |
| Unit (Unit baseUnit, double baseUnitEquivalent, String name, String symbol) | |
Unit of electric current dimension.
This is the base type for units of current dimension. It is also used to specify the dimension for Measure: Measure<CurrentUnit>.
Actual units (such as Units#Amps and Units#Milliamps) can be found in the Units class.
Definition at line 18 of file CurrentUnit.java.
| double org.wpilib.units.CurrentUnit.convertFrom | ( | double | magnitude, |
| CurrentUnit | otherUnit ) |
Converts a measurement value in terms of another current unit to this unit.
| magnitude | the magnitude of the measurement in terms of the other current unit |
| otherUnit | the other current unit |
Definition at line 95 of file CurrentUnit.java.
| CurrentUnit org.wpilib.units.CurrentUnit.getBaseUnit | ( | ) |
Gets the base unit of measurement that this unit is derived from. If the unit is the base unit, the unit will be returned.
NOTE: Subclasses must override this method to provide the correct return type. Failing to do say will make unit combinations that use it break at runtime!
Unit baseUnit = new Unit(null, ...);
baseUnit.getBaseUnit(); // returns baseUnit
Unit derivedUnit = new Unit(baseUnit, ...);
derivedUnit.getBaseUnit(); // returns baseUnit
Reimplemented from org.wpilib.units.Unit.
Definition at line 33 of file CurrentUnit.java.
| PowerUnit org.wpilib.units.CurrentUnit.mult | ( | VoltageUnit | voltage, |
| String | name, | ||
| String | symbol ) |
Constructs a unit of power equivalent to this unit of electrical current multiplied by another unit of voltage. For example, Amps.times(Volts) will return a unit of power equivalent to one Watt; Amps.times(Millivolts) will return a unit of power equivalent to a milliwatt, and so on.
| voltage | the voltage unit to multiply by |
| name | the name of the resulting unit of power |
| symbol | the symbol used to represent the unit of power |
Definition at line 48 of file CurrentUnit.java.
| Current org.wpilib.units.CurrentUnit.of | ( | double | magnitude | ) |
Creates a new immutable measurement of the given magnitude in terms of this unit. Implementations are strongly recommended to sharpen the return type to a unit-specific measurement implementation.
| magnitude | the magnitude of the measurement. |
Reimplemented from org.wpilib.units.Unit.
Definition at line 53 of file CurrentUnit.java.
| Current org.wpilib.units.CurrentUnit.ofBaseUnits | ( | double | baseUnitMagnitude | ) |
Creates a new immutable measurement of the given magnitude in terms of this unit's base unit. Implementations are strongly recommended to sharpen the return type to a unit-specific measurement implementation.
| baseUnitMagnitude | the magnitude in terms of the base unit |
Reimplemented from org.wpilib.units.Unit.
Definition at line 58 of file CurrentUnit.java.
| Current org.wpilib.units.CurrentUnit.one | ( | ) |
Gets a measure with a magnitude of 1.0 in terms of this unit. The returned object is guaranteed to be of the same type returned by of(double). Subclasses are encouraged to override this method to sharpen the return type.
Reimplemented from org.wpilib.units.Unit.
Definition at line 68 of file CurrentUnit.java.
| VelocityUnit< CurrentUnit > org.wpilib.units.CurrentUnit.per | ( | TimeUnit | time | ) |
Combines this unit with a unit of time. This often - but not always - results in a velocity. Subclasses should sharpen the return type to be unit-specific.
| time | the unit of time |
Reimplemented from org.wpilib.units.Unit.
Definition at line 73 of file CurrentUnit.java.
| Current org.wpilib.units.CurrentUnit.zero | ( | ) |
Gets a measure of zero magnitude in terms of this unit. The returned object is guaranteed to be of the same type returned by of(double). Subclasses are encouraged to override this method to sharpen the return type.
Reimplemented from org.wpilib.units.Unit.
Definition at line 63 of file CurrentUnit.java.