state of the Event Display GUI dependent on the mode (online/offline) and state of...
authormaszyman <maszyman@cern.ch>
Tue, 14 Oct 2014 07:41:45 +0000 (09:41 +0200)
committermaszyman <maszyman@cern.ch>
Tue, 14 Oct 2014 07:46:31 +0000 (09:46 +0200)
EVE/EveBase/AliEveConfigManager.cxx
EVE/EveBase/AliEveConfigManager.h
EVE/EveBase/AliEveEventManager.cxx
EVE/EveBase/AliEveEventManager.h
EVE/EveBase/AliEveEventManagerEditor.cxx
EVE/EveBase/AliEveEventManagerEditor.h
MONITOR/alistoragemanager/AliStorageAdministratorPanelListEvents.cxx
MONITOR/alistoragemanager/AliStorageAdministratorPanelListEvents.h
MONITOR/alistoragemanager/clearAll.sh
MONITOR/alistoragemanager/setupStorageDatabase.sh

index efda84f..1d6796c 100644 (file)
@@ -1095,16 +1095,27 @@ void AliEveConfigManager::SetEventInEventManager()
 
 void AliEveConfigManager::StorageManagerChangedState(int state)
 {
+  AliEveEventManager *manager = AliEveEventManager::GetMaster();
+  AliStorageAdministratorPanelListEvents* listEventsTab = AliStorageAdministratorPanelListEvents::GetInstance();
+
+  if (manager->IsOnlineMode()) {
     if (state == 0)// storage manager is down
-    {
-        fStoragePopup->DisableEntry(kStorageListEvents);
+      {
         fStoragePopup->DisableEntry(kStorageMarkEvent);
-    }
+       listEventsTab->SetOfflineMode(kTRUE);
+
+      }
     else if(state == 1)// storage manager is alive
-    {
-        fStoragePopup->EnableEntry(kStorageListEvents);
+      {
         fStoragePopup->EnableEntry(kStorageMarkEvent);
-    }
+       listEventsTab->SetOfflineMode(kFALSE);
+
+      }
+  }
+}
+
+void AliEveConfigManager::DisableStoragePopup(){
+  fStoragePopup->DisableEntry(kStorageMarkEvent);
 }
 
 
index e7f414d..35164d7 100644 (file)
@@ -30,7 +30,8 @@ public:
     void AliEvePopupHandler(Int_t id);
     void SetEventInEventManager();
     void StorageManagerChangedState(int state);
-    
+    void DisableStoragePopup();
+
     void ConnectEventManagerSignals();
     
 protected:
index 35e0e0b..bed6b8b 100644 (file)
@@ -141,7 +141,9 @@ AliEveEventManager::AliEveEventManager(const TString& name, Int_t ev) :
     fgSubSock(EVENTS_SERVER_SUB),
     fEventInUse(1),
     fWritingToEventIndex(0),
-    fIsNewEventAvaliable(false)
+    fIsNewEventAvaliable(false),
+    fStorageDown(false)
+
 {
     // Constructor with event-id.
                
@@ -153,6 +155,14 @@ AliEveEventManager::AliEveEventManager(const TString& name, Int_t ev) :
         GotoEvent(ev);
     }
     
+    if (0 == name.CompareTo("online")) {
+      fOnlineMode = kTRUE;
+    }
+    else{
+      fOnlineMode = kFALSE;
+    }
+
+
 #ifdef ZMQ
     cout<<"ZMQ FOUND. Starting subscriber thread."<<endl;
     fEventListenerThread = new TThread("fEventListenerThread",DispatchEventListener,(void*)this);
@@ -208,24 +218,26 @@ void AliEveEventManager::GetNextEvent()
     {
         tmpEvent = eventManager->GetEvent(EVENTS_SERVER_SUB);
         if(tmpEvent)
-        {
+       {
             if(tmpEvent->GetRunNumber()>=0)
-            {
+           {
                 fMutex.Lock();
                 if(fEventInUse == 0){fWritingToEventIndex = 1;}
                 else if(fEventInUse == 1){fWritingToEventIndex = 0;}
                 cout<<"Received new event"<<endl;
                 if(fCurrentEvent[fWritingToEventIndex])
-                {
+               {
                     delete fCurrentEvent[fWritingToEventIndex];
                     fCurrentEvent[fWritingToEventIndex]=0;
-                }
+               }
                 fCurrentEvent[fWritingToEventIndex] = tmpEvent;
                 fIsNewEventAvaliable = true;
+               NewEventLoaded();
                 fMutex.UnLock();
-            }
-        }
-    }
+           }
+
+      }
+  }
 #endif
 }
 
