Greet 2014
Documentation for the GREET 2014 API
 All Classes Namespaces Functions Variables Enumerations Properties Events
Greet.DataStructureV3.GProject Class Reference
Inheritance diagram for Greet.DataStructureV3.GProject:
Greet.DataStructureV3.Interfaces.IProject

Public Member Functions

 GProject ()
 Creates an empty project, used if nothing else is loaded over More...
 
void AddFileWatcher ()
 Add the file watching system to detect if a file have been changed outside the GUI More...
 
void AutoSave (bool compress=true)
 This methods acts kind of the same way as the save function, however it does the job in another folder so the current copy of the project and the datafiles are not overwritten by the autosaves. When a Save() or SaveAs() is called the autosaves are deleted if the saving was done correctly. More...
 
void DeleteAutosaves ()
 Deletes the autosaved file, this shouldbe exectued after the user saved his project and the saving method retured true More...
 
delegate void DisplayPreferencesChanged ()
 
XmlNode GetPluginXML (string pluginName)
 Returns existing XmlNode or a new one for the plugin desiring it. Modifications to this object will not be saved More...
 
XmlDocument GetProjectDocument ()
 Returns the XmlDocument loaded for this project. Changes to it will not affect the saved data More...
 
void Load (string projectFileName)
 Loads the data from a file name after the class have been instantiated Developer Note: This method should only be used by the execution service, if needed load from execution service and not from here otherwise preprocessing will be missing as well as calls to the plugins More...
 
int PushPluginXML (string pluginName, XmlNode node)
 Allows the user to push a node to the PluginsNode collection. This node will be saved when the project is saved More...
 
void RemoveFileWatcher ()
 Remove the file watching for a specific file, will be used when saving the data More...
 
bool Save (bool compress)
 
bool SaveProjectAs (string fileName, bool autoSaving=false, bool compress=true)
 Saves the project file and the associated data in a subfolder created with the same name as the project More...
 
delegate void ValueHasChanged (bool changed)
 For the Main Form, everytime the SomeValuesHaveBeenUpdatedSinceProjectSaved accessor is set we display a little red label on the bottom left of the main form indicating that we need to save More...
 

Public Attributes

BasicParameters basicParameters = new BasicParameters()
 
DisplayPreferencesChanged DisplayPreferencesChangedEvent
 
bool fileChangedNeedsDisplayedToUser = false
 
FileInfo fileInformation = null
 
bool isLoading = false
 true: Data is currently be loaded. Not all data has been loaded at this point. More...
 
int loadingResult = 0
 0 : everything is fine 1 : data is too old and cannot be loaded 2 : Corrupted Xml structure and cannot be loaded. More...
 
XmlNode PluginsNode = null
 
ValueHasChanged ValueHasChangedEvent
 
int version = -1
 

Properties

BasicParameters BasicParameters [get, set]
 
IData Data [get, set]
 
GData Dataset [get, set]
 
FileSystemWatcher FileSystemWatcher [get]
 
MonitorValues MonitorList [get, set]
 A Collection of the monitor values for fuels in WTP More...
 
List< IMonitorMonitorValues [get]
 
bool SomeValuesHaveBeenUpdatedSinceProjectSaved [get, set]
 
int UpdateCount [get, set]
 
int Version [get, set]
 
- Properties inherited from Greet.DataStructureV3.Interfaces.IProject
IData Data [get, set]
 Entities of the loaded database More...
 
List< IMonitorMonitorValues [get]
 Monitored values More...
 
int Version [get, set]
 Get or sets the version number of the project More...
 

Constructor & Destructor Documentation

Greet.DataStructureV3.GProject.GProject ( )

Creates an empty project, used if nothing else is loaded over

Parameters
projectFileName

Member Function Documentation

void Greet.DataStructureV3.GProject.AddFileWatcher ( )

Add the file watching system to detect if a file have been changed outside the GUI

void Greet.DataStructureV3.GProject.AutoSave ( bool  compress = true)

This methods acts kind of the same way as the save function, however it does the job in another folder so the current copy of the project and the datafiles are not overwritten by the autosaves. When a Save() or SaveAs() is called the autosaves are deleted if the saving was done correctly.

void Greet.DataStructureV3.GProject.DeleteAutosaves ( )

Deletes the autosaved file, this shouldbe exectued after the user saved his project and the saving method retured true

XmlNode Greet.DataStructureV3.GProject.GetPluginXML ( string  pluginName)

Returns existing XmlNode or a new one for the plugin desiring it. Modifications to this object will not be saved

Parameters
pluginNameA plugin instance
Returns
XMLNode for the plugin

Implements Greet.DataStructureV3.Interfaces.IProject.

XmlDocument Greet.DataStructureV3.GProject.GetProjectDocument ( )

Returns the XmlDocument loaded for this project. Changes to it will not affect the saved data

Returns
XmlDocument loaded

Implements Greet.DataStructureV3.Interfaces.IProject.

void Greet.DataStructureV3.GProject.Load ( string  projectFileName)

Loads the data from a file name after the class have been instantiated Developer Note: This method should only be used by the execution service, if needed load from execution service and not from here otherwise preprocessing will be missing as well as calls to the plugins

Parameters
projectFileName
int Greet.DataStructureV3.GProject.PushPluginXML ( string  pluginName,
XmlNode  node 
)

Allows the user to push a node to the PluginsNode collection. This node will be saved when the project is saved

Parameters
pluginNameA plugin instance
nodeThe node that we want to push to the database
Returns
-1 if the name of the node, 0 if the node has been inserted, +1 if the node replaces an existing one

May throw an exceltion if the XmlNode is not created using the same Owner document or contains XMLDeclarations that should no be inserted, see Inner Exception

Implements Greet.DataStructureV3.Interfaces.IProject.

void Greet.DataStructureV3.GProject.RemoveFileWatcher ( )

Remove the file watching for a specific file, will be used when saving the data

bool Greet.DataStructureV3.GProject.SaveProjectAs ( string  fileName,
bool  autoSaving = false,
bool  compress = true 
)

Saves the project file and the associated data in a subfolder created with the same name as the project

Parameters
fileNameThe FileInfo of the project file, defines the location and name where the project will be saved
autoSavingIf true the Working File location is unchanged as it is saving to Autosave location
Returns
Returns true if the project have been saved correctly, false if there was an issue
delegate void Greet.DataStructureV3.GProject.ValueHasChanged ( bool  changed)

For the Main Form, everytime the SomeValuesHaveBeenUpdatedSinceProjectSaved accessor is set we display a little red label on the bottom left of the main form indicating that we need to save

Parameters
changed

Member Data Documentation

bool Greet.DataStructureV3.GProject.isLoading = false

true: Data is currently be loaded. Not all data has been loaded at this point.

int Greet.DataStructureV3.GProject.loadingResult = 0

0 : everything is fine 1 : data is too old and cannot be loaded 2 : Corrupted Xml structure and cannot be loaded.

Property Documentation

MonitorValues Greet.DataStructureV3.GProject.MonitorList
getset

A Collection of the monitor values for fuels in WTP


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