Greet 2014
Documentation for the GREET 2014 API
 All Classes Namespaces Functions Variables Enumerations Properties Events
Greet.DataStructureV3.Entities.Parameter Class Reference

A class used to store a parameter of an entity for the GREET model. Can be displayed in a DBTextBox in the GUI. All Parameters must have a unique ID and be registered to the list of Parameters in the database. Parameters should never be created as the result of an formula, if a result is necessary use LightValue instead. More...

Inheritance diagram for Greet.DataStructureV3.Entities.Parameter:
Greet.DataStructureV3.Interfaces.IParameter Greet.DataStructureV3.IHaveMetadata Greet.ConvenienceLib.IXmlAttr

Public Member Functions

 Parameter (SerializationInfo info, StreamingContext text)
 Constructor for derserialisation, avoid cloning the unit group see the GetObjectData method More...
 
int CompareTo (object obj)
 Compare the actual double value to another double value given as a parameter More...
 
void GetObjectData (SerializationInfo info, StreamingContext context)
 Serializer, serialise everything we do that because we want to override the deserializer which clones the unitgroup we dont want to clone the unit group so basically we specify how to serialize, and how to deserialize More...
 
LightValue ToLightValue ()
 
UnitLib2.LightValue ToLightValue2 ()
 
override string ToString ()
 Override for ToString, returns Value More...
 
XmlAttribute ToXmlAttribute (XmlDocument xmlDocument, String attribute_name)
 Creates an XML node to save that value in the DB files.
 
void UpdateBuffers (GData data, Guid tracer=new Guid())
 Evaluates all formulas in the parameter and populates the buffers More...
 
delegate void ValueChangedDelegate ()
 
virtual double ValueInSpecificUnit (Unit unit)
 Outputs the value in a user specified unit, the unis has to be in the same unit group as the current unit group of that doubleValue More...
 
- Public Member Functions inherited from Greet.ConvenienceLib.IXmlAttr
XmlAttribute ToXmlAttribute (XmlDocument xmlDoc, string name)
 

Static Public Member Functions

static LightValue operator* (Parameter d1, Parameter d2)
 
static LightValue operator* (Parameter d1, LightValue d2)
 
static LightValue operator* (LightValue d1, Parameter d2)
 
static LightValue operator* (double d1, Parameter d2)
 
static LightValue operator* (Parameter d1, double d2)
 
static LightValue operator+ (Parameter d1, Parameter d2)
 
static LightValue operator+ (Parameter d1, LightValue d2)
 
static LightValue operator+ (LightValue d1, Parameter d2)
 
static LightValue operator+ (Parameter d1, double d2)
 
static LightValue operator+ (double d1, Parameter d2)
 
static LightValue operator- (Parameter d1, Parameter d2)
 
static LightValue operator- (Parameter d1, LightValue d2)
 
static LightValue operator- (LightValue d1, Parameter d2)
 
static LightValue operator- (Parameter d1, double d2)
 
static LightValue operator- (double d1, Parameter d2)
 
static LightValue operator- (Parameter d1)
 
static LightValue operator/ (Parameter d1, Parameter d2)
 
static LightValue operator/ (Parameter d1, LightValue d2)
 
static LightValue operator/ (LightValue d1, Parameter d2)
 
static LightValue operator/ (Parameter d1, double d2)
 
static LightValue operator/ (double d1, Parameter d2)
 

Public Attributes

ValueChangedDelegate ValueChanged
 

Protected Member Functions

virtual void OnEvent (EventArgs e)
 

Properties

string Abbrev [get]
 Returns the abbreviation of the preferred unit More...
 
string BottomDim [get]
 If the the dimensions have bottom part this accessor returns one of them, i.e this accessor has to be used carefully and only in cases when the bottom part of the ratio has one dimension. More...
 
string CurrentFormula [get, set]
 
UnitLib2.Dimension Dim [get, set]
 
string DisplayForFormula [get, set]
 
double GreetValue [get, set]
 The value originally stored in this double value from the database or a default value More...
 
virtual double GreetValueInOverrideUnitDouble [get, set]
 Converts default Value to the unit defined in the preferences and returns it as a double. Setting it does the back conversion More...
 
string Id [get, set]
 Unique ID among all the parameters, used to track each parameter for the stochastic simulations or reporting More...
 
string Identifier [get, set]
 Returns Id if no Name is defined else returns Name. Sets the Name More...
 
string ModifiedBy [get, set]
 
string ModifiedOn [get, set]
 
string Name [get, set]
 Unique Name among all the parameters, used as Alias to each parameter for the stochastic simulations or reporting More...
 
string Notes [get, set]
 
string UnitGroupName [get, set]
 
bool UseOriginal [get, set]
 Determines whether to use original or user value More...
 
double UserValue [get, set]
 The user defined value that can be used instead of the original value. More...
 
