
#include "us_report.h"

Classes | |
| class | ReportDocument |
| The ReportDocument class describes an individual report document. This document would be a png or an html snippet that could be included as one of many documents available to be a part of a report. More... | |
| class | ReportTriple |
| The ReportTriple class describes an individual report. This report would ordinarily be associated with a particular runID and triple ( c/c/w ) within the experiment, and could contain any number of report documents. More... | |
| class | ReportTypes |
| Map report types: name-to-label and name-to-mimetype. More... | |
Public Types | |
| enum | Status { REPORT_OK, NOT_FOUND, CONNECT_ERROR, DB_ERROR, MISC_ERROR, SAVED_DB } |
| Some status codes to keep track of latest conditions. More... | |
Public Member Functions | |
| US_Report () | |
| Generic constructor for the US_Report class. More... | |
| ~US_Report () | |
| A destructor. More... | |
| Status | readDB (QString, US_DB2 *=0, QString="") |
| Function to read an entire report structure from the DB, except for the document content itself. More... | |
| Status | saveDB (US_DB2 *=0) |
| Function to save the global report information to db. More... | |
| Status | addTriple (QString, QString="", US_DB2 *=0) |
| Function to add a new empty triple record to the report. More... | |
| Status | addTriple (US_Report::ReportTriple, US_DB2 *=0) |
| Function to add or replace an entire triple. More... | |
| Status | saveAllToDB (QString, US_DB2 *=0) |
| Function to save the entire report structure to db. More... | |
| Status | removeTriple (int, US_DB2 *=0) |
| Function to delete a report triple from the DB, along with all documents. More... | |
| int | findTriple (QString) |
| Function to locate a triple record using the triple string. More... | |
| Status | saveDocumentFromFile (const QString &, const QString &, US_DB2 *, int=1, const QString="") |
| Store a single reportDocument record based on filename info. More... | |
| Status | saveFileDocuments (const QString &, const QStringList &, US_DB2 *, int=1, const QString="") |
| Store multiple reportDocument records from the same triple. More... | |
| Status | removeReport (int, US_DB2 *=0) |
| Function to delete the specified report from the DB. More... | |
| void | reset () |
| Resets the class variables to default values. More... | |
| void | show (void) |
| Displays the contents of the class variables in qDebug()'s. More... | |
Public Attributes | |
| int | ID |
| The ID of this global report structure. More... | |
| QString | GUID |
| The GUID of this global report structure. More... | |
| int | experimentID |
| The experimentID from which triple is derived. More... | |
| QString | runID |
| The runID that identifies this experiment. More... | |
| QString | title |
| The title of the report. More... | |
| QString | html |
| QVector< ReportTriple > | triples |
| The report triple. More... | |
| ReportTypes | rTypes |
| Persistent structure of report type mappings. More... | |
Private Attributes | |
| int | dbg_level |
| Debug level value. More... | |
This class provides a low-level interface to the report tables, allowing the user to read and write them to db.
Definition at line 17 of file us_report.h.
| enum US_Report::Status |
Some status codes to keep track of latest conditions.
| Enumerator | |
|---|---|
| REPORT_OK |
The last db operation completed successfully. |
| NOT_FOUND |
The report, reportTriple or reportDocument ID/GUID was not found. |
| CONNECT_ERROR |
Could not connect to the DB. |
| DB_ERROR |
A US_DB2 error occurred; check db->lastErrno();. |
| MISC_ERROR |
An unspecified error occurred. |
| SAVED_DB |
The report has been saved to the DB. |
Definition at line 23 of file us_report.h.
| US_Report::US_Report | ( | ) |
Generic constructor for the US_Report class.
Definition at line 486 of file us_report.cpp.
|
inline |
A destructor.
Definition at line 212 of file us_report.h.
| US_Report::Status US_Report::addTriple | ( | QString | triple, |
| QString | dataDescription = "", |
||
| US_DB2 * | db = 0 |
||
| ) |
Function to add a new empty triple record to the report.
| triple | The triple identifying which channel |
| dataDescription | The data description from the original file |
| db | For database access, an open database connection |
Definition at line 654 of file us_report.cpp.
| US_Report::Status US_Report::addTriple | ( | US_Report::ReportTriple | t, |
| US_DB2 * | db = 0 |
||
| ) |
Function to add or replace an entire triple.
| t | A US_Report::ReportTriple object |
| db | For database access, an open database connection |
Definition at line 668 of file us_report.cpp.
| int US_Report::findTriple | ( | QString | searchTriple | ) |
Function to locate a triple record using the triple string.
| searchTriple | The triple identifying which channel |
Definition at line 706 of file us_report.cpp.
| US_Report::Status US_Report::readDB | ( | QString | new_runID, |
| US_DB2 * | db = 0, |
||
| QString | new_triple = "" |
||
| ) |
Function to read an entire report structure from the DB, except for the document content itself.
| new_runID | The runID of the associated experiment |
| db | For database access, an open database connection |
| new_triple | The triple string for associated documents |
Definition at line 492 of file us_report.cpp.
| US_Report::Status US_Report::removeReport | ( | int | reportID, |
| US_DB2 * | db = 0 |
||
| ) |
Function to delete the specified report from the DB.
| reportID | The database reportID of the report to delete |
| db | For database access, an open database connection |
Definition at line 1025 of file us_report.cpp.
| US_Report::Status US_Report::removeTriple | ( | int | ndx, |
| US_DB2 * | db = 0 |
||
| ) |
Function to delete a report triple from the DB, along with all documents.
| ndx | The index into the triples QVector of the report triple to delete |
| db | For database access, an open database connection |
Definition at line 687 of file us_report.cpp.
| void US_Report::reset | ( | void | ) |
Resets the class variables to default values.
Definition at line 1076 of file us_report.cpp.
| US_Report::Status US_Report::saveAllToDB | ( | QString | dir, |
| US_DB2 * | db = 0 |
||
| ) |
Function to save the entire report structure to db.
| dir | The directory where the document contents file is located |
| db | For database access, an open database connection |
Definition at line 1043 of file us_report.cpp.
| US_Report::Status US_Report::saveDB | ( | US_DB2 * | db = 0 | ) |
Function to save the global report information to db.
Definition at line 561 of file us_report.cpp.
| US_Report::Status US_Report::saveDocumentFromFile | ( | const QString & | dir, |
| const QString & | filename, | ||
| US_DB2 * | db, | ||
| int | idEdit = 1, |
||
| const QString | dataDescription = "" |
||
| ) |
Store a single reportDocument record based on filename info.
| dir | The directory where the report file is located. The is required to end with the runID, e.g., dir = "/home/user/ultrascan/reports/demo1_veloc" |
| filename | Base file name of the local report document file. This file should be named as follows: analysis.triple.subAnalysis.docType — e.g., 2dsa.2A260.tinoise.svg |
| db | For database access, an open database connection |
| idEdit | ID of EditedData with which document is associated. |
| dataDescription | The data description from the first line of the original file, in case adding new triple |
Definition at line 722 of file us_report.cpp.
| US_Report::Status US_Report::saveFileDocuments | ( | const QString & | dir, |
| const QStringList & | filepaths, | ||
| US_DB2 * | db, | ||
| int | idEdit = 1, |
||
| const QString | dataDescription = "" |
||
| ) |
Store multiple reportDocument records from the same triple.
| dir | The directory where the report file is located. The is required to end with the runID, e.g., dir = "/home/user/ultrascan/reports/demo1_veloc" |
| filepaths | Base file paths of the local report document files. These file should be named as follows: analysis.triple.subAnalysis.docType — e.g., 2dsa.2A260.tinoise.svg |
| db | For database access, an open database connection |
| idEdit | ID of EditedData with which docs are associated. |
| dataDescription | The data description from the first line of the original file, in case adding new triple |
Definition at line 852 of file us_report.cpp.
| void US_Report::show | ( | void | ) |
Displays the contents of the class variables in qDebug()'s.
Definition at line 1090 of file us_report.cpp.
|
private |
Debug level value.
Definition at line 305 of file us_report.h.
| int US_Report::experimentID |
The experimentID from which triple is derived.
Definition at line 200 of file us_report.h.
| QString US_Report::GUID |
The GUID of this global report structure.
Definition at line 199 of file us_report.h.
| QString US_Report::html |
Some introductory html that would appear
at the top of the report
Definition at line 203 of file us_report.h.
| int US_Report::ID |
The ID of this global report structure.
Definition at line 198 of file us_report.h.
| ReportTypes US_Report::rTypes |
Persistent structure of report type mappings.
Definition at line 206 of file us_report.h.
| QString US_Report::runID |
The runID that identifies this experiment.
Definition at line 201 of file us_report.h.
| QString US_Report::title |
The title of the report.
Definition at line 202 of file us_report.h.
| QVector< ReportTriple > US_Report::triples |
The report triple.
Definition at line 205 of file us_report.h.
1.8.3.1-20130324