BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
BmnHtmlReportElement.cxx
Go to the documentation of this file.
1
/**
2
* \file BmnHtmlReportElement.cxx
3
* \author Semen Lebedev <s.lebedev@gsi.de>
4
* \date 2011
5
*/
6
#include "
BmnHtmlReportElement.h
"
7
8
#include <sstream>
9
10
using
std::endl;
11
using
std::stringstream;
12
13
BmnHtmlReportElement::BmnHtmlReportElement
() {}
14
15
BmnHtmlReportElement::~BmnHtmlReportElement
() {}
16
17
string
BmnHtmlReportElement::TableBegin
(
const
string
& caption,
const
vector<string>& colNames)
const
18
{
19
stringstream ss;
20
ss <<
"<h2>"
<< caption <<
"</h2>"
;
21
ss <<
"<table id=\"efficiency\" >"
<< endl;
22
ss <<
"<tr>"
;
23
for
(
size_t
i
= 0;
i
< colNames.size();
i
++)
24
ss <<
"<th>"
<< colNames[
i
] <<
"</th>"
;
25
ss <<
"</tr>"
<< endl;
26
return
ss.str();
27
}
28
29
string
BmnHtmlReportElement::TableEnd
()
const
30
{
31
return
"</table>"
;
32
}
33
34
string
BmnHtmlReportElement::TableEmptyRow
(
int
nofCols,
const
string
& name)
const
35
{
36
stringstream ss;
37
ss <<
"<td colspan=\""
<< nofCols <<
"\"><center><b>"
<< name <<
"</b></center></td></tr>"
<< endl;
38
return
ss.str();
39
}
40
41
string
BmnHtmlReportElement::TableRow
(
const
vector<string>& row)
const
42
{
43
string
st =
"<tr>"
;
44
for
(
size_t
i
= 0;
i
< row.size();
i
++)
45
st +=
"<td>"
+ row[
i
] +
"</td>"
;
46
st +=
"</tr> \n"
;
47
return
st;
48
}
49
50
string
BmnHtmlReportElement::Image
(
const
string
& title,
const
string
& file)
const
51
{
52
stringstream ss;
53
ss <<
"<h3>"
<< title <<
"</h3>"
;
54
ss <<
"<img src=\""
<< file <<
".png\" alt=\""
<< title <<
"\" />"
;
55
56
return
ss.str();
57
}
58
59
string
BmnHtmlReportElement::DocumentBegin
()
const
60
{
61
string
str =
"<html><body><head><style type=\"text/css\">"
;
62
str +=
"#efficiency"
;
63
str +=
"{"
;
64
str +=
"font-family:Verdana, Arial, Helvetica, sans-serif;"
;
65
// str += "width:100%;";
66
str +=
"border-collapse:collapse;"
;
67
str +=
"}"
;
68
str +=
"#efficiency td, #efficiency th"
;
69
str +=
"{"
;
70
str +=
"font-size:1em;"
;
71
str +=
"border:1px solid #98bf21;"
;
72
str +=
"padding:3px 7px 2px 7px;"
;
73
str +=
"}"
;
74
str +=
"#efficiency th"
;
75
str +=
"{"
;
76
str +=
"font-size:1.1em;"
;
77
str +=
"text-align:left;"
;
78
str +=
"padding-top:5px;"
;
79
str +=
"padding-bottom:4px;"
;
80
str +=
"background-color:#A7C942;"
;
81
str +=
"color:#ffffff;"
;
82
str +=
"}"
;
83
str +=
"#efficiency tr.alt td"
;
84
str +=
"{"
;
85
str +=
"color:#000000;"
;
86
str +=
"background-color:#EAF2D3;"
;
87
str +=
"}"
;
88
str +=
"</style></head>"
;
89
return
str;
90
}
91
92
string
BmnHtmlReportElement::DocumentEnd
()
const
93
{
94
return
"</body></html>"
;
95
}
96
97
string
BmnHtmlReportElement::Title
(
int
size,
const
string
& title)
const
98
{
99
stringstream ss;
100
ss <<
"<h"
<< size + 1 <<
">"
<< title <<
"</h"
<< size + 1 <<
">"
;
101
return
ss.str();
102
}
i
int i
Definition
P4_F32vec4.h:22
BmnHtmlReportElement.h
Implementation of BmnReportElement for HTML output.
BmnHtmlReportElement::DocumentEnd
virtual string DocumentEnd() const
Inherited from BmnReportElement.
Definition
BmnHtmlReportElement.cxx:92
BmnHtmlReportElement::TableEmptyRow
virtual string TableEmptyRow(int nofCols, const string &name) const
Inherited from BmnReportElement.
Definition
BmnHtmlReportElement.cxx:34
BmnHtmlReportElement::~BmnHtmlReportElement
virtual ~BmnHtmlReportElement()
Destructor.
Definition
BmnHtmlReportElement.cxx:15
BmnHtmlReportElement::BmnHtmlReportElement
BmnHtmlReportElement()
Constructor.
Definition
BmnHtmlReportElement.cxx:13
BmnHtmlReportElement::Image
virtual string Image(const string &title, const string &file) const
Inherited from BmnReportElement.
Definition
BmnHtmlReportElement.cxx:50
BmnHtmlReportElement::TableBegin
virtual string TableBegin(const string &caption, const vector< string > &colNames) const
Inherited from BmnReportElement.
Definition
BmnHtmlReportElement.cxx:17
BmnHtmlReportElement::TableEnd
virtual string TableEnd() const
Inherited from BmnReportElement.
Definition
BmnHtmlReportElement.cxx:29
BmnHtmlReportElement::Title
virtual string Title(int size, const string &title) const
Inherited from BmnReportElement.
Definition
BmnHtmlReportElement.cxx:97
BmnHtmlReportElement::DocumentBegin
virtual string DocumentBegin() const
Inherited from BmnReportElement.
Definition
BmnHtmlReportElement.cxx:59
BmnHtmlReportElement::TableRow
virtual string TableRow(const vector< string > &row) const
Inherited from BmnReportElement.
Definition
BmnHtmlReportElement.cxx:41
QA
report
BmnHtmlReportElement.cxx
Generated on
for BmnRoot by
1.17.0