13 option_title.ReplaceAll(
"#",
" ");
17 option_subtitle.ReplaceAll(
"#",
" ");
21 option_multi.ToUpper();
24 cout <<
"cwb_mkhtml_file.C - Error : empty file name !!!" << endl;
exit(1);
26 if(file_name.Contains(
"..")) {
27 cout <<
"cwb_mkhtml_file.C - Error : file_name must not contains '..' !!!" << endl;
exit(1);
29 if(file_name==
".") file_name=gSystem->WorkingDirectory();
34 if(flags&2 || file_name==
".") {
39 cout <<
"cwb_mkhtml_file.C - Error : no *.png files found !!!" << endl;
exit(1);
44 TString texiName=odir+
"/png_html_index.texi";
46 if(!overwrite) gSystem->Exit(0);
49 out <<
"@c include texi macros" << endl;
50 out <<
"@include macros.texi" << endl;
51 out <<
"@include mathjax.texi" << endl << endl;
53 if(option_title!=
"") {
54 out <<
"@center @txtfont{"<<
"<br>"<<option_title<<
"<br>"<<
", blue, h1}" << endl;
55 if(option_subtitle!=
"") out <<
"@center @txtcolor{"<<option_subtitle.Data()<<
",black}" << endl;
57 out <<
"@drawline" << endl;
60 if(option_multi==
"TRUE") {
61 for(
int i=0;
i<pngList.size();
i++) {
63 name=gSystem->BaseName(name);
65 out <<
"@multitable @columnfractions .5 .5" << endl;
66 out <<
"@item @center @txtfont{"<<
i+1<<
", red, h2}" << endl;
67 out <<
"@center @displayimage{../.,"<<name<<
",470}"<<endl;
69 out <<
"@tab @center @txtfont{"<<
i+1<<
", red, h2}" << endl;
70 out <<
"@center @displayimage{../.,"<<name<<
",470}"<<endl;
71 out <<
"@end multitable" << endl;
74 if(pngList.size()%2==1) out <<
"@end multitable" << endl;
76 for(
int i=0;
i<pngList.size();
i++) {
78 name=gSystem->BaseName(name);
79 out <<
"@center @txtfont{"<<
i+1<<
", red, h2}" << endl;
80 out <<
"@center @displayimage{../.,"<<name<<
",1000}"<<endl;
86 TString exec_cmd = TString::Format(
"%s/cwb_mkhtml.csh %s wheader;rm %s",
87 cwb_scripts.Data(),texiName.Data(),texiName.Data());
88 int ret=gSystem->Exec(exec_cmd);
90 cout <<
"cwb_mkhtml_file.C : Error while executing cwb_mkhtml png_html_index.texi !!!" << endl;
96 if(!file_name.EndsWith(
".C")) {
97 }
else if(!file_name.EndsWith(
".cc")) {
98 }
else if(!file_name.EndsWith(
".hh")) {
99 }
else if(!file_name.EndsWith(
".c")) {
100 }
else if(!file_name.EndsWith(
".h")) {
102 cout <<
"cwb_mkhtml_file.C - Error : file name must ends with .C/.c/.h/.cc/.hh !!!" << endl;
exit(1);
105 if(!file_name.BeginsWith(
"/")) {
107 file_name =
TString(gSystem->WorkingDirectory())+
"/"+tmp;
112 html_dir.ReplaceAll(
".C",
"");
113 html_dir.ReplaceAll(
".cc",
"");
114 html_dir.ReplaceAll(
".hh",
"");
115 html_dir.ReplaceAll(
".c",
"");
116 html_dir.ReplaceAll(
".h",
"");
120 html.SetEtcDir(gSystem->ExpandPathName(
"$HOME_WAT/html/etc/html"));
121 html.SetProductName(
"CWB");
122 TString html_input_dir=html_dir;
123 html.SetInputDir(html_input_dir.Data());
126 sprintf(cmd,
"cp %s/html/etc/html/ROOT.css %s/",gSystem->ExpandPathName(
"$HOME_WAT"),html_dir.Data());
128 sprintf(cmd,
"cp %s/html/etc/html/ROOT.js %s/",gSystem->ExpandPathName(
"$HOME_WAT"),html_dir.Data());
132 fpos_t poserr; fflush(stderr); fgetpos(stderr, &poserr);
133 int fderr = dup(fileno(stderr)); freopen(
"/dev/null",
"w", stderr);
135 fpos_t posout; fflush(stdout); fgetpos(stdout, &posout);
136 int fdout = dup(fileno(stdout)); freopen(
"/dev/null",
"w", stdout);
139 html.Convert(file_name.Data(),file_name.Data(),html_dir,
"");
148 fflush(stderr); dup2(fderr, fileno(stderr));
close(fderr);
149 clearerr(stderr); fsetpos(stderr, &poserr);
151 fflush(stdout); dup2(fdout, fileno(stdout));
close(fdout);
152 clearerr(stdout); fsetpos(stdout, &posout);
154 TString html_file = html_dir+
"/"+gSystem->BaseName(file_name)+
".html";
155 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)