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

This class manages units, unit groups, and parameters and provides Conversion between More...

Static Public Member Functions

static Unit AddUnit (string unitName, string unitAbbrev, double a, double b, string baseGroupName)
 
static double FormatPrefix (double valueInOverrideUnit, BaseQuantity unit_group, out string prefixedUnit, out int power)
 Takes as an input a value in override unit and tries to multiply or divide by 10 until a prefix can be found for the top and or bottom unit. Returns the values and outptus the new unit to be shown and power of 10 used to convert from the prefixed value to the value in override unit. More...
 
static string FormatSIValue (double valueSI, int format, string groupName, out string prefixedUnit, out int power, bool automaticScaling, int scientificFigures)
 Formats a value according to the options chosen by the user in the main form More...
 
static bool ReadDB (XmlNode rootNode)
 
static void RemoveUnit (Unit remUnit)
 
static double RoundToSigFigs (this double value, int sigFigures)
 
static XmlNode SaveDB (XmlDocument xmlDoc)
 
static List< List< string > > SplitString (string unitExpression, bool invert, bool simplify=true)
 

Properties

static QuantityList QuantityList [get, set]
 Contains all of the unit groups. More...
 
static Dictionary< string, UnitUnitsList [get, set]
 Contains all of the units
 

Detailed Description

This class manages units, unit groups, and parameters and provides Conversion between

Member Function Documentation

static double Greet.UnitLib.Units.FormatPrefix ( double  valueInOverrideUnit,
BaseQuantity  unit_group,
out string  prefixedUnit,
out int  power 
)
static

Takes as an input a value in override unit and tries to multiply or divide by 10 until a prefix can be found for the top and or bottom unit. Returns the values and outptus the new unit to be shown and power of 10 used to convert from the prefixed value to the value in override unit.

Example: Calling the method with FormatPrefix(1250000, "energy", unit, pow); will return 1.25, unit = mmBtu, pow = 6

Parameters
valueInOverrideUnitValue in override unit to be converted
unit_groupUnit group in which the value is defined
prefixedUnitReturns the unit and prefixes if necessary
powerReturns the power of 10 used for the conversion
Returns
Returns the value multiplied by the power of 10 returned
static string Greet.UnitLib.Units.FormatSIValue ( double  valueSI,
int  format,
string  groupName,
out string  prefixedUnit,
out int  power,
bool  automaticScaling,
int  scientificFigures 
)
static

Formats a value according to the options chosen by the user in the main form

Parameters
valueSIThe numerical value to be formated
formatOptional format: 0 unitGroupFormat, 1 scientific notation, 2 all digits
groupNameThe unit or unit group in which this value is represented
prefixedUnitReturns the unit and prefixes if necessary
powerReturns the power of 10 used for the conversion
automaticScalingIf scaling is selected in the options the method will use prefixes like k for kilo, M for mega... Setting this option to false will disable that automatic scaling feature whatever the user selection is
Returns
Formated value

Property Documentation

QuantityList Greet.UnitLib.Units.QuantityList
staticgetset

Contains all of the unit groups.


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