From 9e457aa4284eb2d227549035d710c3e24f6c6ba9 Mon Sep 17 00:00:00 2001 From: Furkan <furkan.erdogan1205@gmail.com> Date: Thu, 5 Oct 2023 11:05:36 +0000 Subject: [PATCH] For now --- src/ParamOutputImpl/Plot/HistoPlot/Histo1DFunction.cc | 5 +++-- src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.cc | 11 ++++++++--- src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.hh | 5 +++-- src/ParamOutputImpl/Plot/PanelPlotOutput.cc | 12 +++++------- src/ParamOutputImpl/Plot/PanelPlotOutput.hh | 3 ++- 5 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/ParamOutputImpl/Plot/HistoPlot/Histo1DFunction.cc b/src/ParamOutputImpl/Plot/HistoPlot/Histo1DFunction.cc index d7467d1..b9d9613 100644 --- a/src/ParamOutputImpl/Plot/HistoPlot/Histo1DFunction.cc +++ b/src/ParamOutputImpl/Plot/HistoPlot/Histo1DFunction.cc @@ -95,8 +95,9 @@ void NormDensity1DFunction::apply(std::vector<std::pair<double,double>> &grid, (yIsLog)? log10(allValues[i].size()/(double)nbRecord) : allValues[i].size()/(double)nbRecord)); - if(yMax < allValues[i].size()/(double)nbRecord) - yMax = allValues[i].size()/(double)nbRecord; + if(yMaxToModify) + if(yMax < allValues[i].size()/(double)nbRecord) + yMax = allValues[i].size()/(double)nbRecord; if(yIsLog){ if(yMin > allValues[i].size()/(double)nbRecord) yMin = allValues[i].size()/(double)nbRecord; diff --git a/src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.cc b/src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.cc index a3e4776..e564ee8 100644 --- a/src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.cc +++ b/src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.cc @@ -294,7 +294,7 @@ void HistoPlot::configureAxisLegend () { } void HistoPlot::histo1DUtils(double startDate, double stopDate, HistogramSeriesProperties &pHistogramProperties, - std::vector<std::pair<double,double>> &grid, double &xBinSize){ + std::vector<std::pair<double,double>> &grid, double &xBinSize, bool resetCache){ // Get X, Y axis. boost::shared_ptr<Axis> lXAxis(_panel->getAxis(pHistogramProperties.getXAxisId())); boost::shared_ptr<Axis> lYAxis(_panel->getAxis(pHistogramProperties.getYAxisId())); @@ -338,8 +338,10 @@ void HistoPlot::histo1DUtils(double startDate, double stopDate, HistogramSeriesP lYAxis->setRange(lYRange); } -void HistoPlot::drawHistogram(double startDate, double stopDate, std::string pParamId, HistogramSeriesProperties &pHistogramProperties){ +void HistoPlot::drawHistogram(double startDate, double stopDate, std::string pParamId, + HistogramSeriesProperties &pHistogramProperties, bool isSuperposed){ + //std::cout << std::fixed << std::setprecision(0) << startDate << " ------ " << stopDate << std::endl; if(pHistogramProperties.getHistogramType() == "histogram1d"){ std::vector<std::pair<double,double>> grid; Color color = pHistogramProperties.getColor(); @@ -416,7 +418,9 @@ 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) @@ -469,3 +473,4 @@ void HistoPlot::resetPlot() } } +// Events from 'tt' in TIMEMIN - TIMEMAX diff --git a/src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.hh b/src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.hh index e439187..519c8c0 100644 --- a/src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.hh +++ b/src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.hh @@ -68,9 +68,10 @@ public: protected: void histo1DUtils(double startDate, double stopDate, HistogramSeriesProperties &pHistogramProperties, - std::vector<std::pair<double,double>> &grid, double &xBinSize); + std::vector<std::pair<double,double>> &grid, double &xBinSize, bool resetCache=FALSE); - virtual void drawHistogram(double startDate, double stopDate, std::string pParamId, HistogramSeriesProperties &pHistogramProperties); + virtual void drawHistogram(double startDate, double stopDate, std::string pParamId, + HistogramSeriesProperties &pHistogramProperties, bool isSuperposed); private: diff --git a/src/ParamOutputImpl/Plot/PanelPlotOutput.cc b/src/ParamOutputImpl/Plot/PanelPlotOutput.cc index d040bf1..7c7bf82 100644 --- a/src/ParamOutputImpl/Plot/PanelPlotOutput.cc +++ b/src/ParamOutputImpl/Plot/PanelPlotOutput.cc @@ -1550,10 +1550,7 @@ namespace plot restoreColor(_pls, lInitialColor, _panel->_page->_mode); } void PanelPlotOutput::drawHistogramBoxes(std::vector<std::pair<double,double>> data, Color &color, double binWidth, double yMin){ - for (unsigned int i(0); i < data.size(); i++ ) - { - } for (unsigned int i(0); i < data.size(); i++ ) { //plcol0(i + 1); @@ -1568,7 +1565,7 @@ 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; @@ -2671,7 +2668,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())); + drawHistogram(startTime, stopTime, parameter._originalParamId, *(parameter.getHistogramSeriesProperties()), _panel->_page->_superposeMode); ParameterData &data = (*_pParameterValues)[parameter.getHistogramSeriesProperties()->getParamId()]; @@ -2754,7 +2751,8 @@ namespace plot return !noData; } - void PanelPlotOutput::drawHistogram(double /*startDate*/, double /*stopDate*/, std::string /*pParamId*/, HistogramSeriesProperties &pHistogramProperties){ + void PanelPlotOutput::drawHistogram(double /*startDate*/, double /*stopDate*/, std::string /*pParamId*/, + HistogramSeriesProperties &pHistogramProperties, bool /*isSuperposed*/){ // Get X, Y and Z axis. boost::shared_ptr<Axis> lXAxis(_panel->getAxis(pHistogramProperties.getXAxisId())); @@ -2764,7 +2762,7 @@ 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 9f48102..08a8aea 100644 --- a/src/ParamOutputImpl/Plot/PanelPlotOutput.hh +++ b/src/ParamOutputImpl/Plot/PanelPlotOutput.hh @@ -417,7 +417,8 @@ protected: virtual void drawSauvaud(double startDate, double stopDate, std::string pParamId, SauvaudProperties& pSauvaud, int subIndex, int subsNumber, std::string opositeLegend); - virtual void drawHistogram(double startTime, double stopTime, std::string pParamId, HistogramSeriesProperties& HistogramSeriesProperties); + virtual void drawHistogram(double startTime, double stopTime, std::string pParamId, + HistogramSeriesProperties& HistogramSeriesProperties, bool isSuperposed); virtual void drawIntervals(double startDate, double stopDate, std::string pParamId, IntervalsProperties& pIntervals); -- libgit2 0.21.2