import { Component, Input } from '@angular/core';
import { CurrentDeviceService } from '@iotize/ionic';
import { TapGPIOController } from './tap-extension';
import * as i0 from "@angular/core";
import * as i1 from "@iotize/ionic";
import * as i2 from "@ionic/angular";
import * as i3 from "@angular/common";
export class TapGpioComponent {
    constructor(tapService) {
        this.tapService = tapService;
        this.schema = [];
        this.lines = 'full';
        this.pins = this.schema.map((entry) => {
            if (entry.pin.type === 'GPIO') {
                entry.controller = new TapGPIOController(this.tap, entry.pin);
            }
            return entry;
        });
    }
    get tap() {
        return this.tapService.tap;
    }
}
/** @nocollapse */ /** @nocollapse */ TapGpioComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TapGpioComponent, deps: [{ token: i1.CurrentDeviceService }], target: i0.ɵɵFactoryTarget.Component });
/** @nocollapse */ /** @nocollapse */ TapGpioComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: TapGpioComponent, selector: "tap-gpio", inputs: { schema: "schema", lines: "lines" }, ngImport: i0, template: "<ion-list [lines]=\"lines\">\n  <ion-item *ngFor=\"let config of pins\">\n    <ng-template [ngIf]=\"config.pin.type == 'GROUND'\" #ground>\n      <span slot=\"start\">{{ config.num }}</span>\n      <ion-label>\n        <span slot=\"start\">{{ config.pin.type }}</span>\n      </ion-label>\n    </ng-template>\n    <ng-template [ngIf]=\"config.pin.type == 'POWER'\" #power>\n      <span slot=\"start\">{{ config.num }}</span>\n      <span slot=\"start\">{{ config.pin.type }}</span>\n      <ion-label>\n        <span slot=\"start\">{{ config.power }}V</span>\n      </ion-label>\n    </ng-template>\n    <ng-template [ngIf]=\"config.pin.type == 'DISABLED'\" #disabledpin>\n      <span slot=\"start\">{{ config.num }}</span>\n      <ion-label>\n        <span slot=\"start\">{{ config.pin.type }}</span>\n      </ion-label>\n    </ng-template>\n    <ng-template [ngIf]=\"config.pin.type == 'GPIO'\" #gpio>\n      <span slot=\"start\">{{ config.num }}</span>\n      <span slot=\"start\">{{ config.pin.type }} {{ config.pin.num }}</span>\n      <ion-label>\n        {{ config.title }}\n      </ion-label>\n      <ion-buttons slot=\"end\">\n        <ion-button\n          [color]=\"config.controller._mode == 'OUT' ? 'primary' : ''\"\n          (click)=\"config.controller.setup('OUT')\"\n          >OUT</ion-button\n        >\n        <ion-button (click)=\"config.controller.read()\">READ</ion-button>\n      </ion-buttons>\n      <ion-buttons slot=\"end\">\n        <ion-button\n          [color]=\"config.controller._mode == 'IN' ? 'primary' : ''\"\n          (click)=\"config.controller.setup('IN')\"\n          >IN</ion-button\n        >\n        <!-- <ion-toggle (click)=\"config.controller.toggle()\"></ion-toggle> -->\n        <ion-button\n          [color]=\"config.controller._state == 'LOW' ? 'primary' : ''\"\n          (click)=\"config.controller.low()\"\n          >LOW</ion-button\n        >\n        <ion-button\n          [color]=\"config.controller._state == 'HIGH' ? 'primary' : ''\"\n          (click)=\"config.controller.high()\"\n          >HIGH</ion-button\n        >\n      </ion-buttons>\n    </ng-template>\n  </ion-item>\n</ion-list>\n", styles: [""], components: [{ type: i2.IonList, selector: "ion-list", inputs: ["inset", "lines", "mode"] }, { type: i2.IonItem, selector: "ion-item", inputs: ["button", "color", "counter", "detail", "detailIcon", "disabled", "download", "fill", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "shape", "target", "type"] }, { type: i2.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { type: i2.IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { type: i2.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }], directives: [{ type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TapGpioComponent, decorators: [{
            type: Component,
            args: [{ selector: 'tap-gpio', template: "<ion-list [lines]=\"lines\">\n  <ion-item *ngFor=\"let config of pins\">\n    <ng-template [ngIf]=\"config.pin.type == 'GROUND'\" #ground>\n      <span slot=\"start\">{{ config.num }}</span>\n      <ion-label>\n        <span slot=\"start\">{{ config.pin.type }}</span>\n      </ion-label>\n    </ng-template>\n    <ng-template [ngIf]=\"config.pin.type == 'POWER'\" #power>\n      <span slot=\"start\">{{ config.num }}</span>\n      <span slot=\"start\">{{ config.pin.type }}</span>\n      <ion-label>\n        <span slot=\"start\">{{ config.power }}V</span>\n      </ion-label>\n    </ng-template>\n    <ng-template [ngIf]=\"config.pin.type == 'DISABLED'\" #disabledpin>\n      <span slot=\"start\">{{ config.num }}</span>\n      <ion-label>\n        <span slot=\"start\">{{ config.pin.type }}</span>\n      </ion-label>\n    </ng-template>\n    <ng-template [ngIf]=\"config.pin.type == 'GPIO'\" #gpio>\n      <span slot=\"start\">{{ config.num }}</span>\n      <span slot=\"start\">{{ config.pin.type }} {{ config.pin.num }}</span>\n      <ion-label>\n        {{ config.title }}\n      </ion-label>\n      <ion-buttons slot=\"end\">\n        <ion-button\n          [color]=\"config.controller._mode == 'OUT' ? 'primary' : ''\"\n          (click)=\"config.controller.setup('OUT')\"\n          >OUT</ion-button\n        >\n        <ion-button (click)=\"config.controller.read()\">READ</ion-button>\n      </ion-buttons>\n      <ion-buttons slot=\"end\">\n        <ion-button\n          [color]=\"config.controller._mode == 'IN' ? 'primary' : ''\"\n          (click)=\"config.controller.setup('IN')\"\n          >IN</ion-button\n        >\n        <!-- <ion-toggle (click)=\"config.controller.toggle()\"></ion-toggle> -->\n        <ion-button\n          [color]=\"config.controller._state == 'LOW' ? 'primary' : ''\"\n          (click)=\"config.controller.low()\"\n          >LOW</ion-button\n        >\n        <ion-button\n          [color]=\"config.controller._state == 'HIGH' ? 'primary' : ''\"\n          (click)=\"config.controller.high()\"\n          >HIGH</ion-button\n        >\n      </ion-buttons>\n    </ng-template>\n  </ion-item>\n</ion-list>\n", styles: [""] }]
        }], ctorParameters: function () { return [{ type: i1.CurrentDeviceService }]; }, propDecorators: { schema: [{
                type: Input
            }], lines: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64, 