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

To be used to perform calculations with physical quantities. An instance of LightValue can be in one of 3 states: 1) formula is null, quantity is NOT null, preffered_unit is NOT null, quantaty.Units.Count less then preffered_unit. In this state the LightValue is aware of the quantity associated with it and what is the preferred units to be used for reports or GUI 2) formula is NOT null, quantity is NOT null, preffered_unit is null. In this state LightValue is aware of the quantity associated with it and units to be used in GUI/Reports are defined by formula. The dimensions of the units in formula must be the same as of the Quantity 3) formula is NOT null, quantity is null, preffered_unit is null. In this state LightValue is not aware of the quantity associated with it, it can happen as a result of * or / operations or user-entering units combination that cannot be matched to any of the defined quantities. In this state units defined in formula are to be used as preferred units to be used in GUI/Reports. Also, in this state user cannot choose in what units the value is to be displayed and will be limited to the choice of SI units or those defined in formula More...

Public Member Functions

 LightValue (double val_, Dimension dim_)
 Creates a new LightValue object using a value in SI unit and an instance of a Dimension Warning the instance of the Dimension will be used as is as a reference. If one needs a new isntance of a Dimension it must be cloned first More...
 
 LightValue (double val_, uint dim_)
 Creates a new LightValue object using a value in SI unit and creates a new instance of a Dimension using the uint representation of the SI unit More...
 
 LightValue (double val_, string quant_name, int pref_unit_id)
 Creates a new LightValue object using a value in SI unit and creates a new instance of a Dimension using a base quantity name and prefered unit id More...
 
 LightValue (string expression)
 
 LightValue (double val_, string expression)
 
override string ToString ()
 
void UpdateValue (string expression)
 This method takes a string such as 23 g/Btu and checks if it is the same quantity as currenntly stored. If it is it updates the Value member of the object, if not it throws exception More...
 

Static Public Member Functions

static LightValue operator* (LightValue a, LightValue b)
 
static LightValue operator* (LightValue a, double b)
 
static LightValue operator+ (LightValue a, LightValue b)
 The preferred unit of the first summand will be used if any More...
 
static LightValue operator+ (LightValue a, double b)
 
static LightValue operator- (LightValue a, LightValue b)
 
static LightValue operator- (LightValue a)
 
static LightValue operator/ (LightValue a, LightValue b)
 
static LightValue operator/ (LightValue a, double b)
 
static LightValue operator/ (double a, LightValue b)
 

Properties

Dimension Dim [get, set]
 
double Value [get, set]
 The value in SI units More...
 

Detailed Description

To be used to perform calculations with physical quantities. An instance of LightValue can be in one of 3 states: 1) formula is null, quantity is NOT null, preffered_unit is NOT null, quantaty.Units.Count less then preffered_unit. In this state the LightValue is aware of the quantity associated with it and what is the preferred units to be used for reports or GUI 2) formula is NOT null, quantity is NOT null, preffered_unit is null. In this state LightValue is aware of the quantity associated with it and units to be used in GUI/Reports are defined by formula. The dimensions of the units in formula must be the same as of the Quantity 3) formula is NOT null, quantity is null, preffered_unit is null. In this state LightValue is not aware of the quantity associated with it, it can happen as a result of * or / operations or user-entering units combination that cannot be matched to any of the defined quantities. In this state units defined in formula are to be used as preferred units to be used in GUI/Reports. Also, in this state user cannot choose in what units the value is to be displayed and will be limited to the choice of SI units or those defined in formula

Constructor & Destructor Documentation

Greet.UnitLib2.LightValue.LightValue ( double  val_,
Dimension  dim_ 
)

Creates a new LightValue object using a value in SI unit and an instance of a Dimension Warning the instance of the Dimension will be used as is as a reference. If one needs a new isntance of a Dimension it must be cloned first

Parameters
val_Value in SI unit
dim_Instance of a Dimension to be used by this LightValue
Greet.UnitLib2.LightValue.LightValue ( double  val_,
uint  dim_ 
)

Creates a new LightValue object using a value in SI unit and creates a new instance of a Dimension using the uint representation of the SI unit

Parameters
val_Value in SI unit
dim_SI Unit Representation
Greet.UnitLib2.LightValue.LightValue ( double  val_,
string  quant_name,
int  pref_unit_id 
)

Creates a new LightValue object using a value in SI unit and creates a new instance of a Dimension using a base quantity name and prefered unit id

Parameters
val_Value in SI unit
quant_nameBaseQuantity name
pref_unit_idPrefered unit ID
Greet.UnitLib2.LightValue.LightValue ( string  expression)

Parses an expression containing a value and SI units to create new object and new instance of a Dimension

The string must be in the form "0.0 kg" where a space char separates the numerical value from the unit expression

The unit expression can use any of the units available from the Context units

Parameters
expressionString expression to be parsed
Greet.UnitLib2.LightValue.LightValue ( double  val_,
string  expression 
)

Parses an expression containing a value and SI units to create new object and new instance of a Dimension

The value must be expressed in the same unit as the expression parameter

The unit expression can use any of the units available from the Context units

Parameters
val_Value in the units specified in expression string
expressionString contains the expression for the units, example: J/kg

Member Function Documentation

static LightValue Greet.UnitLib2.LightValue.operator+ ( LightValue  a,
LightValue  b 
)
static

The preferred unit of the first summand will be used if any

Parameters
a
b
Returns
void Greet.UnitLib2.LightValue.UpdateValue ( string  expression)

This method takes a string such as 23 g/Btu and checks if it is the same quantity as currenntly stored. If it is it updates the Value member of the object, if not it throws exception

Parameters
expression

Property Documentation

double Greet.UnitLib2.LightValue.Value
getset

The value in SI units


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