MdspDump.cxx

00001 #define USELIBRARY
00002 
00003 #include <iostream>
00004 using namespace std;
00005 
00006 #include "../TApi.h"
00007 
00008 int main () {
00009   //  gSystem->Load("/home/sct/rod/RodDaq/TApi/libTApi.so");
00010 
00011   TApi *tapi = new TApi();
00012 
00013   tapi->initialiseAll(0);
00014 
00015   // get starting address and number of bytes to read
00016   char response;
00017   do {
00018     int dspStart, dspEnd;
00019 
00020     hex(cin);
00021     cout << "Starting address (hex): ";
00022     cin >> dspStart;
00023     cout << "Ending address (hex): ";
00024     cin >> dspEnd;
00025     dec(cin);
00026     if(dspEnd > dspStart) {
00027       int numWords = (dspEnd +1 - dspStart)/4;
00028   
00029       // create buffer and read data
00030       //      unsigned long * buffer = new unsigned long[numWords];
00031       tapi->dspBlockDump(0, dspStart, numWords, -1);
00032     } else {
00033       cout << "Start must be less than end, skipping\n";
00034     }
00035 
00036     // do another?
00037     cout << "Do another? [Y/n]: ";
00038     cin >> response;
00039   } while (response != 'n');
00040 
00041   // Clean up before exiting
00042   delete tapi;
00043 
00044   return 0;  
00045 }
00046 
00047 

Generated on Mon Feb 6 14:01:23 2006 for SCT DAQ/DCS Software - C++ by  doxygen 1.4.6