LinInterpolValueIteratorI Class
A ValueIterator that performs linear interpolation.
When next()/prev() is called this specialization of a ValueIteratorI will move to the next/previous interpolated Value as defined by the deltaT parameters.
Interpolated values for an arbitrary time stamp can be obtained by calling interpolate.
Interpolation is not possible between "Info" values line "Archive Off" or "Disabled". When such an info value is hit, the iterator will return the info value. Increment/decrement will then skip to the next/prev non-info value. So when the archive was off for a day and deltaT was set to one hour, this iterator will not return "Archive Off" for 24 hours but only once and then continue on the next day.Interface
- Create a LinearInterpolationValueIterator based on a basic AbstractValueIterator, preferably a ExpandingValueIterator.
deltaT: Time between interpolated values for ++ or -- operators.LinInterpolValueIteratorI (ValueIteratorI *base, double deltaT);- When the original values are further apart in time than maxDeltaT, ARCH_STOPPED ("Archive_Off") will be assumed. This prevents seemingly endless interpolation over huge gaps in time. Default: 0 (continue interpolation)
void setMaxDeltaT (double maxDeltaT); double getMaxDeltaT () const;- This method will return deltaT, not the original scan period of the underlying base iterator
double getPeriod () const;- Get interpolated Value for an arbitrary time stamp.
Use ++ or -- operators to get the next/prev. Value at a period of deltaT.const ValueI * interpolate (const osiTime &time);
IndexCreated from sources with MakeDoc Perl script.