Changeset 11704 for trunk/FACT++/gui/RawEventsViewer
- Timestamp:
- 07/29/11 16:35:55 (13 years ago)
- Location:
- trunk/FACT++/gui/RawEventsViewer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc
r11697 r11704 1390 1390 * CURRENT EVENT HAS CHANGED. ui handler 1391 1391 ************************************************************/ 1392 double xval[4096]; 1393 double yval[4096]; 1394 1392 1395 void UIConnector::currentEventHasChanged(int cEvent) 1393 1396 { … … 1484 1487 } 1485 1488 1486 QVector<QwtIntervalSample> boardsHistoSamples(boardsHistoMap.size());1487 1489 std::map<int,int>::iterator it = boardsHistoMap.begin(); 1490 int nsamples = 0; 1491 int previousValue = it->first-10; 1488 1492 for (unsigned int i=0;i<boardsHistoMap.size();i++) 1489 1493 { 1490 QwtInterval interval(double(it->first), it->first+1.0); 1491 interval.setBorderFlags(QwtInterval::ExcludeMaximum); 1492 boardsHistoSamples[i] = QwtIntervalSample(it->second, interval); 1494 if (previousValue != it->first-1) 1495 { 1496 xval[nsamples] = previousValue+1; 1497 yval[nsamples] = 0; 1498 nsamples++; 1499 xval[nsamples] = it->first-1; 1500 yval[nsamples] = 0; 1501 nsamples++; 1502 } 1503 xval[nsamples] = it->first; 1504 yval[nsamples] = it->second; 1505 previousValue = it->first; 1493 1506 it++; 1494 } 1495 boardsTimeHistoItem.setData(new QwtIntervalSeriesData(boardsHistoSamples)); 1496 1497 QVector<QwtIntervalSample> pixelHistoSamples(pixelHistoMap.size()); 1507 nsamples++; 1508 xval[nsamples] = previousValue; 1509 yval[nsamples] = 0; 1510 nsamples++; 1511 if (nsamples > 4090) 1512 { 1513 cout << "Error: Maximum number of samples reached for histograms. skipping what's remaining" << endl; 1514 break; 1515 } 1516 } 1517 it--; 1518 xval[nsamples] = it->first+1; 1519 yval[nsamples] = 0; 1520 nsamples++; 1521 // if (nsamples > 5) 1522 boardsTimeHistoItem.setSamples(xval, yval, nsamples); 1523 1498 1524 it = pixelHistoMap.begin(); 1525 nsamples = 0; 1526 previousValue = it->first-10; 1499 1527 for (unsigned int i=0;i<pixelHistoMap.size();i++) 1500 1528 { 1501 QwtInterval interval(double(it->first), it->first+1.0); 1502 interval.setBorderFlags(QwtInterval::ExcludeMaximum); 1503 pixelHistoSamples[i] = QwtIntervalSample(it->second, interval); 1529 if (previousValue != it->first-1) 1530 { 1531 xval[nsamples] = previousValue+1; 1532 yval[nsamples] = 0; 1533 nsamples++; 1534 xval[nsamples] = it->first-1; 1535 yval[nsamples] = 0; 1536 nsamples++; 1537 } 1538 xval[nsamples] = it->first; 1539 yval[nsamples] = it->second; 1540 previousValue = it->first; 1504 1541 it++; 1505 } 1506 startCellHistoItem.setData(new QwtIntervalSeriesData(pixelHistoSamples)); 1507 1508 QVector<QwtIntervalSample> TMHistoSamples(timeMarksMap.size()); 1542 nsamples++; 1543 xval[nsamples] = previousValue; 1544 yval[nsamples] = 0; 1545 nsamples++; 1546 if (nsamples > 4090) 1547 { 1548 cout << "Error: Maximum number of samples reached for histograms. skipping what's remaining" << endl; 1549 break; 1550 } 1551 } 1552 it--; 1553 xval[nsamples] = it->first+1; 1554 yval[nsamples] = 0; 1555 nsamples++; 1556 // if (nsamples > 5) 1557 startCellHistoItem.setSamples(xval, yval, nsamples); 1558 1509 1559 it = timeMarksMap.begin(); 1560 nsamples = 0; 1561 previousValue = it->first-10; 1510 1562 for (unsigned int i=0;i<timeMarksMap.size();i++) 1511 1563 { 1512 QwtInterval interval(double(it->first), it->first+1.0); 1513 interval.setBorderFlags(QwtInterval::ExcludeMaximum); 1514 TMHistoSamples[i] = QwtIntervalSample(it->second, interval); 1564 if (previousValue != it->first-1) 1565 { 1566 xval[nsamples] = previousValue+1; 1567 yval[nsamples] = 0; 1568 nsamples++; 1569 xval[nsamples] = it->first-1; 1570 yval[nsamples] = 0; 1571 nsamples++; 1572 } 1573 xval[nsamples] = it->first; 1574 yval[nsamples] = it->second; 1575 previousValue = it->first; 1515 1576 it++; 1516 } 1517 startTimeMarkHistoItem.setData(new QwtIntervalSeriesData(TMHistoSamples)); 1518 1519 QVector<QwtIntervalSample> delayTriggerSamples(delayMap.size()); 1577 nsamples++; 1578 xval[nsamples] = previousValue; 1579 yval[nsamples] = 0; 1580 nsamples++; 1581 if (nsamples > 4090) 1582 { 1583 cout << "Error: Maximum number of samples reached for histograms. skipping what's remaining" << endl; 1584 break; 1585 } 1586 } 1587 it--; 1588 xval[nsamples] = it->first+1; 1589 yval[nsamples] = 0; 1590 nsamples++; 1591 // if (nsamples > 5) 1592 startTimeMarkHistoItem.setSamples(xval, yval, nsamples); 1593 1520 1594 it = delayMap.begin(); 1521 for (unsigned int i=0;i<delayMap.size(); i++) 1522 { 1523 QwtInterval interval(double(it->first), it->first+1.0); 1524 interval.setBorderFlags(QwtInterval::ExcludeMaximum); 1525 delayTriggerSamples[i] = QwtIntervalSample(it->second, interval); 1595 nsamples = 0; 1596 previousValue = it->first-10; 1597 for (unsigned int i=0;i<delayMap.size();i++) 1598 { 1599 if (previousValue != it->first-1) 1600 { 1601 xval[nsamples] = previousValue+1; 1602 yval[nsamples] = 0; 1603 nsamples++; 1604 xval[nsamples] = it->first-1; 1605 yval[nsamples] = 0; 1606 nsamples++; 1607 } 1608 xval[nsamples] = it->first; 1609 yval[nsamples] = it->second; 1610 previousValue = it->first; 1526 1611 it++; 1527 } 1528 triggerDelayHistoItem.setData(new QwtIntervalSeriesData(delayTriggerSamples)); 1612 nsamples++; 1613 xval[nsamples] = previousValue; 1614 yval[nsamples] = 0; 1615 nsamples++; 1616 if (nsamples > 4090) 1617 { 1618 cout << "Error: Maximum number of samples reached for histograms. skipping what's remaining" << endl; 1619 break; 1620 } 1621 } 1622 it--; 1623 xval[nsamples] = it->first+1; 1624 yval[nsamples] = 0; 1625 nsamples++; 1626 // if (nsamples > 5) 1627 triggerDelayHistoItem.setSamples(xval, yval, nsamples); 1628 1529 1629 1530 1630 // startCellHistoZoom->setZoomBase(startCellHistoItem.boundingRect()); … … 1604 1704 triggerDelayHisto->setTitle("Trigger Delays"); 1605 1705 1606 boardsTimeHistoItem.setBrush(QBrush(Qt::red));1607 startCellHistoItem.setBrush(QBrush(Qt::red));1608 startTimeMarkHistoItem.setBrush(QBrush(Qt::red));1609 triggerDelayHistoItem.setBrush(QBrush(Qt::red));1706 // boardsTimeHistoItem.setBrush(QBrush(Qt::red)); 1707 // startCellHistoItem.setBrush(QBrush(Qt::red)); 1708 // startTimeMarkHistoItem.setBrush(QBrush(Qt::red)); 1709 // triggerDelayHistoItem.setBrush(QBrush(Qt::red)); 1610 1710 // pixelValueCurveItem.setBrush(QBrush(Qt::red)); 1711 1712 boardsTimeHistoItem.setPen(QColor(Qt::darkGreen)); 1713 boardsTimeHistoItem.setStyle(QwtPlotCurve::Steps); 1714 startCellHistoItem.setPen(QColor(Qt::darkGreen)); 1715 startCellHistoItem.setStyle(QwtPlotCurve::Steps); 1716 startTimeMarkHistoItem.setPen(QColor(Qt::darkGreen)); 1717 startTimeMarkHistoItem.setStyle(QwtPlotCurve::Steps); 1718 triggerDelayHistoItem.setPen(QColor(Qt::darkGreen)); 1719 triggerDelayHistoItem.setStyle(QwtPlotCurve::Steps); 1611 1720 1612 1721 boardsTimeHistoItem.attach(boardsTimeHisto); … … 1641 1750 1642 1751 } 1643 double xval[1024];1644 double yval[1024];1645 1752 void UIConnector::pixelChanged(int pixel) 1646 1753 { -
trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.h
r11697 r11704 31 31 32 32 #include "qwt_plot.h" 33 #include "qwt_plot_histogram.h"33 //#include "qwt_plot_histogram.h" 34 34 #include "qwt_plot_curve.h" 35 35 … … 271 271 QwtPlot* startTimeMarkHisto; 272 272 QwtPlot* pixelValueCurve; 273 QwtPlot HistogramboardsTimeHistoItem;274 QwtPlot HistogramstartCellHistoItem;275 QwtPlot HistogramstartTimeMarkHistoItem;273 QwtPlotCurve boardsTimeHistoItem; 274 QwtPlotCurve startCellHistoItem; 275 QwtPlotCurve startTimeMarkHistoItem; 276 276 QwtPlotCurve pixelValueCurveItem; 277 277 QwtPlotZoomer* curveZoom; … … 281 281 282 282 QwtPlot* triggerDelayHisto; 283 QwtPlot HistogramtriggerDelayHistoItem;283 QwtPlotCurve triggerDelayHistoItem; 284 284 QwtPlotZoomer* triggerDelayHistoZoom; 285 285 QListWidget* triggerDelayList;
Note:
See TracChangeset
for help on using the changeset viewer.