Changeset 12677 for trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc
- Timestamp:
- 12/01/11 16:32:05 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc
r12671 r12677 489 489 * CONSTRUCTOR. 490 490 ************************************************************/ 491 RawDataViewer::RawDataViewer(QWidget *cParent) : BasicGlCamera(cParent), RMSvalues(1440) 491 RawDataViewer::RawDataViewer(QWidget *cParent) : BasicGlCamera(cParent), RMSvalues(1440), Meanvalues(1440), Maxvalues(1440), PosOfMaxvalues(1440) 492 492 { 493 493 // setFormat(QGLFormat(QGL::DoubleBuffer));// | QGL::DepthBuffer)); … … 1192 1192 1193 1193 for (vector<PixelMapEntry>::const_iterator it=fPixelMap.begin(); it!=fPixelMap.end(); it++) 1194 RMSvalues[it->index] = pixelStatsData[1*1440+it->hw()]; 1195 1194 { 1195 Meanvalues[it->index] = pixelStatsData[0*1440+it->hw()]; 1196 RMSvalues[it->index] = pixelStatsData[1*1440+it->hw()]; 1197 Maxvalues[it->index] = pixelStatsData[2*1440+it->hw()]; 1198 PosOfMaxvalues[it->index] = pixelStatsData[3*1440+it->hw()]; 1199 1200 } 1196 1201 if (nRoiTM == 0)//move back the data back in place 1197 1202 { … … 1391 1396 entireCameraScale->setChecked(true); 1392 1397 1393 GLWindow_2->enableText(false); 1394 // GLWindow_2->ShowPatchCursor(true); 1398 RMS_window->enableText(false); 1399 Mean_window->enableText(false); 1400 PosOfMax_window->enableText(false); 1401 Max_window->enableText(false); 1402 1403 // RMS_window->ShowPatchCursor(true); 1395 1404 1396 1405 QObject::connect(GLWindow, SIGNAL(colorPaletteHasChanged()), … … 1405 1414 this, SLOT(newFileLoaded())); 1406 1415 1407 QObject::connect( GLWindow_2, SIGNAL(signalCurrentPixel(int)),1416 QObject::connect(RMS_window, SIGNAL(signalCurrentPixel(int)), 1408 1417 GLWindow, SLOT(setCurrentPixel(int))); 1418 QObject::connect(Max_window, SIGNAL(signalCurrentPixel(int)), 1419 GLWindow, SLOT(setCurrentPixel(int))); 1420 QObject::connect(PosOfMax_window, SIGNAL(signalCurrentPixel(int)), 1421 GLWindow, SLOT(setCurrentPixel(int))); 1422 QObject::connect(Mean_window, SIGNAL(signalCurrentPixel(int)), 1423 GLWindow, SLOT(setCurrentPixel(int))); 1424 1409 1425 1410 1426 … … 1418 1434 grid4->detach(); 1419 1435 grid5->detach(); 1436 grid6->detach(); 1420 1437 boardsTimeHistoItem.detach(); 1421 1438 startCellHistoItem.detach(); 1422 1439 startTimeMarkHistoItem.detach(); 1423 1440 pixelValueCurveItem.detach(); 1441 pixelAverageCurveItem.detach(); 1424 1442 aMeanCurveItem.detach(); 1425 1443 vCorrCurveItem.detach(); … … 1702 1720 { 1703 1721 1704 GLWindow_2->SetData(GLWindow->RMSvalues); 1705 if (GLWindow_2->isVisible()) 1706 GLWindow_2->updateGL(); 1722 RMS_window->SetData(GLWindow->RMSvalues); 1723 Mean_window->SetData(GLWindow->Meanvalues); 1724 PosOfMax_window->SetData(GLWindow->PosOfMaxvalues); 1725 Max_window->SetData(GLWindow->Maxvalues); 1726 1727 if (RMS_window->isVisible()) 1728 RMS_window->updateGL(); 1729 if (Mean_window->isVisible()) 1730 Mean_window->updateGL(); 1731 if (PosOfMax_window->isVisible()) 1732 PosOfMax_window->updateGL(); 1733 if (Max_window->isVisible()) 1734 Max_window->updateGL(); 1707 1735 ostringstream str; 1708 1736 // str << "Displaying Event " << cEvent; … … 2115 2143 grid4->attach(pixelValueCurve); 2116 2144 2145 grid6 = new QwtPlotGrid; 2146 grid6->enableX(false); 2147 grid6->enableY(true); 2148 grid6->enableXMin(false); 2149 grid6->enableYMin(false); 2150 grid6->setMajPen(QPen(Qt::black, 0, Qt::DotLine)); 2151 grid6->attach(pixelAverageCurve); 2152 2117 2153 grid5 = new QwtPlotGrid; 2118 2154 grid5->enableX(false); … … 2127 2163 startTimeMarkHisto->setAutoReplot(true); 2128 2164 pixelValueCurve->setAutoReplot(true); 2165 pixelAverageCurve->setAutoReplot(true); 2129 2166 triggerDelayHisto->setAutoReplot(true); 2130 2167 boardsTimeHisto->setTitle("Boards time values"); … … 2132 2169 startTimeMarkHisto->setTitle("Start Time Marks values"); 2133 2170 pixelValueCurve->setTitle("Current pixel values"); 2171 pixelAverageCurve->setTitle("Average pixels values"); 2134 2172 triggerDelayHisto->setTitle("Trigger Delays"); 2135 2173 … … 2157 2195 // pixelValueCurveItem.setSymbol(new QwtSymbol(QwtSymbol::Cross, Qt::NoBrush, QPen(Qt::black), QSize(5,5))); 2158 2196 pixelValueCurveItem.setPen(QColor(Qt::black)); 2197 pixelAverageCurveItem.setPen(QColor(Qt::black)); 2159 2198 aMeanCurveItem.setPen(QColor(Qt::darkGreen)); 2160 2199 vCorrCurveItem.setPen(QColor(Qt::red)); 2161 2200 meanCurveItem.setPen(QColor(Qt::blue)); 2162 2201 pixelValueCurveItem.setStyle(QwtPlotCurve::Lines); 2202 pixelAverageCurveItem.setStyle(QwtPlotCurve::Lines); 2163 2203 aMeanCurveItem.setStyle(QwtPlotCurve::Lines); 2164 2204 vCorrCurveItem.setStyle(QwtPlotCurve::Lines); … … 2167 2207 // pixelValueCurveItem.setCurveAttribute(QwtPlotCurve::Fitted); 2168 2208 pixelValueCurveItem.attach(pixelValueCurve); 2209 pixelAverageCurveItem.attach(pixelAverageCurve); 2169 2210 // aMeanCurveItem.attach(pixelValueCurve); 2170 2211 // vCorrCurveItem.attach(pixelValueCurve); … … 2175 2216 curveZoom->setRubberBandPen(QPen(Qt::gray, 2, Qt::DotLine)); 2176 2217 curveZoom->setTrackerPen(QPen(Qt::gray)); 2218 averageCurveZoom = new QwtPlotZoomer(pixelAverageCurve->canvas()); 2219 averageCurveZoom->setRubberBandPen(QPen(Qt::gray, 2, Qt::DotLine)); 2220 averageCurveZoom->setTrackerPen(QPen(Qt::gray)); 2177 2221 2178 2222 boardsTimeHistoZoom = new QwtPlotZoomer(boardsTimeHisto->canvas()); … … 2197 2241 void UIConnector::pixelChanged(int pixel) 2198 2242 { 2199 GLWindow_2->fWhite = pixel; 2243 RMS_window->fWhite = pixel; 2244 Mean_window->fWhite = pixel; 2245 Max_window->fWhite = pixel; 2246 PosOfMax_window->fWhite = pixel; 2200 2247 if (pixel != -1) 2201 GLWindow_2->fWhitePatch = GLWindow_2->pixelsPatch[pixel]; 2248 { 2249 RMS_window->fWhitePatch = RMS_window->pixelsPatch[pixel]; 2250 Mean_window->fWhitePatch = Mean_window->pixelsPatch[pixel]; 2251 Max_window->fWhitePatch = Max_window->pixelsPatch[pixel]; 2252 PosOfMax_window->fWhitePatch = PosOfMax_window->pixelsPatch[pixel]; 2253 } 2202 2254 else 2203 GLWindow_2->fWhitePatch = -1; 2255 { 2256 RMS_window->fWhitePatch = -1; 2257 Mean_window->fWhitePatch = -1; 2258 Max_window->fWhitePatch = -1; 2259 PosOfMax_window->fWhitePatch = -1; 2260 } 2204 2261 if (pixel == -1) 2205 2262 return; … … 2213 2270 2214 2271 int currentPixel = pixel; 2215 //IN ORDER TO GET THE AVERAGE OF ALL PIXELS DISPLAYED IN THE CURVE OF THE VIEWER 2216 //UNCOMMENT THE 9 LINES BELOW, i.e. UNTIL THE END OF AVERAGE DISPLAY COMMENT MARK 2217 //int currentPixel = 0; 2218 // for (int i=0;i<GLWindow->nRoi;i++) 2219 // yval[i] = 0; 2220 // for (int j=0;j<1440;j++) { 2221 // currentPixel = j; 2272 2222 2273 for (int i=0;i<GLWindow->nRoi;i++) 2223 2274 { 2224 2275 xval[i] = i; 2225 2276 yval[i] = GLWindow->eventData[GLWindow->nRoi*currentPixel + i]; 2226 // yval[i] += GLWindow->eventData[GLWindow->nRoi*currentPixel + i]; 2227 } 2228 // } 2229 // for (int i=0;i<GLWindow->nRoi;i++) 2230 // yval[i] /= 1440; 2231 //END OF AVERAGE DISPLAY COMMENTS 2277 } 2278 2279 2232 2280 int realNumSamples = GLWindow->nRoi; 2233 2281 if (GLWindow->nRoiTM != 0) … … 2256 2304 // cout << pixelIdInPatch << " " ; 2257 2305 } 2258 //cout << realNumSamples << endl; 2259 // GLWindow->computePulsesStatistics(); 2306 2260 2307 #if QWT_VERSION < 0x060000 2261 2308 pixelValueCurveItem.setData(xval, yval, realNumSamples); 2262 //// aMeanCurveItem.setData(xval, GLWindow->aMeas, GLWindow->nRoi);2263 // meanCurveItem.setData(xval, GLWindow->n1mean, GLWindow->nRoi);2264 // vCorrCurveItem.setData(xval, GLWindow->vCorr, GLWindow->nRoi-3);2265 2309 #else 2266 2310 pixelValueCurveItem.setSamples(xval, yval, realNumSamples); 2267 // aMeanCurveItem.setSamples(xval, GLWindow->aMeas, GLWindow->nRoi);2268 // meanCurveItem.setSamples(xval, GLWindow->n1mean, GLWindow->nRoi);2269 // vCorrCurveItem.setSamples(xval, GLWindow->vCorr, GLWindow->nRoi-3);2270 2311 #endif 2271 2312 2313 //now compute the average value of all pixels 2314 currentPixel = 0; 2315 for (int i=0;i<GLWindow->nRoi;i++) 2316 yval[i] = 0; 2317 for (int j=0;j<1440;j++) { 2318 currentPixel = j; 2319 for (int i=0;i<GLWindow->nRoi;i++) 2320 { 2321 xval[i] = i; 2322 yval[i] += GLWindow->eventData[GLWindow->nRoi*currentPixel + i]; 2323 } 2324 } 2325 for (int i=0;i<GLWindow->nRoi;i++) 2326 yval[i] /= 1440; 2327 #if QWT_VERSION < 0x060000 2328 pixelAverageCurveItem.setData(xval, yval, GLWindow->nRoi); 2329 #else 2330 pixelAverageCurveItem.setSamples(xval, yval, realNumSamples); 2331 #endif 2272 2332 2273 2333 QStack< QRectF > stack; 2274 2334 stack.push(scaleBoundingRectangle(pixelValueCurveItem.boundingRect(), 1.5f)); 2275 2335 curveZoom->setZoomStack(stack); 2336 stack.pop(); 2337 stack.push(scaleBoundingRectangle(pixelAverageCurveItem.boundingRect(), 1.5f)); 2338 averageCurveZoom->setZoomStack(stack); 2276 2339 stack.pop(); 2277 2340
Note:
See TracChangeset
for help on using the changeset viewer.