Commit d924031cda5da9d8db2cadb05f1b5969b1e94761
1 parent
43ce1f77
Exists in
master
and in
52 other branches
progress
Showing
3 changed files
with
23 additions
and
15 deletions
Show diff stats
src/Info/ParamTable.cc
... | ... | @@ -760,6 +760,15 @@ namespace AMDA { |
760 | 760 | } |
761 | 761 | return res; |
762 | 762 | } |
763 | + bool ParamTable::isInvertedOrder(ParameterManager *parameterManager){ | |
764 | + if(this->getSize(parameterManager) <2) | |
765 | + return true; | |
766 | + | |
767 | + double fist_ = getBound(parameterManager, 0).min; | |
768 | + double second_ = getBound(parameterManager, 1).min; | |
769 | + | |
770 | + return (fist_ > second_); | |
771 | + } | |
763 | 772 | |
764 | 773 | } /* namespace Info */ |
765 | 774 | } /* namespace AMDA */ | ... | ... |
src/Info/ParamTable.hh
... | ... | @@ -82,6 +82,8 @@ namespace AMDA { |
82 | 82 | void addSemiVariableTableInfo(ParameterManager *parameterManager, int dim, std::string paramId, std::string key, std::vector<std::pair<std::string, std::string>>&infoMap); |
83 | 83 | |
84 | 84 | void addRelatedParams(ParameterManager *parameterManager, std::string paramId, std::list<std::string>relatedParams); |
85 | + | |
86 | + bool isInvertedOrder(ParameterManager *parameterManager); | |
85 | 87 | |
86 | 88 | protected: |
87 | 89 | /** logger of paramTable */ | ... | ... |
src/ParamOutputImpl/Plot/Time/TimePlot.cc
... | ... | @@ -505,26 +505,17 @@ namespace plot |
505 | 505 | |
506 | 506 | ParameterSPtr p = _parameterManager.getParameter(param._originalParamId); |
507 | 507 | int rightParameterDimension; |
508 | - int leftParameterDimension; | |
509 | 508 | int rightDim = sauvaudPropertiesPtr->getRightDim(); |
510 | - int leftDim = (rightDim ==0) ? 1 :0; | |
511 | 509 | if (rightDim == 0){ |
512 | 510 | rightParameterDimension = (*_pParameterValues)[sauvaudPropertiesPtr->getParamId()].getDim1Size(); |
513 | - leftParameterDimension = (*_pParameterValues)[sauvaudPropertiesPtr->getParamId()].getDim2Size(); | |
514 | 511 | }else{ |
515 | 512 | rightParameterDimension = (*_pParameterValues)[sauvaudPropertiesPtr->getParamId()].getDim2Size(); |
516 | - leftParameterDimension = (*_pParameterValues)[sauvaudPropertiesPtr->getParamId()].getDim1Size(); | |
517 | 513 | } |
518 | 514 | //set Y axis range |
519 | 515 | |
520 | 516 | |
521 | 517 | AMDA::Info::ParamInfoSPtr paramInfo = AMDA::Info::ParamMgr::getInstance()->getParamInfoFromId(p->getInfoId()); |
522 | 518 | |
523 | - if(_panel->getTitle()->_text.empty()){ | |
524 | - std::string title_ = paramInfo->getShortName().empty() ? paramInfo->getName(): paramInfo->getShortName(); | |
525 | - _panel->setTitleText(title_.c_str()); | |
526 | - } | |
527 | - | |
528 | 519 | // configure right axis |
529 | 520 | Range lYAxisRequestRange = lYAxis->Axis::getRequestedRange(); |
530 | 521 | Range lYAxisRange = lYAxis->Axis::getRange(); |
... | ... | @@ -1381,7 +1372,8 @@ namespace plot |
1381 | 1372 | int rightDim = pSauvaud.getRightDim(); |
1382 | 1373 | int leftDim = (rightDim ==0) ? 1 :0; |
1383 | 1374 | int rightDimSize =-1; |
1384 | - int leftDimSize =-1; | |
1375 | + int leftDimSize =-1; | |
1376 | + bool invertedTable = false; | |
1385 | 1377 | if(rightDim ==0){ |
1386 | 1378 | rightDimSize = data.getDim1Size(); |
1387 | 1379 | leftDimSize = data.getDim2Size() ; |
... | ... | @@ -1399,8 +1391,9 @@ namespace plot |
1399 | 1391 | boost::shared_ptr<AMDA::Info::ParamTable> leftTableSPtr; |
1400 | 1392 | AMDA::Info::ParamInfoSPtr paramInfo = AMDA::Info::ParamMgr::getInstance()->getParamInfoFromId(p->getInfoId()); |
1401 | 1393 | if (paramInfo != nullptr){ |
1402 | - rightTableSPtr = paramInfo->getTable(rightDim); | |
1403 | - leftTableSPtr = paramInfo->getTable(leftDim); | |
1394 | + rightTableSPtr = paramInfo->getTable(rightDim); | |
1395 | + leftTableSPtr = paramInfo->getTable(leftDim); | |
1396 | + invertedTable = leftTableSPtr->isInvertedOrder(&_parameterManager); | |
1404 | 1397 | } |
1405 | 1398 | |
1406 | 1399 | //get axis |
... | ... | @@ -1414,10 +1407,14 @@ namespace plot |
1414 | 1407 | data.getIntervalBounds(startDate, stopDate, startIndex, nbValues); |
1415 | 1408 | |
1416 | 1409 | LOG4CXX_DEBUG(gLogger, "TimePlot::drawSauvaud - Build data grid"); |
1410 | + | |
1411 | + int plotIndex; | |
1417 | 1412 | |
1418 | 1413 | for(int spectroIndex =0; spectroIndex <= leftDimSize; spectroIndex ++){ |
1419 | 1414 | // This will configure window, draw axes (if needed) and legend of axes. |
1420 | 1415 | |
1416 | + plotIndex = (!invertedTable)? spectroIndex : leftDimSize-spectroIndex; | |
1417 | + | |
1421 | 1418 | // set left label for each sub-plot label table value or index |
1422 | 1419 | if(spectroIndex == leftDimSize){ |
1423 | 1420 | std::string plotLabel = " "+leftTableSPtr ->getName(&_parameterManager); |
... | ... | @@ -1427,7 +1424,7 @@ namespace plot |
1427 | 1424 | label._text = plotLabel; |
1428 | 1425 | lYAxis->_legend.setLabel(label); |
1429 | 1426 | |
1430 | - PanelPlotOutput::drawSauvaud(startDate, stopDate, pParamId, pSauvaud, spectroIndex , leftDimSize, ""); | |
1427 | + PanelPlotOutput::drawSauvaud(startDate, stopDate, pParamId, pSauvaud, plotIndex, leftDimSize, ""); | |
1431 | 1428 | break; |
1432 | 1429 | } |
1433 | 1430 | std::string plotLabel = std::to_string(spectroIndex); |
... | ... | @@ -1472,9 +1469,9 @@ namespace plot |
1472 | 1469 | if(spectroIndex == leftDimSize -1){ |
1473 | 1470 | opositeLabel = " "+rightTableSPtr ->getName(&_parameterManager); |
1474 | 1471 | opositeLabel = opositeLabel + "\n ["+rightTableSPtr ->getUnits(&_parameterManager)+"]"; |
1475 | - PanelPlotOutput::drawSauvaud(startDate, stopDate, pParamId, pSauvaud, spectroIndex , leftDimSize, opositeLabel); | |
1472 | + PanelPlotOutput::drawSauvaud(startDate, stopDate, pParamId, pSauvaud,plotIndex , leftDimSize, opositeLabel); | |
1476 | 1473 | }else{ |
1477 | - PanelPlotOutput::drawSauvaud(startDate, stopDate, pParamId, pSauvaud, spectroIndex , leftDimSize, ""); | |
1474 | + PanelPlotOutput::drawSauvaud(startDate, stopDate, pParamId, pSauvaud,plotIndex , leftDimSize, ""); | |
1478 | 1475 | } |
1479 | 1476 | |
1480 | 1477 | ... | ... |