メインページ   モジュール   名前空間一覧   クラス階層   アルファベット順一覧   構成   ファイル一覧   構成メンバ   ファイルメンバ   関連ページ    

TRecordDisplayPreference.cc

解説を見る。
00001 // ============================================================================
00002 //  $Id: TRecordDisplayPreference.cc,v 1.3 2004/06/24 15:15:24 goiwai Exp $
00003 //  $Name: CLDAQ-1-14-03 $
00004 //  $Log: TRecordDisplayPreference.cc,v $
00005 //  Revision 1.3  2004/06/24 15:15:24  goiwai
00006 //  たくさんの変更
00007 //  Tcout,Tcerr,Tlogをバッファ経由にした。
00008 //  何個かexternした。Tlog,Tcout,Tcerr,Tinfo...Tcritなど出力関係。
00009 //
00010 //  Revision 1.2  2004/03/07 10:30:27  goiwai
00011 //  ROOTに組みこむためのおまじないマクロを埋めこみました。
00012 //  全てにおいて完全に動作するわけではありません。
00013 //
00014 //  Revision 1.1  2004/03/01 02:36:25  goiwai
00015 //  RecordDisplay用のクラス群を置きました.
00016 //  お蔵入りになってたものに手直しを加えたものですが,
00017 //  まだ不充分な点も在ります.徐々に修正していきたいと思います.
00018 //  DataRecordオブジェクトを表示するためのツール群なのでRecordDisplayと呼
00019 //  んでいます,多分にオフライン要素が強いです.
00020 //  オンラインよりにしたものを後でEventDisplay(Eventを表示)としてコミット
00021 //  します.
00022 //
00023 // ============================================================================
00024 #ifdef __CLDAQ_ROOT_USE
00025 #include "TRecordDisplayPreference.hh"
00026 #include "TInputObjectFile.hh"
00027 #include "TFileProperty.hh"
00028 
00029 TRecordDisplayPreference* TRecordDisplayPreference::thePreference = 0;
00030 TInputObjectStream* TRecordDisplayPreference::theStream = 0;
00031 
00032 static const Tint _nbin = 512;
00033 static const Tdouble _xmin = 0.0;
00034 static const Tdouble _xmax = 4096.0;
00035 
00036 TRecordDisplayPreference::TRecordDisplayPreference( TInputObjectStream* stream, const Tstring& style )
00037   : theUpdateCycle( 1 ),
00038     theSleepTime( -1 ),
00039     theTerminateAtLast( Tfalse ),
00040     theSaveRootAtLast( Ttrue ),
00041     theSavePsAtLast( Tfalse ),
00042     theSaveGifAtLast( Tfalse ),
00043     theEndOfRecordID(),
00044     theRootOfFileName(),
00045     theDefaultNumberOfBins( _nbin ),
00046     theDefaultMinimumX( _xmin ),
00047     theDefaultMaximumX( _xmax ),
00048     theStyleName( style ),
00049     theCanvasLayoutHint( 0 ),
00050     theTabLayoutHint( 0 ),
00051     thePopupMenuLayoutHint( 0 ),
00052     theMenuBarLayoutHint( 0 )
00053 {
00054   if ( thePreference ) {
00055     Tcout << "Preference constructed twice." << Tendl;
00056     exit( EXIT_SUCCESS );
00057   }
00058   thePreference = this;
00059   theStream = stream;
00060 
00061   TStyle* st = gROOT -> GetStyle( theStyleName.c_str() );
00062   if ( st ) {
00063     st -> cd();
00064   } else {
00065     theStyleName = Tproject;
00066   }
00067 
00068   theCanvasLayoutHint =
00069     new TGLayoutHints( kLHintsCenterX|kLHintsCenterY|kLHintsExpandX|kLHintsExpandY, 0, 0, 0, 0 );
00070   theTabLayoutHint = 
00071     new TGLayoutHints( kLHintsCenterX|kLHintsCenterY|kLHintsExpandX|kLHintsExpandY,  10, 10, 10, 10 );
00072   thePopupMenuLayoutHint = new TGLayoutHints(kLHintsTop|kLHintsLeft,0,4);
00073   theMenuBarLayoutHint = new TGLayoutHints( kLHintsTop|kLHintsLeft|kLHintsExpandX );
00074 
00075 }
00076 
00077 TRecordDisplayPreference::~TRecordDisplayPreference()
00078 {
00079   delete theCanvasLayoutHint;
00080   delete theTabLayoutHint;
00081   delete thePopupMenuLayoutHint;
00082   delete theMenuBarLayoutHint;
00083 
00084   if ( theStream ) {
00085     delete theStream;
00086     theStream = 0;
00087   }
00088 
00089   if ( thePreference ) {
00090     thePreference = 0;
00091   }
00092 }
00093 
00094 Tvoid TRecordDisplayPreference::GuessRootOfFileName()
00095 {
00096   if ( theStream && theStream -> GetStreamType() == tFileStream ) {
00097     Tstring drec = ( (TInputObjectFile*)theStream ) -> GetFileName();
00098     TFileProperty pty( drec );
00099     theRootOfFileName = pty.GetFileRootName();
00100   } else {
00101     theRootOfFileName = Tproject;
00102   }
00103   return;
00104 }
00105 
00106 Tstring TRecordDisplayPreference::RootFile()
00107 {
00108   GuessRootOfFileName();
00109   Tstring filename = theRootOfFileName + ".root";
00110   return filename;
00111 }
00112 
00113 #endif
00114 
00115 #ifdef __CLDAQ_ROOT_DLL
00116     ClassImp(TRecordDisplayPreference)
00117 #endif


CLDAQ - a Class Library for DataAcQuisition (Version 1.14.3)
Go IWAI -- goiwai at users.sourceforge.jp