Commit 808ae6b0bbdea5d67ce557c9b5b6291b65f6ea8a
1 parent
9e457aa4
Exists in
master
and in
16 other branches
#11405 - fixed
Showing
4 changed files
with
34 additions
and
16 deletions
Show diff stats
src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.cc
@@ -28,6 +28,7 @@ namespace plot { | @@ -28,6 +28,7 @@ namespace plot { | ||
28 | HistoPlot::HistoPlot(AMDA::Parameters::ParameterManager& manager, | 28 | HistoPlot::HistoPlot(AMDA::Parameters::ParameterManager& manager, |
29 | boost::shared_ptr<Panel> panel) : | 29 | boost::shared_ptr<Panel> panel) : |
30 | PanelPlotOutput(manager, panel){ | 30 | PanelPlotOutput(manager, panel){ |
31 | + _plotted=false; | ||
31 | 32 | ||
32 | } | 33 | } |
33 | 34 | ||
@@ -271,8 +272,11 @@ void HistoPlot::configureSeriesAxis(double startDate, double stopDate) { | @@ -271,8 +272,11 @@ void HistoPlot::configureSeriesAxis(double startDate, double stopDate) { | ||
271 | } | 272 | } |
272 | 273 | ||
273 | else if(pHistogramProperties->getHistogramType() == "histogram2d"){ | 274 | else if(pHistogramProperties->getHistogramType() == "histogram2d"){ |
274 | - | ||
275 | lZAxis->_used = true; | 275 | lZAxis->_used = true; |
276 | + if(_panel->_page->_superposeMode){ | ||
277 | + _globalStartTime = startDate; | ||
278 | + _globalStopTime = stopDate; | ||
279 | + } | ||
276 | } | 280 | } |
277 | } | 281 | } |
278 | } | 282 | } |
@@ -294,7 +298,7 @@ void HistoPlot::configureAxisLegend () { | @@ -294,7 +298,7 @@ void HistoPlot::configureAxisLegend () { | ||
294 | } | 298 | } |
295 | 299 | ||
296 | void HistoPlot::histo1DUtils(double startDate, double stopDate, HistogramSeriesProperties &pHistogramProperties, | 300 | void HistoPlot::histo1DUtils(double startDate, double stopDate, HistogramSeriesProperties &pHistogramProperties, |
297 | - std::vector<std::pair<double,double>> &grid, double &xBinSize, bool resetCache){ | 301 | + std::vector<std::pair<double,double>> &grid, double &xBinSize){ |
298 | // Get X, Y axis. | 302 | // Get X, Y axis. |
299 | boost::shared_ptr<Axis> lXAxis(_panel->getAxis(pHistogramProperties.getXAxisId())); | 303 | boost::shared_ptr<Axis> lXAxis(_panel->getAxis(pHistogramProperties.getXAxisId())); |
300 | boost::shared_ptr<Axis> lYAxis(_panel->getAxis(pHistogramProperties.getYAxisId())); | 304 | boost::shared_ptr<Axis> lYAxis(_panel->getAxis(pHistogramProperties.getYAxisId())); |
@@ -339,10 +343,12 @@ void HistoPlot::histo1DUtils(double startDate, double stopDate, HistogramSeriesP | @@ -339,10 +343,12 @@ void HistoPlot::histo1DUtils(double startDate, double stopDate, HistogramSeriesP | ||
339 | } | 343 | } |
340 | 344 | ||
341 | void HistoPlot::drawHistogram(double startDate, double stopDate, std::string pParamId, | 345 | void HistoPlot::drawHistogram(double startDate, double stopDate, std::string pParamId, |
342 | - HistogramSeriesProperties &pHistogramProperties, bool isSuperposed){ | 346 | + HistogramSeriesProperties &pHistogramProperties){ |
343 | 347 | ||
344 | - //std::cout << std::fixed << std::setprecision(0) << startDate << " ------ " << stopDate << std::endl; | ||
345 | if(pHistogramProperties.getHistogramType() == "histogram1d"){ | 348 | if(pHistogramProperties.getHistogramType() == "histogram1d"){ |
349 | + if(_panel->_page->_superposeMode && _plotted) | ||
350 | + return; | ||
351 | + | ||
346 | std::vector<std::pair<double,double>> grid; | 352 | std::vector<std::pair<double,double>> grid; |
347 | Color color = pHistogramProperties.getColor(); | 353 | Color color = pHistogramProperties.getColor(); |
348 | double xBinSize = 0; | 354 | double xBinSize = 0; |
@@ -350,13 +356,20 @@ void HistoPlot::drawHistogram(double startDate, double stopDate, std::string pPa | @@ -350,13 +356,20 @@ void HistoPlot::drawHistogram(double startDate, double stopDate, std::string pPa | ||
350 | Range lYRange = lYAxis->getRange(); | 356 | Range lYRange = lYAxis->getRange(); |
351 | 357 | ||
352 | histo1DUtils(startDate, stopDate,pHistogramProperties, grid, xBinSize); | 358 | histo1DUtils(startDate, stopDate,pHistogramProperties, grid, xBinSize); |
353 | - | ||
354 | - PanelPlotOutput::drawHistogram(startDate,stopDate,pParamId, pHistogramProperties); | ||
355 | 359 | ||
360 | + PanelPlotOutput::drawHistogram(startDate,stopDate,pParamId, pHistogramProperties); | ||
356 | PanelPlotOutput::drawHistogramBoxes(grid,color,xBinSize, lYRange.getMin()); | 361 | PanelPlotOutput::drawHistogramBoxes(grid,color,xBinSize, lYRange.getMin()); |
362 | + _plotted = true; | ||
357 | 363 | ||
358 | } | 364 | } |
359 | else { | 365 | else { |
366 | + if(_panel->_page->_superposeMode && _plotted) | ||
367 | + return; | ||
368 | + | ||
369 | + if(_panel->_page->_superposeMode){ | ||
370 | + startDate= _globalStartTime; | ||
371 | + stopDate = _globalStopTime; | ||
372 | + } | ||
360 | // Get X, Y and Z axis. | 373 | // Get X, Y and Z axis. |
361 | boost::shared_ptr<Axis> lXAxis(_panel->getAxis(pHistogramProperties.getXAxisId())); | 374 | boost::shared_ptr<Axis> lXAxis(_panel->getAxis(pHistogramProperties.getXAxisId())); |
362 | boost::shared_ptr<Axis> lYAxis(_panel->getAxis(pHistogramProperties.getYAxisId())); | 375 | boost::shared_ptr<Axis> lYAxis(_panel->getAxis(pHistogramProperties.getYAxisId())); |
@@ -418,9 +431,7 @@ void HistoPlot::drawHistogram(double startDate, double stopDate, std::string pPa | @@ -418,9 +431,7 @@ void HistoPlot::drawHistogram(double startDate, double stopDate, std::string pPa | ||
418 | yValues = yData.getValues(pHistogramProperties.getIndex(), yStartIndex); | 431 | yValues = yData.getValues(pHistogramProperties.getIndex(), yStartIndex); |
419 | 432 | ||
420 | zValues = zData.getValues(pHistogramProperties.getHistotypeProperties().getIndex(), zStartIndex); | 433 | zValues = zData.getValues(pHistogramProperties.getHistotypeProperties().getIndex(), zStartIndex); |
421 | - for (unsigned int i(0); i < xNbValues; ++i){ | ||
422 | - std::cout << xValues[i]<< std::endl; | ||
423 | - } | 434 | + |
424 | for (unsigned int i(0); i < xBinNumber; ++i) | 435 | for (unsigned int i(0); i < xBinNumber; ++i) |
425 | { | 436 | { |
426 | for (unsigned int j(0); j < yBinNumber; ++j) | 437 | for (unsigned int j(0); j < yBinNumber; ++j) |
@@ -451,8 +462,10 @@ void HistoPlot::drawHistogram(double startDate, double stopDate, std::string pPa | @@ -451,8 +462,10 @@ void HistoPlot::drawHistogram(double startDate, double stopDate, std::string pPa | ||
451 | lZRange._extend = lZAxis->isExtended(); | 462 | lZRange._extend = lZAxis->isExtended(); |
452 | lZAxis->setRange(lZRange); | 463 | lZAxis->setRange(lZRange); |
453 | 464 | ||
465 | + | ||
454 | PanelPlotOutput::drawHistogram(startDate,stopDate,pParamId, pHistogramProperties); | 466 | PanelPlotOutput::drawHistogram(startDate,stopDate,pParamId, pHistogramProperties); |
455 | PanelPlotOutput::drawMatrix(matrixGrid, zMin, zMax, minValColor,maxValColor, lZAxis->_color._colorMapIndex, false); | 467 | PanelPlotOutput::drawMatrix(matrixGrid, zMin, zMax, minValColor,maxValColor, lZAxis->_color._colorMapIndex, false); |
468 | + _plotted = true; | ||
456 | } | 469 | } |
457 | } | 470 | } |
458 | 471 | ||
@@ -467,6 +480,7 @@ void HistoPlot::resetPlot() | @@ -467,6 +480,7 @@ void HistoPlot::resetPlot() | ||
467 | 480 | ||
468 | pHistogramProperties->getHistotypeProperties().getHisto1DFunction()->resetCache(); | 481 | pHistogramProperties->getHistotypeProperties().getHisto1DFunction()->resetCache(); |
469 | } | 482 | } |
483 | + _plotted = false; | ||
470 | } | 484 | } |
471 | } | 485 | } |
472 | PanelPlotOutput::resetPlot(); | 486 | PanelPlotOutput::resetPlot(); |
src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.hh
@@ -65,13 +65,15 @@ public: | @@ -65,13 +65,15 @@ public: | ||
65 | */ | 65 | */ |
66 | virtual void resetPlot(); | 66 | virtual void resetPlot(); |
67 | 67 | ||
68 | + bool _plotted; | ||
69 | + | ||
68 | protected: | 70 | protected: |
69 | 71 | ||
70 | void histo1DUtils(double startDate, double stopDate, HistogramSeriesProperties &pHistogramProperties, | 72 | void histo1DUtils(double startDate, double stopDate, HistogramSeriesProperties &pHistogramProperties, |
71 | - std::vector<std::pair<double,double>> &grid, double &xBinSize, bool resetCache=FALSE); | 73 | + std::vector<std::pair<double,double>> &grid, double &xBinSize); |
72 | 74 | ||
73 | virtual void drawHistogram(double startDate, double stopDate, std::string pParamId, | 75 | virtual void drawHistogram(double startDate, double stopDate, std::string pParamId, |
74 | - HistogramSeriesProperties &pHistogramProperties, bool isSuperposed); | 76 | + HistogramSeriesProperties &pHistogramProperties); |
75 | 77 | ||
76 | 78 | ||
77 | private: | 79 | private: |
@@ -84,6 +86,10 @@ protected: | @@ -84,6 +86,10 @@ protected: | ||
84 | // * @brief Configure axis legend with paramInfo. | 86 | // * @brief Configure axis legend with paramInfo. |
85 | // */ | 87 | // */ |
86 | void configureAxisLegend(); | 88 | void configureAxisLegend(); |
89 | + | ||
90 | + double _globalStartTime; | ||
91 | + double _globalStopTime; | ||
92 | + | ||
87 | }; | 93 | }; |
88 | 94 | ||
89 | } /* namespace plot */ | 95 | } /* namespace plot */ |
src/ParamOutputImpl/Plot/PanelPlotOutput.cc
@@ -1565,7 +1565,6 @@ namespace plot | @@ -1565,7 +1565,6 @@ namespace plot | ||
1565 | // set color | 1565 | // set color |
1566 | Color lInitialColor; | 1566 | Color lInitialColor; |
1567 | lInitialColor = changeColor(_pls, color, _panel->_page->_mode); | 1567 | lInitialColor = changeColor(_pls, color, _panel->_page->_mode); |
1568 | - LOG4CXX_ERROR( gLogger, "FER --- " << (float)x0 << " ----- " << y0 ); | ||
1569 | PLFLT x[4], y[4]; | 1568 | PLFLT x[4], y[4]; |
1570 | 1569 | ||
1571 | x[0] = x0; | 1570 | x[0] = x0; |
@@ -2668,7 +2667,7 @@ namespace plot | @@ -2668,7 +2667,7 @@ namespace plot | ||
2668 | 2667 | ||
2669 | LOG4CXX_DEBUG(gLogger, "Draw a Histogram 1D/2D for parameter " << parameter._originalParamId); | 2668 | LOG4CXX_DEBUG(gLogger, "Draw a Histogram 1D/2D for parameter " << parameter._originalParamId); |
2670 | // Draw (configure) window for this series. | 2669 | // Draw (configure) window for this series. |
2671 | - drawHistogram(startTime, stopTime, parameter._originalParamId, *(parameter.getHistogramSeriesProperties()), _panel->_page->_superposeMode); | 2670 | + drawHistogram(startTime, stopTime, parameter._originalParamId, *(parameter.getHistogramSeriesProperties())); |
2672 | 2671 | ||
2673 | ParameterData &data = (*_pParameterValues)[parameter.getHistogramSeriesProperties()->getParamId()]; | 2672 | ParameterData &data = (*_pParameterValues)[parameter.getHistogramSeriesProperties()->getParamId()]; |
2674 | 2673 | ||
@@ -2752,7 +2751,7 @@ namespace plot | @@ -2752,7 +2751,7 @@ namespace plot | ||
2752 | } | 2751 | } |
2753 | 2752 | ||
2754 | void PanelPlotOutput::drawHistogram(double /*startDate*/, double /*stopDate*/, std::string /*pParamId*/, | 2753 | void PanelPlotOutput::drawHistogram(double /*startDate*/, double /*stopDate*/, std::string /*pParamId*/, |
2755 | - HistogramSeriesProperties &pHistogramProperties, bool /*isSuperposed*/){ | 2754 | + HistogramSeriesProperties &pHistogramProperties){ |
2756 | 2755 | ||
2757 | // Get X, Y and Z axis. | 2756 | // Get X, Y and Z axis. |
2758 | boost::shared_ptr<Axis> lXAxis(_panel->getAxis(pHistogramProperties.getXAxisId())); | 2757 | boost::shared_ptr<Axis> lXAxis(_panel->getAxis(pHistogramProperties.getXAxisId())); |
@@ -2762,7 +2761,6 @@ namespace plot | @@ -2762,7 +2761,6 @@ namespace plot | ||
2762 | Range lYRange = lYAxis->getRange(); | 2761 | Range lYRange = lYAxis->getRange(); |
2763 | 2762 | ||
2764 | // Range lZRange = getZAxisRange (pSeries, lZAxis); | 2763 | // Range lZRange = getZAxisRange (pSeries, lZAxis); |
2765 | - std::cout << lXRange.getMin() << " ---- " << lXRange.getMax() << " ---- " << lYRange.getMin() << " ---- " << lYRange.getMax() << std::endl; | ||
2766 | PlWindow lPlWindow = PlWindow(lXRange.getMin(), lXRange.getMax(), lYRange.getMin(), lYRange.getMax()); | 2764 | PlWindow lPlWindow = PlWindow(lXRange.getMin(), lXRange.getMax(), lYRange.getMin(), lYRange.getMax()); |
2767 | // Calculate X and Y tick | 2765 | // Calculate X and Y tick |
2768 | TickConf lTickConf; | 2766 | TickConf lTickConf; |
src/ParamOutputImpl/Plot/PanelPlotOutput.hh
@@ -418,7 +418,7 @@ protected: | @@ -418,7 +418,7 @@ protected: | ||
418 | SauvaudProperties& pSauvaud, int subIndex, int subsNumber, std::string opositeLegend); | 418 | SauvaudProperties& pSauvaud, int subIndex, int subsNumber, std::string opositeLegend); |
419 | 419 | ||
420 | virtual void drawHistogram(double startTime, double stopTime, std::string pParamId, | 420 | virtual void drawHistogram(double startTime, double stopTime, std::string pParamId, |
421 | - HistogramSeriesProperties& HistogramSeriesProperties, bool isSuperposed); | 421 | + HistogramSeriesProperties& HistogramSeriesProperties); |
422 | 422 | ||
423 | virtual void drawIntervals(double startDate, double stopDate, std::string pParamId, | 423 | virtual void drawIntervals(double startDate, double stopDate, std::string pParamId, |
424 | IntervalsProperties& pIntervals); | 424 | IntervalsProperties& pIntervals); |