diff --git a/src/main/angular/src/app/pages/dashboard/heating/dashboard-heating-tile.component.ts b/src/main/angular/src/app/pages/dashboard/heating/dashboard-heating-tile.component.ts index b94a31f..7d42080 100644 --- a/src/main/angular/src/app/pages/dashboard/heating/dashboard-heating-tile.component.ts +++ b/src/main/angular/src/app/pages/dashboard/heating/dashboard-heating-tile.component.ts @@ -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'; + } + } diff --git a/src/main/angular/src/app/shared/values-tile/values-tile.component.html b/src/main/angular/src/app/shared/values-tile/values-tile.component.html index 4ffefd0..a12f846 100644 --- a/src/main/angular/src/app/shared/values-tile/values-tile.component.html +++ b/src/main/angular/src/app/shared/values-tile/values-tile.component.html @@ -7,8 +7,12 @@ {{ display.title }} - {{ display?.iValue?.value | number:'0.0-0' }} - {{ display?.iValue?.unit }} + + {{ display?.iValue?.value | number:'0.0-0' }} + + + {{ display?.iValue?.unit }} + diff --git a/src/main/angular/src/app/shared/values-tile/values-tile.component.less b/src/main/angular/src/app/shared/values-tile/values-tile.component.less index ff5703d..1835a40 100644 --- a/src/main/angular/src/app/shared/values-tile/values-tile.component.less +++ b/src/main/angular/src/app/shared/values-tile/values-tile.component.less @@ -30,6 +30,7 @@ text-align: left; width: 0; white-space: nowrap; + font-weight: normal; } .v {