put y axis definition into its own object

This commit is contained in:
2020-02-09 17:16:27 +01:00
parent ed7cc9bee5
commit 859491e99e
28 changed files with 268 additions and 324 deletions

View File

@@ -1,7 +1,6 @@
<div>
<mat-form-field>
<mat-label>Y-Axis:</mat-label>
<mat-label>Y{{yIndex}}-Axis:</mat-label>
<mat-select [(value)]="yAxisScale">
<mat-option value="LOG10">Logarithm</mat-option>
<mat-option value="LINEAR">Linear</mat-option>
@@ -9,7 +8,7 @@
</mat-form-field>
<mat-form-field class="pdb-form-mid">
<mat-label>Y-Axis Range:</mat-label>
<mat-label>Y{{yIndex}}-Axis Range:</mat-label>
<mat-select [(value)]="yAxisUnit">
<mat-option value="AUTOMATIC">automatic</mat-option>
<mat-option value="MILLISECONDS">millis</mat-option>

View File

@@ -1,4 +1,5 @@
import { Component, Input } from '@angular/core';
import { YAxisDefinition } from '../plot.service';
@Component({
selector: 'pdb-y-axis-definition',
@@ -7,12 +8,23 @@ import { Component, Input } from '@angular/core';
})
export class YAxisDefinitionComponent {
yAxisScale: string = "LOG10";
yAxisUnit: string = "SECONDS";
minYValue: number = 0;
maxYValue: number = 300;
@Input()
yIndex: string = "";
constructor() {
}
getAxisDefinition() {
const result = new YAxisDefinition();
result.axisScale = this.yAxisScale;
result.rangeMin = this.minYValue;
result.rangeMax = this.maxYValue;
result.rangeUnit = this.yAxisUnit;
return result;
}
}