Changeset 10913 for fact/drsdaq
- Timestamp:
- 06/06/11 14:35:10 (14 years ago)
- Location:
- fact/drsdaq
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/drsdaq/History.txt
r10903 r10913 74 74 drsdaq is 264. 75 75 30/7/2010 Published some run-related information as DIM service. 76 3/6/2011 Added 'write' command (for PEBS application) 76 3/6/2011 Added 'write' command (for PEBS application). 77 6/6/2011 Event header is printed in RawDataCTX.cc before trying to seek. 77 78 -
fact/drsdaq/RawDataCTX.cc
r132 r10913 84 84 // If requested, print run header (including board structures) to file 85 85 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")); 87 87 fprintf(fptr, "Data format: %u\n", RHeader->DataFormat); 88 88 fprintf(fptr, "Software revision: %d\n", RHeader->SoftwareRevision); … … 113 113 for (unsigned int i=0; i<RHeader->NBoards; i++) { 114 114 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); 116 116 fprintf(fptr, "Sampling frequency: %.3f GHz\n", BStruct[i].NomFreq); 117 117 fprintf(fptr, "Temperature: %.3f deg C\n", BStruct[i].BoardTemp); … … 165 165 } 166 166 } 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 data179 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 }183 167 184 168 // If requested, print event header to file … … 190 174 fprintf(fptr, "Size [byte]: %u\n", EHeader->EventSize); 191 175 } 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 } 192 194 193 195 return CTX_OK;
Note:
See TracChangeset
for help on using the changeset viewer.