Dashboard heating-colors
This commit is contained in:
parent
79d5aad71f
commit
4ed155381a
@ -1,6 +1,6 @@
|
||||
import {Component, Input} from '@angular/core';
|
||||
import {ValuesTileComponent} from "../../../shared/values-tile/values-tile.component";
|
||||
import {Display, DisplayOrSeparator} from "../../../api/series/IValue";
|
||||
import {Display, DisplayOrSeparator, IValue} from "../../../api/series/IValue";
|
||||
import {SeriesService} from "../../../api/series/series.service";
|
||||
|
||||
@Component({
|
||||
@ -25,16 +25,31 @@ export class DashboardHeatingTileComponent {
|
||||
|
||||
getDisplayList(): DisplayOrSeparator[] {
|
||||
return [
|
||||
new Display('Abgas', '', this.seriesService.heatingExhaustTemperature),
|
||||
new Display('Puffer Vorlauf', '', this.seriesService.heatingBufferSupplyTemperature),
|
||||
new Display('Puffer Rücklauf', '', this.seriesService.heatingBufferReturnTemperature),
|
||||
new Display('Puffer Kalt', '', this.seriesService.heatingBufferColdTemperature),
|
||||
new Display('Puffer Speicher', '', this.seriesService.heatingBufferInnerTemperature),
|
||||
new Display('Puffer Warm', '', this.seriesService.heatingBufferHotTemperature),
|
||||
new Display('Puffer Zirkulation', '', this.seriesService.heatingBufferCirculationTemperature),
|
||||
new Display('Heizkreis Vorlauf', '', this.seriesService.heatingLoopSupplyTemperature),
|
||||
new Display('Heizkreis Rücklauf', '', this.seriesService.heatingLoopReturnTemperature),
|
||||
new Display('Abgas', this.color(50, 100, this.seriesService.heatingExhaustTemperature), this.seriesService.heatingExhaustTemperature),
|
||||
null,
|
||||
new Display('Heizkreis Vorlauf', this.color(22, 40, this.seriesService.heatingLoopSupplyTemperature), this.seriesService.heatingLoopSupplyTemperature),
|
||||
new Display('Heizkreis Rücklauf', this.color(22, 40, this.seriesService.heatingLoopReturnTemperature), this.seriesService.heatingLoopReturnTemperature),
|
||||
null,
|
||||
new Display('Puffer Vorlauf', this.color(22, 40, this.seriesService.heatingBufferSupplyTemperature), this.seriesService.heatingBufferSupplyTemperature),
|
||||
new Display('Puffer Rücklauf', this.color(22, 40, this.seriesService.heatingBufferReturnTemperature), this.seriesService.heatingBufferReturnTemperature),
|
||||
null,
|
||||
new Display('Puffer Kalt', this.color(22, 40, this.seriesService.heatingBufferColdTemperature), this.seriesService.heatingBufferColdTemperature),
|
||||
new Display('Puffer Speicher', this.color(22, 40, this.seriesService.heatingBufferInnerTemperature), this.seriesService.heatingBufferInnerTemperature),
|
||||
new Display('Puffer Warm', this.color(22, 40, this.seriesService.heatingBufferHotTemperature), this.seriesService.heatingBufferHotTemperature),
|
||||
new Display('Puffer Zirkulation', this.color(22, 40, this.seriesService.heatingBufferCirculationTemperature), this.seriesService.heatingBufferCirculationTemperature),
|
||||
];
|
||||
}
|
||||
|
||||
private color(middle: number, height: number, value: IValue | null): string {
|
||||
if (value === null || value.value === null) {
|
||||
return "";
|
||||
}
|
||||
if (value.value < middle) {
|
||||
return 'blue';
|
||||
} else if (value.value < height) {
|
||||
return 'orange';
|
||||
}
|
||||
return 'red';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -7,8 +7,12 @@
|
||||
<ng-container *ngFor="let display of displayList">
|
||||
<tr class="rate" *ngIf="display" [style.color]="display.color">
|
||||
<th>{{ display.title }}</th>
|
||||
<td class="v">{{ display?.iValue?.value | number:'0.0-0' }}</td>
|
||||
<td class="u">{{ display?.iValue?.unit }}</td>
|
||||
<td class="v">
|
||||
{{ display?.iValue?.value | number:'0.0-0' }}
|
||||
</td>
|
||||
<td class="u">
|
||||
{{ display?.iValue?.unit }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr *ngIf="!display" class="spacer">
|
||||
<td colspan="3"></td>
|
||||
|
||||
@ -30,6 +30,7 @@
|
||||
text-align: left;
|
||||
width: 0;
|
||||
white-space: nowrap;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.v {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user