24 #ifndef _GEMA_SIMULATION_DATA_H_ 25 #define _GEMA_SIMULATION_DATA_H_ 46 struct QtHardwareInfo;
47 struct QtGlobalMemUsage;
55 const QVariantMap& configConstants,
const QVariantMap& configOptions);
72 QVariantMap& constants, QVariantMap& options)
75 _description = description;
76 _constants = constants;
113 bool cancelRequested()
const { assert(_threadManager);
return _threadManager->cancelRequested(); }
122 QtHardwareInfo*
hwInfo()
const {
return _hwInfo; }
130 double currentTime (
const Unit& desiredUnit)
const;
131 double previousTime(
const Unit& desiredUnit)
const;
146 _prevTime = (time == 0.0 ? 0.0 : _currentTime);
149 _results->setCurrentTime(_currentTime);
204 void printMapValues (
const GmLogCategory& logger,
const QVariantMap& map,
const QVariantMap& configMap);
206 const QVariant& mapValue(
const QString& name,
const QVariantMap& map,
const QVariantMap& configMap)
const;
207 QVariant mapValue(
const QString& name,
const QVariantMap& map,
const QVariantMap& configMap,
const QVariant& defValue)
const;
Auxiliar class used to store the complete set of solution methods data for a simulation.
Definition: gmSolutionData.h:40
bool cancelRequested() const
Do we have a pending request to cancel the simulation?
Definition: gmSimulationData.h:113
GmThreadManager * threadManager() const
Returns a pointer to the configured thread manager.
Definition: gmSimulationData.h:116
const QVariantMap & simulationOptions() const
Returns the map with options read from the simulation.
Definition: gmSimulationData.h:185
Auxiliar class used to store the complete set of model data for a simulation.
Definition: gmModelData.h:49
const QVariantMap & _configOptions
The map with options defined in the configuration file.
Definition: gmSimulationData.h:215
QVariant constantValue(const QString &name, const QVariant &defValue) const
Returns the given constant value. Looks for the given name first in the data set read from the Simula...
Definition: gmSimulationData.h:180
GmModelData * modelData() const
Returns the model data associated to this simulation.
Definition: gmSimulationData.h:87
QString description() const
Returns the simulation description.
Definition: gmSimulationData.h:65
Declaration of usefull configuration definitions for the Core library.
QString _sharedCode
The shared code for setting the Lua environment for worker threads.
Definition: gmSimulationData.h:220
const QVariantMap & configConstants() const
Returns the map with constants read from the config file.
Definition: gmSimulationData.h:200
double currentTime() const
Returns the current simulation time in the current time unit.
Definition: gmSimulationData.h:125
QVariant optionValue(const QString &name, const QVariant &defValue) const
Returns the given option value. Looks for the given name first in the data set read from the Simulati...
Definition: gmSimulationData.h:168
QStringList _loadedFiles
The set of Lua files that where loaded for this simulation.
Definition: gmSimulationData.h:211
GmTaskManager * _taskManager
The configured task manager.
Definition: gmSimulationData.h:226
Auxiliar class used to store the complete set of simulation data.
Definition: gmSimulationData.h:51
Declaration of the GmThreadManager class.
GmPluginLoader * loader() const
Returns the plugin loader to allow for plugins to load other plugins.
Definition: gmSimulationData.h:99
void setCurrentTime(double time, bool updatePrev=true)
Updates the current time.
Definition: gmSimulationData.h:142
QtGlobalMemUsage * _initMemoryInfo
The global memory usage pattern before loading the simulation data.
Definition: gmSimulationData.h:223
Class used to store releveant system and project paths, providing functions for path macro translatio...
Definition: gmPath.h:37
QVariantMap _options
The map with options defined in the simulation section.
Definition: gmSimulationData.h:213
QString _name
Simulation name.
Definition: gmSimulationData.h:209
const GmPath * _paths
Object storing the set of important paths for path macro substitution.
Definition: gmSimulationData.h:229
Class responsible for managing discovery and loading of plugins.
Definition: gmPluginLoader.h:42
QString name() const
Returns the simulation name.
Definition: gmSimulationData.h:62
Declaration of the GmResultsData class.
GmResultsData * resultsData() const
Returns the results configuration associated to this simulation.
Definition: gmSimulationData.h:93
double previousTime() const
Returns the previous simulation time in the current time unit.
Definition: gmSimulationData.h:128
const GmPath * paths() const
Returns the object storing information for path macro susbstitution.
Definition: gmSimulationData.h:102
const QVariant & constantValue(const QString &name) const
Returns a reference to the given constant value. Looks for the given name first in the data set read ...
Definition: gmSimulationData.h:174
QString sharedCode() const
Returns the shared code associated to this simulation.
Definition: gmSimulationData.h:96
void setCurrentTimeUnit(const Unit &unit)
Updates the current time unit.
Definition: gmSimulationData.h:156
QVariantMap _constants
The map with constants defined in the simulation section.
Definition: gmSimulationData.h:212
Auxiliar class used to store the complete set of results data for a simulation.
Definition: gmResultsData.h:51
GmSolutionData * solutionData() const
Returns the solution definition associated to this simulation.
Definition: gmSimulationData.h:90
Unit _timeUnit
The current simulation time unit.
Definition: gmSimulationData.h:233
#define GMC_API_EXPORT
Macro for controling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_LI...
Definition: gmCoreConfig.h:35
const QStringList & loadedFiles() const
Returns the list of loaded files for this simulation.
Definition: gmSimulationData.h:68
GmModelData * _model
Model data.
Definition: gmSimulationData.h:217
GmSolutionData * _solution
Solution method data.
Definition: gmSimulationData.h:218
const QVariantMap & simulationConstants() const
Returns the map with constants read from the simulation.
Definition: gmSimulationData.h:190
QString _description
Simulation description.
Definition: gmSimulationData.h:210
GmPluginLoader * _loader
The application plugin manager.
Definition: gmSimulationData.h:228
Class representing a category with multiple logging levels.
Definition: gmLog.h:58
GmResultsData * _results
Results configuration data.
Definition: gmSimulationData.h:219
static bool inMainThread()
Is the current thread the main thread? Equivalent to comparing the currentId() with 0.
Definition: gmThreadManager.h:169
void setLoadedFiles(const QStringList &loadedFiles)
Updates the list of loaded files for this simulation.
Definition: gmSimulationData.h:81
QtHardwareInfo * hwInfo() const
Returns some usefull information about the execution hardware.
Definition: gmSimulationData.h:122
QtHardwareInfo * _hwInfo
Some usefull information about the execution hardware.
Definition: gmSimulationData.h:222
const Unit & timeUnit() const
Returns the unit in which the current time is stored.
Definition: gmSimulationData.h:134
void setSharedCode(QString sharedCode)
Updates the shared code.
Definition: gmSimulationData.h:84
GmThreadManager * _threadManager
The configured thread manager.
Definition: gmSimulationData.h:225
Thread manager used for handling parallel executions.
Definition: gmThreadManager.h:94
void setPreviousTime(double time)
Updates the previous time.
Definition: gmSimulationData.h:153
GmTaskManager * taskManager() const
Returns a pointer to the configured task manager.
Definition: gmSimulationData.h:119
double _currentTime
The current simulation time.
Definition: gmSimulationData.h:231
void setSimulationGlobalInfo(QString name, QString description, QVariantMap &constants, QVariantMap &options)
Updates the simulation global attributes: name & description.
Definition: gmSimulationData.h:71
const QVariantMap & configOptions() const
Returns the map with options read from the config file.
Definition: gmSimulationData.h:195
const QVariantMap & _configConstants
The map with constants defined in the configuration file.
Definition: gmSimulationData.h:214
double _prevTime
The previous simulation time.
Definition: gmSimulationData.h:232
Task manager used for handling parallel executions.
Definition: gmTaskManager.h:76
const QVariant & optionValue(const QString &name) const
Returns a reference to the given option value. Looks for the given name first in the data set read fr...
Definition: gmSimulationData.h:162