]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/EveDet/AliEveTOFStripEditor.cxx
make loader more tolerant to missing files
[u/mrichter/AliRoot.git] / EVE / EveDet / AliEveTOFStripEditor.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
3  * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
4  * full copyright notice.                                                 *
5  **************************************************************************/
6
7 // $Id$
8 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
9
10 #include "AliEveTOFStripEditor.h"
11 #include <EveDet/AliEveTOFStrip.h>
12
13 #include <TVirtualPad.h>
14 #include <TColor.h>
15 #include <TEveGValuators.h>
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>
23
24 //
25 // AliEveTOFStripEditor class
26 // Editor for AliEveTOFStrip class
27 //
28 // Author A. De Caro (email: decaro@sa.infn.it)
29 //
30
31 ClassImp(AliEveTOFStripEditor)
32
33 AliEveTOFStripEditor::AliEveTOFStripEditor(const TGWindow *p, Int_t width, Int_t height,
34                                            UInt_t options, Pixel_t back) :
35   TGedFrame(p, width, height, options | kVerticalFrame, back),
36   fM         (0),
37   fThreshold (0),
38   fMaxVal    (0)
39   // Initialize widget pointers to 0
40 {
41   //ctr
42
43   MakeTitle("AliEveTOFStrip");
44
45   // Create widgets
46   // fXYZZ = new TGSomeWidget(this, ...);
47   // AddFrame(fXYZZ, new TGLayoutHints(...));
48   // fXYZZ->Connect("SignalName()", "AliEveTOFStripEditor", this, "DoXYZZ()");
49
50   fThreshold = new TEveGValuator(this, "Threshold", 200, 0);
51   fThreshold->SetNELength(4);
52   fThreshold->SetLabelWidth(60);
53   fThreshold->Build();
54   fThreshold->GetSlider()->SetWidth(120);
55   fThreshold->SetLimits(0,250);
56   fThreshold->Connect("ValueSet(Double_t)",
57                       "AliEveTOFSectorEditor", this, "DoThreshold()");
58   AddFrame(fThreshold, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
59
60   fMaxVal = new TEveGValuator(this,"MaxVal", 200, 0);
61   fMaxVal->SetNELength(4);
62   fMaxVal->SetLabelWidth(60);
63   fMaxVal->Build();
64   fMaxVal->GetSlider()->SetWidth(60);
65   fMaxVal->SetLimits(0, 500);
66   fMaxVal->Connect("ValueSet(Double_t)",
67                    "AliEveTOFSectorEditor", this, "DoMaxVal()");
68   AddFrame(fMaxVal, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
69
70 }
71
72 /******************************************************************************/
73
74 void AliEveTOFStripEditor::SetModel(TObject* obj)
75 {
76   // Set object to monitor at visualization level
77
78   fM = dynamic_cast<AliEveTOFStrip*>(obj);
79
80   // Set values of widgets
81   // fXYZZ->SetValue(fM->GetXYZZ());
82 }
83
84 /******************************************************************************/
85 void AliEveTOFStripEditor::DoThreshold()
86 {
87   fM->SetThreshold((Short_t) fThreshold->GetValue());
88   fThreshold->SetValue(fM->GetThreshold());
89   Update();
90 }
91
92 /******************************************************************************/
93 void AliEveTOFStripEditor::DoMaxVal()
94 {
95   fM->SetMaxVal((Int_t) fMaxVal->GetValue());
96   fMaxVal->SetValue(fM->GetMaxVal());
97   Update();
98 }
99
100 // Implements callback/slot methods
101
102 // void AliEveTOFStripEditor::DoXYZZ()
103 // {
104 //   fM->SetXYZZ(fXYZZ->GetValue());
105 //   Update();
106 // }