24 #ifndef _GEMA_RESULTS_DATA_H_ 25 #define _GEMA_RESULTS_DATA_H_ 74 bool evalRules(
QString ruleId =
"");
76 int registerResultAttribute(
const void* owner,
QString name,
QString description,
Unit unit,
77 int nlin,
int ncol,
QString format);
79 void removeRegisteredAttributes(
void* owner);
83 void setResultAttributeValue(
int id,
double val);
84 void setResultAttributeValue(
int id,
double val1,
double val2);
85 void setResultAttributeValue(
int id,
double val1,
double val2,
double val3);
86 void setResultAttributeValue(
int id,
const double* val);
87 void setResultAttributeValue(
int id,
const GmVector& val);
88 void setResultAttributeValue(
int id,
const GmMatrix& val);
89 void setResultAttributeValue(
int id,
QString val);
97 assert((
id >= 0 &&
id < _resultAttributeData.size()) ||
98 ((
id-firstStringAttributeId) >= 0 && (
id-firstStringAttributeId) < _resultStringAttributeData.size()));
99 return id < firstStringAttributeId;
105 return isNumericResult(
id) ? _resultAttributeData[id].first :
106 _resultStringAttributeData[
id-firstStringAttributeId].first;
112 assert(isNumericResult(
id));
113 return _resultAttributeData[id].second;
119 assert(!isNumericResult(
id));
120 return _resultStringAttributeData[
id-firstStringAttributeId].second;
132 void setCurrentTime(
double time);
151 void monitoredValueChanged(
int trackId,
const GmResultTrackedData& value,
bool waitForMore);
154 void monitoredValueChangedDone();
160 void monitoredAttributeInfoChanged(
int trackId,
int ruleId,
QString name,
QString description,
168 return _registeredRuleAttributesMap.value(
id, qMakePair<GmResultsRule*, GmAttributeResultDataSrc*>(NULL, NULL)).second;
176 static const int firstStringAttributeId = 1000;
int _numTrackedSrcs
The sum of the number of data srcs in the set of monitor result rules.
Definition: gmResultsData.h:196
QMap< QString, QPair< const void *, int > > _resultAttributeMap
Map storing for each registered result attribute name its id and the object that registered that name...
Definition: gmResultsData.h:208
QVector< QPair< GmAttributeResultDataSrcInfo *, double * > > _resultAttributeData
A list storing for each registered numeric result attribute its metadata.
Definition: gmResultsData.h:216
bool isNumericResult(int id) const
Returns true if the given valid result id refers to a numeric based value.
Definition: gmResultsData.h:95
const QMap< QString, GmResultsRule * > & monitorRules() const
Returns a const reference to the monitor rules map.
Definition: gmResultsData.h:63
Declaration of usefull configuration definitions for the Core library.
QMutex * monitoringMutex()
Returns the mutex needed to protect access to rule metadata AFTER the model loading....
Definition: gmResultsData.h:130
Declaration of the GmMatrix class.
const GmSimulationData * _simData
The simulation data object.
Definition: gmResultsData.h:178
The index data for a result rule, storing "evaluation point" data for node, cell or gauss based indic...
Definition: gmResultTrackedData.h:64
A serializer object used to save mesh data to several file formats.
Definition: gmResultsSerializer.h:48
QMap< QString, QPair< GmResultsRule *, GmAttributeResultDataSrc * > > _unregisteredRuleAttributesMap
A map storing for each yet unregistered monitor rule attribute, its associated rule + data src.
Definition: gmResultsData.h:227
Auxiliar class used to store the complete set of simulation data.
Definition: gmSimulationData.h:51
GmAttributeResultDataSrc * monitoredAttrDataSrc(int id)
Helper function to return the attribute data src for monitored attributes or NULL otherwise.
Definition: gmResultsData.h:165
const GmLogCategory & logger() const
Returns the internal logger used by rules to emmit messages.
Definition: gmResultsData.h:139
GmLogCategory _logger
The logger object used by rules to emmit messages.
Definition: gmResultsData.h:198
A result rule storing what should be exported, when it should be exported and to where it should be e...
Definition: gmResultsRule.h:54
QMap< QString, GmResultsRule * > _monitorMap
Map storing monitor result rules, keyed by rule id.
Definition: gmResultsData.h:193
void enableMonitoring()
Enables the emission of the monitorValueChanged() family of signals.
Definition: gmResultsData.h:124
A tracked data value. Can be either a double vector or a string. Thanks to the implicitly shared natu...
Definition: gmResultTrackedData.h:37
int _timeAttributeId
The id stored in _resultAttributeMap for the stanard "time" attribute.
Definition: gmResultsData.h:210
int resultAttributeId(QString name) const
Returns the id associated with the given result attribute name or -1 if no attribute with that name e...
Definition: gmResultsData.h:92
Auxiliar class used to store the complete set of results data for a simulation.
Definition: gmResultsData.h:51
bool _monitor
Is there someone monitoring data changes?
Definition: gmResultsData.h:179
Declaration of the GmVector class.
A class implementing the GmResultDataSrcInfo interface, storing the metadata and id for a result data...
Definition: gmResultDataSrc.h:43
QMutex _monitorMutex
A mutex shared with the monitor thread to protect access to rule metadata, AFTER the model loading....
Definition: gmResultsData.h:191
#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
QVector< QPair< GmAttributeResultDataSrcInfo *, QString > > _resultStringAttributeData
A list storing for each registered string result attribute its metadata.
Definition: gmResultsData.h:221
Class representing a category with multiple logging levels.
Definition: gmLog.h:58
A basic class used to store meta-data information about result attributes DEFINITIONS.
Definition: gmResultDataSrcInfo.h:100
const GmAttributeResultDataSrcInfo * resultAttributeInfo(int id) const
Returns the metadata associated with the given result attribute id.
Definition: gmResultsData.h:103
arma::vec GmVector
The basic type for a GeMA vector object. Currently based on an Armadillo vector.
Definition: gmVector.h:34
QString resultAttributeString(int id) const
Returns the string value for the given STRING result attribute id.
Definition: gmResultsData.h:117
int numTrackedDataSrcs() const
Returns the number of data srcs inside the set of monitor rules.
Definition: gmResultsData.h:72
QMap< QString, GmResultsRule * > _saveMap
Map storing save result rules, keyed by rule id.
Definition: gmResultsData.h:194
arma::mat GmMatrix
The basic type for a GeMA matrix object. Currently based on an Armadillo matrix.
Definition: gmMatrix.h:38
QMap< int, QPair< GmResultsRule *, GmAttributeResultDataSrc * > > _registeredRuleAttributesMap
A map storing for each result attribute id with an associated rule data src, that rule + data src obj...
Definition: gmResultsData.h:224
const double * resultAttributeBuffer(int id) const
Returns the internal buffer used to store the last saved result for the given NUMERIC result attribut...
Definition: gmResultsData.h:110
const QMap< QString, GmResultsRule * > & saveRules() const
Returns a const reference to the save rules map.
Definition: gmResultsData.h:66
Declaration of support functions and macros for information logging.