@@ -247,11 +259,14 @@ void AliEveEventManager::CheckStorageStatus()
         {
             StorageManagerOk();
             long response = eventManager->GetLong(CLIENT_COMMUNICATION_REQ);
+           fStorageDown = kFALSE;
         }
         else
         {
             StorageManagerDown();
             cout<<"WARNING -- Storage Manager is DOWN!!"<<endl;
+           fStorageDown = kTRUE;
+
         }
         sleep(1);
     }
@@ -847,78 +862,84 @@ void AliEveEventManager::GotoEvent(Int_t event)
     }
     if (fExternalCtrl)
     {
-        // throw (kEH + "Event-loop is under external control.");
+      // throw (kEH + "Event-loop is under external control.");
 #ifdef ZMQ
-        if (fESD)
-        {
-            // create new server request:
-            struct serverRequestStruct *requestMessage = new struct serverRequestStruct;
+      if (fStorageDown && -1 == event) 
+      {
+       NextEvent();
+       return;
+      }
+
+      if (fESD)
+      {
+         // create new server request:
+         struct serverRequestStruct *requestMessage = new struct serverRequestStruct;
             
-            // set request type:
-            if (event == -1)      {requestMessage->messageType = REQUEST_GET_LAST_EVENT;}
-            else  if (event == 0) {requestMessage->messageType = REQUEST_GET_FIRST_EVENT;}
-            else  if (event == 1) {requestMessage->messageType = REQUEST_GET_PREV_EVENT;}
-            else  if (event == 2) {requestMessage->messageType = REQUEST_GET_NEXT_EVENT;}
+         // set request type:
+         if (event == -1)      {requestMessage->messageType = REQUEST_GET_LAST_EVENT;}
+         else  if (event == 0) {requestMessage->messageType = REQUEST_GET_FIRST_EVENT;}
+         else  if (event == 1) {requestMessage->messageType = REQUEST_GET_PREV_EVENT;}
+         else  if (event == 2) {requestMessage->messageType = REQUEST_GET_NEXT_EVENT;}
             
-            // set event struct:
-            struct eventStruct eventToLoad;
-            eventToLoad.runNumber = fESD->GetRunNumber();
-            eventToLoad.eventNumber = fESD->GetEventNumberInFile();
-            requestMessage->event = eventToLoad;
+         // set event struct:
+         struct eventStruct eventToLoad;
+         eventToLoad.runNumber = fESD->GetRunNumber();
+         eventToLoad.eventNumber = fESD->GetEventNumberInFile();
+         requestMessage->event = eventToLoad;
             
-            // create event manager:
-            AliStorageEventManager *eventManager =
+         // create event manager:
+         AliStorageEventManager *eventManager =
             AliStorageEventManager::GetEventManagerInstance();
-            AliESDEvent *resultEvent = NULL;
+         AliESDEvent *resultEvent = NULL;
             
-            eventManager->CreateSocket(SERVER_COMMUNICATION_REQ);
-            fMutex.Lock();
+         eventManager->CreateSocket(SERVER_COMMUNICATION_REQ);
+         fMutex.Lock();
             
-            // send request and receive event:
-            eventManager->Send(requestMessage,SERVER_COMMUNICATION_REQ);
-            resultEvent = eventManager->GetEvent(SERVER_COMMUNICATION_REQ);
+         // send request and receive event:
+         eventManager->Send(requestMessage,SERVER_COMMUNICATION_REQ);
+         resultEvent = eventManager->GetEvent(SERVER_COMMUNICATION_REQ);
             
-            if(resultEvent)
-            {
-                DestroyElements();
-                InitOCDB(resultEvent->GetRunNumber());
-                SetEvent(0,0,resultEvent,0);
-            }
-            else
-            {
-                if(event==-1){cout<<"\n\nWARNING -- No last event is avaliable.\n\n"<<endl;}
-                if(event==0){cout<<"\n\nWARNING -- No first event is avaliable.\n\n"<<endl;}
-                if(event==1){cout<<"\n\nWARNING -- No previous event is avaliable.\n\n"<<endl;}
-                if(event==2){cout<<"\n\nWARNING -- No next event is avaliable.\n\n"<<endl;}
-            }
+         if(resultEvent)
+          {
+             DestroyElements();
+             InitOCDB(resultEvent->GetRunNumber());
+             SetEvent(0,0,resultEvent,0);
+          }
+         else
+          {
+             if(event==-1){cout<<"\n\nWARNING -- No last event is avaliable.\n\n"<<endl;}
+             if(event==0){cout<<"\n\nWARNING -- No first event is avaliable.\n\n"<<endl;}
+             if(event==1){cout<<"\n\nWARNING -- No previous event is avaliable.\n\n"<<endl;}
+             if(event==2){cout<<"\n\nWARNING -- No next event is avaliable.\n\n"<<endl;}
+          }
             
-            fMutex.UnLock();
+         fMutex.UnLock();
         }
-        else
-        {
-            cout<<"\n\nWARNING -- No event has been already loaded. Loading the most recent event...\n\n"<<endl;
+      else
+      {
+         cout<<"\n\nWARNING -- No event has been already loaded. Loading the most recent event...\n\n"<<endl;
 
-            struct serverRequestStruct *requestMessage = new struct serverRequestStruct;
-            requestMessage->messageType = REQUEST_GET_LAST_EVENT;
+         struct serverRequestStruct *requestMessage = new struct serverRequestStruct;
+         requestMessage->messageType = REQUEST_GET_LAST_EVENT;
             
-            AliStorageEventManager *eventManager = AliStorageEventManager::GetEventManagerInstance();
-            eventManager->CreateSocket(SERVER_COMMUNICATION_REQ);
-            AliESDEvent *resultEvent = NULL;
+         AliStorageEventManager *eventManager = AliStorageEventManager::GetEventManagerInstance();
+         eventManager->CreateSocket(SERVER_COMMUNICATION_REQ);
+         AliESDEvent *resultEvent = NULL;
             
-            fMutex.Lock();
-            eventManager->Send(requestMessage,SERVER_COMMUNICATION_REQ);
-            resultEvent = eventManager->GetEvent(SERVER_COMMUNICATION_REQ);
+         fMutex.Lock();
+         eventManager->Send(requestMessage,SERVER_COMMUNICATION_REQ);
+         resultEvent = eventManager->GetEvent(SERVER_COMMUNICATION_REQ);
             
-            if(resultEvent)
-            {
-                fESD=resultEvent;
-                DestroyElements();
-                InitOCDB(resultEvent->GetRunNumber());
-                SetEvent(0,0,resultEvent,0);
-            }
-            else{cout<<"\n\nWARNING -- The most recent event is not avaliable.\n\n"<<endl;}
-            fMutex.UnLock();
-        }
+         if(resultEvent)
+          {
+             fESD=resultEvent;
+             DestroyElements();
+             InitOCDB(resultEvent->GetRunNumber());
+             SetEvent(0,0,resultEvent,0);
+          }
+         else{cout<<"\n\nWARNING -- The most recent event is not avaliable.\n\n"<<endl;}
+         fMutex.UnLock();
+      }
 #endif 
 
     }
@@ -1120,12 +1141,17 @@ void AliEveEventManager::NextEvent()
                     DestroyElements();
                     InitOCDB(fCurrentEvent[fEventInUse]->GetRunNumber());
                     SetEvent(0,0,fCurrentEvent[fEventInUse],0);
+
                 }
             }
             fIsNewEventAvaliable = false;
             fMutex.UnLock();
         }
