Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Quantity Types

From Resonite Wiki

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)
  • meters per second squared (m/s^2)
Angle Basic ✔️ Yes

radians (rad)
  • radians (rad)
  • degrees (°)
  • arcminutes (′)
  • arcseconds (″)
Current Electronic ✔️ Yes amperes (A)
  • amperes (A)
Density Basic No kilograms per cubic meter (kg/m³)
  • kilograms per cubic meter (kg/m³)
  • pounds per cubic foot (lb/ft³)
  • grams per cubic centimeter (g/cm³)
Distance Basic ✔️ Yes meters (m)
  • ångströms (Å)
  • thous (th)
  • inches (in)
  • feet (ft)
  • yards (yd)
  • meters (m)
  • fathoms (ftm)
  • rods (rd)
  • chains (ch)
  • miles (mi)
  • nautical miles (NM)
  • lightseconds (ls)
  • Solar radii (R☉)
  • Astronomical Units (AU)
  • lightyears (ly)
  • parsecs (pc)
Luminance Basic No candelas per square meter (cd/m²)
  • candelas per square meter (cd/m²)
  • nits (nt)
Mass Basic ✔️ Yes kilograms (kg)
  • grains (gr)
  • drachms (dr)
  • ounces (oz)
  • pounds (lb)
  • grams (g)
  • stones (st)
  • quarters (qr)
  • slugs (slug)
  • hundredweights (cwt)
  • tons (tn)
  • tonnes (t)
  • imperial tons (LT)
Pressure Basic ✔️ Yes pascals (Pa)
  • pounds per square inch (psi)
  • pascals (Pa)
  • millibars (mbar)
  • torrs (Torr)
  • bars (bar)
  • standard atmospheres (atm)
Ratio Basic No "RatioValue" (none)[qtt 5]
  • percent (%)
  • "RatioValue" (none)[qtt 5]
Resistance Electronic ✔️ Yes ohms (Ω)
  • ohms (Ω)
Temperature Basic No Kelvins (K)
  • degrees Celsius (°C)
  • degrees Fahrenheit (°F)
  • degrees Rankine (°R)
  • Kelvins (K)
Time Basic No seconds (s)
  • milliseconds (ms)
  • seconds (s)
  • minutes (m)
  • hours (h)
  • days (d)
Torque Basic No newton meters (N m)
  • newton meters (N m)
  • pound-feet (lb·ft)
Velocity Basic No meters per second (m/s)
  • kilometers per hour (km/h)
  • feet per second (ft/s)
  • miles per hour (mph)
  • knots (kn)
  • meters per second (m/s)
Voltage Electronic ✔️ Yes volts (V)
  • volts (V)
  1. The overarching family that this quantity belongs to as defined in the assembly.
  2. This indicates whether or not the default unit can use Metric (SI) prefixes.
  3. This is the exact name and prefix used for a default unit when the quantity value is zero.
  4. These contain the exact names and prefixes used to trigger a unit conversion. Note that alternate names and prefixes are not listed.
  5. 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

List of components with generic quantity type parameters
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

List of ProtoFlux nodes with generic quantity type parameters
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.