00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include <stdio.h>
00014 #include <unistd.h>
00015 #include <getopt.h>
00016 #include <sys/types.h>
00017 #include <stdlib.h>
00018
00019 #include <rtsLog.h>
00020 #include <rtsSystems.h>
00021
00022
00023 #include <DAQ_READER/daqReader.h>
00024 #include <SUNRT/clock.h>
00025
00026 int main(int argc, char *argv[])
00027 {
00028 rtsLogOutput(RTS_LOG_STDERR) ;
00029 rtsLogLevel(WARN) ;
00030
00031 RtsTimer timer;
00032
00033 char *fn = NULL;
00034 if(argc > 1) {
00035 fn = argv[1];
00036 }
00037
00038 daqReader *evp;
00039 evp = new daqReader(fn) ;
00040
00041 int good=0;
00042 int bad=0;
00043
00044 double t;
00045
00046 for(;;) {
00047 timer.reset();
00048 char *ret = evp->get(0,EVP_TYPE_ANY);
00049 t = timer.currtime();
00050
00051 if(ret) {
00052 if(evp->status) {
00053 LOG(ERR,"evp status is non-null [0x08X, %d dec]",evp->status,evp->status) ;
00054 continue ;
00055 }
00056 good++;
00057 LOG("JEFF", "Got event in %lf seconds",t);
00058 }
00059 else {
00060 switch(evp->status) {
00061 case EVP_STAT_OK:
00062 LOG("JEFF", "Got empty in %lf seconds",t);
00063 continue;
00064 case EVP_STAT_EOR:
00065 LOG("JEFF", "Got EOR in %lf seconds", t);
00066 break;
00067 case EVP_STAT_EVT:
00068 bad++;
00069 LOG("JEFF", "Got ERR in %lf seconds", t);
00070 continue;
00071 case EVP_STAT_CRIT:
00072 LOG(CRIT,"evp->status CRITICAL (?)") ;
00073 return -1;
00074 }
00075 }
00076 }
00077
00078 delete evp ;
00079 return 0 ;
00080 }