changeset 299:46a6b91ea51b

Update to match latest changes to piper-js shape structures
author Chris Cannam <cannam@all-day-breakfast.com>
date Thu, 11 May 2017 11:29:54 +0100
parents bc67503ea8c6
children 1d39cc796046
files src/app/services/feature-extraction/FeatureReducers.ts src/app/waveform/waveform.component.ts
diffstat 2 files changed, 15 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- 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 = <T>(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<Float32Array>(
 	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<TrackFeature>(
+      incoming = val.features.collected as TracksFeature;
+      collected = acc.features.collected as TracksFeature;
+      acc.features.collected = arrayReducer<VectorFeature>(
 	collected, incoming
       );
       break;
--- 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) {