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

TRecordDisplay.hh

解説を見る。
00001 // ============================================================================
00002 //  $Id: TRecordDisplay.hh,v 1.2 2004/03/07 10:30:27 goiwai Exp $
00003 //  $Name: CLDAQ-1-13-00 $
00004 //  $Log: TRecordDisplay.hh,v $
00005 //  Revision 1.2  2004/03/07 10:30:27  goiwai
00006 //  ROOTに組みこむためのおまじないマクロを埋めこみました。
00007 //  全てにおいて完全に動作するわけではありません。
00008 //
00009 //  Revision 1.1  2004/03/01 02:36:25  goiwai
00010 //  RecordDisplay用のクラス群を置きました.
00011 //  お蔵入りになってたものに手直しを加えたものですが,
00012 //  まだ不充分な点も在ります.徐々に修正していきたいと思います.
00013 //  DataRecordオブジェクトを表示するためのツール群なのでRecordDisplayと呼
00014 //  んでいます,多分にオフライン要素が強いです.
00015 //  オンラインよりにしたものを後でEventDisplay(Eventを表示)としてコミット
00016 //  します.
00017 //
00018 // ============================================================================
00019 #ifdef __CLDAQ_ROOT_USE
00020 #ifndef CLDAQ__TRECORDDISPLAY_HH
00021 #define CLDAQ__TRECORDDISPLAY_HH
00022 
00023 #include <TGFrame.h>
00024 #include "Tglobals.h"
00025 #include "TRecordDisplayComponent.hh"
00026 
00027 class TGMainFrame;
00028 class TRecordDisplayPreference;
00029 class TRecordAssociationTable;
00030 class TH1D;
00031 class TRootEmbeddedCanvas;
00032 class TApplication;
00033 class TRecordDisplayCanvas;
00034 class TRecordDisplayTab;
00035 class TDirectory;
00036 class TRecordDisplayMenuBar;
00037 
00038 
00039 // コミットしますがまだまともに動いてないです
00040 // お遊び程度に考えましょう
00041 // TODOを書いておきます
00042 // 
00043 // 多くのメソッドがまだOpen(),SaveAs(),Pause()等が実装されていません
00044 //   特に状態をコントロール出来るように
00045 //   Start(),Pause(),Stop(),Update()はしっかりと
00046 //   Pause(),Stop()が手つかず
00047 //   これに手を入れるとStart()の内部をいじくる必要ある
00048 // Preferences()
00049 //   動的に設定を変更・更新出来るように
00050 //   設定キャンバスが起動
00051 //   もう少し設定内容が多くてもいい
00052 // TRecordAssociation
00053 //   もうすこし設定内容増やしてもよい
00054 // View関係のメソッドは後回し
00055 // 動的にファイル(*.drec)の設定して,表示
00056 // Initialize()
00057 //   メニューバー残して全部消えるように
00058 //   多少のメモリリークは無視
00059 // メモリリーク
00060 //   TRecordDisplayTab,TRecordDisplayMenuBar で発生
00061 // Event Displayとしての使われ方のイメージ
00062 //   SystemBeginで new
00063 //     RunBegin -> Initialize()
00064 //       EventBeginで設定をHash
00065 //       EventEndでフィルとか更新
00066 //     RunEndでセーブする
00067 //   SystemEndでTerminate
00068 
00069 
00070 class TRecordDisplay
00071   : public TRecordDisplayComponent, public TGMainFrame
00072 {
00073 
00074   public:
00075     enum {
00076       MENU_FILE_OPEN,
00077       MENU_FILE_BROWSE,
00078       MENU_FILE_SAVE,
00079       MENU_FILE_SAVEAS,
00080       MENU_FILE_PRINT,
00081       MENU_FILE_PRINTAS,
00082       MENU_FILE_QUIT,
00083 
00084       MENU_CTRL_START,
00085       MENU_CTRL_PAUSE,
00086       MENU_CTRL_UPDATE,
00087       MENU_CTRL_STOP,
00088 
00089       MENU_EDIT_EDIT,
00090       MENU_EDIT_UNDO,
00091       MENU_EDIT_CLEAR,
00092       MENU_EDIT_INITIALIZE,
00093       MENU_EDIT_PREFERENCES,
00094 
00095       MENU_VIEW_FULL_SCREEN,
00096       MENU_VIEW_ICONIFY,
00097       MENU_VIEW_COLOR_LIST,
00098       MENU_VIEW_FONT_LIST,
00099       MENU_VIEW_MARKER_LIST,
00100       MENU_VIEW_X3D,
00101       MENU_VIEW_OPEN_GL,
00102 
00103       N_MESSAGE_ID
00104     };
00105 
00106   private:
00107     static TApplication* theApplication;
00108 
00109   private:
00110     TRecordDisplayPreference* thePreference;
00111     TRecordAssociationTable* theAssociationTable;
00112     Tint theNumberOfRecords;
00113     Tbool theAutoBuild;
00114     TRecordDisplayTab* theTab;
00115     TRecordDisplayMenuBar* theMenu;
00116 
00117   public:
00118     TRecordDisplay();
00119     TRecordDisplay( const Tstring& filename, TRecordAssociationTable* as = 0 );
00120     TRecordDisplay( TRecordDisplayPreference* pre, const Tstring& filename, TRecordAssociationTable* as = 0 );
00121     TRecordDisplay( TRecordDisplayPreference* pre, TRecordAssociationTable* as = 0 );
00122     ~TRecordDisplay();
00123 
00124   public:
00125     // File Menu
00126     Tvoid Open();
00127     Tvoid Browse();
00128     Tvoid Save();
00129     Tvoid SaveAs();
00130     Tvoid Print();
00131     Tvoid PrintAs();
00132     Tvoid Quit();
00133 
00134     // Control Menu
00135     Tvoid Start();
00136     Tvoid Start( const Tstring& filename );
00137     Tvoid Pause();
00138     Tvoid Update();
00139     Tvoid Stop();
00140 
00141     // Edit Menu
00142     Tvoid Edit();
00143     Tvoid Undo();
00144     Tvoid Clear();
00145     Tvoid Initialize();
00146     Tvoid Preferences();
00147 
00148   public:
00149     Tvoid Associate();
00150     Tvoid AutoBuild();
00151     Tvoid Build();
00152     TDirectory* GetDirectory( Tstring* tags );
00153     Tstring GetHistogramName( Tint id ) const;
00154     Tstring GetCanvasName( Tint id ) const;
00155     Tvoid BuildMenuBar();
00156     Tvoid BuildTabFrame();
00157     TGCompositeFrame* GetFrame( Tstring* tags );
00158 
00159   public:
00160     const TRecordDisplayPreference* GetPreference() const;
00161     const TRecordAssociationTable* GetAssociationTable() const;
00162     Tint GetNumberOfRecords() const;
00163     Tbool IsAutoBuild() const;
00164     Tbool ProcessMessage( Tlong msg, Tlong id, Tlong arg );
00165 
00166   public:
00167     static TApplication* GetApplication();
00168 
00169 #ifdef __CLDAQ_ROOT_DLL
00170     ClassDef(TRecordDisplay,0)
00171 #endif
00172 
00173 };
00174 
00175 inline TApplication* TRecordDisplay::GetApplication()
00176 {
00177   return theApplication;
00178 }
00179 
00180 inline const TRecordDisplayPreference* TRecordDisplay::GetPreference() const
00181 {
00182   return thePreference;
00183 }
00184 
00185 inline const TRecordAssociationTable* TRecordDisplay::GetAssociationTable() const
00186 {
00187   return theAssociationTable;
00188 }
00189 
00190 inline Tint TRecordDisplay::GetNumberOfRecords() const
00191 {
00192   return theNumberOfRecords;
00193 }
00194 
00195 inline Tbool TRecordDisplay::IsAutoBuild() const
00196 {
00197   return theAutoBuild;
00198 }
00199 
00200 #endif
00201 #endif

CLDAQ - a Class Library for Data AcQuisition (Version 1.13.0)
Go IWAI <goiwai@users.sourceforge.jp>