MdspDump.cxx

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

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