| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- import {Component, ViewRef} from '@angular/core';
- import {HsLayoutService, HsPanelBaseComponent} from 'hslayers-ng';
- import {AdjusterPresetsService} from '../adjuster-presets.service';
- import {AdjusterService} from '../adjuster.service';
- @Component({
- selector: 'pra-adjuster-advanced',
- templateUrl: './adjuster-advanced-panel.component.html',
- styleUrls: ['./adjuster-advanced-panel.component.scss'],
- })
- export class AdjusterAdvancedPanelComponent extends HsPanelBaseComponent {
- name = 'adjuster-advanced';
- data: any;
- errorMsg: string;
- //method: string;
- showAdvancedOptions = false;
- viewRef: ViewRef;
- constructor(
- public adjusterService: AdjusterService,
- public adjusterPresetsService: AdjusterPresetsService,
- public hsLayoutService: HsLayoutService
- ) {
- super(hsLayoutService);
- //this.descriptionVisible = false;
- //this.method = this.adjusterService.method;
- /*this.adjusterEventService.loaded.subscribe(({success, err}) => {
- if (!success) {
- this.errorMsg = err.message;
- }
- });*/
- }
- hasDatasets(factor): boolean {
- return factor.datasets.length > 0;
- }
- getLabelInCurrentLang(labels) {
- return this.adjusterPresetsService.getLabelInCurrentLang(labels);
- }
- isVisible(): boolean {
- return this.hsLayoutService.panelVisible('adjuster-advanced');
- }
- noDataSelected(): boolean {
- if (this.adjusterService.factors.length === 0) {
- return true;
- }
- let datasetsEffectivelyTurnedOn = [];
- for (const factor of this.adjusterService.factors) {
- if (factor.weight === 0) {
- continue;
- }
- datasetsEffectivelyTurnedOn = [
- ...datasetsEffectivelyTurnedOn,
- ...factor.datasets.filter((ds) => ds.included),
- ];
- }
- return datasetsEffectivelyTurnedOn.length === 0;
- }
- noOperationSelected(): boolean {
- return (
- !this.adjusterService.allowIndex && !this.adjusterService.allowClusters
- );
- }
- /*selectMethod(): void {
- this.adjusterService.method = this.method;
- this.adjusterEventService.methodChanged.next(this.method);
- }*/
- }
|