Changeset 10913 for fact/drsdaq


Ignore:
Timestamp:
06/06/11 14:35:10 (14 years ago)
Author:
ogrimm
Message:
FADctrl will write and publish data only for active boards
Location:
fact/drsdaq
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • fact/drsdaq/History.txt

    r10903 r10913  
    7474                        drsdaq is 264.
    757530/7/2010       Published some run-related information as DIM service.
    76 3/6/2011        Added 'write' command (for PEBS application)
     763/6/2011        Added 'write' command (for PEBS application).
     776/6/2011        Event header is printed in RawDataCTX.cc before trying to seek.
    7778                       
  • fact/drsdaq/RawDataCTX.cc

    r132 r10913  
    8484  // If requested, print run header (including board structures) to file
    8585  if(fptr != NULL) {
    86     fprintf(fptr, "Magic number          %x (%s)\n", RHeader->MagicNum, RHeader->MagicNum==MAGICNUM_CLOSED?"OK":(RHeader->MagicNum==MAGICNUM_OPEN?"File not closed":"Error"));
     86    fprintf(fptr, "Magic number          0x%X (%s)\n", RHeader->MagicNum, RHeader->MagicNum==MAGICNUM_CLOSED?"OK":(RHeader->MagicNum==MAGICNUM_OPEN?"File not closed":"Error"));
    8787    fprintf(fptr, "Data format:          %u\n", RHeader->DataFormat);
    8888    fprintf(fptr, "Software revision:    %d\n", RHeader->SoftwareRevision);         
     
    113113    for (unsigned int i=0; i<RHeader->NBoards; i++) {
    114114      fprintf(fptr, "*** Board %d ***\n", i);
    115       fprintf(fptr, "Serial number:            %d\n", BStruct[i].SerialNo);
     115      fprintf(fptr, "Serial number:            0x%X\n", BStruct[i].SerialNo);
    116116      fprintf(fptr, "Sampling frequency:       %.3f GHz\n", BStruct[i].NomFreq);
    117117      fprintf(fptr, "Temperature:              %.3f deg C\n", BStruct[i].BoardTemp); 
     
    165165    }
    166166  }
    167   if(!SEEK_OK) {
    168     if(!Silent) printf("Error: Could not move to requested event\n");
    169     return CTX_SEEK;
    170   }
    171 
    172   // Allocate memory for event data (enlarge if necessary)
    173   if(Data==NULL || (sizeof(Data) < EHeader->EventSize)) {
    174     delete[] Data;
    175     Data = new char[EHeader->EventSize];
    176   }
    177 
    178   // Read event data
    179   if(fread(Data, 1, EHeader->EventSize, Rawfile) != EHeader->EventSize) {
    180     if(!Silent) printf("Error: Could not read (all) event data\n");
    181     return CTX_DATA;   
    182   }
    183167
    184168  // If requested, print event header to file
     
    190174    fprintf(fptr, "Size [byte]:     %u\n",        EHeader->EventSize);
    191175  }
     176
     177  // Moce to requested event
     178  if(!SEEK_OK) {
     179    if(!Silent) printf("Error: Could not move to requested event\n");
     180    return CTX_SEEK;
     181  }
     182
     183  // Allocate memory for event data (enlarge if necessary)
     184  if(Data==NULL || (sizeof(Data) < EHeader->EventSize)) {
     185    delete[] Data;
     186    Data = new char[EHeader->EventSize];
     187  }
     188
     189  // Read event data
     190  if(fread(Data, 1, EHeader->EventSize, Rawfile) != EHeader->EventSize) {
     191    if(!Silent) printf("Error: Could not read (all) event data\n");
     192    return CTX_DATA;   
     193  }
    192194 
    193195  return CTX_OK;
Note: See TracChangeset for help on using the changeset viewer.