-        else{cout<<"No new event is avaliable."<<endl;}
+        else
+       {
+         cout<<"No new event is avaliable."<<endl;
+         NoEventLoaded();
+       }
 #endif
     }
     else if ((fESDTree!=0) || (fHLTESDTree!=0))
@@ -1857,6 +1883,11 @@ void AliEveEventManager::NewEventLoaded()
     // Emit NewEventLoaded signal.
     Emit("NewEventLoaded()");
 }
+void AliEveEventManager::NoEventLoaded()
+{
+    // Emit NoEventLoaded signal.
+    Emit("NoEventLoaded()");
+}
 void AliEveEventManager::StorageManagerOk()
 {
     // Emit StorageManagerOk signal.
@@ -2186,3 +2217,14 @@ TEveElement* AliEveEventManager::FindGlobal(const TString& tag)
 {
     return dynamic_cast<TEveElement*>(fGlobal->GetValue(tag));
 }
+Int_t AliEveEventManager::NewEventAvailable()
+{
+  if (fIsNewEventAvaliable)
+  {
+    return 1;
+  }
+  else
+  {
+    return 0;
+  }
+}
index 58fae55..a510d31 100644 (file)
@@ -134,6 +134,8 @@ public:
     Bool_t        IsEventAvailable()       const { return fHasEvent;     }
     Bool_t        IsUnderExternalControl() const { return fExternalCtrl; }
 
+    Bool_t        IsOnlineMode() const { return fOnlineMode; }
+
     Bool_t        InsertGlobal(const TString& tag, TEveElement* model);
     Bool_t        InsertGlobal(const TString& tag, TEveElement* model,
                                Bool_t replace, Bool_t update);
@@ -142,6 +144,7 @@ public:
     virtual void  AfterNewEventLoaded();
     void          NewEventDataLoaded();  // *SIGNAL*
     void          NewEventLoaded();      // *SIGNAL*
+    void          NoEventLoaded();      // *SIGNAL*
     void          StorageManagerOk();    // *SIGNAL*
     void          StorageManagerDown();  // *SIGNAL*
 
@@ -149,6 +152,8 @@ public:
     void InitOCDB(int runNo=-1);
 
     void PrepareForNewEvent(AliESDEvent *event);
+    Int_t NewEventAvailable();
+
 protected:
     Int_t         fEventId;            // Id of current event.
 
@@ -237,7 +242,10 @@ private:
     int fWritingToEventIndex;
     bool fIsNewEventAvaliable;
     storageSockets fgSubSock;
-    
+
+    Bool_t fOnlineMode;
+    Bool_t fStorageDown;
+
     AliEveEventManager(const AliEveEventManager&);            // Not implemented
     AliEveEventManager& operator=(const AliEveEventManager&); // Not implemented
     
index 470ca26..2f8c403 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "AliEveEventManagerEditor.h"
 #include "AliEveEventManager.h"
+#include "AliEveConfigManager.h"
 
 #include <AliESDEvent.h>
 
 
 #include "Riostream.h"
 
+#ifdef ZMQ
+#include "AliStorageAdministratorPanelListEvents.h"
+#include "AliStorageAdministratorPanelMarkEvent.h"
+#endif
+
 //______________________________________________________________________________
 // GUI editor for AliEveEventManager.
 //
@@ -179,15 +185,17 @@ AliEveEventManagerWindow::AliEveEventManagerWindow(AliEveEventManager* mgr) :
     fTrigSel->Connect("Selected(char*)", cls, this, "DoSetTrigSel()");
 
     fStorageStatus = MkLabel(f,"Storage: Waiting",0,8,8);
+    fEventServerStatus = MkLabel(f,"Event Server: Waiting",0,10,10);
       
   }
     
   fEventInfo = new TGTextView(this, 400, 600);
   AddFrame(fEventInfo, new TGLayoutHints(kLHintsNormal | kLHintsExpandX | kLHintsExpandY));
 
