From 3cdbc98f985d708d479367b6c58beeba95a19cc3 Mon Sep 17 00:00:00 2001 From: Furkan Date: Wed, 22 Feb 2023 13:07:16 +0000 Subject: [PATCH] Fxes on Z-Axis and time --- src/ParamOutputImpl/Plot/Scatter/XYPlot.cc | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/ParamOutputImpl/Plot/Scatter/XYPlot.cc b/src/ParamOutputImpl/Plot/Scatter/XYPlot.cc index 56382b6..a46fb8b 100644 --- a/src/ParamOutputImpl/Plot/Scatter/XYPlot.cc +++ b/src/ParamOutputImpl/Plot/Scatter/XYPlot.cc @@ -58,7 +58,7 @@ void XYPlot::preparePlotArea(double startTime, double stopTime, int intervalInde //Title must be updated during the next interval plot _panel->_updateTitleOnNextInterval = true; // Set start date and end date. - std::string lTimeFormat("%H:%M %d/%m/%Y"); + std::string lTimeFormat("%Y/%m/%d %H:%M:%S"); long int lStartTime = static_cast(startTime); tm * lStartTimeTm = gmtime(&lStartTime); @@ -66,6 +66,8 @@ void XYPlot::preparePlotArea(double startTime, double stopTime, int intervalInde // Format date. strftime(lStartTimeChr, 80, lTimeFormat.c_str(), lStartTimeTm); + std::string lStartTimeStr= lStartTimeChr; + lStartTimeStr += '.'+std::to_string(startTime -lStartTime ).substr(2,3); long int lStopTime = static_cast(stopTime); tm * lStopTimeTm = gmtime(&lStopTime); @@ -73,8 +75,10 @@ void XYPlot::preparePlotArea(double startTime, double stopTime, int intervalInde // Format date. strftime(lStopTimeChr, 80, lTimeFormat.c_str(), lStopTimeTm); + std::string lStopTimeStr= lStopTimeChr; + lStopTimeStr += '.'+std::to_string(stopTime -lStopTime ).substr(2,3); - std::string titleText = std::string(lStartTimeChr) + " - " + std::string(lStopTimeChr); + std::string titleText = lStartTimeStr + " - " + lStopTimeStr; _panel->setTitleText(titleText.c_str()); } @@ -674,6 +678,7 @@ void XYPlot::drawHistogram2D(double startDate, double stopDate, std::string pPar Range lXRange = lXAxis->getRange(); Range lYRange = lYAxis->getRange(); + Range lZRange = lZAxis->getRequestedRange(); Color minValColor = lZAxis->getMinValColor(); @@ -691,15 +696,12 @@ void XYPlot::drawHistogram2D(double startDate, double stopDate, std::string pPar double xBinSize = (lXRange.getMax() - lXRange.getMin())/ xBinNumber; double yBinSize = (lYRange.getMax() - lYRange.getMin())/ yBinNumber; - ParameterData &yData = (*_pParameterValues)[pHistogram2DProperties.getParamId()]; - ParameterAxes* xSerieParameterAxes = getParameterAxesByXSerieId(pHistogram2DProperties.getXId()); - //get parameter x data for this serie + ParameterAxes* xSerieParameterAxes = getParameterAxesByXSerieId(pHistogram2DProperties.getXId()); XSeriesProperties& xSerie = xSerieParameterAxes->getXSeriePropertiesById(pHistogram2DProperties.getXId()); - //get parameter x data for this serie ParameterData &xData = (*_pParameterValues)[xSerie.getParamId()]; - + ParameterData &yData = (*_pParameterValues)[pHistogram2DProperties.getParamId()]; ParameterData &zData = (*_pParameterValues)[pHistogram2DProperties.getHistotypeProperties().getParamId()]; @@ -718,6 +720,7 @@ void XYPlot::drawHistogram2D(double startDate, double stopDate, std::string pPar double* xValues; double* yValues; + double* zValues; if(lXAxis->_scale==Axis::Scale::LOGARITHMIC) xValues = lXAxis->getComputedValues(xData.getValues(xSerie.getIndex(), xStartIndex),xNbValues,exp10(lXRange.getMin()), exp10(lXRange.getMax())); else @@ -727,7 +730,7 @@ void XYPlot::drawHistogram2D(double startDate, double stopDate, std::string pPar else yValues = yData.getValues(pHistogram2DProperties.getIndex(), yStartIndex); - double* zValues = zData.getValues(pHistogram2DProperties.getHistotypeProperties().getIndex(), zStartIndex); + zValues = zData.getValues(pHistogram2DProperties.getHistotypeProperties().getIndex(), zStartIndex); for (unsigned int i(0); i < xBinNumber; ++i) { @@ -751,7 +754,12 @@ void XYPlot::drawHistogram2D(double startDate, double stopDate, std::string pPar if(lYAxis->_scale==Axis::Scale::LOGARITHMIC) free(yValues); - Range lZRange = Range(zMin, zMax); + if(std::isnan(lZRange.getMin())) + lZRange.setMin(zMin); + if(std::isnan(lZRange.getMax())) + lZRange.setMax(zMax); + + lZRange._extend = lZAxis->isExtended(); lZAxis->setRange(lZRange); PanelPlotOutput::drawHistogram2D(startDate,stopDate,pParamId, pHistogram2DProperties); -- libgit2 0.21.2