From 06e649671fc4e5ec2f2036176f4c60219453f2ac Mon Sep 17 00:00:00 2001 From: "Engelbart Kai Sven (PEA4-Fe)" Date: Wed, 24 Feb 2021 13:58:14 +0100 Subject: [PATCH] Allow viscosity number predictions to be saved --- src/app/prediction/prediction.component.html | 16 ++++++++++++++- src/app/prediction/prediction.component.ts | 21 +++++++++++++++----- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/src/app/prediction/prediction.component.html b/src/app/prediction/prediction.component.html index db1dbdb..1bbe7ba 100644 --- a/src/app/prediction/prediction.component.html +++ b/src/app/prediction/prediction.component.html @@ -40,7 +40,7 @@
- @@ -72,6 +72,20 @@ Export to PDF + + +
+ + + Save Prediction + + + + Prediction saved! + + +
+
('/prediction/new', prediction); + } + // Aggregates spectrum names and prediction values into an associative array prepareExport() { const zip = (a, b) => a.map((k, i) => [k, b[i]]); const values = this.result.predictions - .map(prediction => prediction - .filter(field => field.category === 'Prediction') - .map(field => field.value)); - return zip(this.spectrumNames, values); + .map(prediction => prediction + .filter(field => field.category === 'Prediction') + .map(field => field.value)); + return zip(this.spectrumNames, values); } // Generates a timestamp suitable for file naming