* AliHLTHOMERBlockDesc holds now a copy of the data
[u/mrichter/AliRoot.git] / EVE / EveHLT / AliEveHOMERManagerEditor.cxx
index 12cd381..61b08b8 100644 (file)
@@ -32,6 +32,8 @@ AliEveHOMERManagerEditor::AliEveHOMERManagerEditor(const TGWindow *p, Int_t widt
   fM(0),
   fButtonConnect(0),
   fButtonNextEvent(0),
+  fButtonNavigateBack(0),
+  fButtonNavigateFwd(0),
   fButtonEventLoop(0),
   fEventLoopStarted(kFALSE) {
 
@@ -50,17 +52,22 @@ AliEveHOMERManagerEditor::AliEveHOMERManagerEditor(const TGWindow *p, Int_t widt
   AddFrame(fButtonNextEvent); //, new TGLayoutHints(...));
   fButtonNextEvent->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "NextEvent()");
 
+  fButtonNavigateBack = new TGTextButton(this, "  Navigate Back  ");
+  AddFrame(fButtonNavigateBack); //, new TGLayoutHints(...));
+  fButtonNavigateBack->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "NavigateBack()");
+
+  fButtonNavigateFwd = new TGTextButton(this, "  Navigate Fwd  ");
+  AddFrame(fButtonNavigateFwd); //, new TGLayoutHints(...));
+  fButtonNavigateFwd->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "NavigateFwd()");
 
   fButtonEventLoop = new TGPictureButton(this, gClient->GetPicture("$ALICE_ROOT/EVE/hlt-macros/HLT-logo.png"));
   AddFrame(fButtonEventLoop); //, new TGLayoutHints(...));
   fButtonEventLoop->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "EventLoop()");
-
 }
 
 /******************************************************************************/
 
-void AliEveHOMERManagerEditor::SetModel(TObject* obj)
-{
+void AliEveHOMERManagerEditor::SetModel(TObject* obj) {
   fM = dynamic_cast<AliEveHOMERManager*>(obj);
 
   // Set values of widgets
@@ -69,30 +76,48 @@ void AliEveHOMERManagerEditor::SetModel(TObject* obj)
 
 /******************************************************************************/
 
-// Implements callback/slot methods
-
-// void AliEveHOMERManagerEditor::DoXYZZ()
-// {
-//   fM->SetXYZZ(fXYZZ->GetValue());
-//   Update();
-// }
-
-void AliEveHOMERManagerEditor::ConnectToHLT()
-{
+void AliEveHOMERManagerEditor::ConnectToHLT() {
   // Connects to HOMER sources -> to HLT.
-
+  
   fM->ConnectEVEtoHOMER();
 }
 
-void AliEveHOMERManagerEditor::NextEvent()
-{
+void AliEveHOMERManagerEditor::NextEvent() {
   // call next event from macro
-  gROOT->ProcessLineFast("nextEvent();");
 
+  if ( fM->NextEvent() )
+    return;
+
+  gROOT->ProcessLineFast("processEvent();");
+
+  return;
 }
 
-void AliEveHOMERManagerEditor::EventLoop()
-{
+void AliEveHOMERManagerEditor::NavigateFwd() {
+  // navigate forward
+  
+  if ( !fEventLoopStarted ) {
+    if ( fM->NavigateEventBufferFwd() == -1 )
+      return;
+
+    gROOT->ProcessLineFast("processEvent();");
+  }
+  return;
+}
+
+void AliEveHOMERManagerEditor::NavigateBack() {
+  // navigate back
+
+  if ( !fEventLoopStarted ) {
+    if ( fM->NavigateEventBufferBack() == -1 )
+      return;
+
+    gROOT->ProcessLineFast("processEvent();");
+  }
+  return;
+}
+
+void AliEveHOMERManagerEditor::EventLoop() {
 
   // Start/stop event loop
   if ( !fEventLoopStarted ) {
@@ -104,3 +129,4 @@ void AliEveHOMERManagerEditor::EventLoop()
     fEventLoopStarted = kFALSE;
   }
 }
+