|
| ~GlobalSettings () |
|
Model * | model () const |
|
ModelController * | controller () const |
|
void | setModel (Model *model) |
|
void | setModelController (ModelController *mc) |
|
int | currentYear () const |
|
void | setCurrentYear (const int year) |
|
QString | executeJavascript (const QString &command) |
| access the global QScriptEngine used throughout the model for all Javascript related functionality. More...
|
|
QString | executeJSFunction (const QString function_name) |
| execute a javasript function in the global context More...
|
|
QJSEngine * | scriptEngine () const |
|
void | resetScriptEngine () |
| re-creates the script engine (when the Model is re-created) More...
|
|
SystemStatistics * | systemStatistics () |
|
void | setDebugOutput (const int debug) |
|
void | setDebugOutput (const DebugOutputs dbg, const bool enable=true) |
| enable/disable a specific output type. More...
|
|
bool | isDebugEnabled (const DebugOutputs dbg) |
| returns true, if a specific debug outut type is enabled. More...
|
|
int | currentDebugOutput () const |
|
QString | debugOutputName (const DebugOutputs d) |
| returns the name attached to 'd' or an empty string if not found More...
|
|
DebugOutputs | debugOutputId (const QString debug_name) |
| returns the DebugOutputs bit or 0 if not found More...
|
|
DebugList & | debugList (const int ID, const DebugOutputs dbg) |
| returns a ref to a list ready to be filled with debug output of a type/id combination. More...
|
|
const QList< const DebugList * > | debugLists (const int ID, const DebugOutputs dbg) |
| return a list of debug outputs More...
|
|
QStringList | debugListCaptions (const DebugOutputs dbg) |
| returns stringlist of captions for a specific output type More...
|
|
QList< QPair< QString, QVariant > > | debugValues (const int ID) |
| all debug values for object with given ID More...
|
|
void | clearDebugLists () |
| clear all debug data More...
|
|
QStringList | debugDataTable (GlobalSettings::DebugOutputs type, const QString separator, const QString fileName=QString(), const bool do_append=false) |
| output for all available items (trees, ...) in table form or write to a file More...
|
|
QSqlDatabase | dbin () |
|
QSqlDatabase | dbout () |
|
QSqlDatabase | dbclimate () |
|
QString | path (const QString &fileName, const QString &type="home") |
| extend the file to a full absoulte path of the given type (temp, home, ...). More...
|
|
bool | fileExists (const QString &fileName, const QString &type="home") |
| returns true if file fileName exists. More...
|
|
const XmlHelper & | settings () const |
|
void | loadProjectFile (const QString &fileName) |
|
bool | setupDatabaseConnection (const QString &dbname, const QString &fileName, bool fileMustExist) |
|
void | clearDatabaseConnections () |
| shutdown and clear connections More...
|
|
OutputManager * | outputManager () |
|
void | setupDirectories (QDomElement pathNode, const QString &projectFilePath) |
|
void | printDirectories () const |
|
General settings and globally available data.
This class contains various global structures/definitions.
This class is a Singleton and accessed via the static instance() function.
- various (textual) meta data (SettingMetaData)
- global database connections
- There are two defined global database connections dbin() and dbout() with the names "in" and "out". They are setup with setupDatabaseConnection(). Currently, only SQLite DBs are supported. Use dbin() and dbout() to faciliate those database connections:
...
query.exec(...);
...
static GlobalSettings * instance()
Definition: globalsettings.h:51
QSqlDatabase dbin()
Definition: globalsettings.h:96
- Helpers with file Paths
- the actual project file is parsed for path defined in the <path> section. Use the path() function to expand a
fileName
to a iLand-Path. To check if a file exists, you could use fileExists(). Available paths:
- home: the project's home directory. All other directories can be defined relative to this dir.
- lip: path for the storage of LIP (aka binary Stamp files) (default: home/lip)
- database: base path for SQLite database files (default: home/database)
- temp: path for storage of temporary files (default: home/temp)
- log: storage for log-files (default: home/log)
- exe: the path to the executable file.
QString p;
p =
Globals->path(
"somestuff.txt",
"temp");
p =
Globals->path(
"e:\averyspecial\place.txt",
"temp");
p =
Globals->path(
"log123.txt",
"log");
- Fine-Grained debugging outputs
- The enumeration DebugOutputs defines a list of realms (uses binary notation: 1,2,4,8,...!). Use setDebugOutput() to enable/disable such an output. Use isDebugEnabled() to test inside the code if the generation of debug output for a specific type is enabled. Internally, this is a single bitwise operation which is very fast. Call debugLists() to retrieve a list of lists of data that fit specific criteria.
out << hd_growth << factor_diameter << delta_d_estimate << d_increment;
}
);
DebugList & debugList(const int ID, const DebugOutputs dbg)
returns a ref to a list ready to be filled with debug output of a type/id combination.
Definition: globalsettings.cpp:221
bool isDebugEnabled(const DebugOutputs dbg)
returns true, if a specific debug outut type is enabled.
Definition: globalsettings.h:82
@ dTreeGrowth
Definition: globalsettings.h:76
#define DBGMODE(stmts)
Definition: global.h:66