24 #ifndef _GEMA_SIMULATION_H_ 25 #define _GEMA_SIMULATION_H_ 69 QUIET_LOG_MODE = 0x001,
70 VERBOSE_LOG_MODE = 0x002,
71 NOCONSOLE_LOG_MODE = 0x004,
72 REGRESSION_LOG_MODE = 0x008,
73 MEMORY_LOG_MODE = 0x010,
74 NOMEMORY_LOG_MODE = 0x020,
75 TIME_LOG_MODE = 0x040,
76 NOTIME_LOG_MODE = 0x080,
77 SERVER_LOG_MODE = 0x100,
78 NOSERVER_LOG_MODE = 0x200,
79 PLUGININFO_LOG_MODE = 0x400,
80 TIMESTATS_LOG_MODE = 0x800,
94 ServerMode serverMode,
unsigned localServerPort,
95 QString serverAddrFile,
bool rsrcFiles);
98 int timeout = -1, lua_State* state = NULL);
136 void cancelRequested();
139 bool setConfigFile(
QString configFile,
QString logFile,
int logMode,
140 ServerMode serverMode,
unsigned localServerPort,
QString serverAddrFile);
144 bool setupLogging (
LuaEnv& env,
QString logFile,
int logMode);
145 bool setupMonitorServer (
LuaEnv& env, ServerMode serverMode,
unsigned localServerPort,
bool logToServer,
QString serverAddrFile);
146 bool setupUnitManager (
LuaEnv& env);
147 bool loadConfigValueTables(
LuaEnv& env);
150 void clearDataOnError(
bool abort);
Basic class for defining a GeMA physical Simulation, containing references to the model definition,...
Definition: gmSimulation.h:58
Declaration of usefull configuration definitions.
void clear()
Clears the current simulation environment, preparing the object for a new simulation: new calls to in...
Definition: gmSimulation.h:105
GmSimulationLoader * _simulationLoader
Simulation loader.
Definition: gmSimulation.h:155
bool _redirectPrint
Should we redirect Lua print() calls to the logger?
Definition: gmSimulation.h:175
LuaEnv * env()
Returns the simulation environment.
Definition: gmSimulation.h:113
Auxiliary class responsible for loading simulation information from a Lua File.
Definition: gmSimulationLoader.h:43
The monitor server will be turned on, listening for connections on the local host.
Definition: gmSimulation.h:89
const GmLogCategory & logger()
Returns the basic logger for the GeMA library.
Definition: gmSimulation.h:110
The simulation was cancelled by user request.
Definition: gmSimulation.h:50
The monitor server will be turned on or off depending on the config file.
Definition: gmSimulation.h:86
LuaEnv * _env
Lua environment used to read the Simulation. Reused during the execution step as it contains function...
Definition: gmSimulation.h:173
GmSimulationData * _simulationData
Object storing the complete Simulation information.
Definition: gmSimulation.h:154
ServerMode
Server initialization modes.
Definition: gmSimulation.h:84
The simulation completed successfully.
Definition: gmSimulation.h:49
LogModes
Predefined Log modes. Can be ored together.
Definition: gmSimulation.h:67
GmCommServer * _monitorServer
The monitor server. Will be NULL if monitoring is not enabled.
Definition: gmSimulation.h:163
GmLogCategory _logger
Basic logger object for the library.
Definition: gmSimulation.h:161
QMutex _envMutex
The mutex used to control the possible data race during the creation of the Lua environments and poss...
Definition: gmSimulation.h:168
bool _externalState
Are we using an external Lua environment provided in initSimulation() ?
Definition: gmSimulation.h:174
The monitor server will be turned off.
Definition: gmSimulation.h:88
GmPath * _paths
Object storing the set of important simulation paths for macro translation.
Definition: gmSimulation.h:156
QVariantMap _configConstants
The set of constants defined on the config file.
Definition: gmSimulation.h:157
const GmPath * paths() const
Returns the object storing information for path macro susbstitution.
Definition: gmSimulation.h:121
The monitor server will be turned on.
Definition: gmSimulation.h:87
bool _loadCompleted
A flag set to true when the model loading has finished successfully. Also protected by _envMutex.
Definition: gmSimulation.h:176
bool _rsrcFiles
If set to true, the config file and the model file are allowed to be resource files.
Definition: gmSimulation.h:159
GmSimulationResult
Enumeration describing the result of a simulation.
Definition: gmSimulation.h:47
The simulation was aborted by a run time error.
Definition: gmSimulation.h:51
QVariantMap _configOptions
The set of options defined on the config file.
Definition: gmSimulation.h:158
GmSimulationData * data() const
Returns a reference to the simulation data.
Definition: gmSimulation.h:116
QList< LuaEnv * > _workerEnvList
A list with Lua environments for worker threads.
Definition: gmSimulation.h:178