Changeset 12677 for trunk/FACT++
- Timestamp:
- 12/01/11 16:32:05 (13 years ago)
- Location:
- trunk/FACT++/gui/RawEventsViewer
- Files:
-
- 2 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 -
trunk/FACT++/gui/RawEventsViewer/viewer.ui
r12461 r12677 8 8 <y>0</y> 9 9 <width>984</width> 10 <height> 894</height>10 <height>712</height> 11 11 </rect> 12 12 </property> … … 27 27 <property name="sizePolicy"> 28 28 <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> 29 <horstretch> 0</horstretch>30 <verstretch> 0</verstretch>29 <horstretch>1</horstretch> 30 <verstretch>1</verstretch> 31 31 </sizepolicy> 32 32 </property> … … 48 48 </property> 49 49 <property name="sizePolicy"> 50 <sizepolicy hsizetype=" Maximum" vsizetype="Maximum">51 <horstretch> 0</horstretch>52 <verstretch> 0</verstretch>50 <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> 51 <horstretch>1</horstretch> 52 <verstretch>1</verstretch> 53 53 </sizepolicy> 54 </property>55 <property name="maximumSize">56 <size>57 <width>10000</width>58 <height>10000</height>59 </size>60 54 </property> 61 55 </widget> … … 197 191 </layout> 198 192 </widget> 193 <widget class="QWidget" name="tab_7"> 194 <attribute name="title"> 195 <string>Average Curve</string> 196 </attribute> 197 <layout class="QGridLayout" name="gridLayout_41"> 198 <item row="0" column="0"> 199 <widget class="QwtPlot" name="pixelAverageCurve"/> 200 </item> 201 </layout> 202 </widget> 199 203 </widget> 200 204 </item> … … 207 211 <layout class="QGridLayout" name="gridLayout_6"> 208 212 <item row="0" column="0"> 209 <widget class="QCameraWidget" name=" GLWindow_2" native="true">213 <widget class="QCameraWidget" name="RMS_window" native="true"> 210 214 <property name="enabled"> 211 215 <bool>true</bool> 212 216 </property> 213 217 <property name="sizePolicy"> 214 <sizepolicy hsizetype=" Maximum" vsizetype="Maximum">218 <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> 215 219 <horstretch>0</horstretch> 216 220 <verstretch>0</verstretch> … … 227 231 </layout> 228 232 </widget> 233 <widget class="QWidget" name="tab_8"> 234 <attribute name="title"> 235 <string>Mean</string> 236 </attribute> 237 <layout class="QGridLayout" name="gridLayout_61"> 238 <item row="0" column="0"> 239 <widget class="QCameraWidget" name="Mean_window" native="true"> 240 <property name="enabled"> 241 <bool>true</bool> 242 </property> 243 <property name="sizePolicy"> 244 <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> 245 <horstretch>0</horstretch> 246 <verstretch>0</verstretch> 247 </sizepolicy> 248 </property> 249 <property name="maximumSize"> 250 <size> 251 <width>10000</width> 252 <height>10000</height> 253 </size> 254 </property> 255 </widget> 256 </item> 257 </layout> 258 </widget> 259 <widget class="QWidget" name="tab_9"> 260 <attribute name="title"> 261 <string>Max</string> 262 </attribute> 263 <layout class="QGridLayout" name="gridLayout_62"> 264 <item row="0" column="0"> 265 <widget class="QCameraWidget" name="Max_window" native="true"> 266 <property name="enabled"> 267 <bool>true</bool> 268 </property> 269 <property name="sizePolicy"> 270 <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> 271 <horstretch>0</horstretch> 272 <verstretch>0</verstretch> 273 </sizepolicy> 274 </property> 275 <property name="maximumSize"> 276 <size> 277 <width>10000</width> 278 <height>10000</height> 279 </size> 280 </property> 281 </widget> 282 </item> 283 </layout> 284 </widget> 285 <widget class="QWidget" name="tab_10"> 286 <attribute name="title"> 287 <string>Pos. of Max.</string> 288 </attribute> 289 <layout class="QGridLayout" name="gridLayout_63"> 290 <item row="0" column="0"> 291 <widget class="QCameraWidget" name="PosOfMax_window" native="true"> 292 <property name="enabled"> 293 <bool>true</bool> 294 </property> 295 <property name="sizePolicy"> 296 <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> 297 <horstretch>0</horstretch> 298 <verstretch>0</verstretch> 299 </sizepolicy> 300 </property> 301 <property name="maximumSize"> 302 <size> 303 <width>10000</width> 304 <height>10000</height> 305 </size> 306 </property> 307 </widget> 308 </item> 309 </layout> 310 </widget> 229 311 </widget> 230 312 </item> … … 246 328 <widget class="QLabel" name="extraInfoLabel"> 247 329 <property name="sizePolicy"> 248 <sizepolicy hsizetype="Preferred" vsizetype=" MinimumExpanding">330 <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> 249 331 <horstretch>0</horstretch> 250 332 <verstretch>0</verstretch> … … 295 377 <property name="font"> 296 378 <font> 297 <pointsize>1 2</pointsize>379 <pointsize>11</pointsize> 298 380 <weight>75</weight> 299 381 <bold>true</bold> … … 313 395 <widget class="QLabel" name="label_10"> 314 396 <property name="text"> 315 <string>H ardwareID</string>397 <string>Hw ID</string> 316 398 </property> 317 399 <property name="alignment"> … … 330 412 </widget> 331 413 </item> 332 </layout>333 </item>334 <item>335 <layout class="QHBoxLayout" name="horizontalLayout_7">336 414 <item> 337 415 <widget class="QLabel" name="label_11"> 338 416 <property name="text"> 339 <string>S oftwareID</string>417 <string>Sw ID</string> 340 418 </property> 341 419 <property name="alignment"> … … 454 532 <widget class="QLabel" name="displayingEventLabel"> 455 533 <property name="text"> 456 <string> DisplayingEvent</string>534 <string>Event</string> 457 535 </property> 458 536 </widget> … … 461 539 <widget class="QSpinBox" name="displayingEventBox"/> 462 540 </item> 463 </layout>464 </item>465 <item>466 <layout class="QHBoxLayout" name="horizontalLayout_9">467 541 <item> 468 542 <widget class="QLabel" name="displayingSliceLabel"> 469 543 <property name="text"> 470 <string> DisplayingSlice </string>544 <string>Slice </string> 471 545 </property> 472 546 </widget>
Note:
See TracChangeset
for help on using the changeset viewer.