Greet 2014
Documentation for the GREET 2014 API
 All Classes Namespaces Functions Variables Enumerations Properties Events
Greet.Model.Interfaces.IGREETController Interface Reference

An interface that defines what methods and events can be used in order to interact with the GREET software More...

Inheritance diagram for Greet.Model.Interfaces.IGREETController:
Greet.Model.ModelControler

Public Member Functions

void Compress (Stream inp, Stream outp)
 Uses an input stream and compresses it using deflate More...
 
void Decompress (Stream inp, Stream outp)
 Uses an input stream and decompresses it More...
 
string DownloadDatabaseFromServer (int revNumber=0)
 Orders the software to download a specific version of the database from the webservice More...
 
string FormatValue (double valueSIUnit, string SIUnitOrGroup, int format=-1, bool scaleIfSelected=true, int scientificFigures=4)
 Formats a value according to the options chosen by the user in the main form More...
 
string GetDefaultFolder ()
 Get the default folder used by GREET to store data, by default the MyDocument/Greet folder More...
 
int GetModelYear ()
 Returns the current modeling year chosen by the user More...
 
IProject LoadProjectFile (string filename)
 Loads a project file and returns the project object with the data. More...
 
void OpenProject (string fileName, bool rememberLastDatabase)
 Orders the main GUI to open a specific file as the current project Warning this will simply discard the currently loaded data and all changes that are not saved to a real file When the new file is loaded into the main form, the onDatabaseLoaded method will be called for all plugins More...
 
void RunSimalation (bool textMinMaxMonitors)
 Asks GREET to run the simulation and computes the model More...
 
void RunSimalationAsync ()
 Asks GREET to run the simulation and computes the model More...
 
string SaveProject (IProject project, string fileName)
 Saves the given project to a file More...
 

Properties

IProject CurrentProject [get]
 Returns the project currently in use More...
 
Dictionary< string, IQuantityUnitGroupsAvailable [get]
 Returns a dictionary with unit groups available in GREET More...
 
Dictionary< string, IUnitUnitsAvailable [get]
 Returns a dictionary with units available in GREET More...
 

Events

EventHandler CalculationFinished
 When the calculations are done, this event fires up to warn any plugin that we are going to have some results available now. More...
 

Detailed Description

An interface that defines what methods and events can be used in order to interact with the GREET software

Member Function Documentation

void Greet.Model.Interfaces.IGREETController.Compress ( Stream  inp,
Stream  outp 
)

Uses an input stream and compresses it using deflate

Parameters
inpNot compressed stream
outpCompressed stream

Implemented in Greet.Model.ModelControler.

void Greet.Model.Interfaces.IGREETController.Decompress ( Stream  inp,
Stream  outp 
)

Uses an input stream and decompresses it

Parameters
inpCompressed input stream to be compressed
outpDecompressed stream using deflate

Implemented in Greet.Model.ModelControler.

string Greet.Model.Interfaces.IGREETController.DownloadDatabaseFromServer ( int  revNumber = 0)

Orders the software to download a specific version of the database from the webservice

Parameters
revNumber
Returns

Implemented in Greet.Model.ModelControler.

string Greet.Model.Interfaces.IGREETController.FormatValue ( double  valueSIUnit,
string  SIUnitOrGroup,
int  format = -1,
bool  scaleIfSelected = true,
int  scientificFigures = 4 
)

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

Parameters
valueSIUnitThe numerical value to be formated
SIUnitOrGroupThe unit or unit group in which this value is represented
formatFormat: -1 GUI user preference, 0 unit specific, 1 scientific notation, 2 all digits
scaleIfSelectedIf format is different than -1, scaling is selected in the options the method will use prefixes like k for kilo, M for mega...
scientificFiguresIf format is 1, then this parameter set how many digits are displayed for scientific notation
Returns
Formatted value according to the desired format option

Implemented in Greet.Model.ModelControler.

string Greet.Model.Interfaces.IGREETController.GetDefaultFolder ( )

Get the default folder used by GREET to store data, by default the MyDocument/Greet folder

Returns

Implemented in Greet.Model.ModelControler.

int Greet.Model.Interfaces.IGREETController.GetModelYear ( )

Returns the current modeling year chosen by the user

Returns

Implemented in Greet.Model.ModelControler.

IProject Greet.Model.Interfaces.IGREETController.LoadProjectFile ( string  filename)

Loads a project file and returns the project object with the data.

Parameters
filename
Returns

Implemented in Greet.Model.ModelControler.

void Greet.Model.Interfaces.IGREETController.OpenProject ( string  fileName,
bool  rememberLastDatabase 
)

Orders the main GUI to open a specific file as the current project Warning this will simply discard the currently loaded data and all changes that are not saved to a real file When the new file is loaded into the main form, the onDatabaseLoaded method will be called for all plugins

Parameters
fileNameFull file path + name for the database to be opened
rememberLastDatabaseIf set to true, next time GREET opens this file will be loaded automatically

Implemented in Greet.Model.ModelControler.

void Greet.Model.Interfaces.IGREETController.RunSimalation ( bool  textMinMaxMonitors)

Asks GREET to run the simulation and computes the model

Implemented in Greet.Model.ModelControler.

void Greet.Model.Interfaces.IGREETController.RunSimalationAsync ( )

Asks GREET to run the simulation and computes the model

Implemented in Greet.Model.ModelControler.

string Greet.Model.Interfaces.IGREETController.SaveProject ( IProject  project,
string  fileName 
)

Saves the given project to a file

Parameters
projectThe project to save, can be the current project
fileNameFilename to be used to create the data file
Returns

Implemented in Greet.Model.ModelControler.

Property Documentation

IProject Greet.Model.Interfaces.IGREETController.CurrentProject
get

Returns the project currently in use

Dictionary<string, IQuantity> Greet.Model.Interfaces.IGREETController.UnitGroupsAvailable
get

Returns a dictionary with unit groups available in GREET

Dictionary<string, IUnit> Greet.Model.Interfaces.IGREETController.UnitsAvailable
get

Returns a dictionary with units available in GREET

Event Documentation

EventHandler Greet.Model.Interfaces.IGREETController.CalculationFinished

When the calculations are done, this event fires up to warn any plugin that we are going to have some results available now.


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