DspDump.cxx

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

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