Graph cleanup
This commit is contained in:
@@ -22,10 +22,11 @@ export default class DataAnalysis {
|
||||
else {
|
||||
this._resetCache(analysisParameters, sessionId);
|
||||
newData = allMeasurements;
|
||||
console.log("cache reset");
|
||||
}
|
||||
|
||||
// peaks
|
||||
const newPeaks = this.peakDetectorSimple.addVector(newData);
|
||||
const newPeaks = this.peakDetectorSimple.addVector(newData.toArray());
|
||||
this.allPeaks = this.allPeaks.concat(List(newPeaks));
|
||||
|
||||
// aggregated sum/max
|
||||
@@ -43,7 +44,7 @@ export default class DataAnalysis {
|
||||
peaks: this.allPeaks,
|
||||
totalTime: allMeasurements / analysisParameters.numMeasurementsPerSec,
|
||||
|
||||
totalMomentum: this.aggregatedMomentum / allMeasurements.size,
|
||||
totalMomentum: this.aggregatedMomentum,
|
||||
peakMax: this.peakMax,
|
||||
|
||||
momentumWindow: momentumWindow,
|
||||
|
||||
@@ -21,6 +21,7 @@ class PeakDetectorSimple {
|
||||
|
||||
addVector(vec) {
|
||||
let result = [];
|
||||
|
||||
for (let i = 0; i < vec.length; ++i) {
|
||||
const res = this.add(vec[i]);
|
||||
if(res !== null)
|
||||
|
||||
Reference in New Issue
Block a user