concord-consortium/lab — pull request #32 by wday (2013-05-31 16:55:46+00:00)
Title: Filtered output patch for pressure equilibrium

This fixes an issue with a coupling between filteredOutputs and tickHistory and includes the updated pressure equilibrium interactive relying on the fixes.

The main issue was that since TickHistory invalidation is coupled to filteredOutput invalidation but tickHistory push was not couple, if invalidatingChangesPostHook happened at the right time then tickHistory could invalidate the samples added during the current tick. This balances the coupling by also adding samples when tickHistory is pushed.

This also fixes a small bug in running-average-filter.coffee where invalidation was not setting the local location pointer @_idx when invalidating a particular location. This was not an issue in other use cases, but here @_idx could get ahead of the length of the time series when invalidatingChangesPostHook invalidated the samples added for the current tick, since the arrays were truncated but @_idx remained ahead.