Greet 2014
Documentation for the GREET 2014 API
|
Builds on DimensionUtils and IQuantity. It allows to store dimension as a single integer or as a quantity. Along with quantity it stores the index of the preferred unit from the Units list of IQUanitty. There are multiple states the class can be. Here Q = quantity is NOT null E = expression is NOT null P = preffered_unit is NOT -1 D = dim is NOT null More...
Public Member Functions | |
Dimension (uint dim_, string expression_=null) | |
Dimension (string q_name, int?preferred_unit_index=null) | |
Dimension | Clone () |
double | InPreferredUnitsD (double si_val) |
Performs unit conversion to the preferred units, if defined. More... | |
void | InPreferredUnitsS (double val, out double display_val, out string display_expression) |
Performs conversion to preferred units (if defined) and returns a string. For example for quantity energy, if preferred units are Btu and val = 1500, then the function will return "1.42172568 Btu". If preferred units are not defined, it just returns "1500 J" More... | |
double | InSIUnitsD (double val) |
Performs unit conversion to the SI units More... | |
string | InSIUnitsS (double val) |
Performs conversion to SI units and returns a string. For example for quantity energy, if preferred units are Btu and val = 1.42172568 , then the function will return "1500 J". If preferred units are not defined, it just returns "1.42172568 J" More... | |
string | PreferredUnit () |
String | ToAttributeValue () |
Static Public Member Functions | |
static Dimension | FromAttributeValue (string p) |
static Dimension | operator* (Dimension a, Dimension b) |
static Dimension | operator+ (Dimension a, Dimension b) |
static Dimension | operator- (Dimension a, Dimension b) |
static Dimension | operator/ (Dimension a, Dimension b) |
Properties | |
uint | Dim [get, set] |
Returns the dimensions of the Quantity. If quantity is not defined, returns value of dim attribute of the object, throws DimensionStateException otherwise More... | |
string | PreferedExpression [get] |
Formula that represents the dimensions of the value, i.e. "lb/gal" for mass density More... | |
int | Preffered_unit_id [get, set] |
Stores index of the Unit object from Quantity.Units list. Makes sense only if Quantity is not null. If preferred unit is not defined for this object, returns preferred unit of associated Quantity When quantity is not defined, returns -1 More... | |
string | pu_expression [get, set] |
string | QuantityName [get] |
Quantity associated with the value. Can be null! More... | |
Builds on DimensionUtils and IQuantity. It allows to store dimension as a single integer or as a quantity. Along with quantity it stores the index of the preferred unit from the Units list of IQUanitty. There are multiple states the class can be. Here Q = quantity is NOT null E = expression is NOT null P = preffered_unit is NOT -1 D = dim is NOT null
Q&D = 0; E&P = 0; D&P = 0 Here are passable states When Q=1, user can convert the value between SI units and those defined for the quantity When E=1, user can convert the value between SI units and those defined by expression, provided that units in expression are defined in database, i.e. for expression "Btu/lb" both Btu and lb must be associated with a quantity. When P=1, the user can specify preferred units to be used in GUI/Reports When D=1, the quantity is defined by base base SI dimensions as in DimensionUtils. To be used when the quantity is not defined in the database, or looking up in database has performance implications.
| 1 | 0 | 1 | 0 | | 1 | 0 | 0 | 0 | | 1 | 1 | 0 | 0 | | 0 | 0 | 0 | 1 | | 0 | 1 | 0 | 1 |
Greet.UnitLib2.Dimension.Dimension | ( | string | q_name, |
int? | preferred_unit_index = null |
||
) |
q_name | Cannot be null nor empty, ArgumentException will be thrown otherwise |
preferred_unit_index | Has to be null or less then the length of Quantity.Units, DimensionStateException will be thrown otherwise |
double Greet.UnitLib2.Dimension.InPreferredUnitsD | ( | double | si_val | ) |
Performs unit conversion to the preferred units, if defined.
si_val | The value in SI units |
void Greet.UnitLib2.Dimension.InPreferredUnitsS | ( | double | val, |
out double | display_val, | ||
out string | display_expression | ||
) |
Performs conversion to preferred units (if defined) and returns a string. For example for quantity energy, if preferred units are Btu and val = 1500, then the function will return "1.42172568 Btu". If preferred units are not defined, it just returns "1500 J"
val | The value in SI units |
double Greet.UnitLib2.Dimension.InSIUnitsD | ( | double | val | ) |
Performs unit conversion to the SI units
val | The value in prefered units units |
string Greet.UnitLib2.Dimension.InSIUnitsS | ( | double | val | ) |
Performs conversion to SI units and returns a string. For example for quantity energy, if preferred units are Btu and val = 1.42172568 , then the function will return "1500 J". If preferred units are not defined, it just returns "1.42172568 J"
val | The value in SI units |
|
getset |
Returns the dimensions of the Quantity. If quantity is not defined, returns value of dim attribute of the object, throws DimensionStateException otherwise
|
get |
Formula that represents the dimensions of the value, i.e. "lb/gal" for mass density
|
getset |
|
get |
Quantity associated with the value. Can be null!