Ignore:
Timestamp:
07/29/11 16:35:55 (13 years ago)
Author:
lyard
Message:
replace histograms by curves drawn by myself
Location:
trunk/FACT++/gui/RawEventsViewer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc

    r11697 r11704  
    13901390 * CURRENT EVENT HAS CHANGED. ui handler
    13911391 ************************************************************/
     1392double xval[4096];
     1393double yval[4096];
     1394
    13921395void UIConnector::currentEventHasChanged(int cEvent)
    13931396{
     
    14841487    }
    14851488
    1486     QVector<QwtIntervalSample> boardsHistoSamples(boardsHistoMap.size());
    14871489    std::map<int,int>::iterator it = boardsHistoMap.begin();
     1490    int nsamples = 0;
     1491    int previousValue = it->first-10;
    14881492    for (unsigned int i=0;i<boardsHistoMap.size();i++)
    14891493    {
    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;
    14931506        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
    14981524    it = pixelHistoMap.begin();
     1525    nsamples = 0;
     1526    previousValue = it->first-10;
    14991527    for (unsigned int i=0;i<pixelHistoMap.size();i++)
    15001528    {
    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;
    15041541        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
    15091559    it = timeMarksMap.begin();
     1560    nsamples = 0;
     1561    previousValue = it->first-10;
    15101562    for (unsigned int i=0;i<timeMarksMap.size();i++)
    15111563    {
    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;
    15151576        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
    15201594    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;
    15261611        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
    15291629
    15301630//    startCellHistoZoom->setZoomBase(startCellHistoItem.boundingRect());
     
    16041704    triggerDelayHisto->setTitle("Trigger Delays");
    16051705
    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));
    16101710//    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);
    16111720
    16121721    boardsTimeHistoItem.attach(boardsTimeHisto);
     
    16411750
    16421751}
    1643 double xval[1024];
    1644 double yval[1024];
    16451752void UIConnector::pixelChanged(int pixel)
    16461753{
  • trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.h

    r11697 r11704  
    3131
    3232#include "qwt_plot.h"
    33 #include "qwt_plot_histogram.h"
     33//#include "qwt_plot_histogram.h"
    3434#include "qwt_plot_curve.h"
    3535
     
    271271    QwtPlot*     startTimeMarkHisto;
    272272    QwtPlot*     pixelValueCurve;
    273     QwtPlotHistogram boardsTimeHistoItem;
    274     QwtPlotHistogram startCellHistoItem;
    275     QwtPlotHistogram startTimeMarkHistoItem;
     273    QwtPlotCurve boardsTimeHistoItem;
     274    QwtPlotCurve startCellHistoItem;
     275    QwtPlotCurve startTimeMarkHistoItem;
    276276    QwtPlotCurve     pixelValueCurveItem;
    277277    QwtPlotZoomer* curveZoom;
     
    281281
    282282    QwtPlot*        triggerDelayHisto;
    283     QwtPlotHistogram triggerDelayHistoItem;
     283    QwtPlotCurve triggerDelayHistoItem;
    284284    QwtPlotZoomer* triggerDelayHistoZoom;
    285285    QListWidget* triggerDelayList;
Note: See TracChangeset for help on using the changeset viewer.