Commit 2d64c2359d10f134f37ec9a4fc02cb6487ed34fe
1 parent
76bfb610
Exists in
master
and in
79 other branches
Fix bug with spectro and y axis range (#8564)
Showing
1 changed file
with
29 additions
and
9 deletions
Show diff stats
src/ParamOutputImpl/Plot/Time/TimePlot.cc
... | ... | @@ -909,6 +909,10 @@ void TimePlot::drawSpectro(double startDate, double stopDate, std::string pParam |
909 | 909 | LOG4CXX_DEBUG(gLogger, "TimePlot::drawSpectro - Build data grid"); |
910 | 910 | MatrixGrid matrixGrid; |
911 | 911 | |
912 | + //get specific colors for min / max values | |
913 | + Color minValColor = lZAxis->getMinValColor(); | |
914 | + Color maxValColor = lZAxis->getMaxValColor(); | |
915 | + | |
912 | 916 | if ((tableSPtr == nullptr) || !tableSPtr->isVariable(&_parameterManager)) |
913 | 917 | { |
914 | 918 | int startIndex; |
... | ... | @@ -945,6 +949,19 @@ void TimePlot::drawSpectro(double startDate, double stopDate, std::string pParam |
945 | 949 | } |
946 | 950 | } |
947 | 951 | |
952 | + if (lYAxis->_reverse) { | |
953 | + if (((part.y[0] < lYAxis->getRange().getMax()) && (part.y[1] < lYAxis->getRange().getMax())) || | |
954 | + ((part.y[0] > lYAxis->getRange().getMin()) && (part.y[1] < lYAxis->getRange().getMin()))) { | |
955 | + continue; | |
956 | + } | |
957 | + } | |
958 | + else { | |
959 | + if (((part.y[0] < lYAxis->getRange().getMin()) && (part.y[1] < lYAxis->getRange().getMin())) || | |
960 | + ((part.y[0] > lYAxis->getRange().getMax()) && (part.y[1] < lYAxis->getRange().getMax()))) { | |
961 | + continue; | |
962 | + } | |
963 | + } | |
964 | + | |
948 | 965 | for (int i = 0; i < nbValues - 1; ++i) |
949 | 966 | { |
950 | 967 | part.x[0] = data.getTimes()[startIndex+i]; |
... | ... | @@ -953,6 +970,12 @@ void TimePlot::drawSpectro(double startDate, double stopDate, std::string pParam |
953 | 970 | part.value = data.getValues(index, startIndex)[i]; |
954 | 971 | matrixGrid.push_back(part); |
955 | 972 | } |
973 | + | |
974 | + //draw spectro | |
975 | + LOG4CXX_DEBUG(gLogger, "TimePlot::drawSpectro - Draw data grid - " << matrixGrid.size()); | |
976 | + drawMatrix(matrixGrid, pSpectro.getMin(), pSpectro.getMax(), | |
977 | + minValColor, maxValColor, lZAxis->_color._colorMapIndex, pSpectro.getUseLog0AsMin()); | |
978 | + matrixGrid.clear(); | |
956 | 979 | } |
957 | 980 | } |
958 | 981 | else |
... | ... | @@ -1010,18 +1033,15 @@ void TimePlot::drawSpectro(double startDate, double stopDate, std::string pParam |
1010 | 1033 | else |
1011 | 1034 | matrixGrid.push_back(part); |
1012 | 1035 | } |
1036 | + | |
1037 | + //draw spectro | |
1038 | + LOG4CXX_DEBUG(gLogger, "TimePlot::drawSpectro - Draw data grid - " << matrixGrid.size()); | |
1039 | + drawMatrix(matrixGrid, pSpectro.getMin(), pSpectro.getMax(), | |
1040 | + minValColor, maxValColor, lZAxis->_color._colorMapIndex, pSpectro.getUseLog0AsMin()); | |
1041 | + matrixGrid.clear(); | |
1013 | 1042 | } |
1014 | 1043 | } |
1015 | 1044 | } |
1016 | - | |
1017 | - //get specific colors for min / max values | |
1018 | - Color minValColor = lZAxis->getMinValColor(); | |
1019 | - Color maxValColor = lZAxis->getMaxValColor(); | |
1020 | - | |
1021 | - //draw spectro | |
1022 | - LOG4CXX_DEBUG(gLogger, "TimePlot::drawSpectro - Draw data grid"); | |
1023 | - drawMatrix(matrixGrid, pSpectro.getMin(), pSpectro.getMax(), | |
1024 | - minValColor, maxValColor, lZAxis->_color._colorMapIndex, pSpectro.getUseLog0AsMin()); | |
1025 | 1045 | } |
1026 | 1046 | |
1027 | 1047 | Color TimePlot::getStatusColor(AMDA::Info::ParamInfoSPtr& paramInfo, double value) { | ... | ... |