]>
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> | |
cfa641b1 | 22 | #include <TGComboBox.h> |
707b281a | 23 | |
57ffa5fb | 24 | //______________________________________________________________________________ |
d810d0de | 25 | // AliEveHOMERManagerEditor |
26 | // | |
27 | ||
28 | ClassImp(AliEveHOMERManagerEditor) | |
29 | ||
30 | AliEveHOMERManagerEditor::AliEveHOMERManagerEditor(const TGWindow *p, Int_t width, Int_t height, | |
31 | UInt_t options, Pixel_t back) : | |
cfa641b1 | 32 | |
33 | TGedFrame(p, width, height, options | kVerticalFrame, back), | |
d810d0de | 34 | fM(0), |
3ce2db7a | 35 | fButtonConnect(NULL), |
d52fea52 | 36 | fButtonWriteToFile(0), |
7279ee15 | 37 | fButtonNextEvent(0), |
ea9a0e13 | 38 | fButtonNavigateBack(0), |
39 | fButtonNavigateFwd(0), | |
71614c9f | 40 | fButtonPrintScreens(NULL), |
cfa641b1 | 41 | fBoxTriggerSelector(0), |
cfa641b1 | 42 | // fBoxEventLoopSpeed(0), |
71614c9f | 43 | fButtonEventLoopText(0), |
7279ee15 | 44 | fButtonEventLoop(0), |
cfa641b1 | 45 | fEventLoopStarted(kFALSE) |
46 | { | |
47 | ||
d810d0de | 48 | MakeTitle("AliEveHOMERManager"); |
49 | ||
50 | // Create widgets | |
51 | // fXYZZ = new TGSomeWidget(this, ...); | |
52 | // AddFrame(fXYZZ, new TGLayoutHints(...)); | |
53 | // fXYZZ->Connect("SignalName()", "AliEveHOMERManagerEditor", this, "DoXYZZ()"); | |
46eadbb4 | 54 | |
3ce2db7a | 55 | fButtonConnect = new TGTextButton(this, " Reconnect "); |
56 | AddFrame(fButtonConnect); //, new TGLayoutHints(...)); | |
57 | fButtonConnect->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "ConnectToHLT()"); | |
cfa641b1 | 58 | |
59 | fButtonWriteToFile = new TGTextButton(this, " Write to file "); | |
60 | AddFrame(fButtonWriteToFile); //, new TGLayoutHints(...)); | |
61 | fButtonWriteToFile->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "WriteBlockListToFile()"); | |
62 | ||
7279ee15 | 63 | |
64 | fButtonNextEvent = new TGTextButton(this, " NextEvent "); | |
65 | AddFrame(fButtonNextEvent); //, new TGLayoutHints(...)); | |
66 | fButtonNextEvent->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "NextEvent()"); | |
67 | ||
ea9a0e13 | 68 | fButtonNavigateBack = new TGTextButton(this, " Navigate Back "); |
69 | AddFrame(fButtonNavigateBack); //, new TGLayoutHints(...)); | |
70 | fButtonNavigateBack->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "NavigateBack()"); | |
71 | ||
72 | fButtonNavigateFwd = new TGTextButton(this, " Navigate Fwd "); | |
73 | AddFrame(fButtonNavigateFwd); //, new TGLayoutHints(...)); | |
74 | fButtonNavigateFwd->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "NavigateFwd()"); | |
a82a31af | 75 | |
a3234a73 | 76 | |
77 | fButtonPrintScreens = new TGTextButton(this, " Save Viewers "); | |
78 | AddFrame(fButtonPrintScreens); //, new TGLayoutHints(...)); | |
79 | fButtonPrintScreens->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "PrintScreens()"); | |
80 | ||
81 | ||
cfa641b1 | 82 | fBoxTriggerSelector = new TGComboBox(this, "Select Trigger"); |
83 | fBoxTriggerSelector->AddEntry("HLT Global Trigger", 0); | |
84 | fBoxTriggerSelector->AddEntry("Barrel multiplicity trigger", 1); | |
85 | fBoxTriggerSelector->AddEntry("PHOS Geometry trigger", 2); | |
86 | fBoxTriggerSelector->AddEntry("No trigger selection", 3); | |
87 | fBoxTriggerSelector->Connect("Selected(Int_t)","AliEveHOMERManagerEditor", this, "SetTriggerString(int)"); | |
88 | fBoxTriggerSelector->SetWidth(150); | |
89 | fBoxTriggerSelector->SetHeight(25); | |
90 | AddFrame(fBoxTriggerSelector); | |
91 | ||
92 | fButtonEventLoopText = new TGTextButton(this, " Loop Events "); | |
93 | AddFrame(fButtonEventLoopText); //, new TGLayoutHints(...)); | |
94 | fButtonEventLoopText->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "EventLoop()"); | |
95 | ||
a82a31af | 96 | fButtonEventLoop = new TGPictureButton(this, gClient->GetPicture("$ALICE_ROOT/EVE/hlt-macros/HLT-logo.png")); |
7279ee15 | 97 | AddFrame(fButtonEventLoop); //, new TGLayoutHints(...)); |
98 | fButtonEventLoop->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "EventLoop()"); | |
d810d0de | 99 | } |
100 | ||
57ffa5fb | 101 | /******************************************************************************/ |
d810d0de | 102 | |
ea9a0e13 | 103 | void AliEveHOMERManagerEditor::SetModel(TObject* obj) { |
d810d0de | 104 | fM = dynamic_cast<AliEveHOMERManager*>(obj); |
105 | ||
106 | // Set values of widgets | |
107 | // fXYZZ->SetValue(fM->GetXYZZ()); | |
108 | } | |
109 | ||
57ffa5fb | 110 | /******************************************************************************/ |
d810d0de | 111 | |
3ce2db7a | 112 | void AliEveHOMERManagerEditor::ConnectToHLT() { |
113 | // Connects to HOMER sources -> to HLT. | |
114 | fM->ReConnectHOMER(); | |
115 | } | |
7279ee15 | 116 | |
ea9a0e13 | 117 | void AliEveHOMERManagerEditor::NextEvent() { |
3da168a7 | 118 | // call next event from AliEveHOMERManger |
33791895 | 119 | fM->NextHOMEREvent(); |
7279ee15 | 120 | } |
121 | ||
cfa641b1 | 122 | void AliEveHOMERManagerEditor::WriteBlockListToFile() { |
cfa641b1 | 123 | gROOT->ProcessLineFast("writeToFile();"); |
124 | ||
125 | } | |
126 | ||
bf1911d5 | 127 | |
128 | void AliEveHOMERManagerEditor::PrintScreens() { | |
129 | //Print screens | |
130 | fM->PrintScreens(); | |
131 | } | |
132 | ||
ea9a0e13 | 133 | void AliEveHOMERManagerEditor::NavigateFwd() { |
134 | // navigate forward | |
135 | ||
136 | if ( !fEventLoopStarted ) { | |
137 | if ( fM->NavigateEventBufferFwd() == -1 ) | |
138 | return; | |
139 | ||
3da168a7 | 140 | fM->ProcessEvent(); |
141 | // gROOT->ProcessLineFast("processEvent();"); | |
ea9a0e13 | 142 | } |
143 | return; | |
144 | } | |
145 | ||
146 | void AliEveHOMERManagerEditor::NavigateBack() { | |
147 | // navigate back | |
148 | ||
149 | if ( !fEventLoopStarted ) { | |
150 | if ( fM->NavigateEventBufferBack() == -1 ) | |
151 | return; | |
3da168a7 | 152 | |
153 | fM->ProcessEvent(); | |
154 | //gROOT->ProcessLineFast("processEvent();"); | |
ea9a0e13 | 155 | } |
156 | return; | |
157 | } | |
158 | ||
159 | void AliEveHOMERManagerEditor::EventLoop() { | |
a82a31af | 160 | // Start/stop event loop |
161 | if ( !fEventLoopStarted ) { | |
a82a31af | 162 | fEventLoopStarted = kTRUE; |
cfa641b1 | 163 | fButtonEventLoopText->SetText(" Stop Loop "); |
33791895 | 164 | //fM->SetEventLoopStarted(kTRUE); |
165 | fM->StartLoop(); | |
166 | ||
167 | // gROOT->ProcessLineFast("loopEvent();"); | |
168 | ||
169 | } else { | |
170 | ||
171 | //gROOT->ProcessLineFast("stopLoopEvent();"); | |
172 | fM->StopLoop(); | |
a82a31af | 173 | fEventLoopStarted = kFALSE; |
33791895 | 174 | //fM->SetEventLoopStarted(kFALSE); |
cfa641b1 | 175 | fButtonEventLoopText->SetText(" Loop Events "); |
176 | } | |
177 | } | |
178 | ||
179 | void AliEveHOMERManagerEditor::SetTriggerString(int id) { | |
180 | ||
181 | if (id < 0 || id > 4) { | |
182 | return; | |
a82a31af | 183 | } |
cfa641b1 | 184 | |
185 | TString tsa[4] = {"HLTGlobalTrigger", | |
186 | "BarrelMultiplicityTrigger", | |
187 | "PHOSgeomTrigger", | |
188 | "ALL"}; | |
189 | ||
190 | ||
191 | fM->SetTriggerString(tsa[id]); | |
192 | ||
7279ee15 | 193 | } |
ea9a0e13 | 194 |