Commit ecf2e1478e8de966f7424534ef9185cd0d552b48
1 parent
193183ca
Exists in
master
and in
78 other branches
Use resampled table param in downloaded files (#8758)
Showing
1 changed file
with
29 additions
and
7 deletions
Show diff stats
src/ParamOutputImpl/Download/DownloadOutput.cc
... | ... | @@ -90,8 +90,15 @@ namespace AMDA { |
90 | 90 | if (!tableParamIds.empty()) |
91 | 91 | for (auto tableParamId : tableParamIds) { |
92 | 92 | AMDA::Parameters::ParameterSPtr tableParam = _parameterManager.getParameter(tableParamId.second); |
93 | - tableParam ->openConnection(this); | |
94 | - AMDA::Info::ParamInfoSPtr tableInfo = AMDA::Info::ParamMgr::getInstance()->getParamInfoFromId(tableParamId.second); | |
93 | + if ((_downloadProperties.getTimeResolution() > 0) && (_downloadProperties.getOutputStructure() != ONE_FILE_PER_PARAMETER_PER_INTERVAL)) { | |
94 | + // Use resampled table param | |
95 | + tableParam = _parameterManager.getSampledParameter( | |
96 | + tableParamId.second, | |
97 | + "classic", | |
98 | + _downloadProperties.getTimeResolution(), | |
99 | + tableParam->getGapThreshold(), true); | |
100 | + } | |
101 | + tableParam ->openConnection(this); | |
95 | 102 | } |
96 | 103 | } |
97 | 104 | } |
... | ... | @@ -114,13 +121,20 @@ namespace AMDA { |
114 | 121 | return; |
115 | 122 | AMDA::Info::ParamInfoSPtr processInfo = AMDA::Info::ParamMgr::getInstance()->getParamInfoFromId(paramId); |
116 | 123 | if (isFullVariable || (pParam->isTableIndexParam() && processInfo->getProcessInfo().empty())) { |
124 | + if ((_downloadProperties.getTimeResolution() > 0) && (_downloadProperties.getOutputStructure() != ONE_FILE_PER_PARAMETER_PER_INTERVAL)) { | |
125 | + //Use resampled table param | |
126 | + pParam = _parameterManager.getSampledParameter( | |
127 | + paramId, | |
128 | + "classic", | |
129 | + _downloadProperties.getTimeResolution(), | |
130 | + pParam->getGapThreshold(), true); | |
131 | + } | |
117 | 132 | pParam->openConnection(this); |
118 | 133 | ParamProperties* paramProperties = new ParamProperties(); |
119 | 134 | paramProperties->setOriginalId(paramId); |
120 | - paramProperties->setOutputId(paramId); | |
135 | + paramProperties->setOutputId(pParam->getId()); | |
121 | 136 | _downloadProperties.addParamProperties(paramProperties); |
122 | 137 | pParam->init(this, _timeIntervalList); |
123 | - | |
124 | 138 | } |
125 | 139 | AMDA::Info::ParamInfoSPtr paramInfo = AMDA::Info::ParamMgr::getInstance()->getParamInfoFromId(paramId); |
126 | 140 | const std::vector<std::string>& paramLinkedParams = paramInfo->getLinkedParamList(); |
... | ... | @@ -175,13 +189,21 @@ namespace AMDA { |
175 | 189 | AMDA::Parameters::ParameterSPtr tableParam = _parameterManager.getParameter(tableParamId.second); |
176 | 190 | if (tableParam == NULL) |
177 | 191 | continue; |
192 | + if ((_downloadProperties.getTimeResolution() > 0) && (_downloadProperties.getOutputStructure() != ONE_FILE_PER_PARAMETER_PER_INTERVAL)) { | |
193 | + //Use resampled table param | |
194 | + tableParam = _parameterManager.getSampledParameter( | |
195 | + tableParamId.second, | |
196 | + "classic", | |
197 | + _downloadProperties.getTimeResolution(), | |
198 | + tableParam->getGapThreshold(), true); | |
199 | + } | |
178 | 200 | tableParam -> init(this, _timeIntervalList); |
179 | 201 | if (table.second->isFullVariable(&_parameterManager)) { |
180 | - addAditionalDownloadParams(tableParamId.second, true); | |
202 | + addAditionalDownloadParams(tableParam->getId(), true); | |
181 | 203 | } else { |
182 | - _tableParamsList.push_back(tableParamId.second); | |
204 | + _tableParamsList.push_back(tableParam->getId()); | |
183 | 205 | } |
184 | - AMDA::Info::ParamInfoSPtr tableInfo = AMDA::Info::ParamMgr::getInstance()->getParamInfoFromId(tableParamId.second); | |
206 | + AMDA::Info::ParamInfoSPtr tableInfo = AMDA::Info::ParamMgr::getInstance()->getParamInfoFromId(tableParam->getId()); | |
185 | 207 | for (auto linkedParamId : tableInfo->getLinkedParamList()) { |
186 | 208 | addAditionalDownloadParams(linkedParamId, false); |
187 | 209 | } | ... | ... |