Changeset 89 for drsdaq


Ignore:
Timestamp:
07/13/09 14:47:30 (15 years ago)
Author:
ogrimm
Message:
Corrected writing of wrong board structure is first chosen board is not also the first physical board
Location:
drsdaq
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • drsdaq/DAQReadout.cc

    r86 r89  
    961961  }   
    962962
    963   if(write(Rawfile, BStruct, sizeof(BoardStructure)*(LastBoard-FirstBoard+1+(NumBoards==0))) != (ssize_t) sizeof(BoardStructure)*(LastBoard-FirstBoard+1+(NumBoards==0))) {
     963  if(write(Rawfile, &BStruct[FirstBoard], sizeof(BoardStructure)*(LastBoard-FirstBoard+1+(NumBoards==0))) != (ssize_t) sizeof(BoardStructure)*(LastBoard-FirstBoard+1+(NumBoards==0))) {
    964964    PrintMessage("Error: Could not write (all) board structures, terminating run (%s)\n", strerror(errno));
    965965    return false;
     
    12801280    m->SlowDataClass->AddToEntry("%d %s %s %d %d", m->RunNumber, daq_runtype_str[m->daq_runtype], m->RHeader->Description, m->NumEvents, m->FileNumber);
    12811281    if(m->SlowDataClass->ErrorCode != 0) {
    1282       m->PrintMessage("SlowData: Error, could not write data to file (%s); closing file\n", strerror(m->SlowDataClass->ErrorCode));
     1282      m->PrintMessage("Error, could not write DAQ data to file (%s), file closed\n", strerror(m->SlowDataClass->ErrorCode));
    12831283    }
    12841284
  • drsdaq/HVFeedback.cc

    r86 r89  
    2929  PixMap = new PixelMap(PIXMAP_LOCATION, false);
    3030
     31  // Create instance of slow data class for feedback
    3132  snprintf(Filename,sizeof(Filename),"%s/SlowData/", m->fRawDataPath);
    3233  SlowDataClass = new SlowData("HVFB", Filename);
     34  if (SlowDataClass->ErrorCode != 0) {
     35    m->PrintMessage("Warning: Could not open feedback slowdata file (%s)\n", strerror(SlowDataClass->ErrorCode));
     36  }
    3337
    3438  // Initialise with zero content
     
    128132  // Acquired number of event requires action
    129133  switch (FBMode) {
    130     case FB_Active: SlowDataClass->NewEntry("Average");  break;
    131     case FB_Targets: SlowDataClass->NewEntry("Target");  break;
    132     case FB_ResponseSecond: SlowDataClass->NewEntry("Response"); SlowDataClass->AddToEntry("%.3f ",DiffVoltage);  break;
     134    case FB_Active: SlowDataClass->NewEntry("Average");
     135                    break;
     136    case FB_Targets: SlowDataClass->NewEntry("Target");
     137                     break;
     138    case FB_ResponseSecond: SlowDataClass->NewEntry("Response");
     139                            SlowDataClass->AddToEntry("%.3f ",DiffVoltage);
     140                            break;
    133141    default: break;  // to suppress warning abount not handled enumeration value
    134142  }                     
    135143
    136   for (i=m->FirstBoard; i<=m->LastBoard; i++)
    137     for (j=0; j<kNumberOfChips; j++)
     144  for (i=m->FirstBoard; i<=m->LastBoard; i++) {
     145    for (j=0; j<kNumberOfChips; j++) {
    138146      for (k=0; k<kNumberOfChannels; k++) {
    139147        Average[i][j][k] /= Count;
     
    171179        }                       
    172180      }
    173 
     181    }
     182  }
     183 
    174184  switch (FBMode) {
    175185    case FB_Targets:
     
    187197    default: break;  // to suppress warning abount not handled enumeration value
    188198  }
     199 
     200  if(m->SlowDataClass->ErrorCode != 0) {
     201    m->PrintMessage("Error, could not write feedback slow data to file (%s), file closed.\n", strerror(m->SlowDataClass->ErrorCode));
     202  }
    189203  ClearAverages();
     204 
    190205  return true; 
    191206}
Note: See TracChangeset for help on using the changeset viewer.