-  fM->Connect("NewEventLoaded()", cls, this, "Update()");
-    fM->Connect("StorageManagerOk()",cls,this,"StorageManagerChangedState(=1)");
-    fM->Connect("StorageManagerDown()",cls,this,"StorageManagerChangedState(=0)");
+   fM->Connect("NewEventLoaded()", cls, this, "Update(=1)");
+   fM->Connect("NoEventLoaded()", cls, this, "Update(=0)");
+   fM->Connect("StorageManagerOk()",cls,this,"StorageManagerChangedState(=1)");
+   fM->Connect("StorageManagerDown()",cls,this,"StorageManagerChangedState(=0)");
 
   SetCleanup(kDeepCleanup);
   Layout();
@@ -215,7 +223,13 @@ void AliEveEventManagerWindow::DoPrevEvent()
 {
   // Load previous event
   // fM->PrevEvent();
-  fM->GotoEvent(1);
+  if (fM->IsOnlineMode()) {
+    fM->GotoEvent(1);
+  }
+  else {
+    fM->GotoEvent((Int_t) fEventId->GetNumber()-1);
+
+  }
 
 }
 
@@ -224,8 +238,12 @@ void AliEveEventManagerWindow::DoNextEvent()
 {
   // Load next event
   // fM->NextEvent();
-  fM->GotoEvent(2);
-
+  if (fM->IsOnlineMode()) {
+    fM->GotoEvent(2);
+  }
+  else {
+    fM->GotoEvent((Int_t) fEventId->GetNumber()+1);
+  }
 }
 
 //______________________________________________________________________________
