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 1/2] 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 From f7f351d6a303899fd86628d142e8585e03809636 Mon Sep 17 00:00:00 2001 From: "Engelbart Kai Sven (PEA4-Fe)" Date: Wed, 24 Feb 2021 15:34:46 +0100 Subject: [PATCH 2/2] Add very simple prediction delta UI --- src/app/app-routing.module.ts | 2 + src/app/app.component.html | 1 + src/app/app.module.ts | 4 +- .../prediction-delta.component.html | 10 +++++ .../prediction-delta.component.scss | 0 .../prediction-delta.component.spec.ts | 25 +++++++++++ .../prediction-delta.component.ts | 41 +++++++++++++++++++ 7 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/app/prediction-delta/prediction-delta.component.html create mode 100644 src/app/prediction-delta/prediction-delta.component.scss create mode 100644 src/app/prediction-delta/prediction-delta.component.spec.ts create mode 100644 src/app/prediction-delta/prediction-delta.component.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index d5c4f6d..b180e60 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -11,6 +11,7 @@ import {UsersComponent} from './users/users.component'; import {ChangelogComponent} from './changelog/changelog.component'; import {DocumentationDatabaseComponent} from './documentation/documentation-database/documentation-database.component'; import {PredictionComponent} from './prediction/prediction.component'; +import {PredictionDeltaComponent} from './prediction-delta/prediction-delta.component'; import {ModelTemplatesComponent} from './model-templates/model-templates.component'; import {DocumentationArchitectureComponent} from './documentation/documentation-architecture/documentation-architecture.component'; @@ -23,6 +24,7 @@ const routes: Routes = [ {path: '', component: HomeComponent}, {path: 'home', component: HomeComponent}, {path: 'prediction', component: PredictionComponent}, + {path: 'prediction-delta', component: PredictionDeltaComponent}, {path: 'models', component: ModelTemplatesComponent}, {path: 'samples', component: SamplesComponent, canActivate: [LoginService]}, {path: 'samples/new', component: SampleComponent, canActivate: [LoginService]}, diff --git a/src/app/app.component.html b/src/app/app.component.html index 57cb40d..844116c 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -2,6 +2,7 @@