|
|
@@ -1,4 +1,4 @@
|
|
|
-import { Component, OnDestroy, OnInit } from '@angular/core';
|
|
|
+import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
|
|
|
import { ActivatedRoute } from '@angular/router';
|
|
|
import { map, tap } from 'rxjs/operators';
|
|
|
import * as moment from 'moment-timezone';
|
|
|
@@ -26,18 +26,18 @@ export class UnitComponent implements OnInit, OnDestroy {
|
|
|
time = [];
|
|
|
from: Date = moment().hour(0).minutes(0).subtract(7, 'days').toDate();
|
|
|
to: Date = moment().toDate();
|
|
|
- today: Date = moment().toDate();
|
|
|
+ today: Date = moment().toDate();
|
|
|
observationsData: any[] = [];
|
|
|
sensorGroups = [];
|
|
|
selectedSensors: string[] = [];
|
|
|
- sensors: Sensor[];
|
|
|
+ sensors: Sensor[];
|
|
|
dateChanged = false;
|
|
|
sensorTypes: SensorType[];
|
|
|
unitDescription: string;
|
|
|
subscription: Subscription[] = [];
|
|
|
|
|
|
constructor(
|
|
|
- private activatedRoute: ActivatedRoute,
|
|
|
+ private activatedRoute: ActivatedRoute,
|
|
|
private sensorService: SensorsService,
|
|
|
private toastService: ToastService,
|
|
|
private observationService: ObservationService,
|
|
|
@@ -83,7 +83,7 @@ export class UnitComponent implements OnInit, OnDestroy {
|
|
|
}
|
|
|
});
|
|
|
this.sensorService.getSensorTypes().toPromise().then(types => this.sensorTypes = types);
|
|
|
- this.unitId = parseInt(this.activatedRoute.snapshot.paramMap.get('unitId'), 10);
|
|
|
+ this.unitId = parseInt(this.activatedRoute.snapshot.paramMap.get('unitId'), 10);
|
|
|
}
|
|
|
|
|
|
ngOnInit(): void {
|
|
|
@@ -102,7 +102,7 @@ export class UnitComponent implements OnInit, OnDestroy {
|
|
|
showGraph(changedDate: boolean = true, changedSensor: string = null) {
|
|
|
const range: Date[] = [this.from, this.to];
|
|
|
this.getObservations(range, changedDate, changedSensor);
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* Check button handler.
|