@@ -266,7 +284,7 @@ void AliEveEventManagerWindow::DoSetAutoLoad()
   // Set the auto-load flag
 
   fM->SetAutoLoad(fAutoLoad->IsOn());
-  Update();
+  Update(fM->NewEventAvailable());
 }
 
 //______________________________________________________________________________
@@ -286,72 +304,133 @@ void AliEveEventManagerWindow::DoSetTrigSel()
 }
 
 //______________________________________________________________________________
-void AliEveEventManagerWindow::Update()
+void AliEveEventManagerWindow::Update(int state)
 {
-  // Update current event, number of available events, list of active triggers
+  AliESDEvent*  esd = fM->GetESD();
+  AliStorageAdministratorPanelListEvents* listEventsTab = AliStorageAdministratorPanelListEvents::GetInstance();
+  AliEveConfigManager *configManager = AliEveConfigManager::GetMaster();
 
   Bool_t autoLoad = fM->GetAutoLoad();
   Bool_t extCtrl  = fM->IsUnderExternalControl();
   Bool_t evNavOn  = !autoLoad && !extCtrl;
 
-  // fFirstEvent->SetEnabled(evNavOn);
-  // fPrevEvent ->SetEnabled(evNavOn);
-  // fLastEvent ->SetEnabled(evNavOn);
-  fFirstEvent->SetEnabled(!autoLoad);
-  fPrevEvent ->SetEnabled(!autoLoad);
-  fLastEvent ->SetEnabled(!autoLoad);
-  fNextEvent ->SetEnabled(!autoLoad);
-  fRefresh   ->SetEnabled(evNavOn);
-
-  fEventId->SetNumber(fM->GetEventId());
-  fEventId->SetState(evNavOn);
-  fInfoLabel->SetText(Form("/ %d", fM->GetMaxEventId()));
-
-  fAutoLoad->SetState(fM->GetAutoLoad() ? kButtonDown : kButtonUp);
-  fAutoLoadTime->SetValue(fM->GetAutoLoadTime());
-
-  // Loop over active trigger classes
-  if (fM->GetESD()) {
-    for(Int_t iTrig = 0; iTrig < AliESDRun::kNTriggerClasses; iTrig++) {
-      TString trigName = fM->GetESD()->GetESDRun()->GetTriggerClass(iTrig);
-      if (trigName.IsNull()) {
-       if (fTrigSel->GetListBox()->GetEntry(iTrig)) {
-         if (fTrigSel->GetSelected() == iTrig) fTrigSel->Select(-1);
-         fTrigSel->RemoveEntry(iTrig);
+  if (!fM->IsOnlineMode()) {
+
+      listEventsTab->SetOfflineMode(kTRUE);
+      configManager->DisableStoragePopup();
+
+      fFirstEvent->SetEnabled(!autoLoad);
+      fPrevEvent ->SetEnabled(!autoLoad);
+      fLastEvent ->SetEnabled(!autoLoad);
+      fNextEvent ->SetEnabled(!autoLoad);
+      fMarkEvent ->SetEnabled(kFALSE);
+
+      fInfoLabel->SetText(Form("/ %d", fM->GetMaxEventId()));
+
+  }
+  else if (1 == state && fStorageStatus->GetText()->Contains("DOWN")) {
+    fEventServerStatus->SetText("Event Server: OK");
+    fFirstEvent->SetEnabled(kFALSE);
+    fPrevEvent ->SetEnabled(kFALSE);
+    fLastEvent ->SetEnabled(!autoLoad);
+    fNextEvent ->SetEnabled(kFALSE);
+    fMarkEvent ->SetEnabled(kFALSE);
+    listEventsTab->SetOfflineMode(kTRUE);
+    fInfoLabel->SetText(Form("/ %d",fM->GetEventId()));
+  }
+  else if (0 == state && fStorageStatus->GetText()->Contains("DOWN")) {
+    fEventServerStatus->SetText("Event Server: Waiting");
+    fFirstEvent->SetEnabled(kFALSE);
+    fPrevEvent ->SetEnabled(kFALSE);
+    fLastEvent ->SetEnabled(!autoLoad);
+    fNextEvent ->SetEnabled(kFALSE);
+    fMarkEvent ->SetEnabled(kFALSE);
+    listEventsTab->SetOfflineMode(kTRUE);
+  }
+  else if (0 == state && fStorageStatus->GetText()->Contains("OK")) {
+    fEventServerStatus->SetText("Event Server: Waiting");
+    fFirstEvent->SetEnabled(!autoLoad);
+    fPrevEvent ->SetEnabled(!autoLoad);
+    fLastEvent ->SetEnabled(!autoLoad);
+    fNextEvent ->SetEnabled(!autoLoad);
+    fMarkEvent ->SetEnabled(kTRUE);
+    listEventsTab->SetOfflineMode(kFALSE);
+  }
+  else {
+    fEventServerStatus->SetText("Event Server: OK");
+    fFirstEvent->SetEnabled(!autoLoad);
+    fPrevEvent ->SetEnabled(!autoLoad);
+    fLastEvent ->SetEnabled(!autoLoad);
+    fNextEvent ->SetEnabled(!autoLoad);
+    fMarkEvent ->SetEnabled(kTRUE);
+    listEventsTab->SetOfflineMode(kFALSE);
+  }
+
+  if (1 == state) {
+    fRefresh   ->SetEnabled(evNavOn);
+
+    fEventId->SetNumber(fM->GetEventId());
+    fEventId->SetState(evNavOn);
+    // fInfoLabel->SetText(Form("/ %d", fM->GetMaxEventId()));
+
+    fAutoLoad->SetState(fM->GetAutoLoad() ? kButtonDown : kButtonUp);
+    fAutoLoadTime->SetValue(fM->GetAutoLoadTime());
+
+    // Loop over active trigger classes
+    if (fM->GetESD()) {
+      for(Int_t iTrig = 0; iTrig < AliESDRun::kNTriggerClasses; iTrig++) {
+       TString trigName = fM->GetESD()->GetESDRun()->GetTriggerClass(iTrig);
+       if (trigName.IsNull()) {
+         if (fTrigSel->GetListBox()->GetEntry(iTrig)) {
+           if (fTrigSel->GetSelected() == iTrig) fTrigSel->Select(-1);
+           fTrigSel->RemoveEntry(iTrig);
+         }
+         continue;
        }
-       continue;
+       if (!fTrigSel->FindEntry(trigName.Data()))
+         fTrigSel->AddEntry(trigName.Data(),iTrig);
       }
-      if (!fTrigSel->FindEntry(trigName.Data()))
-       fTrigSel->AddEntry(trigName.Data(),iTrig);
     }
-  }
-  fTrigSel->SetEnabled(!evNavOn);
+    fTrigSel->SetEnabled(!evNavOn);
 
-  fEventInfo->LoadBuffer(fM->GetEventInfoHorizontal());
+    fEventInfo->LoadBuffer(fM->GetEventInfoHorizontal());
 
-  Layout();
+    Layout();
+  }
 }
 
 void AliEveEventManagerWindow::StorageManagerChangedState(int state)
 {
+  Bool_t autoLoad = fM->GetAutoLoad();
+  AliStorageAdministratorPanelListEvents* listEventsTab = AliStorageAdministratorPanelListEvents::GetInstance();
+  AliEveConfigManager *configManager = AliEveConfigManager::GetMaster();
+
+  if (fM->IsOnlineMode()) {
     if (state == 0)
-    {
+      {
         fStorageStatus->SetText("Storage: DOWN");
-        fMarkEvent->SetEnabled(false);
-        fNextEvent->SetEnabled(false);
-        fLastEvent->SetEnabled(false);
-        fPrevEvent->SetEnabled(false);
-        fFirstEvent->SetEnabled(false);
-    }
+        fMarkEvent->SetEnabled(kFALSE);
+        fNextEvent->SetEnabled(kFALSE);
+        fLastEvent->SetEnabled(!autoLoad);
+        fPrevEvent->SetEnabled(kFALSE);
+        fFirstEvent->SetEnabled(kFALSE);
+       listEventsTab->SetOfflineMode(kTRUE);
+       configManager->DisableStoragePopup();
+       fEventId->SetState(kFALSE);
+      }
     else if(state == 1)
-    {
+      {
+       listEventsTab->SetOfflineMode(kFALSE);
+
         fStorageStatus->SetText("Storage: OK");
-        fMarkEvent->SetEnabled(true);
-        fNextEvent->SetEnabled(true);
-        fLastEvent->SetEnabled(true);
-        fPrevEvent->SetEnabled(true);
-        fFirstEvent->SetEnabled(true);
-    }
+        fMarkEvent->SetEnabled(kTRUE);
+        fNextEvent->SetEnabled(!autoLoad);
+        fLastEvent->SetEnabled(!autoLoad);
+        fPrevEvent->SetEnabled(!autoLoad);
+        fFirstEvent->SetEnabled(!autoLoad);
+       fEventId->SetState(!autoLoad);
+      }
+  }
 }
 
 //------------------------------------------------------------------------------
index f151479..4c2bc5e 100644 (file)
@@ -82,9 +82,8 @@ public:
   void DoSetAutoLoadTime();
   void DoSetTrigSel();
 
-  void Update();
-    
-    void StorageManagerChangedState(int state);
+  void Update(int=1);    
+  void StorageManagerChangedState(int state);
 
 protected:
   AliEveEventManager   *fM;            // Model object.
@@ -104,6 +103,7 @@ protected:
 
   TGComboBox           *fTrigSel;      // Trigger selection combo box
   TGLabel              *fStorageStatus; // Display status of Storage Manager
+  TGLabel              *fEventServerStatus; // Display status of Event Server
 
   TGTextView           *fEventInfo;    // Text box with event info
 
index 5a9936b..58f756d 100644 (file)
@@ -181,17 +181,18 @@ void AliStorageAdministratorPanelListEvents::InitWindow()
        AddFrame(fStatusLabel,new TGLayoutHints(kLHintsExpandX | kLHintsLeft));
 
        //buttons
-       AddFrame(new TGTextButton(this,"Close",BUTTON_CLOSE),
+       fCloseButton = new TGTextButton(this,"Close",BUTTON_CLOSE);
+       AddFrame(fCloseButton,
                 new TGLayoutHints(kLHintsLeft));
-
-       AddFrame(new TGTextButton(this,"Get event's list",BUTTON_GET_LIST),
+       fGetListButton = new TGTextButton(this,"Get event's list",BUTTON_GET_LIST);
+       AddFrame(fGetListButton,
                 new TGLayoutHints(kLHintsRight));
-
-       AddFrame(new TGTextButton(this,"Mark selected event",BUTTON_MARK_EVENT),
+       fMarkButton = new TGTextButton(this,"Mark selected event",BUTTON_MARK_EVENT);
+       AddFrame(fMarkButton,
+                new TGLayoutHints(kLHintsRight));
+       fLoadButton = new TGTextButton(this,"Load event",BUTTON_LOAD_EVENT);
+       AddFrame(fLoadButton,
                 new TGLayoutHints(kLHintsRight));
-
-    AddFrame(new TGTextButton(this,"Load event",BUTTON_LOAD_EVENT),
-             new TGLayoutHints(kLHintsRight));
     
 
        //event's list
@@ -390,3 +391,36 @@ Bool_t AliStorageAdministratorPanelListEvents::ProcessMessage(Long_t msg, Long_t
 
        return false;
 }
+       
+void AliStorageAdministratorPanelListEvents::SetOfflineMode(Bool_t ison)
+{
+
+  if (ison) {
+    fProtonProtonCheckButton->SetDisabledAndSelected(ison);
+    fLeadLeadCheckButton->SetDisabledAndSelected(ison);
+    fTempCheckButton->SetDisabledAndSelected(ison);
+    fPermCheckButton->SetDisabledAndSelected(ison);
+  }
+  else {
+    fProtonProtonCheckButton->SetEnabled(!ison);
+    fLeadLeadCheckButton->SetEnabled(!ison);
+    fTempCheckButton->SetEnabled(!ison);
+    fPermCheckButton->SetEnabled(!ison);
+    fProtonProtonCheckButton->SetOn();
+    fLeadLeadCheckButton->SetOn();
+    fTempCheckButton->SetOn();
+    fPermCheckButton->SetOn();
+  }
+
+  fRunNumberMinEntry->SetState(!ison);
+  fRunNumberMaxEntry->SetState(!ison);
+  fEventNumberMinEntry->SetState(!ison);
+  fEventNumberMaxEntry->SetState(!ison);
+  fMultiplicityMinEntry->SetState(!ison);
+  fMultiplicityMaxEntry->SetState(!ison);
+
+  fCloseButton->SetEnabled(!ison);
+  fGetListButton->SetEnabled(!ison);
+  fMarkButton->SetEnabled(!ison);
+  fLoadButton->SetEnabled(!ison);
+}
index 6dc47bd..1ce741f 100644 (file)
@@ -16,6 +16,8 @@ public:
     AliESDEvent* GetSelectedEvent(){return fCurrentEvent;}
        void onExit();
     void SelectedEvent(); //*SIGNAL*
+    void SetOfflineMode(Bool_t);
+
 private:
        AliStorageAdministratorPanelListEvents();
        virtual ~AliStorageAdministratorPanelListEvents();
@@ -38,6 +40,11 @@ private:
        TGCheckButton *fTempCheckButton;
        TGCheckButton *fPermCheckButton;
        
+       TGTextButton *fCloseButton;
+       TGTextButton *fGetListButton;
+       TGTextButton *fMarkButton;
+       TGTextButton *fLoadButton;
+
        TGListBox *fEventsList;
        
        void InitWindow();
index 1372864..c86a83b 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 rm -fr /opt/reco/run197669/
 rm -fr /opt/reco/log/run197669.log
-rm -fr /local/storedFiles/
+rm -fr ~/storedFiles/
 mysql -u storage -pstorage123 -e "drop database storage"
 ./setupStorageDatabase.sh
index 3832390..29f110e 100755 (executable)
@@ -1,13 +1,12 @@
 #!/bin/bash
-DB_PASS=""
 HOST="localhost"   # IP of machine on which mysql database is located
 PORT="5055"
 DATABASE="storage"
 USER="storage"
 PASS="storage123"
 TABLE="events"
-STORAGE_PATH="/local/storedFiles"
-MAX_SIZE="3000000"
+STORAGE_PATH="/Users/Jerus/storedFiles"
+MAX_SIZE="30000000"
 MAX_OCCUPATION="80"
 REMOVE_PERCENT="60"
 EVENTS_IN_FILE="5"
@@ -17,10 +16,10 @@ STORAGE_SERVER="localhost"      # IP of machine running alistorage
 STORAGE_SERVER_PORT="5066"      # server thread communication port
 STORAGE_CLIENT_PORT="5088"      # client thread communication port
 XML_SERVER_PORT="5099"          # server of xml files
-mysql -u root -p$DB_PASS -e "create database if not exists $DATABASE;"
-mysql -u root -p$DB_PASS -e "grant ALL PRIVILEGES on $DATABASE.* to '$USER'@'$HOST' identified by '$PASS';"
-mysql -u root -p$DB_PASS -e "use $DATABASE;"
-mysql -u root -p$DB_PASS -e "CREATE TABLE IF NOT EXISTS $DATABASE.$TABLE(\
+mysql -u root -pdaq -e "create database if not exists $DATABASE;"
+mysql -u root -pdaq -e "grant ALL PRIVILEGES on $DATABASE.* to '$USER'@'$HOST' identified by '$PASS';"
+mysql -u root -pdaq -e "use $DATABASE;"
+mysql -u root -pdaq -e "CREATE TABLE IF NOT EXISTS $DATABASE.$TABLE(\
 run_number int(6) NOT NULL,\
 event_number int(6) NOT NULL,\
 system text(7) DEFAULT NULL,\