// =====================================================================
//  $Id: runinfo.cc,v 1.4 2003/10/06 04:03:39 goiwai Exp $
//  $Name: CLDAQ-1-14-06 $
//  $Log: runinfo.cc,v $
//  Revision 1.4  2003/10/06 04:03:39  goiwai
//  TArgumentを使用するように全てのプログラムを修整しました.
//
//  Revision 1.3  2003/07/30 16:21:39  goiwai
//  ファイルにコミットログをつけることにしました.
//
// =====================================================================
#include "TOutputHtmlFileStream.hh"
#include "TRunInformationTable.hh"
#include "TRunInformation.hh"
#include "TBenchmark.hh"
#include "TArgument.hh"

int main( int argc, char** argv, char** envv )
{
  TArgument arg( argc, argv );

  TBenchmark bench;
  bench.Start();

  // ランイフォメーションテーブルを作る
  TstringList selectlist;
  selectlist.push_back( "SOURCE RUN" );
  selectlist.push_back( "DARK RUN" );
  selectlist.push_back( "TEST RUN" );
  selectlist.push_back( "DUMMY RUN" );
  TRunInformationList infolist;
  infolist.push_back( TRunInformation( "OPERATOR", tInfoFreeValue ) );
  infolist.push_back( TRunInformation( "RUN TYPE", selectlist ) );
  infolist.push_back( TRunInformation( "COMMENT", tInfoFreeText ) );
  TRunInformationTable table( infolist );


  infolist.clear();
  infolist.push_back( TRunInformation( "__OPERATOR", tInfoFreeValue ) );
  infolist.push_back( TRunInformation( "__RUN TYPE", selectlist ) );
  infolist.push_back( TRunInformation( "__COMMENT", tInfoFreeText ) );
  TRunInformationTable table2( infolist );

  TOutputHtmlFileStream html;
  html.Open( "runinfo1.html" );
  html << table << Tendl;
  html << infolist[ 1 ] << Tendl;
  html << "Free Comment<br>" << Tendl;
  html << "<ul>" << Tendl;
  html << "<li>Free Comment" << Tendl;
  html << "<li>Free Comment" << Tendl;
  html << "<li>Free Comment" << Tendl;
  html << "<li>Free Comment" << Tendl;
  html << "<li>Free Comment" << Tendl;
  html << "</ul>" << Tendl;
  html << infolist[ 0 ] << Tendl;
  html << table + table2 << Tendl;
  html.Close();


  html.Open( "runinfo2.html" );
  html << table << Tendl;
  html.Close();


  html.Open( "runinfo3.html", "CLDAQ" );
  html << infolist[ 0 ] << Tendl;
  html << table + table2 << Tendl;
  html.Close();


  bench.Stop();
  Tcout << bench << Tendl;

  return 0;
}
