import {Component, OnInit} from '@angular/core';

@Component({
    selector: 'v-alarm-bar',
    templateUrl: './alarm-bar.component.html',
    styleUrls: ['./alarm-bar.component.scss'],
})
export class AlarmBarComponent implements OnInit {

    options = [
        {a: '西中转池搅拌开关 01数据异常', time: 1559809667000},
        {a: '西中转池搅拌开关 01数据异常', time: 1559809667000},
        {a: '西中转池搅拌开关 01数据异常', time: 1559809667000}
    ];
    active = 0;

    constructor() {
        this.changeAlarm();
    }

    changeAlarm() {
        setTimeout(() => {
            if (this.active >= this.options.length - 1) {
                this.active = 0;
            } else {
                this.active++;
            }
            this.changeAlarm();
        }, 3000);
    }

    ngOnInit() {
    }

}