virtual double UserValueInOverrideUnitDouble [get, set]
 Converts User Value to the unit defined in the preferences and returns it as a double. Setting it does the back conversion More...
 
double ValueInDefaultUnit [get, set]
 Gets or sets the original value if UseOriginal is set or overriden otherwise More...
 
- Properties inherited from Greet.DataStructureV3.Interfaces.IParameter
string CurrentFormula [get, set]
 Returns the formula in use for the parameter (in default unit) In case a formula is used there will be a string here and the GreetValue and UserValue needs to be calculated from that formula If there is no string in here, it means that the parameter is not using a formula, therefore the UserValue and GreetValue do not need to be refreshed More...
 
double GreetValue [get, set]
 Default or "original" value of the parameter in default unit More...
 
string Id [get]
 Unique ID for the parameter. More...
 
string Name [get]
 Unique Name for the parameter. More...
 
string UnitGroupName [get]
 Unit or group of the parameter. More...
 
bool UseOriginal [get, set]
 Defines weather the calculations should use the original value or the user value True uses the original, false uses the override More...
 
double UserValue [get, set]
 Use override value for the parameter in default unit More...
 

Detailed Description

A class used to store a parameter of an entity for the GREET model. Can be displayed in a DBTextBox in the GUI. All Parameters must have a unique ID and be registered to the list of Parameters in the database. Parameters should never be created as the result of an formula, if a result is necessary use LightValue instead.

Constructor & Destructor Documentation

Greet.DataStructureV3.Entities.Parameter.Parameter ( SerializationInfo  info,
StreamingContext  text 
)

Constructor for derserialisation, avoid cloning the unit group see the GetObjectData method

Parameters
info
text

Member Function Documentation

int Greet.DataStructureV3.Entities.Parameter.CompareTo ( object  obj)

Compare the actual double value to another double value given as a parameter

Parameters
objThe double value to compare to
Returns
Returns 0 if their values are equal, -1 if the value of the current one is less than the parameter, and +1 if the current one is greated than the parameter
void Greet.DataStructureV3.Entities.Parameter.GetObjectData ( SerializationInfo  info,
StreamingContext  context 
)

Serializer, serialise everything we do that because we want to override the deserializer which clones the unitgroup we dont want to clone the unit group so basically we specify how to serialize, and how to deserialize

Parameters
info
context
override string Greet.DataStructureV3.Entities.Parameter.ToString ( )

Override for ToString, returns Value

Returns
void Greet.DataStructureV3.Entities.Parameter.UpdateBuffers ( GData  data,
Guid  tracer = new Guid() 
)

Evaluates all formulas in the parameter and populates the buffers

Parameters
dataThe datacontext to find potential references to other parameters
guidA GUID that will be used to parse all parameters, used to avoid parsing twice the same parameter if used in multiple formulas
virtual double Greet.DataStructureV3.Entities.Parameter.ValueInSpecificUnit ( Unit  unit)
virtual

Outputs the value in a user specified unit, the unis has to be in the same unit group as the current unit group of that doubleValue

Parameters
unit
Returns

Property Documentation

string Greet.DataStructureV3.Entities.Parameter.Abbrev
get

Returns the abbreviation of the preferred unit

string Greet.DataStructureV3.Entities.Parameter.BottomDim
get

If the the dimensions have bottom part this accessor returns one of them, i.e this accessor has to be used carefully and only in cases when the bottom part of the ratio has one dimension.

double Greet.DataStructureV3.Entities.Parameter.GreetValue
getset

The value originally stored in this double value from the database or a default value

virtual double Greet.DataStructureV3.Entities.Parameter.GreetValueInOverrideUnitDouble
getset

Converts default Value to the unit defined in the preferences and returns it as a double. Setting it does the back conversion

string Greet.DataStructureV3.Entities.Parameter.Id
getset

Unique ID among all the parameters, used to track each parameter for the stochastic simulations or reporting

string Greet.DataStructureV3.Entities.Parameter.Identifier
getset

Returns Id if no Name is defined else returns Name. Sets the Name

string Greet.DataStructureV3.Entities.Parameter.Name
getset

Unique Name among all the parameters, used as Alias to each parameter for the stochastic simulations or reporting

bool Greet.DataStructureV3.Entities.Parameter.UseOriginal
getset

Determines whether to use original or user value

double Greet.DataStructureV3.Entities.Parameter.UserValue
getset

The user defined value that can be used instead of the original value.

virtual double Greet.DataStructureV3.Entities.Parameter.UserValueInOverrideUnitDouble
getset

Converts User Value to the unit defined in the preferences and returns it as a double. Setting it does the back conversion

double Greet.DataStructureV3.Entities.Parameter.ValueInDefaultUnit
getset

Gets or sets the original value if UseOriginal is set or overriden otherwise


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