]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MONITOR/AliMonitorClient.h
AliHMPIDDigitN no longer needed
[u/mrichter/AliRoot.git] / MONITOR / AliMonitorClient.h
CommitLineData
04fa961a 1#ifndef ALIMONITORCLIENT_H
2#define ALIMONITORCLIENT_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
8#include <TGFrame.h>
04fa961a 9#include <RQ_OBJECT.h>
c4bd737c 10#include "AliMonitorDialog.h"
11
12class TGListTreeItem;
13class TGLayoutHints;
14class TGPopupMenu;
15class TGMenuBar;
16class TGHorizontal3DLine;
17class TGToolBar;
18class TGNumberEntry;
19class TGPicture;
20class TGButton;
21class TGCanvas;
22class TGListTree;
23class TGVSplitter;
24class TGHSplitter;
25class TRootEmbeddedCanvas;
26class TGTextView;
27class TGLabel;
28class TGTextEntry;
29class TSocket;
30class TFileHandler;
31class TFolder;
32class TTimer;
33class AliMonitorHisto;
04fa961a 34
35
36class AliMonitorClient : public TGMainFrame {
37
38RQ_OBJECT("AliMonitorClient")
39
40public:
41 AliMonitorClient();
42 virtual ~AliMonitorClient();
43
44 void CloseWindow();
45
46 void OnNewData();
47
48 void OnMenuActivated(Int_t id);
49
50 void OnEventNumberChanged();
51 void OnEventButtonPressed();
52 void OnSumButtonPressed();
53 void OnRunButtonPressed();
54 void OnLoopButtonClicked();
55 void OnPreviousButtonClicked();
56 void OnNextButtonClicked();
57 void OnCopyButtonClicked();
58 void OnSaveButtonClicked();
59 void OnPrintButtonClicked();
60
61 void OnTreeClicked(TGListTreeItem* item, Int_t btn);
62 void OnTreeReturnPressed(TGListTreeItem* item);
63
64 void OnLoopTimer();
65
66private:
d557984f 67 AliMonitorClient(const AliMonitorClient& client); // Not implemented
68 AliMonitorClient& operator = (const AliMonitorClient& client); // Not implemented
69
c4bd737c 70 TFolder* CreateTopFolder() const;
04fa961a 71 AliMonitorHisto* GetHisto(const char* folderName, const char* histoName);
72 TGListTreeItem* GetItem(TGListTreeItem* base, const char* folderName,
73 const char* histoName, Bool_t create);
74
75 Bool_t ConnectToServer();
76 void DisconnectFromServer();
77 Bool_t OpenFile();
78
79 void ViewToolBar(Bool_t visible);
80 void ViewTree(Bool_t visible);
81 void ViewDescription(Bool_t visible);
82 void ViewReference(Bool_t visible);
83 void ViewStatistics(Bool_t visible);
84
85 Bool_t AddFavorite();
86 Bool_t DeleteFavorite();
87 Bool_t LoadFavorites(Bool_t dialog = kTRUE);
88 Bool_t SaveFavorites();
89 Bool_t SaveFavoritesAs();
90
91 Bool_t LoadReference(Bool_t dialog = kTRUE);
92 void SetReference();
93 Bool_t TakeCurrentReference();
94 void TakeReferenceHisto(const char* folderName,
95 AliMonitorHisto* histo);
96 void TakeReferenceFolder(TGListTreeItem* item);
97 Bool_t SaveReference();
98 Bool_t SaveReferenceAs();
99
100 void LoadSettings();
101 void SaveSettings();
102
103 void StopLoop();
104 Bool_t GetBaseItem();
105 Bool_t GoToNextItem();
106 Bool_t GoToPreviousItem();
107 void UpdateItem(Bool_t highlight);
108
109 Bool_t CheckForNewData();
c4bd737c 110 void ClearItems(TGListTreeItem* base) const;
04fa961a 111 void CleanUpTree(TGListTreeItem* base);
112 void UpdateTree();
113 void UpdateFavoritesTree();
114 void UpdateComparisonTree();
115 void UpdateDescription();
116 void UpdateHisto();
117 void UpdateAll();
118
c4bd737c 119 TGLayoutHints* fMenuBarLayout; // layout of the menu bar
120 TGLayoutHints* fMenuBarItemLayout; // layout of the menu items
121 TGLayoutHints* fMenuBarHelpLayout; // layout of the help menu
122 TGPopupMenu* fMenuFile; // the file menu
123 TGPopupMenu* fMenuView; // the view menu
124 TGPopupMenu* fMenuFavorites; // the favorites menu
125 TGPopupMenu* fMenuReference; // the reference menu
126 TGPopupMenu* fMenuOptions; // the options menu
127 TGPopupMenu* fMenuHelp; // the help menu
128 TGMenuBar* fMenuBar; // the menu bar
129
130 TGLayoutHints* fToolBarLayout; // layout of the tool bar
131 TGHorizontal3DLine* fToolBarSep; // separation of the tool bar
132 TGToolBar* fToolBar; // the tool bar
133 TGLayoutHints* fEventNumberLayout; // layout of the event number
134 TGNumberEntry* fEventNumber; // the event number
135 TGButton* fEventButton; // the button for one event
136 TGButton* fSumButton; // the button for the sum of events
137 TGButton* fRunButton; // the button for a run
138 TGButton* fLoopButton; // the botton for the loop
139 const TGPicture* fLoopOnPicture; // the picture for running loop
140 const TGPicture* fLoopOffPicture; // the picture for stoped loop
141 TGButton* fPreviousButton; // the button for previous histo
142 TGButton* fNextButton; // the button for next histo
143 TGButton* fCopyButton; // the button for copy histo
144 TGButton* fSaveButton; // the button for save histo
145 TGButton* fPrintButton; // the button for print histo
146
147 TGLayoutHints* fBottomLayout; // layout at bottom
148 TGLayoutHints* fLeftLayout; // layout at left
149 TGLayoutHints* fExpandLayout; // expanded layout
150
151 TGVerticalFrame* fVerticalFrame; // frame for tree/histo and description
152 TGHorizontalFrame* fHorizontalFrame; // frame for tree and histo
153
154 TGCompositeFrame* fTreeFrame; // frame for tree
155 TGCanvas* fTreeCanvas; // canvas for tree
156 TGListTree* fTree; // tree with histos
157 const TGPicture* fHistoPicture; // picture for histo item
158 TGListTreeItem* fAllItem; // top item for all histos
159 TGListTreeItem* fFavoritesItem; // top item for favorites
160 TGListTreeItem* fComparisonItem; // top item for comparison
161
162 TGVSplitter* fTreeSplitter; // splitter for tree and histo
163
164 TGCompositeFrame* fDrawFrame; // frame for histo
165 TRootEmbeddedCanvas* fDrawCanvas; // canvas for histo
166
167 TGHSplitter* fDescriptionSplitter; // splitter tree/histo and description
168
169 TGCompositeFrame* fDescriptionFrame; // frame for description
170 TGTextView* fDescription; // description text
171
172 TString fServerName; // name of the monitor server
173 TSocket* fSocket; // socket to the monitor server
174 TFileHandler* fSocketHandler; // handler for fSocket
175
176 TFolder* fFolder; // folder with histos
177
178 TGListTreeItem* fCurrentItem; // current tree item
179 TGListTreeItem* fBaseItem; // base item of current item
180 TTimer* fLoopTimer; // timer for loop over histos
181 Int_t fLoopInterval; // loop interval
182
183 TString fFavoritesFileName; // file name of favorites
184
185 TString fReferenceFileName; // file name with reference histos
186 TFolder* fReference; // folder with reference histos
187
188 TString fPrintCommand; // print command
189
190 static const char* fgSettingsFileName; // file name of settings
191
192
193 class AliMonitorStringDlg : public AliMonitorDialog {
194
195 public:
196 AliMonitorStringDlg(TString& string, TGFrame* main, const char* title,
197 const char* label);
c4bd737c 198 virtual ~AliMonitorStringDlg();
199
200 virtual void OnOkClicked();
201
202 private:
17c3cc9e 203 AliMonitorStringDlg(const AliMonitorStringDlg& dlg);
204 AliMonitorStringDlg& operator = (const AliMonitorStringDlg& /*dlg*/);
205
c4bd737c 206 TGLayoutHints* fStringLayout; // layout of the text entry
207 TGLabel* fStringLabel; // label for the text entry
208 TGTextEntry* fStringEntry; // the text enty
209
210 TString& fString; // result
211 };
212
213
214 class AliMonitorNumberDlg : public AliMonitorDialog {
215
216 public:
217 AliMonitorNumberDlg(Float_t& value, TGFrame* main, const char* title,
218 const char* label, Float_t min);
c4bd737c 219 virtual ~AliMonitorNumberDlg();
220
221 virtual void OnOkClicked();
222
223 private:
17c3cc9e 224 AliMonitorNumberDlg(const AliMonitorNumberDlg& dlg);
225 AliMonitorNumberDlg& operator = (const AliMonitorNumberDlg& /*dlg*/);
226
c4bd737c 227 TGLayoutHints* fNumberLayout; // layout of the number entry
228 TGLabel* fNumberLabel; // label for the number entry
229 TGNumberEntry* fNumberEntry; // the number entry
230
231 Float_t& fNumber; // result
232 };
233
04fa961a 234
235 ClassDef(AliMonitorClient, 0) // class for receiving and displaying monitor histograms
236};
237
238
239#endif
240
241
242
243
244
245
246
247
248