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

TRecordDisplay.hh

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

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