Commit 3cdbc98f985d708d479367b6c58beeba95a19cc3

Authored by Erdogan Furkan
1 parent 97f9b74e

Fxes on Z-Axis and time

Showing 1 changed file with 17 additions and 9 deletions   Show diff stats
src/ParamOutputImpl/Plot/Scatter/XYPlot.cc
... ... @@ -58,7 +58,7 @@ void XYPlot::preparePlotArea(double startTime, double stopTime, int intervalInde
58 58 //Title must be updated during the next interval plot
59 59 _panel->_updateTitleOnNextInterval = true;
60 60 // Set start date and end date.
61   - std::string lTimeFormat("%H:%M %d/%m/%Y");
  61 + std::string lTimeFormat("%Y/%m/%d %H:%M:%S");
62 62  
63 63 long int lStartTime = static_cast<long int>(startTime);
64 64 tm * lStartTimeTm = gmtime(&lStartTime);
... ... @@ -66,6 +66,8 @@ void XYPlot::preparePlotArea(double startTime, double stopTime, int intervalInde
66 66  
67 67 // Format date.
68 68 strftime(lStartTimeChr, 80, lTimeFormat.c_str(), lStartTimeTm);
  69 + std::string lStartTimeStr= lStartTimeChr;
  70 + lStartTimeStr += '.'+std::to_string(startTime -lStartTime ).substr(2,3);
69 71  
70 72 long int lStopTime = static_cast<long int>(stopTime);
71 73 tm * lStopTimeTm = gmtime(&lStopTime);
... ... @@ -73,8 +75,10 @@ void XYPlot::preparePlotArea(double startTime, double stopTime, int intervalInde
73 75  
74 76 // Format date.
75 77 strftime(lStopTimeChr, 80, lTimeFormat.c_str(), lStopTimeTm);
  78 + std::string lStopTimeStr= lStopTimeChr;
  79 + lStopTimeStr += '.'+std::to_string(stopTime -lStopTime ).substr(2,3);
76 80  
77   - std::string titleText = std::string(lStartTimeChr) + " - " + std::string(lStopTimeChr);
  81 + std::string titleText = lStartTimeStr + " - " + lStopTimeStr;
78 82 _panel->setTitleText(titleText.c_str());
79 83 }
80 84  
... ... @@ -674,6 +678,7 @@ void XYPlot::drawHistogram2D(double startDate, double stopDate, std::string pPar
674 678  
675 679 Range lXRange = lXAxis->getRange();
676 680 Range lYRange = lYAxis->getRange();
  681 + Range lZRange = lZAxis->getRequestedRange();
677 682  
678 683  
679 684 Color minValColor = lZAxis->getMinValColor();
... ... @@ -691,15 +696,12 @@ void XYPlot::drawHistogram2D(double startDate, double stopDate, std::string pPar
691 696 double xBinSize = (lXRange.getMax() - lXRange.getMin())/ xBinNumber;
692 697 double yBinSize = (lYRange.getMax() - lYRange.getMin())/ yBinNumber;
693 698  
694   - ParameterData &yData = (*_pParameterValues)[pHistogram2DProperties.getParamId()];
695   - ParameterAxes* xSerieParameterAxes = getParameterAxesByXSerieId(pHistogram2DProperties.getXId());
696   -
697 699 //get parameter x data for this serie
  700 + ParameterAxes* xSerieParameterAxes = getParameterAxesByXSerieId(pHistogram2DProperties.getXId());
698 701 XSeriesProperties& xSerie = xSerieParameterAxes->getXSeriePropertiesById(pHistogram2DProperties.getXId());
699 702  
700   - //get parameter x data for this serie
701 703 ParameterData &xData = (*_pParameterValues)[xSerie.getParamId()];
702   -
  704 + ParameterData &yData = (*_pParameterValues)[pHistogram2DProperties.getParamId()];
703 705 ParameterData &zData = (*_pParameterValues)[pHistogram2DProperties.getHistotypeProperties().getParamId()];
704 706  
705 707  
... ... @@ -718,6 +720,7 @@ void XYPlot::drawHistogram2D(double startDate, double stopDate, std::string pPar
718 720  
719 721 double* xValues;
720 722 double* yValues;
  723 + double* zValues;
721 724 if(lXAxis->_scale==Axis::Scale::LOGARITHMIC)
722 725 xValues = lXAxis->getComputedValues(xData.getValues(xSerie.getIndex(), xStartIndex),xNbValues,exp10(lXRange.getMin()), exp10(lXRange.getMax()));
723 726 else
... ... @@ -727,7 +730,7 @@ void XYPlot::drawHistogram2D(double startDate, double stopDate, std::string pPar
727 730 else
728 731 yValues = yData.getValues(pHistogram2DProperties.getIndex(), yStartIndex);
729 732  
730   - double* zValues = zData.getValues(pHistogram2DProperties.getHistotypeProperties().getIndex(), zStartIndex);
  733 + zValues = zData.getValues(pHistogram2DProperties.getHistotypeProperties().getIndex(), zStartIndex);
731 734  
732 735 for (unsigned int i(0); i < xBinNumber; ++i)
733 736 {
... ... @@ -751,7 +754,12 @@ void XYPlot::drawHistogram2D(double startDate, double stopDate, std::string pPar
751 754 if(lYAxis->_scale==Axis::Scale::LOGARITHMIC)
752 755 free(yValues);
753 756  
754   - Range lZRange = Range(zMin, zMax);
  757 + if(std::isnan(lZRange.getMin()))
  758 + lZRange.setMin(zMin);
  759 + if(std::isnan(lZRange.getMax()))
  760 + lZRange.setMax(zMax);
  761 +
  762 + lZRange._extend = lZAxis->isExtended();
755 763 lZAxis->setRange(lZRange);
756 764  
757 765 PanelPlotOutput::drawHistogram2D(startDate,stopDate,pParamId, pHistogram2DProperties);
... ...