/**
 * @fileoverview added by tsickle
 * Generated from: lib/tap-monitoring-settings/tap-monitoring-settings.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { __awaiter, __generator } from "tslib";
import { Component, Input } from '@angular/core';
import { FormBuilder } from '@angular/forms';
import { MonitoringSettingsService } from './monitoring-settings.service';
import { ModalController } from '@ionic/angular';
var TapMonitoringSettingsComponent = /** @class */ (function () {
    function TapMonitoringSettingsComponent(formBuilder, monitoringSettingsService, modalController) {
        this.formBuilder = formBuilder;
        this.monitoringSettingsService = monitoringSettingsService;
        this.modalController = modalController;
        this.showDataSource = false;
        this.form = this.formBuilder.group({
            period: [this.monitoringSettingsService.settings.period],
            dataSource: ['live']
        });
    }
    Object.defineProperty(TapMonitoringSettingsComponent.prototype, "period", {
        get: /**
         * @return {?}
         */
        function () { return (/** @type {?} */ (this.form.get('period'))); },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TapMonitoringSettingsComponent.prototype, "dataSource", {
        get: /**
         * @return {?}
         */
        function () { return (/** @type {?} */ (this.form.get('dataSource'))); },
        enumerable: true,
        configurable: true
    });
    /**
     * @return {?}
     */
    TapMonitoringSettingsComponent.prototype.ngOnInit = /**
     * @return {?}
     */
    function () {
        var _this = this;
        this.form.valueChanges.subscribe((/**
         * @param {?} newValues
         * @return {?}
         */
        function (newValues) {
            _this.monitoringSettingsService.settings = {
                period: _this.period.value
            };
        }));
    };
    /**
     * @return {?}
     */
    TapMonitoringSettingsComponent.prototype.dismiss = /**
     * @return {?}
     */
    function () {
        return __awaiter(this, void 0, void 0, function () {
            var topOverlay;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.modalController.getTop()];
                    case 1:
                        topOverlay = _a.sent();
                        if (topOverlay) {
                            this.modalController.dismiss(topOverlay.id);
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    TapMonitoringSettingsComponent.decorators = [
        { type: Component, args: [{
                    selector: 'lib-tap-monitoring-settings',
                    template: "<ion-content>\r\n    <form [formGroup]=\"form\">\r\n        <ion-list>\r\n            <ion-list-header>\r\n                <ion-label>\r\n                    Monitoring settings\r\n                </ion-label>\r\n            </ion-list-header>\r\n            <ion-item>\r\n                <ion-label>Frequency (in milliseconds)</ion-label>\r\n                <ion-input [formControlName]=\"'period'\" slot=\"end\" text-right type=\"number\"></ion-input>\r\n            </ion-item>\r\n            <ion-item *ngIf=\"showDataSource\">\r\n                <ion-label>Data source</ion-label>\r\n                <ion-select [formControlName]=\"'dataSource'\" slot=\"end\">\r\n                    <ion-select-option value=\"live\">Live data</ion-select-option>\r\n                    <ion-select-option value=\"datalog\">Data log</ion-select-option>\r\n                </ion-select>\r\n            </ion-item>\r\n        </ion-list>\r\n    </form>\r\n</ion-content>\r\n<ion-footer>\r\n    <ion-toolbar>\r\n        <ion-buttons slot=\"end\">\r\n            <ion-button (click)=\"dismiss()\">Ok</ion-button>\r\n        </ion-buttons>\r\n    </ion-toolbar>\r\n</ion-footer>\r\n",
                    styles: [""]
                }] }
    ];
    /** @nocollapse */
    TapMonitoringSettingsComponent.ctorParameters = function () { return [
        { type: FormBuilder },
        { type: MonitoringSettingsService },
        { type: ModalController }
    ]; };
    TapMonitoringSettingsComponent.propDecorators = {
        showDataSource: [{ type: Input }]
    };
    return TapMonitoringSettingsComponent;
}());
export { TapMonitoringSettingsComponent };
if (false) {
    /** @type {?} */
    TapMonitoringSettingsComponent.prototype.showDataSource;
    /** @type {?} */
    TapMonitoringSettingsComponent.prototype.form;
    /** @type {?} */
    TapMonitoringSettingsComponent.prototype.formBuilder;
    /** @type {?} */
    TapMonitoringSettingsComponent.prototype.monitoringSettingsService;
    /** @type {?} */
    TapMonitoringSettingsComponent.prototype.modalController;
}
//# sourceMappingURL=data:application/json;base64, 