24#ifndef _GEMA_RUN_PROGRESS_REPORT_H_
25#define _GEMA_RUN_PROGRESS_REPORT_H_
66 int addColumn(
int itemId,
int attrId,
QString colTitle=
"",
bool autoTimeUnit =
false,
int width = -1, ColAlignment align = GM_RUNPROG_REPORT_AUTO,
int attrDim = -1);
67 int addColumn(
QString colTitle,
QString colUnit,
QString fmt =
"",
bool autoTimeUnit =
false,
int width = -1, ColAlignment align = GM_RUNPROG_REPORT_RIGHT);
69 void setColumnValueFunction(
int col,
const ValueFunctionT& f);
70 void setColumnIgnoreOnZero(
int col);
72 void setColumnValue(
int col,
int val);
73 void setColumnValue(
int col,
double val);
74 void setColumnValue(
int col,
const double* val,
int size);
75 void setColumnValue(
int col,
QString str);
77 void saveReportLine(
int itemId,
void* itemUserData);
78 void saveTrailler(
QString traillerStr);
83 void saveReportHeader();
84 void saveFormattedHeader(
bool title);
85 void saveFormattedLine();
86 void saveFormattedTrailler(
QString traillerStr);
88 void saveCsvHeader(
bool title);
90 void saveCsvTrailler(
QString traillerStr);
109 int findColumnWidth (
const ColData& colData,
int dataSize)
const;
Class representing a category with multiple logging levels.
Definition gmLog.h:58
Auxiliar class used to store the complete set of results data for a simulation.
Definition gmResultsData.h:58
A class used to create formatted reports based on ProgressStats item attribute values.
Definition gmRunProgressReport.h:40
QString _fileName
Output file name.
Definition gmRunProgressReport.h:116
QVector< ColData > _columns
The set of report columns.
Definition gmRunProgressReport.h:121
QStringList _itemDescriptions
Item descriptions, saved between the title and the column headers.
Definition gmRunProgressReport.h:120
ColAlignment
Definition gmRunProgressReport.h:43
@ GM_RUNPROG_REPORT_CENTER
Column data is aligned to the center.
Definition gmRunProgressReport.h:45
@ GM_RUNPROG_REPORT_AUTO
Column data is aligned according to the data type as defined by the associated result attribute.
Definition gmRunProgressReport.h:47
@ GM_RUNPROG_REPORT_LEFT
Column data is aligned to the left (default for strings)
Definition gmRunProgressReport.h:44
@ GM_RUNPROG_REPORT_RIGHT
Column data is aligned to the right (default for numbers)
Definition gmRunProgressReport.h:46
void addItemDescription(QString description)
Adds an item description to the report.
Definition gmRunProgressReport.h:64
QString fileName() const
Returns the output file name for this report.
Definition gmRunProgressReport.h:58
bool _csv
Save to csv file? If not, a formatted text file will be saved.
Definition gmRunProgressReport.h:117
GmRunProgressStats * _ps
The ProgressStats object that owns this report.
Definition gmRunProgressReport.h:114
const GmLogCategory & _logger
The logger used to display error messages.
Definition gmRunProgressReport.h:115
std::function< void(GmRunProgressReport *report, int col, int itemId, void *itemUserData)> ValueFunctionT
The column value function type.
Definition gmRunProgressReport.h:51
GmResultsData * _resultsData
The results data object storing data attributes.
Definition gmRunProgressReport.h:113
int _numHeaderRows
The number of rows needed for the header. Set to -1 if there was an error creating the save file.
Definition gmRunProgressReport.h:122
QString _title
The report title.
Definition gmRunProgressReport.h:119
void setTitle(QString title)
Adjusts the report title.
Definition gmRunProgressReport.h:61
FILE * _file
The output file handle.
Definition gmRunProgressReport.h:118
A class used to store time, memory and additional values statistics related to the simulation loading...
Definition gmRunProgressStats.h:42
An item used to store time, memory and additional values statistics related to the simulation loading...
Definition gmRunProgressStatsItem.h:39
#define GMC_API_EXPORT
Macro for controlling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_L...
Definition gmCoreConfig.h:35
Declaration of the GmResultsData class.
Definition gmRunProgressReport.h:93
int _attrDim
A dimension index used to select a vector attribute dimension to display, as a scalar,...
Definition gmRunProgressReport.h:101
bool _ignoreOnZero
If set to true, a zero value will be printed as an empty column.
Definition gmRunProgressReport.h:102
ColAlignment _align
The column alignment. AUTO values should already have been translated when stored.
Definition gmRunProgressReport.h:97
int _attrId
The attribute index providing the column data or -1 if given manually.
Definition gmRunProgressReport.h:100
QStringList _title
The column title, split in multiple rows, if needed with added unit row if unit is not empty.
Definition gmRunProgressReport.h:94
QString _fmt
The format string used to convert numeric values.
Definition gmRunProgressReport.h:98
QString _value
The formatted column value when manually provided.
Definition gmRunProgressReport.h:103
ValueFunctionT _colValueFunction
A function that, when present, is called by saveReportLine() to update the column value.
Definition gmRunProgressReport.h:104
int _autoTime
Should we try to auto adjust time unit according to the value? If different from -1,...
Definition gmRunProgressReport.h:99
QString _unit
The column unit.
Definition gmRunProgressReport.h:95
int _width
The column width.
Definition gmRunProgressReport.h:96