/**
 * @fileoverview added by tsickle
 * Generated from: lib/tap-gpio.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { Component, Input } from '@angular/core';
import { CurrentDeviceService } from '@iotize/ionic';
import { TapGPIOController } from './tap-extension';
export class TapGpioComponent {
    /**
     * @param {?} tapService
     */
    constructor(tapService) {
        this.tapService = tapService;
        this.schema = [];
        this.lines = 'full';
        this.pins = this.schema.map((/**
         * @param {?} entry
         * @return {?}
         */
        (entry) => {
            if (entry.pin.type == 'GPIO') {
                ((/** @type {?} */ (entry))).controller = new TapGPIOController(this.tap, entry.pin);
            }
            return (/** @type {?} */ (entry));
        }));
    }
    /**
     * @return {?}
     */
    get tap() {
        return this.tapService.tap;
    }
    /**
     * @return {?}
     */
    ngOnInit() {
    }
}
TapGpioComponent.decorators = [
    { type: Component, args: [{
                selector: 'tap-gpio',
                template: "\r\n<ion-list [lines]=\"lines\">\r\n  <ion-item *ngFor=\"let config of pins\">\r\n    <ng-template [ngIf]=\"config.pin.type == 'GROUND'\" #ground>\r\n        <span slot=\"start\">{{config.num}}</span>\r\n        <ion-label>\r\n          <span slot=\"start\">{{config.pin.type}}</span>\r\n        </ion-label>\r\n    </ng-template>\r\n    <ng-template [ngIf]=\"config.pin.type == 'POWER'\" #power>\r\n        <span slot=\"start\">{{config.num}}</span>\r\n        <span slot=\"start\">{{config.pin.type}}</span>\r\n        <ion-label>\r\n          <span slot=\"start\">{{config.power}}V</span>\r\n        </ion-label>\r\n    </ng-template>\r\n    <ng-template [ngIf]=\"config.pin.type == 'DISABLED'\" #disabledpin>\r\n        <span slot=\"start\">{{config.num}}</span>\r\n        <ion-label>\r\n          <span slot=\"start\">{{config.pin.type}}</span>\r\n        </ion-label>\r\n    </ng-template>\r\n    <ng-template [ngIf]=\"config.pin.type == 'GPIO'\" #gpio>\r\n        <span slot=\"start\">{{config.num}}</span>\r\n        <span slot=\"start\">{{config.pin.type}} {{config.pin.num}}</span> \r\n        <ion-label>\r\n          {{config.title}}\r\n        </ion-label>\r\n        <ion-buttons slot=\"end\">\r\n            <ion-button [color]=\"config.controller._mode == 'OUT' ? 'primary' : ''\" (click)=\"config.controller.setup('OUT')\">OUT</ion-button>\r\n            <ion-button (click)=\"config.controller.read()\">READ</ion-button>\r\n        </ion-buttons>\r\n        <ion-buttons slot=\"end\">\r\n            <ion-button [color]=\"config.controller._mode == 'IN' ? 'primary' : ''\" (click)=\"config.controller.setup('IN')\">IN</ion-button>\r\n            <!-- <ion-toggle (click)=\"config.controller.toggle()\"></ion-toggle> -->\r\n            <ion-button [color]=\"config.controller._state == 'LOW' ? 'primary': ''\" (click)=\"config.controller.low()\">LOW</ion-button>\r\n            <ion-button [color]=\"config.controller._state == 'HIGH' ? 'primary': ''\" (click)=\"config.controller.high()\">HIGH</ion-button>\r\n        </ion-buttons>\r\n    </ng-template>\r\n  </ion-item>\r\n</ion-list>",
                styles: [""]
            }] }
];
/** @nocollapse */
TapGpioComponent.ctorParameters = () => [
    { type: CurrentDeviceService }
];
TapGpioComponent.propDecorators = {
    schema: [{ type: Input }],
    lines: [{ type: Input }]
};
if (false) {
    /** @type {?} */
    TapGpioComponent.prototype.schema;
    /** @type {?} */
    TapGpioComponent.prototype.lines;
    /** @type {?} */
    TapGpioComponent.prototype.pins;
    /** @type {?} */
    TapGpioComponent.prototype.tapService;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFwLWdwaW8uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vQGlvdGl6ZS9pb25pYy9ncGlvLyIsInNvdXJjZXMiOlsibGliL3RhcC1ncGlvLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUFVLE1BQU0sZUFBZSxDQUFDO0FBQ3pELE9BQU8sRUFBRSxv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