]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Adding new option to get the DE by its name (moreover to get it by its ID).
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 4 May 2007 11:14:43 +0000 (11:14 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 4 May 2007 11:14:43 +0000 (11:14 +0000)
(Christian)

MUON/mapping/AliMpDEVisu.cxx
MUON/mapping/AliMpDEVisu.h

index 4d5ebfcd1fd8ab18af9f456a2d34f955b35d8302..c1de220b1b46e55045581dc33cd1b4fb4d9cce06 100644 (file)
@@ -160,7 +160,7 @@ AliMpDEVisu::AliMpDEVisu(UInt_t w, UInt_t h)
   fCurrentDEName = detElem->GetDEName();
   fNameDECombo = new  TGComboBox(hframe, kDEName);
 
-  UpdateNameView();
+  UpdateNameView(kTRUE);
   fNameDECombo->Resize(160, 20);
   fNameDECombo->Select(0);
   fNameDECombo->Associate(this);
@@ -367,6 +367,10 @@ void AliMpDEVisu::DrawDE(Bool_t info)
   fEcanvas->GetCanvas()->cd();
   fEcanvas->GetCanvas()->SetEditable(kTRUE);
   
+  fNameDECombo->Select(fDEOccurrence[fCurrentDetElem]);
+  TGLBEntry* entry = fNameDECombo->GetSelectedEntry();
+  entry->SetBackgroundColor(0xDDDDDD);
+
   if (AliMpDEManager::GetStationType(fCurrentDetElem) == AliMp::kStation345 ) {
     
     DrawSlat("PMCI");
@@ -605,7 +609,7 @@ Bool_t AliMpDEVisu::ProcessMessage(Long_t msg, Long_t parm1, Long_t /*parm2*/)
           {
             case kChamberCombo: 
               UpdateComboDE();
-              UpdateNameView();
+              UpdateNameView(kTRUE);
               break;
               
             case kDECombo:
@@ -676,13 +680,13 @@ void AliMpDEVisu::UpdateComboCH()
 
     AliMpDetElement* detElem = AliMpDEManager::GetDetElement(fCurrentDEName);
 
-    Int_t Idx =  AliMpDEManager::GetChamberId(detElem->GetId());
-    fChamberCombo->Select(Idx);
+    Int_t idx =  AliMpDEManager::GetChamberId(detElem->GetId());
+    fChamberCombo->Select(idx);
 
     UpdateComboDE();
 
-    Idx = detElem->GetId() % 100;
-    fDECombo->Select(Idx);
+    idx = detElem->GetId() % 100;
+    fDECombo->Select(idx);
 
     fCurrentDetElem = fDEComboIdx[fDECombo->GetSelected()];
 
@@ -709,7 +713,7 @@ void AliMpDEVisu::UpdateComboDE()
 }
 
 //__________________________________________________________
-void AliMpDEVisu::UpdateNameView()
+void AliMpDEVisu::UpdateNameView(Bool_t firstTime)
 {
   /// update DE name in respect to selected DE id.
     
@@ -719,11 +723,21 @@ void AliMpDEVisu::UpdateNameView()
 
   fCurrentDEName = detElem->GetDEName();
 
-  Int_t entry = fNameDECombo->GetNumberOfEntries();
-  if (fDEOccurrence[fCurrentDetElem] == -1) {
-      fNameDECombo->AddEntry(fCurrentDEName.Data(), entry);
-      fNameDEComboIdx[entry] = fCurrentDEName;
-      fDEOccurrence[fCurrentDetElem] = entry;
+  if (firstTime) {
+    AliMpDEIterator it;
+    fNameDECombo->RemoveAll();
+  
+    for ( it.First(fChamberCombo->GetSelected()); !it.IsDone(); it.Next() ) {
+
+      Int_t detElemId = it.CurrentDE()->GetId();
+      TString deName  = it.CurrentDE()->GetDEName();
+
+      Int_t idx = fNameDECombo->GetNumberOfEntries();
+      fNameDECombo->AddEntry(deName.Data(), idx);
+      fNameDEComboIdx[idx]   = deName;
+      fDEOccurrence[detElemId] = idx;
+    }
   }
 
   fNameDECombo->Select(fDEOccurrence[fCurrentDetElem]);
index 53bf514b1cfc8c8d6e4a1078a2ac172c33820d62..93a3e0c55edf1afc3c82610575a383dfa298f0da 100644 (file)
@@ -53,7 +53,7 @@ public:
     void   DrawSlat(Option_t* option, Bool_t popup = kFALSE);
 
     void   ResetManu();
-    void   UpdateNameView();
+    void   UpdateNameView(Bool_t firstTime = kFALSE);
     void   PopUpManuMotif(AliMpSlat* slat);
     void   PopUpManuMotif(AliMpSector* sector);
     void   PopUpZoom(Int_t ix0, Int_t iy0, Int_t ix1, Int_t iy1);