]>
Commit | Line | Data |
---|---|---|
d810d0de | 1 | // $Id$ |
2 | // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 | |
8616d353 | 3 | |
d810d0de | 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 "AliEveTOFSectorEditor.h" | |
cb4245bb | 11 | #include <EveDet/AliEveTOFSector.h> |
8616d353 | 12 | |
13 | #include <TVirtualPad.h> | |
14 | #include <TColor.h> | |
84aff7a4 | 15 | #include <TEveGValuators.h> |
8616d353 | 16 | |
17 | #include <TGLabel.h> | |
18 | #include <TGButton.h> | |
19 | #include <TGNumberEntry.h> | |
20 | #include <TGColorSelect.h> | |
21 | #include <TGSlider.h> | |
22 | #include <TGDoubleSlider.h> | |
d810d0de | 23 | |
8616d353 | 24 | |
57ffa5fb | 25 | //______________________________________________________________________________ |
d810d0de | 26 | // AliEveTOFSectorEditor |
8616d353 | 27 | // |
28 | ||
d810d0de | 29 | ClassImp(AliEveTOFSectorEditor) |
51346b82 | 30 | |
d810d0de | 31 | AliEveTOFSectorEditor::AliEveTOFSectorEditor(const TGWindow *p, Int_t width, Int_t height, |
8616d353 | 32 | UInt_t options, Pixel_t back) : |
33 | TGedFrame(p, width, height, options | kVerticalFrame, back), | |
34 | fM(0) , | |
35 | //fHMTrans (0), | |
36 | fSectorID (0), fAutoTrans (0), | |
37 | fPlate0(0x0), fPlate1(0x0), fPlate2(0x0), fPlate3(0x0), fPlate4(0x0), | |
38 | fThreshold (0), fMaxVal (0) | |
39 | // fTime (0) | |
40 | // Initialize widget pointers to 0 | |
41 | //{ | |
51346b82 | 42 | |
8616d353 | 43 | /* |
84aff7a4 | 44 | fHMTrans = new TEveTransSubEditor(this); |
d810d0de | 45 | fHMTrans->Connect("UseTrans()", "AliEveTPCSectorVizEditor", this, "Update()"); |
46 | fHMTrans->Connect("TransChanged()", "AliEveTPCSectorVizEditor", this, "Update()"); | |
8616d353 | 47 | AddFrame(fHMTrans, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 0, 0, 0)); |
51346b82 | 48 | |
d810d0de | 49 | MakeTitle("AliEveTPCSectorViz");*/ |
8616d353 | 50 | { |
51346b82 | 51 | |
8616d353 | 52 | fPlate = new TGCheckButton*[5]; |
53 | for (Int_t ii=0; ii<5; ii++) fPlate[ii] = new TGCheckButton; | |
51346b82 | 54 | |
8616d353 | 55 | //fPriority = 40; |
51346b82 | 56 | MakeTitle("AliEveTOFSector"); |
8616d353 | 57 | |
84aff7a4 | 58 | fSectorID = new TEveGValuator(this, "SectorID", 110, 0); |
8616d353 | 59 | fSectorID->SetLabelWidth(60); |
60 | fSectorID->SetShowSlider(kFALSE); | |
61 | fSectorID->SetNELength(4); | |
62 | fSectorID->Build(); | |
63 | fSectorID->SetLimits(0, 17); | |
64 | fSectorID->SetToolTip("The 18 Tof Sector's"); | |
65 | fSectorID->Connect("ValueSet(Double_t)", | |
d810d0de | 66 | "AliEveTOFSectorEditor", this, "DoSectorID()"); |
8616d353 | 67 | // Reuse sectorID for auto-transformation button |
68 | fAutoTrans = new TGCheckButton(fSectorID, "AutoTrans"); | |
69 | fAutoTrans->SetToolTipText("Automatically set transformation to true position"); | |
70 | fSectorID->AddFrame(fAutoTrans, new TGLayoutHints(kLHintsLeft, 12, 0, 1, 0)); | |
d810d0de | 71 | fAutoTrans->Connect("Toggled(Bool_t)","AliEveTOFSectorEditor", this, "DoAutoTrans()"); |
8616d353 | 72 | AddFrame(fSectorID, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1)); |
51346b82 | 73 | |
8616d353 | 74 | // Create widgets |
75 | // fXYZZ = new TGSomeWidget(this, ...); | |
76 | // AddFrame(fXYZZ, new TGLayoutHints(...)); | |
d810d0de | 77 | // fXYZZ->Connect("SignalName()", "AliEveTOFSectorEditor", this, "DoXYZZ()"); { |
8616d353 | 78 | TGHorizontalFrame* f = new TGHorizontalFrame(this); |
79 | ||
80 | Int_t nPlate = 0; | |
81 | fPlate0 = new TGCheckButton(f, "Plate0"); | |
82 | f->AddFrame(fPlate0, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0)); | |
d810d0de | 83 | fPlate0->Connect("Toggled(Bool_t)","AliEveTOFSectorEditor", this, "DoPlate0()"); |
84 | //fPlate0->Connect("Toggled(Bool_t)","AliEveTOFSectorEditor", this, "DoPlate(Int_t)"); | |
8616d353 | 85 | |
86 | nPlate = 1; | |
87 | fPlate1 = new TGCheckButton(f, "Plate 1"); | |
88 | f->AddFrame(fPlate1, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0)); | |
d810d0de | 89 | fPlate1->Connect("Toggled(Bool_t)","AliEveTOFSectorEditor", this, "DoPlate1()"); |
90 | //fPlate1->Connect("Toggled(Bool_t)","AliEveTOFSectorEditor", this, "DoPlate(Int_t)"); | |
8616d353 | 91 | |
92 | nPlate = 2; | |
93 | fPlate2 = new TGCheckButton(f, "Plate 2"); | |
94 | f->AddFrame(fPlate2, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0)); | |
d810d0de | 95 | fPlate2->Connect("Toggled(Bool_t)","AliEveTOFSectorEditor", this, "DoPlate2()"); |
96 | //fPlate2->Connect("Toggled(Bool_t)","AliEveTOFSectorEditor", this, "DoPlate(Int_t)"); | |
8616d353 | 97 | |
98 | nPlate = 3; | |
99 | fPlate3 = new TGCheckButton(f, "Plate 3"); | |
100 | f->AddFrame(fPlate3, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0)); | |
d810d0de | 101 | fPlate3->Connect("Toggled(Bool_t)","AliEveTOFSectorEditor", this, "DoPlate3()"); |
102 | //fPlate3->Connect("Toggled(Bool_t)","AliEveTOFSectorEditor", this, "DoPlate(Int_t)"); | |
8616d353 | 103 | |
104 | nPlate = 4; | |
105 | fPlate4 = new TGCheckButton(f, "Plate 4"); | |
106 | f->AddFrame(fPlate4, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0)); | |
d810d0de | 107 | fPlate4->Connect("Toggled(Bool_t)","AliEveTOFSectorEditor", this, "DoPlate4()"); |
108 | //fPlate4->Connect("Toggled(Bool_t)","AliEveTOFSectorEditor", this, "DoPlate(Int_t)"); | |
8616d353 | 109 | |
110 | ||
111 | fPlate[0] = fPlate0; | |
112 | fPlate[1] = fPlate1; | |
113 | fPlate[2] = fPlate2; | |
114 | fPlate[3] = fPlate3; | |
115 | fPlate[4] = fPlate4; | |
116 | ||
117 | AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1)); | |
118 | ||
84aff7a4 | 119 | fThreshold = new TEveGValuator(this, "Threshold", 200, 0); |
8616d353 | 120 | fThreshold->SetNELength(4); |
121 | fThreshold->SetLabelWidth(60); | |
122 | fThreshold->Build(); | |
123 | fThreshold->GetSlider()->SetWidth(120); | |
124 | fThreshold->SetLimits(0,250); | |
125 | fThreshold->Connect("ValueSet(Double_t)", | |
d810d0de | 126 | "AliEveTOFSectorEditor", this, "DoThreshold()"); |
8616d353 | 127 | AddFrame(fThreshold, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1)); |
51346b82 | 128 | |
84aff7a4 | 129 | fMaxVal = new TEveGValuator(this,"MaxVal", 200, 0); |
8616d353 | 130 | fMaxVal->SetNELength(4); |
131 | fMaxVal->SetLabelWidth(60); | |
132 | fMaxVal->Build(); | |
133 | fMaxVal->GetSlider()->SetWidth(60); | |
134 | fMaxVal->SetLimits(0, 500); | |
135 | fMaxVal->Connect("ValueSet(Double_t)", | |
d810d0de | 136 | "AliEveTOFSectorEditor", this, "DoMaxVal()"); |
8616d353 | 137 | AddFrame(fMaxVal, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1)); |
51346b82 | 138 | |
8616d353 | 139 | } |
140 | ||
141 | ||
142 | ||
143 | ||
d810d0de | 144 | AliEveTOFSectorEditor::~AliEveTOFSectorEditor() |
8616d353 | 145 | {} |
146 | ||
57ffa5fb | 147 | /******************************************************************************/ |
8616d353 | 148 | |
d810d0de | 149 | void AliEveTOFSectorEditor::SetModel(TObject* obj) |
8616d353 | 150 | { |
d810d0de | 151 | fM = dynamic_cast<AliEveTOFSector*>(obj); |
8616d353 | 152 | |
153 | fSectorID->SetValue(fM->GetSectorID()); | |
154 | fAutoTrans->SetState(fM->GetAutoTrans() ? kButtonDown : kButtonUp); | |
155 | ||
156 | fPlate0->SetState(fM->GetPlate(0) ? kButtonDown : kButtonUp); | |
157 | fPlate1->SetState(fM->GetPlate(1) ? kButtonDown : kButtonUp); | |
158 | fPlate2->SetState(fM->GetPlate(2) ? kButtonDown : kButtonUp); | |
159 | fPlate3->SetState(fM->GetPlate(3) ? kButtonDown : kButtonUp); | |
160 | fPlate4->SetState(fM->GetPlate(4) ? kButtonDown : kButtonUp); | |
161 | ||
162 | // Set values of widgets | |
163 | // fXYZZ->SetValue(fM->GetXYZZ()); | |
164 | } | |
165 | ||
57ffa5fb | 166 | /******************************************************************************/ |
d810d0de | 167 | void AliEveTOFSectorEditor::DoSectorID() |
8616d353 | 168 | { |
169 | fM->SetSectorID((Int_t) fSectorID->GetValue()); | |
170 | Update(); | |
171 | } | |
172 | ||
d810d0de | 173 | void AliEveTOFSectorEditor::DoAutoTrans() |
8616d353 | 174 | { |
175 | fM->SetAutoTrans(fAutoTrans->IsOn()); | |
176 | Update(); | |
177 | } | |
178 | ||
57ffa5fb | 179 | /******************************************************************************/ |
8616d353 | 180 | |
d810d0de | 181 | void AliEveTOFSectorEditor::DoPlate(Int_t nPlate) |
8616d353 | 182 | { |
183 | fM->SetPlate(nPlate, fPlate[nPlate]->IsOn()); | |
184 | Update(); | |
185 | } | |
186 | ||
d810d0de | 187 | void AliEveTOFSectorEditor::DoPlate0() |
8616d353 | 188 | { |
189 | fM->SetPlate(0, fPlate0->IsOn()); | |
190 | Update(); | |
191 | } | |
192 | ||
d810d0de | 193 | void AliEveTOFSectorEditor::DoPlate1() |
8616d353 | 194 | { |
195 | fM->SetPlate(1, fPlate1->IsOn()); | |
196 | Update(); | |
197 | } | |
198 | ||
d810d0de | 199 | void AliEveTOFSectorEditor::DoPlate2() |
8616d353 | 200 | { |
201 | fM->SetPlate(2, fPlate2->IsOn()); | |
202 | Update(); | |
203 | } | |
d810d0de | 204 | void AliEveTOFSectorEditor::DoPlate3() |
8616d353 | 205 | { |
206 | fM->SetPlate(3, fPlate3->IsOn()); | |
207 | Update(); | |
208 | } | |
209 | ||
d810d0de | 210 | void AliEveTOFSectorEditor::DoPlate4() |
8616d353 | 211 | { |
212 | fM->SetPlate(4, fPlate4->IsOn()); | |
213 | Update(); | |
214 | } | |
215 | ||
216 | ||
d810d0de | 217 | void AliEveTOFSectorEditor::DoThreshold() |
8616d353 | 218 | { |
219 | fM->SetThreshold((Short_t) fThreshold->GetValue()); | |
220 | fThreshold->SetValue(fM->GetThreshold()); | |
221 | Update(); | |
222 | } | |
223 | ||
d810d0de | 224 | void AliEveTOFSectorEditor::DoMaxVal() |
8616d353 | 225 | { |
226 | fM->SetMaxVal((Int_t) fMaxVal->GetValue()); | |
227 | fMaxVal->SetValue(fM->GetMaxVal()); | |
228 | Update(); | |
229 | } | |
230 | ||
57ffa5fb | 231 | /******************************************************************************/ |
8616d353 | 232 | /* |
d810d0de | 233 | void AliEveTOFSectorEditor::DoTime() |
51346b82 | 234 | { |
8616d353 | 235 | fM->SetMinTime((Int_t) fTime->GetMin()); |
236 | fM->SetMaxTime((Int_t) fTime->GetMax()); | |
237 | Update(); | |
238 | } | |
239 | */ | |
240 | ||
57ffa5fb | 241 | /******************************************************************************/ |
8616d353 | 242 | |
243 | ||
244 | ||
245 | ||
246 | ||
247 | ||
248 | ||
249 | ||
250 | ||
251 | ||
252 | ||
253 | ||
254 | ||
255 | ||
256 | ||
257 | ||
258 | ||
259 | // Implements callback/slot methods | |
260 | ||
d810d0de | 261 | // void AliEveTOFSectorEditor::DoXYZZ() |
8616d353 | 262 | // { |
263 | // fM->SetXYZZ(fXYZZ->GetValue()); | |
264 | // Update(); | |
265 | // } |