# HG changeset patch # User Chris Cannam # Date 1494498594 -3600 # Node ID 46a6b91ea51b5082b8210350a578f0ea4e9ada2d # Parent bc67503ea8c6b9aeb1049408cccda224d1f5402a Update to match latest changes to piper-js shape structures diff -r bc67503ea8c6 -r 46a6b91ea51b src/app/services/feature-extraction/FeatureReducers.ts --- a/src/app/services/feature-extraction/FeatureReducers.ts Wed May 10 15:42:26 2017 +0100 +++ b/src/app/services/feature-extraction/FeatureReducers.ts Thu May 11 11:29:54 2017 +0100 @@ -5,7 +5,7 @@ import {Feature, FeatureList} from 'piper/Feature'; import {SampleType} from 'piper'; import { - VectorFeatures, MatrixFeatures, TrackFeature, TrackFeatures + VectorFeature, MatrixFeature, TracksFeature } from "piper/HigherLevelUtilities"; export const arrayReducer = (acc: T[], val: T[]): T[] => { @@ -45,8 +45,8 @@ switch (acc.features.shape) { case "vector": - incoming = val.features.collected as VectorFeatures; - collected = acc.features.collected as VectorFeatures; + incoming = val.features.collected as VectorFeature; + collected = acc.features.collected as VectorFeature; if (isOneSamplePerStep) { // for one sample per step vectors we know there will be // totalBlockCount number of samples - so pre-allocate the @@ -72,8 +72,8 @@ break; case "matrix": - incoming = val.features.collected as MatrixFeatures; - collected = acc.features.collected as MatrixFeatures; + incoming = val.features.collected as MatrixFeature; + collected = acc.features.collected as MatrixFeature; collected.data = arrayReducer( collected.data, incoming.data @@ -90,9 +90,9 @@ break; case "tracks": - incoming = val.features.collected as TrackFeatures; - collected = acc.features.collected as TrackFeatures; - acc.features.collected = arrayReducer( + incoming = val.features.collected as TracksFeature; + collected = acc.features.collected as TracksFeature; + acc.features.collected = arrayReducer( collected, incoming ); break; diff -r bc67503ea8c6 -r 46a6b91ea51b src/app/waveform/waveform.component.ts --- a/src/app/waveform/waveform.component.ts Wed May 10 15:42:26 2017 +0100 +++ b/src/app/waveform/waveform.component.ts Thu May 11 11:29:54 2017 +0100 @@ -21,10 +21,9 @@ import { FeatureCollection, SimpleResponse, - VectorFeatures, - MatrixFeatures, - TrackFeature, - TrackFeatures + VectorFeature, + MatrixFeature, + TracksFeature } from 'piper/HigherLevelUtilities'; import {toSeconds} from 'piper'; import {FeatureList, Feature} from 'piper/Feature'; @@ -697,7 +696,8 @@ switch (features.shape) { case 'vector': { - const collected = features.collected as VectorFeatures; + const collected = features.collected as VectorFeature; + const startTime = collected.startTime; //!!! + make use of const stepDuration = collected.stepDuration; const featureData = collected.data; this.addLineLayer(stepDuration, featureData, colour); @@ -807,9 +807,9 @@ break; } case 'matrix': { - const collected = features.collected as MatrixFeatures; + const collected = features.collected as MatrixFeature; + const startTime = collected.startTime; //!!! + make use of const stepDuration = collected.stepDuration; - // !!! + start time const matrixData = collected.data; if (matrixData.length === 0) {