Scrolling data

{
// This simple example opens a demo meta database and plots a vector.
// The vector is scrolled 1 s at a time, nvecmax times.
// The extraction of the vector shows that one can select a vector
// without having to think about the frame boundaries.
// The length of the vector is arbitrary and is only limited by the available
// amount of memory.
 
   gROOT->Reset();

   gBenchmark->Start("scroll");

   FrVect* frv;
   double time;

// Max number of vectors displayed
   int nvecmax = 20;

// Time step of the scroll
   double tistep = 1;

// Length of the displayed vector
   double veclength = 4;

// Open a new window (canvas)   
   c1 = new TCanvas("c1","c1",1);
   
// Open a frame channel
   fc = new VFrameChannel("demoDB.root");
   
// Start time
   time = fc->GetStart();

// Get the first vector
   frv = fc->GetVect("adc.MYGO_ADC1",time,veclength);
   int nvec = 0;
   while ( (frv!=0) && (nvec<nvecmax) ) {
      nvec++;
      printf("nvect = %d, time = %fn",nvec,time);

// Draws the vector
      gVM->Draw(frv);
// Update the canvas
      gPad->Update();

      FrVectFree(frv);

      time += tistep;
      frv = fc->GetVect("adc.MYGO_ADC1",time,veclength); // Get the next vector
   }

   gBenchmark->Show("scroll");
}
  


- ROOT page - VEGA page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to , or contact with any questions or problems regarding ROOT or VEGA.