Greet 2014
Documentation for the GREET 2014 API
|
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... | |
void | ExportResultsToXml (string fileName) |
Export the calculated results in an xml file 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... | |
Dictionary< int, string > | GetResourcesGroups () |
This methods access the resource groups available in the loaded database and returns a dictionary containing their unique IDs and their Names. More... | |
Dictionary< string, IResults > | GetVehicleResults (GData data, int simulationRun, int vehicleID) |
Get a dictionary representing the vehicle results, the key may be "wtw", "wtp" or "ptw" the values represents the results associated with each items More... | |
IResults | GetVehicleResults (IData data, int vehicleID) |
Get a dictionary representing the vehicle results, the key may be "wtw", "wtp" or "ptw" the values represents the results associated with each items More... | |
void | LoadPlugIns () |
IProject | LoadProjectFile (string filename) |
delegate void | NewProjectLoaded (string fileName) |
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 testMinMaxMonitor) |
Starts the simulations and waits it to be done before returning More... | |
void | RunSimalationAsync () |
Starts asynchronously the simulations More... | |
string | SaveProject (IProject project, string fileName) |
Saves the given project to a file More... | |
void | TellFinalize () |
Called when GREET main routine ends, triggers an event for all the plugin in order to warn them to finalize. This is the last call before everything gets unallocated from the memory More... | |
void | TellMainFormClosing () |
Called when GREET main form is getting closed. After that we'll check if the data has been changed and prompt the user to save the file More... | |
Public Attributes | |
NewProjectLoaded | NewProjectLoadedEvent |
GData.ReadingXMLFilesInProgressEvent | ReadingDataInProgressEvent |
Properties | |
IProject | CurrentProject [get] |
Returns the project currently in use in GREET More... | |
Dictionary< string, IQuantity > | UnitGroupsAvailable [get] |
Dictionary< string, IUnit > | UnitsAvailable [get] |
Properties inherited from Greet.Model.Interfaces.IGREETController | |
IProject | CurrentProject [get] |
Returns the project currently in use More... | |
Dictionary< string, IQuantity > | UnitGroupsAvailable [get] |
Returns a dictionary with unit groups available in GREET More... | |
Dictionary< string, IUnit > | UnitsAvailable [get] |
Returns a dictionary with units available in GREET More... | |
Events | |
EventHandler | CalculationsFinished |
Events inherited from Greet.Model.Interfaces.IGREETController | |
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... | |
void Greet.Model.ModelControler.Compress | ( | Stream | inp, |
Stream | outp | ||
) |
Uses an input stream and compresses it using deflate
inp | Not compressed stream |
outp | Compressed stream |
Implements Greet.Model.Interfaces.IGREETController.
void Greet.Model.ModelControler.Decompress | ( | Stream | inp, |
Stream | outp | ||
) |
Uses an input stream and decompresses it
inp | Compressed input stream to be compressed |
outp | Decompressed stream using deflate |
Implements Greet.Model.Interfaces.IGREETController.
string Greet.Model.ModelControler.DownloadDatabaseFromServer | ( | int | revNumber = 0 | ) |
Orders the software to download a specific version of the database from the webservice
revNumber |
Implements Greet.Model.Interfaces.IGREETController.
void Greet.Model.ModelControler.ExportResultsToXml | ( | string | fileName | ) |
Export the calculated results in an xml file
fileName | Full path for the XML file to be written |
string Greet.Model.ModelControler.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
valueSIUnit | The numerical value to be formated |
SIUnitOrGroup | The unit or unit group in which this value is represented |
format | Format: -1 GUI user preference, 0 unit specific, 1 scientific notation, 2 all digits |
scaleIfSelected | If format is different than -1, scaling is selected in the options the method will use prefixes like k for kilo, M for mega... |
scientificFigures | If format is 1, then this parameter set how many digits are displayed for scientific notation |
Implements Greet.Model.Interfaces.IGREETController.
string Greet.Model.ModelControler.GetDefaultFolder | ( | ) |
Get the default folder used by GREET to store data, by default the MyDocument/Greet folder
Implements Greet.Model.Interfaces.IGREETController.
int Greet.Model.ModelControler.GetModelYear | ( | ) |
Returns the current modeling year chosen by the user
Implements Greet.Model.Interfaces.IGREETController.
Dictionary<int, string> Greet.Model.ModelControler.GetResourcesGroups | ( | ) |
This methods access the resource groups available in the loaded database and returns a dictionary containing their unique IDs and their Names.
Dictionary<string, IResults> Greet.Model.ModelControler.GetVehicleResults | ( | GData | data, |
int | simulationRun, | ||
int | vehicleID | ||
) |
Get a dictionary representing the vehicle results, the key may be "wtw", "wtp" or "ptw" the values represents the results associated with each items
vehicleID | The desired vehicle ID |
Get a dictionary representing the vehicle results, the key may be "wtw", "wtp" or "ptw" the values represents the results associated with each items
vehicleID | The desired vehicle ID |
IProject Greet.Model.ModelControler.LoadProjectFile | ( | string | filename | ) |
Load a data file.
If the given file is saved using an old format, it will be converted first, and a backup of the old version will be saved
filename | Filename of the datafile to load |
Implements Greet.Model.Interfaces.IGREETController.
void Greet.Model.ModelControler.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
fileName | Full file path + name for the database to be opened |
rememberLastDatabase | If set to true, next time GREET opens this file will be loaded automatically |
Implements Greet.Model.Interfaces.IGREETController.
void Greet.Model.ModelControler.RunSimalation | ( | bool | testMinMaxMonitor | ) |
Starts the simulations and waits it to be done before returning
Implements Greet.Model.Interfaces.IGREETController.
void Greet.Model.ModelControler.RunSimalationAsync | ( | ) |
Starts asynchronously the simulations
Implements Greet.Model.Interfaces.IGREETController.
string Greet.Model.ModelControler.SaveProject | ( | IProject | project, |
string | fileName | ||
) |
Saves the given project to a file
project | The project to save, can be the current project |
fileName | Filename to be used to create the data file |
Implements Greet.Model.Interfaces.IGREETController.
void Greet.Model.ModelControler.TellFinalize | ( | ) |
Called when GREET main routine ends, triggers an event for all the plugin in order to warn them to finalize. This is the last call before everything gets unallocated from the memory
void Greet.Model.ModelControler.TellMainFormClosing | ( | ) |
Called when GREET main form is getting closed. After that we'll check if the data has been changed and prompt the user to save the file
|
get |
Returns the project currently in use in GREET