added possibility to stop buffer monitor
authorslindal <slindal@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Nov 2010 20:47:03 +0000 (20:47 +0000)
committerslindal <slindal@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Nov 2010 20:47:03 +0000 (20:47 +0000)
EVE/EveHLT/AliEveEventBuffer.cxx
EVE/EveHLT/AliEveEventBuffer.h
EVE/EveHLT/AliEveEventBufferHomer.cxx
EVE/EveHLT/AliEveEventBufferHomer.h
EVE/EveHLT/AliEveHLTEventManagerEditor.cxx

index edef8e2..e7817e4 100644 (file)
@@ -61,12 +61,12 @@ AliEveEventBuffer::~AliEveEventBuffer() {
   fCurrentEvent = NULL;
 
 }
-
+///___________________________________________________________________________
 void AliEveEventBuffer::CreateBufferThread() {
-  //  cout << "hereherehere"<<endl;
+  cout << "CreateBufferThread()"<<endl;
   TThread * fThread = new TThread(AliEveEventBuffer::BufferThread, (void*) this);
   fThread->Run();
-
+  cout << "Done BufferThread"<<endl;
 }
 
 ///___________________________________________________________________________
@@ -252,9 +252,15 @@ Int_t AliEveEventBuffer::CalculateDifference(Int_t top, Int_t low) {
 void AliEveEventBuffer::StartBufferMonitor() {
   //cout << "NOT !!! starting buffer mon"<<endl;
   cout << "starting buffer mon"<<endl;
-  CreateBufferThread();
-  SetBufferMonStarted(kTRUE);
-  fTimer->Start(3000);
+  if(!GetBufferMonStarted()) {
+    CreateBufferThread();
+    SetBufferMonStarted(kTRUE);
+    fTimer->Start(3000);
+  } else {
+    cout << "Stopping buffer monitor"<<endl;
+    fTimer->Stop();
+    SetBufferMonStarted(kFALSE);
+  }
 }
 ///___________________________________________________________________________________
 void AliEveEventBuffer::StopBufferMonitor() {
index 0a201fe..bf81f16 100644 (file)
@@ -87,7 +87,6 @@ protected:
   
   //Add event to buffer
   virtual void AddToBuffer(TObject * event);
-  //  virtual void AddToBuffer(TObject * event, ULong64_t eventId);
   virtual TObject * GetEventFromSource() = 0;
   virtual ULong64_t GetEventIdFromSource() { return 0;}
 
index 16d7d3c..8769a46 100644 (file)
@@ -68,18 +68,6 @@ void AliEveEventBufferHomer::AddToBuffer(TObject * event) {
   }
 }
 
-// ///___________________________________________________________________________
-// void AliEveEventBufferHomer::AddToBuffer(TObject * event, ULong64_t eventId ) {
-//   cout << "Add to buffer"<<endl;
-//   if(!event) return;
-//   fBIndex[kTop] = CalculateNext(fBIndex[kTop]);
-//   TList * list = dynamic_cast<TList*>(fEventBuffer->At(fBIndex[kTop]));
-//   if(list) {
-//     list->Clear();
-//     list->AddAll(dynamic_cast<TList*>(event));
-//     fEventId[fBIndex[kTop]] = eventId;  
-//   }
-// }
 
 
 ///______________________________________________________________________
index 3812aad..e31066f 100644 (file)
@@ -66,7 +66,6 @@ private:
 
   ///Inherited form AliEveEventBuffer
   void AddToBuffer(TObject * event);
-  //void AddToBuffer(TObject * event, ULong64_t eventId);
   AliEveHOMERManager * fHomer;
   Int_t fEventNo;
   TList * fAsyncList;
index e71a8d6..5999123 100644 (file)
@@ -48,7 +48,7 @@ TGedFrame(p, width, height, options | kVerticalFrame, back),
 
   MakeTitle("AliEveHLTEventManager");
 
-  fButtonUpdateEvents = new TGTextButton(this, " Fill buffer.. ");
+  fButtonUpdateEvents = new TGTextButton(this, "- Fill buffer - ");
   AddFrame(fButtonUpdateEvents); //, new TGLayoutHints(...));
   fButtonUpdateEvents->Connect("Clicked()", "AliEveHLTEventManagerEditor", this, "PollEvents()");
 
@@ -57,28 +57,28 @@ TGedFrame(p, width, height, options | kVerticalFrame, back),
   // AddFrame(fXYZZ, new TGLayoutHints(...));
   // fXYZZ->Connect("SignalName()", "AliEveHLTEventManagerEditor", this, "DoXYZZ()");
 
-  fButtonNextEvent = new TGTextButton(this, "  NextEvent  ");
+  fButtonNextEvent = new TGTextButton(this, "-   NextEvent  -");
   AddFrame(fButtonNextEvent); //, new TGLayoutHints(...));
   fButtonNextEvent->Connect("Clicked()", "AliEveHLTEventManagerEditor", this, "NextEvent()");
 
-  fButtonNavigateBack = new TGTextButton(this, "  Navigate Back  ");
+  fButtonNavigateBack = new TGTextButton(this, "-  Navigate Back - ");
   AddFrame(fButtonNavigateBack); //, new TGLayoutHints(...));
   fButtonNavigateBack->Connect("Clicked()", "AliEveHLTEventManagerEditor", this, "NavigateBack()");
 
-  fButtonNavigateFwd = new TGTextButton(this, "  Navigate Fwd  ");
+  fButtonNavigateFwd = new TGTextButton(this, "-  Navigate Fwd  -");
   AddFrame(fButtonNavigateFwd); //, new TGLayoutHints(...));
   fButtonNavigateFwd->Connect("Clicked()", "AliEveHLTEventManagerEditor", this, "NavigateFwd()");
 
 
-  fButtonPrintScreens = new TGTextButton(this, "  Save Viewers  ");
+  fButtonPrintScreens = new TGTextButton(this, "-  Save Viewers - ");
   AddFrame(fButtonPrintScreens); //, new TGLayoutHints(...));
   fButtonPrintScreens->Connect("Clicked()", "AliEveHLTEventManagerEditor", this, "PrintScreens()");
   
-  fButtonWriteToFile = new TGTextButton(this, " Write to file  ");
+  fButtonWriteToFile = new TGTextButton(this, "-  Write to file  -");
   AddFrame(fButtonWriteToFile); //, new TGLayoutHints(...));
   fButtonWriteToFile->Connect("Clicked()", "AliEveHLTEventManagerEditor", this, "WriteBlockListToFile()");
 
-  fButtonConnect = new TGTextButton(this, " Reconnect ");
+  fButtonConnect = new TGTextButton(this, "-     Reconnect   - ");
   AddFrame(fButtonConnect); //, new TGLayoutHints(...));
   fButtonConnect->Connect("Clicked()", "AliEveHLTEventManagerEditor", this, "ConnectToHLT()");
 
@@ -151,6 +151,7 @@ void AliEveHLTEventManagerEditor::PollEvents() {
   fM->StartBufferMonitor();
 }
 
+
 void AliEveHLTEventManagerEditor::EventLoop() {
   // Start/stop event loop
   if ( !fEventLoopStarted ) {