112 lines
3.5 KiB
TypeScript
112 lines
3.5 KiB
TypeScript
|
// import { Component, OnInit, Input, Inject, DoCheck } from '@angular/core';
|
||
|
// import { Target } from '../../../target/model';
|
||
|
// import { MAT_DIALOG_DATA, MatSnackBar } from '@angular/material';
|
||
|
// import { Infra } from '../../../infra/model';
|
||
|
// import { MetaCrawler } from '../../../meta/crawler/model/MetaCrawler';
|
||
|
// import { MetaSensorDisplayItem } from '../../../meta/sensor-display-item/model/MetaSensorDisplayItem';
|
||
|
|
||
|
// import { Store, select } from '@ngrx/store';
|
||
|
// import { RPCClientError } from '@loafer/ng-rpc/protocol';
|
||
|
// import * as SensorItemKeyListStore from 'packages/sensor-item/store/key-list';
|
||
|
// import { ReadSensorItemKeySelector } from 'packages/sensor-item/store';
|
||
|
// import { MetaSensorItemKey } from '../../../meta/sensor-item-key/model/MetaSensorItemKey';
|
||
|
|
||
|
// @Component({
|
||
|
// selector: 'of-sensor-setting',
|
||
|
// templateUrl: './setting.component.html',
|
||
|
// styleUrls: ['./setting.component.scss']
|
||
|
// })
|
||
|
// export class SettingComponent implements OnInit, DoCheck {
|
||
|
|
||
|
// selectedTarget: Target = null;
|
||
|
// selectedCrawler: MetaCrawler = null;
|
||
|
// testPassed = false;
|
||
|
// selectedSensorDisplayItems: Set<MetaSensorDisplayItem> = null;
|
||
|
// step = 1;
|
||
|
// nextable = false;
|
||
|
// focus = 0;
|
||
|
// isAllSelectable = true;
|
||
|
|
||
|
// sensorItemKeys$ = this.keyListStore.pipe(select(ReadSensorItemKeySelector.select('list')));
|
||
|
|
||
|
// constructor(
|
||
|
// @Inject(MAT_DIALOG_DATA) public data: any,
|
||
|
// public snackBar: MatSnackBar,
|
||
|
// private keyListStore: Store<SensorItemKeyListStore.State>,
|
||
|
// ) {
|
||
|
// if (data !== null) {
|
||
|
// this.isAllSelectable = false;
|
||
|
// this.selectedTarget = data.infra.target;
|
||
|
// }
|
||
|
// }
|
||
|
|
||
|
// ngOnInit() {
|
||
|
// this.sensorItemKeys$.subscribe(
|
||
|
// (list: MetaSensorItemKey[]) => {
|
||
|
// if (list !== null) {
|
||
|
// console.log('#############################');
|
||
|
// console.log(list);
|
||
|
// console.log('#############################');
|
||
|
// }
|
||
|
// },
|
||
|
// (error: RPCClientError) => {
|
||
|
// console.log(error.response.message);
|
||
|
// }
|
||
|
// );
|
||
|
// }
|
||
|
|
||
|
// ngDoCheck() {
|
||
|
// if (
|
||
|
// this.selectedTarget === null ||
|
||
|
// this.selectedCrawler === null ||
|
||
|
// this.selectedSensorDisplayItems === null ||
|
||
|
// this.selectedSensorDisplayItems.size === 0 ||
|
||
|
// this.testPassed === false
|
||
|
// ) {
|
||
|
// this.nextable = false;
|
||
|
// } else {
|
||
|
// this.nextable = true;
|
||
|
// }
|
||
|
// }
|
||
|
|
||
|
// onNext() {
|
||
|
// this.step += 1;
|
||
|
// }
|
||
|
|
||
|
// onPrev() {
|
||
|
// this.step -= 1;
|
||
|
// }
|
||
|
|
||
|
// onDone() {
|
||
|
// this.openSnackBar('센서 등록해야되는데 아직 못함');
|
||
|
// // List<MetaSensorItemKey> SensorItemDependencyService.readAllByDisplayItem(MetaSensorDisplayItem displayItem)
|
||
|
// for (const displayItem of Array.from(this.selectedSensorDisplayItems)) {
|
||
|
// this.keyListStore.dispatch(new SensorItemKeyListStore.ReadAllByDisplayItem(displayItem));
|
||
|
// }
|
||
|
// // Sensor SensorService.registSensorConfig(Sensor sensor, List<SensorItem> sensorItemList, String etcJson)
|
||
|
// }
|
||
|
|
||
|
// openSnackBar(message: string) {
|
||
|
// this.snackBar.open(message, 'OK', {
|
||
|
// duration: 2000,
|
||
|
// });
|
||
|
// }
|
||
|
|
||
|
// handleTargetSelection(t: Target) {
|
||
|
// this.selectedTarget = t;
|
||
|
// }
|
||
|
// handleCrawlerSelection(c: MetaCrawler) {
|
||
|
// this.selectedCrawler = c;
|
||
|
// }
|
||
|
// handleItemSelection(itemSet: Set<MetaSensorDisplayItem>) {
|
||
|
// this.selectedSensorDisplayItems = itemSet;
|
||
|
// }
|
||
|
// handleTest(b: boolean) {
|
||
|
// this.testPassed = b;
|
||
|
// }
|
||
|
|
||
|
// onAreaClick(no: number) {
|
||
|
// this.focus = no;
|
||
|
// }
|
||
|
// }
|