Commit 808ae6b0bbdea5d67ce557c9b5b6291b65f6ea8a

Authored by Erdogan Furkan
1 parent 9e457aa4

#11405 - fixed

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