]>
Commit | Line | Data |
---|---|---|
d810d0de | 1 | // $Id$ |
2 | // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 | |
3 | ||
4 | /************************************************************************** | |
5 | * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. * | |
6 | * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * | |
51346b82 | 7 | * full copyright notice. * |
d810d0de | 8 | **************************************************************************/ |
9 | ||
10 | #include "AliEveHOMERManagerEditor.h" | |
707b281a | 11 | #include "AliEveHOMERManager.h" |
d810d0de | 12 | |
13 | #include <TVirtualPad.h> | |
14 | #include <TColor.h> | |
7279ee15 | 15 | #include <TROOT.h> |
d810d0de | 16 | |
17 | #include <TGLabel.h> | |
18 | #include <TGButton.h> | |
19 | #include <TGNumberEntry.h> | |
20 | #include <TGColorSelect.h> | |
21 | #include <TGDoubleSlider.h> | |
707b281a | 22 | |
57ffa5fb | 23 | //______________________________________________________________________________ |
d810d0de | 24 | // AliEveHOMERManagerEditor |
25 | // | |
26 | ||
27 | ClassImp(AliEveHOMERManagerEditor) | |
28 | ||
29 | AliEveHOMERManagerEditor::AliEveHOMERManagerEditor(const TGWindow *p, Int_t width, Int_t height, | |
30 | UInt_t options, Pixel_t back) : | |
31 | TGedFrame(p, width, height, options | kVerticalFrame, back), | |
32 | fM(0), | |
7279ee15 | 33 | fButtonConnect(0), |
34 | fButtonNextEvent(0), | |
ea9a0e13 | 35 | fButtonNavigateBack(0), |
36 | fButtonNavigateFwd(0), | |
7279ee15 | 37 | fButtonEventLoop(0), |
38 | fEventLoopStarted(kFALSE) { | |
39 | ||
d810d0de | 40 | MakeTitle("AliEveHOMERManager"); |
41 | ||
42 | // Create widgets | |
43 | // fXYZZ = new TGSomeWidget(this, ...); | |
44 | // AddFrame(fXYZZ, new TGLayoutHints(...)); | |
45 | // fXYZZ->Connect("SignalName()", "AliEveHOMERManagerEditor", this, "DoXYZZ()"); | |
46eadbb4 | 46 | |
7279ee15 | 47 | fButtonConnect = new TGTextButton(this, " Connect to HLT "); |
48 | AddFrame(fButtonConnect); //, new TGLayoutHints(...)); | |
49 | fButtonConnect->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "ConnectToHLT()"); | |
50 | ||
51 | fButtonNextEvent = new TGTextButton(this, " NextEvent "); | |
52 | AddFrame(fButtonNextEvent); //, new TGLayoutHints(...)); | |
53 | fButtonNextEvent->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "NextEvent()"); | |
54 | ||
ea9a0e13 | 55 | fButtonNavigateBack = new TGTextButton(this, " Navigate Back "); |
56 | AddFrame(fButtonNavigateBack); //, new TGLayoutHints(...)); | |
57 | fButtonNavigateBack->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "NavigateBack()"); | |
58 | ||
59 | fButtonNavigateFwd = new TGTextButton(this, " Navigate Fwd "); | |
60 | AddFrame(fButtonNavigateFwd); //, new TGLayoutHints(...)); | |
61 | fButtonNavigateFwd->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "NavigateFwd()"); | |
a82a31af | 62 | |
63 | fButtonEventLoop = new TGPictureButton(this, gClient->GetPicture("$ALICE_ROOT/EVE/hlt-macros/HLT-logo.png")); | |
7279ee15 | 64 | AddFrame(fButtonEventLoop); //, new TGLayoutHints(...)); |
65 | fButtonEventLoop->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "EventLoop()"); | |
d810d0de | 66 | } |
67 | ||
57ffa5fb | 68 | /******************************************************************************/ |
d810d0de | 69 | |
ea9a0e13 | 70 | void AliEveHOMERManagerEditor::SetModel(TObject* obj) { |
d810d0de | 71 | fM = dynamic_cast<AliEveHOMERManager*>(obj); |
72 | ||
73 | // Set values of widgets | |
74 | // fXYZZ->SetValue(fM->GetXYZZ()); | |
75 | } | |
76 | ||
57ffa5fb | 77 | /******************************************************************************/ |
d810d0de | 78 | |
ea9a0e13 | 79 | void AliEveHOMERManagerEditor::ConnectToHLT() { |
4b456ebb | 80 | // Connects to HOMER sources -> to HLT. |
ea9a0e13 | 81 | |
a82a31af | 82 | fM->ConnectEVEtoHOMER(); |
d810d0de | 83 | } |
7279ee15 | 84 | |
ea9a0e13 | 85 | void AliEveHOMERManagerEditor::NextEvent() { |
7279ee15 | 86 | // call next event from macro |
7279ee15 | 87 | |
ea9a0e13 | 88 | if ( fM->NextEvent() ) |
89 | return; | |
90 | ||
91 | gROOT->ProcessLineFast("processEvent();"); | |
92 | ||
93 | return; | |
7279ee15 | 94 | } |
95 | ||
ea9a0e13 | 96 | void AliEveHOMERManagerEditor::NavigateFwd() { |
97 | // navigate forward | |
98 | ||
99 | if ( !fEventLoopStarted ) { | |
100 | if ( fM->NavigateEventBufferFwd() == -1 ) | |
101 | return; | |
102 | ||
103 | gROOT->ProcessLineFast("processEvent();"); | |
104 | } | |
105 | return; | |
106 | } | |
107 | ||
108 | void AliEveHOMERManagerEditor::NavigateBack() { | |
109 | // navigate back | |
110 | ||
111 | if ( !fEventLoopStarted ) { | |
112 | if ( fM->NavigateEventBufferBack() == -1 ) | |
113 | return; | |
114 | ||
115 | gROOT->ProcessLineFast("processEvent();"); | |
116 | } | |
117 | return; | |
118 | } | |
119 | ||
120 | void AliEveHOMERManagerEditor::EventLoop() { | |
7279ee15 | 121 | |
a82a31af | 122 | // Start/stop event loop |
123 | if ( !fEventLoopStarted ) { | |
124 | gROOT->ProcessLineFast("loopEvent();"); | |
125 | fEventLoopStarted = kTRUE; | |
126 | } | |
127 | else { | |
128 | gROOT->ProcessLineFast("stopLoopEvent();"); | |
129 | fEventLoopStarted = kFALSE; | |
130 | } | |
7279ee15 | 131 | } |
ea9a0e13 | 132 |