GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
GmMonitorResultsRule Class Reference

A results rule used to send the associated data sets to the monitor server thread. More...

#include <gmMonitorResultsRule.h>

Inheritance diagram for GmMonitorResultsRule:
Collaboration diagram for GmMonitorResultsRule:

Public Member Functions

virtual ~GmMonitorResultsRule ()
 Destructor.
 
virtual GmResultsRuleType type () const
 Returns the result rule type.
 
virtual void print (const GmLogCategory &logger, GmLogLevel level) const
 Prints the rule description to the appointed logger / level.
 
virtual bool run (const GmLogCategory &logger)
 Sends the data specified by the associated data sets to the monitor thread.
 
- Public Member Functions inherited from GmResultsRule
virtual ~GmResultsRule ()
 Destructor.
 
QString id () const
 Returns the result rule name.
 
QString description () const
 Returns the result rule description.
 
const QVector< GmResultsDataSet * > & dataSets () const
 Returns the list of data sets acted upon by this rule.
 
const QVector< GmResultsTimeSet * > & timeSets () const
 Returns the list of time sets defining when this rule should be acted upon.
 
bool hasTimeSet () const
 Returns true if this rule is associated with a time set.
 

Static Public Member Functions

static GmMonitorResultsRuleloadFromTable (GmResultsData *data, LuaTable &tab, const GmLogCategory &parseLogger, const GmSimulationData *simData)
 Parses either a save rule definition from the given Lua table, returning a save rule object.
 

Protected Member Functions

 GmMonitorResultsRule (GmResultsData *data, QString id, QString description, const QVector< GmResultsDataSet * > &dataSets, const QVector< GmResultsTimeSet * > &timeSets, bool trackObj, const GmSimulationData *simData)
 Protected constructor. Object is created by loadFromTable()
 
- Protected Member Functions inherited from GmResultsRule
 GmResultsRule (QString id, QString description, const QVector< GmResultsDataSet * > &dataSets, const QVector< GmResultsTimeSet * > &timeSets, bool trackObj, const GmSimulationData *simData)
 Constructor. The rule does NOT own the data sets and time sets.
 

Private Member Functions

 Q_DISABLE_COPY (GmMonitorResultsRule)
 
void evalMonitoredAttributeData (GmResultsDataSet *dset, const GmLogCategory &errLogger)
 Evaluates data set attribute data, emitting monitoredValueChanged() signal on behalf of the stored result data object.
 
void evalMonitoredEvalSetData (GmResultsDataSet *dset, GmResultsDataSrcType type, const GmLogCategory &errLogger)
 Evaluates data set eval set data, emitting monitoredValueChanged() and monitoredIndexChanged() signals on behalf of the stored result data object.
 

Private Attributes

GmResultsData_resultsData
 The results data object used to emit the monitor signals.
 

Additional Inherited Members

- Static Protected Member Functions inherited from GmResultsRule
static bool fillCommonFields (const GmResultsData *data, LuaTable &tab, const GmLogCategory &logger, QString &id, QString &description, QVector< GmResultsDataSet * > &dataSets, QVector< GmResultsTimeSet * > &timeSets, bool &trackObj)
 Helper function for the loadFromTable functions from derived classes. Parses the common fields for every result rule from the given Lua table. The logger is used to emmit messages during rule parsing. The data object is used to find data sets and time sets on the results data object.
 
- Protected Attributes inherited from GmResultsRule
QString _id
 The save rule id (name)
 
QString _description
 A description of the save rule.
 
QVector< GmResultsDataSet * > _dataSets
 The list of associated data sets.
 
QVector< GmResultsTimeSet * > _timeSets
 The list of associated time sets.
 
const GmSimulationData_simData
 The simulation data object.
 
int _itemId
 The run progress item id for result rules of this kind (subclass: save rules, print rules or monitor rules)

 
int _objItemId
 The run progress item for this object if the user requested to monitor the time for this specific result rule.
 

Detailed Description

A results rule used to send the associated data sets to the monitor server thread.

Member Function Documentation

◆ evalMonitoredAttributeData()

void GmMonitorResultsRule::evalMonitoredAttributeData ( GmResultsDataSet * dset,
const GmLogCategory & errLogger )
private

Evaluates data set attribute data, emitting monitoredValueChanged() signal on behalf of the stored result data object.

If the attribute is not available yet, its value will not be broadcasted. If evaluating an attribute results in an error, a message is logged and the value is not broadcasted.

◆ evalMonitoredEvalSetData()

void GmMonitorResultsRule::evalMonitoredEvalSetData ( GmResultsDataSet * dset,
GmResultsDataSrcType type,
const GmLogCategory & errLogger )
private

Evaluates data set eval set data, emitting monitoredValueChanged() and monitoredIndexChanged() signals on behalf of the stored result data object.

If a value line is not available (missing gauss point or no ghost data, for example), a value of zero will be sent in its place (to always keep the vector size consistent with the index size). If evaluating a value line results in an error, a message is logged and the entire value is not broadcasted.

◆ loadFromTable()

GmMonitorResultsRule * GmMonitorResultsRule::loadFromTable ( GmResultsData * data,
LuaTable & tab,
const GmLogCategory & parseLogger,
const GmSimulationData * simData )
static

Parses either a save rule definition from the given Lua table, returning a save rule object.

The parseLogger is used to emmit messages during rule parsing.

◆ print()

void GmMonitorResultsRule::print ( const GmLogCategory & logger,
GmLogLevel level ) const
virtual

Prints the rule description to the appointed logger / level.

Reimplemented from GmResultsRule.

◆ run()

bool GmMonitorResultsRule::run ( const GmLogCategory & logger)
virtual

Sends the data specified by the associated data sets to the monitor thread.

Implements GmResultsRule.

◆ type()

virtual GmResultsRuleType GmMonitorResultsRule::type ( ) const
inlinevirtual

Returns the result rule type.

Implements GmResultsRule.


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