Commit c04e147f2a3146e8ee82531ab2e782f7959c54be

Authored by Erdogan Furkan
1 parent b942a2cc

#7318 - Done

src/ExternLib/StatisticFunctions/AbstractFunc.hh
... ... @@ -369,7 +369,8 @@ public:
369 369  
370 370 virtual void pushData(double time, InputElemType& elem) {
371 371 _mem.push_back(std::make_pair(time, elem));
372   - _targets.push_back(time);
  372 + if (time >= AbstractFunc<InputElemType,OutputElemType>::getIntStartTime() && time <= AbstractFunc<InputElemType,OutputElemType>::getIntStopTime())
  373 + _targets.push_back(time);
373 374 }
374 375  
375 376 virtual void resetFunc() {
... ...
src/ExternLib/StatisticFunctions/ProcessStatisticFunctions.cc
... ... @@ -17,9 +17,12 @@
17 17 #include "ProcessStatisticFunctions.hh"
18 18 #include "ParamMgr.hh"
19 19  
  20 +#include "TimeInterval.hh"
  21 +
20 22 using namespace std;
21 23 using namespace boost;
22 24 using namespace log4cxx;
  25 +using namespace TimeTableCatalog;
23 26  
24 27 namespace AMDA {
25 28 namespace Parameters {
... ... @@ -49,8 +52,19 @@ TimeStamp ProcessStatisticFunctions::init() {
49 52 if (_windowtime <= 0) {
50 53 BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_PROCESS_ERR) << AMDA::ex_msg(std::string("Window Time must be greater than 0.")));
51 54 }
52   -
53   - TimeStamp time = _parameterInput->init( this, _timeIntervalList);
  55 +
  56 + TimeIntervalListSPtr lTimeIntervalList(new TimeIntervalList());
  57 +
  58 + // Add shift time for each time interval
  59 + for (TimeIntervalList::iterator it = _timeIntervalList->begin(); it != _timeIntervalList->end(); ++it) {
  60 + if ((*it)._startTime - _windowtime/2. > 0) {
  61 + lTimeIntervalList->push_back(TimeInterval( (*it)._startTime - _windowtime/2., (*it)._stopTime + _windowtime/2.));
  62 + }
  63 + else {
  64 + lTimeIntervalList->push_back(TimeInterval( 0, (*it)._stopTime + _windowtime/2.));
  65 + }
  66 + }
  67 + TimeStamp time = _parameterInput->init( this, lTimeIntervalList);
54 68  
55 69 _paramInput = _parameterInput->getParamData(this).get();
56 70  
... ...