Quantity Types: Difference between revisions

From Resonite Wiki
Created page quantity types
 
Changed component / node links to use "Type" category.
Line 40: Line 40:
! Component !! Description
! Component !! Description
|-
|-
| [[ Component:DataFeedQuantityField´2 | <nowiki>DataFeedQuantityField<Q,T></nowiki> ]] || A quantity field for use with the [[Data Feed]] system
| [[ Type:DataFeedQuantityField´2 | <nowiki>DataFeedQuantityField<Q,T></nowiki> ]] || A quantity field for use with the [[Data Feed]] system
|-
|-
| [[ Component:FeedQuantityFieldInterface´2 | <nowiki>FeedQuantityFieldInterface<Q,T></nowiki> ]] || A quantity field interface for use with the [[Data Feed]] system
| [[ Type:FeedQuantityFieldInterface´2 | <nowiki>FeedQuantityFieldInterface<Q,T></nowiki> ]] || A quantity field interface for use with the [[Data Feed]] system
|-
|-
| [[ Component:QuantityTextEditorParser´2 | <nowiki>QuantityTextEditorParser<U,T></nowiki> ]] || Text editor for parsing and converting a Quantity value from text input
| [[ Type:QuantityTextEditorParser´2 | <nowiki>QuantityTextEditorParser<U,T></nowiki> ]] || Text editor for parsing and converting a Quantity value from text input
|-
|-
| [[ Component:QuantityTextEditorParser´1 | <nowiki>QuantityTextEditorParser<U></nowiki> ]] || Text editor for parsing a Quantity value from text input
| [[ Type:QuantityTextEditorParser´1 | <nowiki>QuantityTextEditorParser<U></nowiki> ]] || Text editor for parsing a Quantity value from text input
|-
|-
| [[ Component:QuantityTextFormatDriver´1 | <nowiki>QuantityTextFormatDriver<U></nowiki> ]] || Drives a formatted text form a Quantity value
| [[ Type:QuantityTextFormatDriver´1 | <nowiki>QuantityTextFormatDriver<U></nowiki> ]] || Drives a formatted text form a Quantity value
|}
|}


Line 57: Line 57:
! Component !! Description
! Component !! Description
|-
|-
| [[ ProtoFlux:BaseValue´1 | <nowiki>BaseValue<U></nowiki> ]] || Returns the base value of a quantity
| [[ Type:BaseValue´1 | <nowiki>BaseValue<U></nowiki> ]] || Returns the base value of a quantity
|-
|-
| [[ ProtoFlux:FormatQuantity´1 | <nowiki>FormatQuantity<U></nowiki> ]] || Formats a quantity string
| [[ Type:FormatQuantity´1 | <nowiki>FormatQuantity<U></nowiki> ]] || Formats a quantity string
|-
|-
| [[ ProtoFlux:FromBaseValue´1 | <nowiki>FromBaseValue<U></nowiki> ]] || Creates a quantity from the quantity type's base value
| [[ Type:FromBaseValue´1 | <nowiki>FromBaseValue<U></nowiki> ]] || Creates a quantity from the quantity type's base value
|-
|-
| [[ ProtoFlux:ParseQuantity´1 | <nowiki>ParseQuantity<U></nowiki> ]] || Parses a quantity string
| [[ Type:ParseQuantity´1 | <nowiki>ParseQuantity<U></nowiki> ]] || Parses a quantity string
|}
|}

Revision as of 08:24, 11 September 2024

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 a base 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 class implementing IQuantity and IQuantity<T> interfaces.


Quantity Types

List of Quantity types
Quantity Type Base Unit
Acceleration m/s²
Angle radian
Current ampere
Distance meter
Mass gram
Ratio (no unit)
Resistance ohm
Temperature Kelvin
Time Second
Velocity m/s
Voltage volt

Quantity Components

List of components with generic quantity type parameters
Component Description
DataFeedQuantityField<Q,T> A quantity field for use with the Data Feed system
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 components with generic quantity type parameters
Component 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