31 option_title.ReplaceAll(
"#",
" ");
35 option_subtitle.ReplaceAll(
"#",
" ");
39 option_multi.ToUpper();
42 cout <<
"cwb_mkhtml_file.C - Error : empty file name !!!" << endl;
exit(1);
44 if(file_name.Contains(
"..")) {
45 cout <<
"cwb_mkhtml_file.C - Error : file_name must not contains '..' !!!" << endl;
exit(1);
47 if(file_name==
".") file_name=gSystem->WorkingDirectory();
52 if(flags&2 || file_name==
".") {
57 cout <<
"cwb_mkhtml_file.C - Error : no *.png files found !!!" << endl;
exit(1);
62 TString texiName=odir+
"/png_html_index.texi";
64 if(!overwrite) gSystem->Exit(0);
67 out <<
"@c include texi macros" << endl;
68 out <<
"@include macros.texi" << endl;
69 out <<
"@include mathjax.texi" << endl << endl;
71 if(option_title!=
"") {
72 out <<
"@center @txtfont{"<<
"<br>"<<option_title<<
"<br>"<<
", blue, h1}" << endl;
73 if(option_subtitle!=
"") out <<
"@center @txtcolor{"<<option_subtitle.Data()<<
",black}" << endl;
75 out <<
"@drawline" << endl;
78 if(option_multi==
"TRUE") {
79 for(
int i=0;
i<pngList.size();
i++) {
81 name=gSystem->BaseName(name);
83 out <<
"@multitable @columnfractions .5 .5" << endl;
84 out <<
"@item @center @txtfont{"<<
i+1<<
", red, h2}" << endl;
85 out <<
"@center @displayimage{../.,"<<name<<
",470}"<<endl;
87 out <<
"@tab @center @txtfont{"<<
i+1<<
", red, h2}" << endl;
88 out <<
"@center @displayimage{../.,"<<name<<
",470}"<<endl;
89 out <<
"@end multitable" << endl;
92 if(pngList.size()%2==1) out <<
"@end multitable" << endl;
94 for(
int i=0;
i<pngList.size();
i++) {
96 name=gSystem->BaseName(name);
97 out <<
"@center @txtfont{"<<
i+1<<
", red, h2}" << endl;
98 out <<
"@center @displayimage{../.,"<<name<<
",1000}"<<endl;
104 TString exec_cmd = TString::Format(
"%s/cwb_mkhtml.csh %s wheader;rm %s",
105 cwb_scripts.Data(),texiName.Data(),texiName.Data());
106 int ret=gSystem->Exec(exec_cmd);
108 cout <<
"cwb_mkhtml_file.C : Error while executing cwb_mkhtml png_html_index.texi !!!" << endl;
114 indexName.ReplaceAll(
".texi",
"/index.html");
116 sprintf(cmd,
"sed -i 's/<title>CWB Display/<title>CWB Report/g' %s",indexName.Data());
122 if(!file_name.EndsWith(
".C")) {
123 }
else if(!file_name.EndsWith(
".cc")) {
124 }
else if(!file_name.EndsWith(
".hh")) {
125 }
else if(!file_name.EndsWith(
".c")) {
126 }
else if(!file_name.EndsWith(
".h")) {
128 cout <<
"cwb_mkhtml_file.C - Error : file name must ends with .C/.c/.h/.cc/.hh !!!" << endl;
exit(1);
131 if(!file_name.BeginsWith(
"/")) {
133 file_name =
TString(gSystem->WorkingDirectory())+
"/"+tmp;
138 html_dir.ReplaceAll(
".C",
"");
139 html_dir.ReplaceAll(
".cc",
"");
140 html_dir.ReplaceAll(
".hh",
"");
141 html_dir.ReplaceAll(
".c",
"");
142 html_dir.ReplaceAll(
".h",
"");
146 html.SetEtcDir(gSystem->ExpandPathName(
"$HOME_WAT/html/etc/html"));
147 html.SetProductName(
"CWB");
148 TString html_input_dir=html_dir;
149 html.SetInputDir(html_input_dir.Data());
152 sprintf(cmd,
"cp %s/html/etc/html/ROOT.css %s/",gSystem->ExpandPathName(
"$HOME_WAT"),html_dir.Data());
154 sprintf(cmd,
"cp %s/html/etc/html/ROOT.js %s/",gSystem->ExpandPathName(
"$HOME_WAT"),html_dir.Data());
158 fpos_t poserr; fflush(stderr); fgetpos(stderr, &poserr);
159 int fderr = dup(fileno(stderr)); freopen(
"/dev/null",
"w", stderr);
161 fpos_t posout; fflush(stdout); fgetpos(stdout, &posout);
162 int fdout = dup(fileno(stdout)); freopen(
"/dev/null",
"w", stdout);
166 sprintf(title,
"<h2 class=\"convert\" align=\"center\"> %s </h2>",file_name.Data());
167 html.Convert(file_name.Data(),
"",html_dir,
"", 0,
title);
170 fflush(stderr); dup2(fderr, fileno(stderr));
close(fderr);
171 clearerr(stderr); fsetpos(stderr, &poserr);
173 fflush(stdout); dup2(fdout, fileno(stdout));
close(fdout);
174 clearerr(stdout); fsetpos(stdout, &posout);
176 TString html_file = html_dir+
"/"+gSystem->BaseName(file_name)+
".html";
177 cout << endl <<
"created html file : " << html_file << endl << endl;
void cwb_mkhtml_file(TString file_name, TString options="")
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)