Quantity Types
More actions
To work with various quantities, Resonite provides a generic quantity system, which allows converting between various units for a given quantity type. An example of this is converting a Distance quantity value between metric and imperial units. There are various quantity types available, which can be used with all generic quantity nodes and components. Each quantity type has default unit, which can be used to create a quantity value, which can then be converted between all known units of the given quantity type.
Technical
The quantity system is part of the Elements.Quantity assembly. Every quantity type is a struct that implements either an IQuantity<T> or IQuantitySI<T> interface.
Quantity Types
| Quantity Type | Family [qtt 1] | Supports SI Prefixes [qtt 2] | Default Unit [qtt 3] | Supported Units [qtt 4] |
|---|---|---|---|---|
| Acceleration | Basic | ❌ No
|
meters per second squared (m/s^2) |
|
| Angle | Basic | ✔️ Yes
|
radians (rad) |
|
| Current | Electronic | ✔️ Yes | amperes (A) |
|
| Density | Basic | ❌ No | kilograms per cubic meter (kg/m³) |
|
| Distance | Basic | ✔️ Yes | meters (m) |
|
| Luminance | Basic | ❌ No | candelas per square meter (cd/m²) |
|
| Mass | Basic | ✔️ Yes | kilograms (kg) |
|
| Pressure | Basic | ✔️ Yes | pascals (Pa) |
|
| Ratio | Basic | ❌ No | "RatioValue" (none)[qtt 5] |
|
| Resistance | Electronic | ✔️ Yes | ohms (Ω) |
|
| Temperature | Basic | ❌ No | Kelvins (K) |
|
| Time | Basic | ❌ No | seconds (s) |
|
| Torque | Basic | ❌ No | newton meters (N m) |
|
| Velocity | Basic | ❌ No | meters per second (m/s) |
|
| Voltage | Electronic | ✔️ Yes | volts (V) |
|
- ↑ The overarching family that this quantity belongs to as defined in the assembly.
- ↑ This indicates whether or not the default unit can use Metric (SI) prefixes.
- ↑ This is the exact name and prefix used for a default unit when the quantity value is zero.
- ↑ These contain the exact names and prefixes used to trigger a unit conversion. Note that alternate names and prefixes are not listed.
- ↑ 5.0 5.1 The name and abbreviation of this unit are empty strings. For the purpose of this table, text was provided for this unit.
Quantity Components
| Component | Description |
|---|---|
| FeedQuantityFieldInterface<Q,T> | A quantity field interface for use with the Data Feed system |
| QuantityTextEditorParser<U,T> | Text editor for parsing and converting a Quantity value from text input |
| QuantityTextEditorParser<U> | Text editor for parsing a Quantity value from text input |
| QuantityTextFormatDriver<U> | Drives a formatted text form a Quantity value |
Quantity ProtoFlux Nodes
| ProtoFlux Node | Description |
|---|---|
| BaseValue<U> | Returns the base value of a quantity |
| FormatQuantity<U> | Formats a quantity string |
| FromBaseValue<U> | Creates a quantity from the quantity type's base value |
| ParseQuantity<U> | Parses a quantity string |
Deprecated
The quantity interface before the type update was referenced as QuantityX.