Projekt

Obecné

Profil

« Předchozí | Další » 

Revize b5525aef

Přidáno uživatelem Jakub Hlaváč před více než 3 roky(ů)

Re #8850 - Ověření funkčnosti - implementované enpointy

+ new use case add position to unit
  • tweaking all calls to operations with units and sensors
    + adding sensor type enum from backend endpoint
    + some form validation :)
    - removing all endpoints from /senslog1

Zobrazit rozdíly:

src/app/unit/components/unit.component.ts
2 2
import {ActivatedRoute} from '@angular/router';
3 3
import {AnalyticsService} from '../../shared/api/endpoints/services/analytics.service';
4 4
import {map, tap} from 'rxjs/operators';
5
import {AggreationModel} from '../../shared/models/aggreation.model';
5
import {AggregationModel} from '../../shared/models/aggregationModel';
6 6
import * as moment from 'moment-timezone';
7 7
import {GraphLoader} from '../../shared/graph-loading/graphloader';
8 8
import {SensorsService} from '../../shared/api/endpoints/services/sensors.service';
......
31 31
  selectedSensors = [];
32 32
  sensors: Sensor[];
33 33
  showAggregation = false;
34
  aggregationFunction: AggreationModel[];
34
  aggregationFunction: AggregationModel[];
35 35
  selectedAggregationFunction = 'HOUR';
36 36

  
37 37
  constructor(
......
53 53
        this.sensors = sensors;
54 54
        if (sensors) {
55 55
          sensors.forEach(sensor => {
56
            const sensorType = sensor.sensorId.toString().slice(0, 2);
56
            const sensorType = sensor.sensorId.toString().slice(0, 5);
57 57
            if (!this.sensorGroups.some(group => group === sensorType)) {
58 58
              this.sensorGroups.push(sensorType);
59 59
            }
60
            if (!this.selectedSensors.some(sens => sens.toString().slice(0, 2) === sensorType)) {
60
            if (!this.selectedSensors.some(sens => sens.toString().slice(0, 5) === sensorType)) {
61 61
              this.selectedSensors.push(sensor.sensorId);
62 62
            }
63 63
          })
......
111 111
        const objectKeys = Object.keys(data);
112 112
        for(const key of objectKeys ) {
113 113
          if (data[key].data) {
114
            const view = '#vega_container_' + key.slice(0, 2);
114
            const view = '#vega_container_' + key.slice(0, 5);
115 115
            if (this.selectedSensors.some(sens => sens.toString() === key)) {
116 116
              GraphLoader.getGraph(key, data[key].data, data[key].interval, view);
117 117
            }

Také k dispozici: Unified diff