diff --git a/src/ParamOutputImpl/Download/DownloadOutput.cc b/src/ParamOutputImpl/Download/DownloadOutput.cc index 8b0d5d5..88a45e1 100644 --- a/src/ParamOutputImpl/Download/DownloadOutput.cc +++ b/src/ParamOutputImpl/Download/DownloadOutput.cc @@ -90,8 +90,15 @@ namespace AMDA { if (!tableParamIds.empty()) for (auto tableParamId : tableParamIds) { AMDA::Parameters::ParameterSPtr tableParam = _parameterManager.getParameter(tableParamId.second); - tableParam ->openConnection(this); - AMDA::Info::ParamInfoSPtr tableInfo = AMDA::Info::ParamMgr::getInstance()->getParamInfoFromId(tableParamId.second); + if ((_downloadProperties.getTimeResolution() > 0) && (_downloadProperties.getOutputStructure() != ONE_FILE_PER_PARAMETER_PER_INTERVAL)) { + // Use resampled table param + tableParam = _parameterManager.getSampledParameter( + tableParamId.second, + "classic", + _downloadProperties.getTimeResolution(), + tableParam->getGapThreshold(), true); + } + tableParam ->openConnection(this); } } } @@ -114,13 +121,20 @@ namespace AMDA { return; AMDA::Info::ParamInfoSPtr processInfo = AMDA::Info::ParamMgr::getInstance()->getParamInfoFromId(paramId); if (isFullVariable || (pParam->isTableIndexParam() && processInfo->getProcessInfo().empty())) { + if ((_downloadProperties.getTimeResolution() > 0) && (_downloadProperties.getOutputStructure() != ONE_FILE_PER_PARAMETER_PER_INTERVAL)) { + //Use resampled table param + pParam = _parameterManager.getSampledParameter( + paramId, + "classic", + _downloadProperties.getTimeResolution(), + pParam->getGapThreshold(), true); + } pParam->openConnection(this); ParamProperties* paramProperties = new ParamProperties(); paramProperties->setOriginalId(paramId); - paramProperties->setOutputId(paramId); + paramProperties->setOutputId(pParam->getId()); _downloadProperties.addParamProperties(paramProperties); pParam->init(this, _timeIntervalList); - } AMDA::Info::ParamInfoSPtr paramInfo = AMDA::Info::ParamMgr::getInstance()->getParamInfoFromId(paramId); const std::vector& paramLinkedParams = paramInfo->getLinkedParamList(); @@ -175,13 +189,21 @@ namespace AMDA { AMDA::Parameters::ParameterSPtr tableParam = _parameterManager.getParameter(tableParamId.second); if (tableParam == NULL) continue; + if ((_downloadProperties.getTimeResolution() > 0) && (_downloadProperties.getOutputStructure() != ONE_FILE_PER_PARAMETER_PER_INTERVAL)) { + //Use resampled table param + tableParam = _parameterManager.getSampledParameter( + tableParamId.second, + "classic", + _downloadProperties.getTimeResolution(), + tableParam->getGapThreshold(), true); + } tableParam -> init(this, _timeIntervalList); if (table.second->isFullVariable(&_parameterManager)) { - addAditionalDownloadParams(tableParamId.second, true); + addAditionalDownloadParams(tableParam->getId(), true); } else { - _tableParamsList.push_back(tableParamId.second); + _tableParamsList.push_back(tableParam->getId()); } - AMDA::Info::ParamInfoSPtr tableInfo = AMDA::Info::ParamMgr::getInstance()->getParamInfoFromId(tableParamId.second); + AMDA::Info::ParamInfoSPtr tableInfo = AMDA::Info::ParamMgr::getInstance()->getParamInfoFromId(tableParam->getId()); for (auto linkedParamId : tableInfo->getLinkedParamList()) { addAditionalDownloadParams(linkedParamId, false); } -- libgit2 0.21.2