Changeset 197


Ignore:
Timestamp:
04/15/10 11:50:47 (15 years ago)
Author:
qweitzel
Message:
M0 display adapted to new DRS4 data
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/ddd/Functions.cpp

    r131 r197  
    5858  PhysPipeAction->setEnabled(true);
    5959  EventNo->setRange(1, RD->RHeader->Events);
     60  M0Display->setEnabled(true);
    6061  M0Start->setRange(0,(RD->RHeader->Samples)-1); 
    6162  M0Stop->setRange(0,(RD->RHeader->Samples)-1);
     
    8485void ddd::DisplayEvent(int) {
    8586
    86   PixelID->setText(PixMap->DRS_to_Pixel(BoardNo->value(), ChannelNo->value()/10, ChannelNo->value()%10).c_str());  // Translate to pixel ID
     87  PixelID->setText(PixMap->DRS_to_Pixel(BoardNo->value(), ChannelNo->value()/RD->RHeader->NChannels,
     88                                        ChannelNo->value()%RD->RHeader->NChannels).c_str());  // Translate to pixel ID
    8789  if(Socket->state() == QAbstractSocket::ConnectedState) return; // do not execute if socket is open
    8890 
     
    139141  // ************************************   
    140142
    141   double z[6][6];//36 pixels
     143  if (!(M0Display->isEnabled())) return;
     144
     145  double z[6][6] = {{0}};//36 pixels
     146  bool IDerror = false;
     147
     148  //only interested in M0 data using DRS2
     149  //if (RD->RHeader->NChannels == 9) IDerror = true; 
     150
     151  //only interested in M0 data using DRS4
     152  if (RD->RHeader->NChannels == 10) IDerror = true; 
    142153
    143154  for(unsigned int i=0; i<RD->RHeader->NBoards; i++) {//board loop
     
    145156      for(unsigned int k=0; k<RD->RHeader->NChannels; k++) {//channel loop
    146157
    147         //only interested in M0 data
    148         if( ( (i==0 || i==1) && (j<=1) && (k<=7) ) || ( (i==2) && (j==0) && (k<=3) ) ) {
    149 
     158        //for DRS2 data (requires the correct pixelmap!!!
     159        //if( ( (i==0 || i==1) && (j<=1) && (k<=7) ) || ( (i==2) && (j==0) && (k<=3) ) ) {
     160
     161        //for DRS4 data (requires the correct pixelmap!!!
     162        if( ( (i==0 || i==1) && (j<=3) && (k==0 || k==2 || k==4 || k==6) ) || ( (i==2) && (j==0) && (k==0 || k==2 || k==4 || k==6) ) ) {
     163         
    150164          //get module, superpixel and pixel number from pixel name
    151 
    152165          std::string pixelname = PixMap->DRS_to_Pixel(i,j,k);
     166          if (pixelname == "") {
     167            IDerror = true;
     168            continue;
     169          }
    153170          char pixelname_copy[256];
    154171          memset(pixelname_copy,'\0',256);
     
    189206                             l)*RD->BStruct[i].ScaleFactor;
    190207
    191             if (sample > z[binx][biny]) {
    192               z[binx][biny]=sample;
     208            if (fabs(sample) > z[binx][biny]) {
     209              z[binx][biny]=fabs(sample);
    193210            }
    194211
     
    199216  }//board loop
    200217
     218  if(IDerror){
     219    QMessageBox::warning(this, "ddd Message","Sorry! The M0 display is not available for this data file because of a pixel ID mismatch.",QMessageBox::Ok);
     220    if(M0Window->isVisible()) M0Window->hide();
     221    M0Display->setEnabled(false);
     222    return;
     223  }
     224
    201225  //fill data to M0 display (event based)
    202226  Signal2D->setData(SpectrogramDataM0(z));
     
    251275        QMessageBox::No, QMessageBox::Yes) != QMessageBox::Yes) return;
    252276               
    253         PhysPipeAction->setChecked(false);
     277    PhysPipeAction->setChecked(false);
    254278           
    255279    Socket->connectToHost(IPAddress->text(),Port->value());
     
    271295      CloseDatafile();
    272296
     297      M0Window->hide();
     298      M0Display->setEnabled(false);
     299
    273300      ChannelNo->setEnabled(true);
    274301      BoardNo->setEnabled(true);
Note: See TracChangeset for help on using the changeset viewer.