- Timestamp:
- 04/15/10 11:50:47 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/ddd/Functions.cpp
r131 r197 58 58 PhysPipeAction->setEnabled(true); 59 59 EventNo->setRange(1, RD->RHeader->Events); 60 M0Display->setEnabled(true); 60 61 M0Start->setRange(0,(RD->RHeader->Samples)-1); 61 62 M0Stop->setRange(0,(RD->RHeader->Samples)-1); … … 84 85 void ddd::DisplayEvent(int) { 85 86 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 87 89 if(Socket->state() == QAbstractSocket::ConnectedState) return; // do not execute if socket is open 88 90 … … 139 141 // ************************************ 140 142 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; 142 153 143 154 for(unsigned int i=0; i<RD->RHeader->NBoards; i++) {//board loop … … 145 156 for(unsigned int k=0; k<RD->RHeader->NChannels; k++) {//channel loop 146 157 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 150 164 //get module, superpixel and pixel number from pixel name 151 152 165 std::string pixelname = PixMap->DRS_to_Pixel(i,j,k); 166 if (pixelname == "") { 167 IDerror = true; 168 continue; 169 } 153 170 char pixelname_copy[256]; 154 171 memset(pixelname_copy,'\0',256); … … 189 206 l)*RD->BStruct[i].ScaleFactor; 190 207 191 if ( sample> z[binx][biny]) {192 z[binx][biny]= sample;208 if (fabs(sample) > z[binx][biny]) { 209 z[binx][biny]=fabs(sample); 193 210 } 194 211 … … 199 216 }//board loop 200 217 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 201 225 //fill data to M0 display (event based) 202 226 Signal2D->setData(SpectrogramDataM0(z)); … … 251 275 QMessageBox::No, QMessageBox::Yes) != QMessageBox::Yes) return; 252 276 253 277 PhysPipeAction->setChecked(false); 254 278 255 279 Socket->connectToHost(IPAddress->text(),Port->value()); … … 271 295 CloseDatafile(); 272 296 297 M0Window->hide(); 298 M0Display->setEnabled(false); 299 273 300 ChannelNo->setEnabled(true); 274 301 BoardNo->setEnabled(true);
Note:
See TracChangeset
for help on using the changeset viewer.