Greet 2014
Documentation for the GREET 2014 API
 All Classes Namespaces Functions Variables Enumerations Properties Events
Greet.UnitLib.DerivedQuantity Class Reference

This is a group which contains one or more BaseGroups, this allows combining BaseGroups into more complicated groups such as HeatingValue = Energy/Mass. The references to the BaseGroups are stored in a list of Bases which contains the default and override unit and whether it is in the numerator or denominator. More...

Inheritance diagram for Greet.UnitLib.DerivedQuantity:
Greet.UnitLib.BaseQuantity Greet.UnitLib.IQuantity

Public Member Functions

 DerivedQuantity (XmlNode node)
 
 DerivedQuantity (string name, string displayName, string format, string baseString)
 
 DerivedQuantity (ref double d1, string d1_unitgroupname, ref double d2, string d2_unitgroupname, char operation)
 This constructor is for the DoubleValue operators, it takes the defaultUnit expressions and the operation that is being done as inputs. It parses the expressions, simplifies, and adds the appropriate groups. More...
 
 DerivedQuantity (BaseQuantity g1, BaseQuantity g2, char operation, string forcedName="")
 
 DerivedQuantity (string unitExpression)
 Used for generating the derived groups "on the fly" More...
 
string BasesToString (bool forXmlAttibute)
 
override double ConvertFromDefaultToOverride (double valueToConvert)
 Takes a value in the default unit and converts it to the user prefered unit More...
 
override double ConvertFromDefaultToSpecific (double valueToConvert, string unit)
 Converts a value represented in default unit to a specified unit (this must be a unit that belongs to the same group) More...
 
override double ConvertFromOverrideToDefault (double valueToConvert)
 Takes a value in the override unit, and converts it to the default unit Usefull to parse user inputs in textboxes More...
 
override bool Equals (object obj)
 
override int GetHashCode ()
 
- Public Member Functions inherited from Greet.UnitLib.BaseQuantity
bool DefaultOnlyEquals (BaseQuantity obj)
 
override bool Equals (object obj)
 
override int GetHashCode ()
 
virtual void OnEvent ()
 
override string ToString ()
 
delegate void UnitChangedDelegate ()
 

Public Attributes

List< DerivedQuantityBaseBaseGroups = new List<DerivedQuantityBase>()
 
bool createdByTheCalculations
 
string defaultUnitStringBuffer
 
- Public Attributes inherited from Greet.UnitLib.BaseQuantity
string format = ""
 Used to visualize parameters of this group with the number of significant digits specified. This attribute is used with ToString methods. Possible value=0.000 More...
 
UnitChangedDelegate UnitChanged
 Occurs when the overrideUnit changes. More...
 

Properties

override string Abbrev [get]
 
string BottomUnit [get]
 Return the first of the bottom units, use with care, we never know if there are many bottom units More...
 
BaseQuantity DefaultOnlyMatchedGroup [get]
 
override string DefaultUnitAbbrev [get]
 
override string DisplayUnitStr [get]
 
BaseQuantity MatchedGroup [get]
 Returns the group in Utils.groups that matches this DerivedGroup. Matching criteria includes containing a match for each bases (regardless of order) on the numerator and denominator. To be a matching base the group, defaultunit, and numerator must be the same (override is ignored). More...
 
override string SIUnitStr [get]
 
string TopUnit [get]
 Return the first of the bottom units, use with care, we never know if there are many bottom units More...
 
- Properties inherited from Greet.UnitLib.BaseQuantity
abstract string Abbrev [get]
 
abstract string DefaultUnitAbbrev [get]
 
string DisplayName [get, set]
 
abstract string DisplayUnitStr [get]
 
string Name [get, set]
 
abstract string SIUnitStr [get]
 
UnitChangedDelegate UnitChangedEvent
 
- Properties inherited from Greet.UnitLib.IQuantity
string DisplayUnitStr [get]
 The prefered unit used for this group in order to represent a value on the user interface More...
 
string Name [get]
 Unique name of the unit group More...
 
string SIUnitStr [get]
 The default unit used for this group in SI unit. This is the unit that is used across the calculations More...
 

Additional Inherited Members

- Protected Member Functions inherited from Greet.UnitLib.BaseQuantity
 BaseQuantity (XmlNode node)
 

Detailed Description

This is a group which contains one or more BaseGroups, this allows combining BaseGroups into more complicated groups such as HeatingValue = Energy/Mass. The references to the BaseGroups are stored in a list of Bases which contains the default and override unit and whether it is in the numerator or denominator.

Constructor & Destructor Documentation

Greet.UnitLib.DerivedQuantity.DerivedQuantity ( string  name,
string  displayName,
string  format,
string  baseString 
)

Parameters
name
displayName
format
baseStringString that contains information about base groups of this derived group, example: "volume:gallons/distance:miles"
Greet.UnitLib.DerivedQuantity.DerivedQuantity ( ref double  d1,
string  d1_unitgroupname,
ref double  d2,
string  d2_unitgroupname,
char  operation 
)

This constructor is for the DoubleValue operators, it takes the defaultUnit expressions and the operation that is being done as inputs. It parses the expressions, simplifies, and adds the appropriate groups.

Parameters
d1ValueInDefaultUnit of parameter d1
d1_unitgroupnameUnitGroupName of parameter d1
d2ValueInDefaultUnit of parameter d2
d2_unitgroupnameUnitGroupName of parameter d2
operation
Greet.UnitLib.DerivedQuantity.DerivedQuantity ( string  unitExpression)

Used for generating the derived groups "on the fly"

Parameters
unitExpressionContains name of a unit or unit group, example: meters/grams
name

Member Function Documentation

override double Greet.UnitLib.DerivedQuantity.ConvertFromDefaultToOverride ( double  valueToConvert)
virtual

Takes a value in the default unit and converts it to the user prefered unit

Parameters
valueToConvertValue in default unit to be converted
Returns
Value converted in user prefered unit

Implements Greet.UnitLib.BaseQuantity.

override double Greet.UnitLib.DerivedQuantity.ConvertFromDefaultToSpecific ( double  valueToConvert,
string  unit 
)
virtual

Converts a value represented in default unit to a specified unit (this must be a unit that belongs to the same group)

Parameters
valueToConvertValue in default unit to be converted
unitUnit that belongs to that group in which the value will be converted
Returns
The converted value in the new unit

Implements Greet.UnitLib.BaseQuantity.

override double Greet.UnitLib.DerivedQuantity.ConvertFromOverrideToDefault ( double  valueToConvert)
virtual

Takes a value in the override unit, and converts it to the default unit Usefull to parse user inputs in textboxes

Parameters
valueToConvertValue in override unit to be converted
Returns
Value converted in default unit<returns>

Implements Greet.UnitLib.BaseQuantity.

Property Documentation

string Greet.UnitLib.DerivedQuantity.BottomUnit
get

Return the first of the bottom units, use with care, we never know if there are many bottom units

BaseQuantity Greet.UnitLib.DerivedQuantity.MatchedGroup
get

Returns the group in Utils.groups that matches this DerivedGroup. Matching criteria includes containing a match for each bases (regardless of order) on the numerator and denominator. To be a matching base the group, defaultunit, and numerator must be the same (override is ignored).

string Greet.UnitLib.DerivedQuantity.TopUnit
get

Return the first of the bottom units, use with care, we never know if there are many bottom units


The documentation for this class was generated from the following file: