From 23c6d2bced3abbc32b1c1bfc5d94e918fa0a7546 Mon Sep 17 00:00:00 2001 From: csba1652 <Bilal.Hassan@student.uibk.ac.at> Date: Tue, 23 May 2023 19:25:41 +0100 Subject: [PATCH] refactoring finished -tested the functionality after finished refactoring --- .../Cjs-timeline-multiple/light-chart.component.ts | 4 ++++ .../module/components/pro-view/pro-view.component.ts | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/app/module/components/charts/Cjs-timeline-multiple/light-chart.component.ts b/src/app/module/components/charts/Cjs-timeline-multiple/light-chart.component.ts index cb74957..4b7571f 100644 --- a/src/app/module/components/charts/Cjs-timeline-multiple/light-chart.component.ts +++ b/src/app/module/components/charts/Cjs-timeline-multiple/light-chart.component.ts @@ -29,6 +29,7 @@ export class CjsTimelineMultiple implements OnInit,OnChanges{ @Input() sensorDataArray!:[SensorData[]] dataParentArray:[Number[]]=[[]] + dataParentArrayOptions:[Number[]]=[[]] timeStampsAsHour:any @@ -81,6 +82,7 @@ export class CjsTimelineMultiple implements OnInit,OnChanges{ borderColor:(rgb+'0.8)'), tension:0.2, data:this.dataParentArray.at(i+2), + pointStyle: 'circle', })); this.linConfig.data.datasets=dataSet @@ -102,9 +104,11 @@ export class CjsTimelineMultiple implements OnInit,OnChanges{ //Map the SensorData this.dataParentArray=[[]] + this.dataParentArrayOptions=[[]] this.sensorDataArray.forEach( sensDat=>{ this.dataParentArray.push(sensDat.map(x=>x.readings.map(y=>y.value)).flat()) + //this.dataParentArrayOptions.push(sensDat.map(x=>x.readings.map(y=>y.)).flat()) } ) this.logger.info("SensorData got from Server",this.dataParentArray) diff --git a/src/app/module/components/pro-view/pro-view.component.ts b/src/app/module/components/pro-view/pro-view.component.ts index 6c727d4..cec400d 100644 --- a/src/app/module/components/pro-view/pro-view.component.ts +++ b/src/app/module/components/pro-view/pro-view.component.ts @@ -7,10 +7,14 @@ import {DatePipe} from "@angular/common"; import {LogLevel, MyLoggerServiceService} from "../../../shared/service/my-logger-service.service"; import {HttpClient} from "@angular/common/http"; -import {ClientControllerService,HostControllerService, SensorControllerService, +import { + ClientControllerService, HostControllerService, ReadingPayload, SensorControllerService, Station, - StationControllerService,ThreePhaseDendrometer} from "../../../../../projects/generated-api/src"; + StationControllerService, ThreePhaseDendrometer +} from "../../../../../projects/generated-api/src"; import {UnsubscribeOnDestroy} from "../../../shared/unsubscribeOnDestroy.class"; +import {MapperService} from "../../../shared/service/mapper.service"; +import SensorErrorEnum = ReadingPayload.SensorErrorEnum; @Component({ selector: 'app-pro-view', @@ -44,6 +48,8 @@ export class ProViewComponent extends UnsubscribeOnDestroy implements OnInit,OnD sensorDataArray:[SensorData[]]=[[]] station!: Observable<Array<Station>>; + sensorErrorEnum:SensorErrorEnum=SensorErrorEnum.NOERROR + constructor(private stationControllerService: StationControllerService,private hostControllerService:HostControllerService, private clientControllerService:ClientControllerService, private sensorControllerService:SensorControllerService, -- GitLab