Fixing file after rebasing master
[u/mrichter/AliRoot.git] / MONITOR / alistoragemanager / AliStorageAdministratorPanel.h
1 #ifndef AliStorageAdministratorPanel_H
2 #define AliStorageAdministratorPanel_H
3
4 #include "AliStorageEventManager.h"
5
6 #include <TGFrame.h>
7 #include <TGLabel.h>
8 #include <TThread.h>
9
10 class AliStorageAdministratorPanel : public TGMainFrame
11 {
12
13 public:
14         AliStorageAdministratorPanel();
15         virtual ~AliStorageAdministratorPanel();
16 private:
17         bool fPanelQuited;
18         
19         //gui components and methods
20         TGLabel *fConnectionLabel;
21         TGLabel *fDataLabel;
22         TGLabel *fSavingLabel;
23         TGLabel *fCurrentSizeLabel;
24         TGLabel *fMaxSizeLabel;
25         TGLabel *fMaxOccupationLabel;
26         TGLabel *fRemoveEventsLabel;
27         TGLabel *fEventsInChunkLabel;
28         
29         void InitWindow();
30         void SetupThreadsFrame();
31         void SetupToolbar();
32         void SetupFixedMenuBar();
33         void SetupDockableMenuBar();
34
35         //set labels method
36         void SetLabel(TGLabel *label, int option);
37         void SetLabelValue(TGLabel *label, long value, int option);
38         
39         //handle different actions
40         void onExit();
41         void onOption1();
42         void onOption2();
43         void onOption3();
44
45         void onServerListEvents();
46         void onServerMarkEvent();
47     void onServerMarkAllEvents();
48         void onServerGetEvent();
49         void onClientSetParams();
50         void onServerGetNextEvent();
51         void onServerGetLastEvent();
52
53         //client params
54         int fMaxStorageSize;
55         int fMaxOccupation;
56         int fRemoveEvents;
57         int fEventsInChunk;
58         
59         //handle different messages
60         virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t);
61         void CloseWindow();
62          
63         //socket connection
64         TThread *fCommunicationThread;
65         storageSockets fCommunicationSocket;
66     static void* Dispatch(void *arg){static_cast<AliStorageAdministratorPanel*>(arg)->CheckStateHandle();}
67         void CheckStateHandle();
68         void CheckClientState(int option);
69         
70         storageSockets fServerSocket;//socket for two-way communication with AliStorageServerThread
71         AliStorageEventManager *fEventManager;
72
73         AliStorageAdministratorPanel(const AliStorageAdministratorPanel&);
74         AliStorageAdministratorPanel& operator=(const AliStorageAdministratorPanel&);
75         
76         ClassDef(AliStorageAdministratorPanel,0);
77 };
78
79 #endif