Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

evdb::AutoAdvance Class Reference

Automatically advance display to next event based on a timer. More...

#include <AutoAdvance.h>

List of all members.

Public Member Functions

 AutoAdvance ()
 ~AutoAdvance ()
Bool_t HandleTimer (TTimer *t)

Public Attributes

TTimer * fTimer


Detailed Description

Automatically advance display to next event based on a timer.

Definition at line 15 of file AutoAdvance.h.


Constructor & Destructor Documentation

AutoAdvance::AutoAdvance  ) 
 

Definition at line 16 of file AutoAdvance.cxx.

References fTimer.

00016                          : fTimer(0) { 
00017   fTimer = new TTimer;
00018   fTimer->SetObject(this);
00019   fTimer->Start(1000);
00020 }

AutoAdvance::~AutoAdvance  ) 
 

Definition at line 24 of file AutoAdvance.cxx.

References fTimer.

00025 {
00026   fTimer->Stop();
00027   delete fTimer;
00028 }


Member Function Documentation

Bool_t AutoAdvance::HandleTimer TTimer *  t  ) 
 

Definition at line 32 of file AutoAdvance.cxx.

00033 {
00034   t->Stop();
00035   
00036   // Advance to next event. When in auto-advance mode, quit at end of file
00037   FILE* fpp = fopen(".evd-pause-autoadvance","r");
00038   int istat = 1;
00039   if (fpp==0) istat = IoModule::Instance()->Advance();
00040   else        fclose(fpp);
00041   
00042   if (istat == 0) {
00043     // If we reach the end of the file, pause and look for a flag file
00044     // indicating that we should reopen the file and continue
00045     std::cerr << "EOF -- waiting for .evd-reopen-file flag..." << std::endl;
00046     FILE* fp = fopen(".evd-reopen-file","r");
00047     if (fp!=0) {
00048       fclose(fp);
00049       IoModule::Instance()->IoMod().Close();
00050       unlink(".evd-reopen-file");
00051       IoModule::Instance()->IoMod().RewindFile();
00052       IoModule::Instance()->Reload();
00053       std::cerr << "Reopenning file..." << std::endl;
00054     }
00055   }
00056   t->Start(1000);
00057   return true;
00058 }


Member Data Documentation

TTimer* evdb::AutoAdvance::fTimer
 

Definition at line 22 of file AutoAdvance.h.

Referenced by AutoAdvance(), and ~AutoAdvance().


The documentation for this class was generated from the following files:
Generated on Thu Jul 24 12:01:16 2008 for NOvA Offline by doxygen 1.3.5