diff --git a/src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.cc b/src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.cc index e564ee8..89e149e 100644 --- a/src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.cc +++ b/src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.cc @@ -28,6 +28,7 @@ namespace plot { HistoPlot::HistoPlot(AMDA::Parameters::ParameterManager& manager, boost::shared_ptr panel) : PanelPlotOutput(manager, panel){ + _plotted=false; } @@ -271,8 +272,11 @@ void HistoPlot::configureSeriesAxis(double startDate, double stopDate) { } else if(pHistogramProperties->getHistogramType() == "histogram2d"){ - lZAxis->_used = true; + if(_panel->_page->_superposeMode){ + _globalStartTime = startDate; + _globalStopTime = stopDate; + } } } } @@ -294,7 +298,7 @@ void HistoPlot::configureAxisLegend () { } void HistoPlot::histo1DUtils(double startDate, double stopDate, HistogramSeriesProperties &pHistogramProperties, - std::vector> &grid, double &xBinSize, bool resetCache){ + std::vector> &grid, double &xBinSize){ // Get X, Y axis. boost::shared_ptr lXAxis(_panel->getAxis(pHistogramProperties.getXAxisId())); boost::shared_ptr lYAxis(_panel->getAxis(pHistogramProperties.getYAxisId())); @@ -339,10 +343,12 @@ void HistoPlot::histo1DUtils(double startDate, double stopDate, HistogramSeriesP } void HistoPlot::drawHistogram(double startDate, double stopDate, std::string pParamId, - HistogramSeriesProperties &pHistogramProperties, bool isSuperposed){ + HistogramSeriesProperties &pHistogramProperties){ - //std::cout << std::fixed << std::setprecision(0) << startDate << " ------ " << stopDate << std::endl; if(pHistogramProperties.getHistogramType() == "histogram1d"){ + if(_panel->_page->_superposeMode && _plotted) + return; + std::vector> grid; Color color = pHistogramProperties.getColor(); double xBinSize = 0; @@ -350,13 +356,20 @@ void HistoPlot::drawHistogram(double startDate, double stopDate, std::string pPa Range lYRange = lYAxis->getRange(); histo1DUtils(startDate, stopDate,pHistogramProperties, grid, xBinSize); - - PanelPlotOutput::drawHistogram(startDate,stopDate,pParamId, pHistogramProperties); + PanelPlotOutput::drawHistogram(startDate,stopDate,pParamId, pHistogramProperties); PanelPlotOutput::drawHistogramBoxes(grid,color,xBinSize, lYRange.getMin()); + _plotted = true; } else { + if(_panel->_page->_superposeMode && _plotted) + return; + + if(_panel->_page->_superposeMode){ + startDate= _globalStartTime; + stopDate = _globalStopTime; + } // Get X, Y and Z axis. boost::shared_ptr lXAxis(_panel->getAxis(pHistogramProperties.getXAxisId())); boost::shared_ptr lYAxis(_panel->getAxis(pHistogramProperties.getYAxisId())); @@ -418,9 +431,7 @@ void HistoPlot::drawHistogram(double startDate, double stopDate, std::string pPa yValues = yData.getValues(pHistogramProperties.getIndex(), yStartIndex); zValues = zData.getValues(pHistogramProperties.getHistotypeProperties().getIndex(), zStartIndex); - for (unsigned int i(0); i < xNbValues; ++i){ - std::cout << xValues[i]<< std::endl; - } + for (unsigned int i(0); i < xBinNumber; ++i) { for (unsigned int j(0); j < yBinNumber; ++j) @@ -451,8 +462,10 @@ void HistoPlot::drawHistogram(double startDate, double stopDate, std::string pPa lZRange._extend = lZAxis->isExtended(); lZAxis->setRange(lZRange); + PanelPlotOutput::drawHistogram(startDate,stopDate,pParamId, pHistogramProperties); PanelPlotOutput::drawMatrix(matrixGrid, zMin, zMax, minValColor,maxValColor, lZAxis->_color._colorMapIndex, false); + _plotted = true; } } @@ -467,6 +480,7 @@ void HistoPlot::resetPlot() pHistogramProperties->getHistotypeProperties().getHisto1DFunction()->resetCache(); } + _plotted = false; } } PanelPlotOutput::resetPlot(); diff --git a/src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.hh b/src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.hh index 519c8c0..052bc63 100644 --- a/src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.hh +++ b/src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.hh @@ -65,13 +65,15 @@ public: */ virtual void resetPlot(); + bool _plotted; + protected: void histo1DUtils(double startDate, double stopDate, HistogramSeriesProperties &pHistogramProperties, - std::vector> &grid, double &xBinSize, bool resetCache=FALSE); + std::vector> &grid, double &xBinSize); virtual void drawHistogram(double startDate, double stopDate, std::string pParamId, - HistogramSeriesProperties &pHistogramProperties, bool isSuperposed); + HistogramSeriesProperties &pHistogramProperties); private: @@ -84,6 +86,10 @@ protected: // * @brief Configure axis legend with paramInfo. // */ void configureAxisLegend(); + + double _globalStartTime; + double _globalStopTime; + }; } /* namespace plot */ diff --git a/src/ParamOutputImpl/Plot/PanelPlotOutput.cc b/src/ParamOutputImpl/Plot/PanelPlotOutput.cc index 7c7bf82..0445036 100644 --- a/src/ParamOutputImpl/Plot/PanelPlotOutput.cc +++ b/src/ParamOutputImpl/Plot/PanelPlotOutput.cc @@ -1565,7 +1565,6 @@ namespace plot // set color Color lInitialColor; lInitialColor = changeColor(_pls, color, _panel->_page->_mode); - LOG4CXX_ERROR( gLogger, "FER --- " << (float)x0 << " ----- " << y0 ); PLFLT x[4], y[4]; x[0] = x0; @@ -2668,7 +2667,7 @@ namespace plot LOG4CXX_DEBUG(gLogger, "Draw a Histogram 1D/2D for parameter " << parameter._originalParamId); // Draw (configure) window for this series. - drawHistogram(startTime, stopTime, parameter._originalParamId, *(parameter.getHistogramSeriesProperties()), _panel->_page->_superposeMode); + drawHistogram(startTime, stopTime, parameter._originalParamId, *(parameter.getHistogramSeriesProperties())); ParameterData &data = (*_pParameterValues)[parameter.getHistogramSeriesProperties()->getParamId()]; @@ -2752,7 +2751,7 @@ namespace plot } void PanelPlotOutput::drawHistogram(double /*startDate*/, double /*stopDate*/, std::string /*pParamId*/, - HistogramSeriesProperties &pHistogramProperties, bool /*isSuperposed*/){ + HistogramSeriesProperties &pHistogramProperties){ // Get X, Y and Z axis. boost::shared_ptr lXAxis(_panel->getAxis(pHistogramProperties.getXAxisId())); @@ -2762,7 +2761,6 @@ namespace plot Range lYRange = lYAxis->getRange(); // Range lZRange = getZAxisRange (pSeries, lZAxis); - std::cout << lXRange.getMin() << " ---- " << lXRange.getMax() << " ---- " << lYRange.getMin() << " ---- " << lYRange.getMax() << std::endl; PlWindow lPlWindow = PlWindow(lXRange.getMin(), lXRange.getMax(), lYRange.getMin(), lYRange.getMax()); // Calculate X and Y tick TickConf lTickConf; diff --git a/src/ParamOutputImpl/Plot/PanelPlotOutput.hh b/src/ParamOutputImpl/Plot/PanelPlotOutput.hh index 08a8aea..08a59e7 100644 --- a/src/ParamOutputImpl/Plot/PanelPlotOutput.hh +++ b/src/ParamOutputImpl/Plot/PanelPlotOutput.hh @@ -418,7 +418,7 @@ protected: SauvaudProperties& pSauvaud, int subIndex, int subsNumber, std::string opositeLegend); virtual void drawHistogram(double startTime, double stopTime, std::string pParamId, - HistogramSeriesProperties& HistogramSeriesProperties, bool isSuperposed); + HistogramSeriesProperties& HistogramSeriesProperties); virtual void drawIntervals(double startDate, double stopDate, std::string pParamId, IntervalsProperties& pIntervals); -- libgit2 0.21.2