Project

General

Profile

test_nucondb.cxx

Philip Rodrigues, 03/14/2015 11:27 AM

 
1
#include "nucondb.h"
2
#include "WebAPI.h"
3

    
4
#include <iostream>
5
#include <string>
6

    
7
// Build with:
8
// g++ -o test_nucondb -I$NUCONDBROOT/util -I$NUCONDBROOT/src -L$NUCONDBROOT/$CMTCONFIG -lNuConDBLib test_nucondb.cxx
9
int main(int, char**)
10
{
11
  const std::string url="http://mnvcon-data.fnal.gov:8088/mnvcon_prd/app/";
12
  const std::string foldername="minerva_febs_eroicakludge";
13

    
14
  Folder* f=new Folder(foldername, url);
15
  double hg_adc0;
16
  const unsigned long channel=1;
17
  for(unsigned long t=1378253403; t>0; t -= 1){
18
    std::cout << "Getting channel data at t=" << t << std::endl;
19
    try{
20
      f->getNamedChannelData( t, channel, "hg_adc0", &hg_adc0 );
21
    }
22
    catch(...) {}
23
    std::cout << "Got channel data" << std::endl;
24
  }
25
}