Commit d9c8118b153552c614f7aef5455b0e9c8f89bdf8

Authored by Menouard AZIB
1 parent bc850076

Re-factoring de la méthode createParameters dans plotFunction

Showing 1 changed file with 7 additions and 29 deletions   Show diff stats
src/ParamOutputImpl/Plot/InstantPlot/PlotFunction.cc
@@ -200,7 +200,8 @@ namespace plot @@ -200,7 +200,8 @@ namespace plot
200 { 200 {
201 std::stringstream lError; 201 std::stringstream lError;
202 lError << "PlotFunction::compute" 202 lError << "PlotFunction::compute"
203 - << ": param with id '" << param_id << "' is not found in param_nb_points xml node."; 203 + << ": param with id " << param_id << " is not found in param_nb_points xml node.";
  204 + LOG4CXX_DEBUG(gLogger, lError.str());
204 BOOST_THROW_EXCEPTION(PanelPlotOutputException() << AMDA::errno_code(AMDA_ERROR_PLOTFUNCTION_PARAM_NOT_FOUND) << AMDA::ex_msg(lError.str())); 205 BOOST_THROW_EXCEPTION(PanelPlotOutputException() << AMDA::errno_code(AMDA_ERROR_PLOTFUNCTION_PARAM_NOT_FOUND) << AMDA::ex_msg(lError.str()));
205 } 206 }
206 207
@@ -327,48 +328,25 @@ namespace plot @@ -327,48 +328,25 @@ namespace plot
327 328
328 void PlotFunction::createParameters(std::list<std::string> &usedParametersId_) 329 void PlotFunction::createParameters(std::list<std::string> &usedParametersId_)
329 { 330 {
330 - // -- for each y serie on each parameter, calculate  
331 - // y serie sampling according to max resolution 331 +
332 for (ParameterAxesList::iterator it = _parameterAxesList.begin(); 332 for (ParameterAxesList::iterator it = _parameterAxesList.begin();
333 it != _parameterAxesList.end(); ++it) 333 it != _parameterAxesList.end(); ++it)
334 { 334 {
335 AMDA::Parameters::ParameterSPtr originalParam = 335 AMDA::Parameters::ParameterSPtr originalParam =
336 _parameterManager.getParameter(it->_originalParamId); 336 _parameterManager.getParameter(it->_originalParamId);
337 337
338 - LOG4CXX_DEBUG(gLogger, "before resampling : " << it->_originalParamId);  
339 -  
340 - // original parameter sampling  
341 - double samplingValue = getSamplingInTreeParameter(originalParam);  
342 -  
343 // For each series 338 // For each series
344 std::vector<SeriesProperties>::iterator ity; 339 std::vector<SeriesProperties>::iterator ity;
345 for (ity = it->getYSeriePropertiesList().begin(); ity != it->getYSeriePropertiesList().end(); 340 for (ity = it->getYSeriePropertiesList().begin(); ity != it->getYSeriePropertiesList().end();
346 ++ity) 341 ++ity)
347 { 342 {
348 - // get corrected sampling value in relation with max resolution  
349 - double correctedSamplingValue = getCorrectedSamplingValue(ity->getMaxResolution(), samplingValue);  
350 -  
351 - AMDA::Parameters::ParameterSPtr usedParam;  
352 - // create resampling parameters for param  
353 - if (abs(samplingValue - correctedSamplingValue) > 1.)  
354 - {  
355 - // more than one second between samplingValue and correctedSamplingValue  
356 - //=> use resampling parameter  
357 - usedParam = createSampledParameter(originalParam, correctedSamplingValue);  
358 - }  
359 - else  
360 - {  
361 - // use original parameter  
362 - usedParam = originalParam;  
363 - }  
364 -  
365 - // Add used parameter to parameters list 343 + // Add parameter to parameters list
366 if (std::find(usedParametersId_.begin(), usedParametersId_.end(), 344 if (std::find(usedParametersId_.begin(), usedParametersId_.end(),
367 - usedParam->getId()) == usedParametersId_.end())  
368 - usedParametersId_.push_back(usedParam->getId()); 345 + originalParam->getId()) == usedParametersId_.end())
  346 + usedParametersId_.push_back(originalParam->getId());
369 347
370 // link this paramter to the serie 348 // link this paramter to the serie
371 - ity->setParamId(usedParam->getId()); 349 + ity->setParamId(originalParam->getId());
372 } 350 }
373 } 351 }
374 } 352 }