Commit 3cdbc98f985d708d479367b6c58beeba95a19cc3
1 parent
97f9b74e
Exists in
master
and in
28 other branches
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,7 +58,7 @@ void XYPlot::preparePlotArea(double startTime, double stopTime, int intervalInde | ||
58 | //Title must be updated during the next interval plot | 58 | //Title must be updated during the next interval plot |
59 | _panel->_updateTitleOnNextInterval = true; | 59 | _panel->_updateTitleOnNextInterval = true; |
60 | // Set start date and end date. | 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 | long int lStartTime = static_cast<long int>(startTime); | 63 | long int lStartTime = static_cast<long int>(startTime); |
64 | tm * lStartTimeTm = gmtime(&lStartTime); | 64 | tm * lStartTimeTm = gmtime(&lStartTime); |
@@ -66,6 +66,8 @@ void XYPlot::preparePlotArea(double startTime, double stopTime, int intervalInde | @@ -66,6 +66,8 @@ void XYPlot::preparePlotArea(double startTime, double stopTime, int intervalInde | ||
66 | 66 | ||
67 | // Format date. | 67 | // Format date. |
68 | strftime(lStartTimeChr, 80, lTimeFormat.c_str(), lStartTimeTm); | 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 | long int lStopTime = static_cast<long int>(stopTime); | 72 | long int lStopTime = static_cast<long int>(stopTime); |
71 | tm * lStopTimeTm = gmtime(&lStopTime); | 73 | tm * lStopTimeTm = gmtime(&lStopTime); |
@@ -73,8 +75,10 @@ void XYPlot::preparePlotArea(double startTime, double stopTime, int intervalInde | @@ -73,8 +75,10 @@ void XYPlot::preparePlotArea(double startTime, double stopTime, int intervalInde | ||
73 | 75 | ||
74 | // Format date. | 76 | // Format date. |
75 | strftime(lStopTimeChr, 80, lTimeFormat.c_str(), lStopTimeTm); | 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 | _panel->setTitleText(titleText.c_str()); | 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,6 +678,7 @@ void XYPlot::drawHistogram2D(double startDate, double stopDate, std::string pPar | ||
674 | 678 | ||
675 | Range lXRange = lXAxis->getRange(); | 679 | Range lXRange = lXAxis->getRange(); |
676 | Range lYRange = lYAxis->getRange(); | 680 | Range lYRange = lYAxis->getRange(); |
681 | + Range lZRange = lZAxis->getRequestedRange(); | ||
677 | 682 | ||
678 | 683 | ||
679 | Color minValColor = lZAxis->getMinValColor(); | 684 | Color minValColor = lZAxis->getMinValColor(); |
@@ -691,15 +696,12 @@ void XYPlot::drawHistogram2D(double startDate, double stopDate, std::string pPar | @@ -691,15 +696,12 @@ void XYPlot::drawHistogram2D(double startDate, double stopDate, std::string pPar | ||
691 | double xBinSize = (lXRange.getMax() - lXRange.getMin())/ xBinNumber; | 696 | double xBinSize = (lXRange.getMax() - lXRange.getMin())/ xBinNumber; |
692 | double yBinSize = (lYRange.getMax() - lYRange.getMin())/ yBinNumber; | 697 | double yBinSize = (lYRange.getMax() - lYRange.getMin())/ yBinNumber; |
693 | 698 | ||
694 | - ParameterData &yData = (*_pParameterValues)[pHistogram2DProperties.getParamId()]; | ||
695 | - ParameterAxes* xSerieParameterAxes = getParameterAxesByXSerieId(pHistogram2DProperties.getXId()); | ||
696 | - | ||
697 | //get parameter x data for this serie | 699 | //get parameter x data for this serie |
700 | + ParameterAxes* xSerieParameterAxes = getParameterAxesByXSerieId(pHistogram2DProperties.getXId()); | ||
698 | XSeriesProperties& xSerie = xSerieParameterAxes->getXSeriePropertiesById(pHistogram2DProperties.getXId()); | 701 | XSeriesProperties& xSerie = xSerieParameterAxes->getXSeriePropertiesById(pHistogram2DProperties.getXId()); |
699 | 702 | ||
700 | - //get parameter x data for this serie | ||
701 | ParameterData &xData = (*_pParameterValues)[xSerie.getParamId()]; | 703 | ParameterData &xData = (*_pParameterValues)[xSerie.getParamId()]; |
702 | - | 704 | + ParameterData &yData = (*_pParameterValues)[pHistogram2DProperties.getParamId()]; |
703 | ParameterData &zData = (*_pParameterValues)[pHistogram2DProperties.getHistotypeProperties().getParamId()]; | 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,6 +720,7 @@ void XYPlot::drawHistogram2D(double startDate, double stopDate, std::string pPar | ||
718 | 720 | ||
719 | double* xValues; | 721 | double* xValues; |
720 | double* yValues; | 722 | double* yValues; |
723 | + double* zValues; | ||
721 | if(lXAxis->_scale==Axis::Scale::LOGARITHMIC) | 724 | if(lXAxis->_scale==Axis::Scale::LOGARITHMIC) |
722 | xValues = lXAxis->getComputedValues(xData.getValues(xSerie.getIndex(), xStartIndex),xNbValues,exp10(lXRange.getMin()), exp10(lXRange.getMax())); | 725 | xValues = lXAxis->getComputedValues(xData.getValues(xSerie.getIndex(), xStartIndex),xNbValues,exp10(lXRange.getMin()), exp10(lXRange.getMax())); |
723 | else | 726 | else |
@@ -727,7 +730,7 @@ void XYPlot::drawHistogram2D(double startDate, double stopDate, std::string pPar | @@ -727,7 +730,7 @@ void XYPlot::drawHistogram2D(double startDate, double stopDate, std::string pPar | ||
727 | else | 730 | else |
728 | yValues = yData.getValues(pHistogram2DProperties.getIndex(), yStartIndex); | 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 | for (unsigned int i(0); i < xBinNumber; ++i) | 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,7 +754,12 @@ void XYPlot::drawHistogram2D(double startDate, double stopDate, std::string pPar | ||
751 | if(lYAxis->_scale==Axis::Scale::LOGARITHMIC) | 754 | if(lYAxis->_scale==Axis::Scale::LOGARITHMIC) |
752 | free(yValues); | 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 | lZAxis->setRange(lZRange); | 763 | lZAxis->setRange(lZRange); |
756 | 764 | ||
757 | PanelPlotOutput::drawHistogram2D(startDate,stopDate,pParamId, pHistogram2DProperties); | 765 | PanelPlotOutput::drawHistogram2D(startDate,stopDate,pParamId, pHistogram2DProperties); |