diff --git a/src/app/app.component.html b/src/app/app.component.html index 4c6d0759d158345ef9680c1b2140dda137028f4e..a2dd2cf0e9b4c2f6ef118cbdeb36d9753db05e23 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -80,11 +80,11 @@ <main> <div class="container-fluid"> - <cond-distri *ngIf="isDisplayCondDistri()"></cond-distri> - <lechapt-calmon *ngIf="isDisplayLechaptCalmon()"></lechapt-calmon> - <regime-uniforme *ngIf="isDisplayRegimeUnif()"></regime-uniforme> - <section-param *ngIf="isDisplaySectionParam()"></section-param> - <courbe-remous *ngIf="isDisplayCourbeRemous()"></courbe-remous> + <hydrocalc type="ConduiteDistributrice" *ngIf="isDisplayCondDistri()"></hydrocalc> + <hydrocalc type="LechaptCalmon" *ngIf="isDisplayLechaptCalmon()"></hydrocalc> + <hydrocalc type="RegimeUniforme" *ngIf="isDisplayRegimeUnif()"></hydrocalc> + <hydrocalc type="SectionParametree" *ngIf="isDisplaySectionParam()"></hydrocalc> + <hydrocalc type="CourbeRemous" *ngIf="isDisplayCourbeRemous()"></hydrocalc> </div> </main> diff --git a/src/app/app.module.ts b/src/app/app.module.ts index f8388efc5d21b13ebd1fce97e28cc6a32bd77efe..4f3a51f91e8d1bb8e76977e08884537dd0e2ebdd 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -13,11 +13,6 @@ import { FieldSetComponent } from './components/field-set/field-set.component'; import { ParamFieldLineComponent } from './components/param-field-line/param-field-line.component'; import { SelectFieldLineComponent } from './components/select-field-line/select-field-line.component'; import { CheckFieldLineComponent } from './components/check-field-line/check-field-line.component'; -import { CondDistriComponent } from './calculators/cond_distri/conddistri.component'; -import { LechaptCalmonComponent } from './calculators/lechapt-calmon/lechaptcalmon.component'; -import { SectionParametreeComponent } from './calculators/section-param/section-param.component'; -import { RegimeUniformeComponent } from './calculators/regime-uniforme/regime-uniforme.component'; -import { CourbeRemousComponent } from './calculators/remous/remous.component'; // import { AlertDialog } from './components/alert-dialog/alert-dialog.component'; import { AppErrorModule } from './error.module'; import { CalculatorResultsComponent } from './components/calculator-results/calculator-results.component'; @@ -46,7 +41,7 @@ import { LogComponent } from './components/log/log.component'; FieldSetComponent, ParamFieldLineComponent, SelectFieldLineComponent, CheckFieldLineComponent, LogComponent, - CondDistriComponent, LechaptCalmonComponent, SectionParametreeComponent, GenericCalculatorComponent, RegimeUniformeComponent, CourbeRemousComponent, + GenericCalculatorComponent, // AlertDialog, CalculatorResultsComponent, SectionResultsComponent, RemousResultsComponent, CalcCanvasComponent, SectionCanvasComponent diff --git a/src/app/calculators/cond_distri/conddistri.component.html b/src/app/calculators/cond_distri/conddistri.component.html deleted file mode 100644 index b6224435e12412b7ba7a51f4cbbc876eeab6b0a2..0000000000000000000000000000000000000000 --- a/src/app/calculators/cond_distri/conddistri.component.html +++ /dev/null @@ -1,6 +0,0 @@ -<div class="row"> - <div class="col"> - <h1>{{uitextTitre}}</h1> - </div> -</div> -<hydrocalc type="ConduiteDistributrice"></hydrocalc> \ No newline at end of file diff --git a/src/app/calculators/cond_distri/conddistri.component.ts b/src/app/calculators/cond_distri/conddistri.component.ts deleted file mode 100644 index d9605a1535ad328e3b231e0b39ac05cc361bbb01..0000000000000000000000000000000000000000 --- a/src/app/calculators/cond_distri/conddistri.component.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Component } from '@angular/core'; - -import { InternationalisationService } from '../../services/internationalisation/internationalisation.service'; - -@Component({ - selector: 'cond-distri', - templateUrl: "./conddistri.component.html" -}) -export class CondDistriComponent { - private get uitextTitre() { - return this.intlService.localizeText("INFO_CONDDISTRI_TITRE") - } - - constructor(private intlService: InternationalisationService) { - } -} diff --git a/src/app/calculators/generic/calculator.component.html b/src/app/calculators/generic/calculator.component.html index c430304b047fbf3c97cd04738eadd19c2a743397..ffc9d4aec8abf7a99f2b37aa820af31968c5b717 100644 --- a/src/app/calculators/generic/calculator.component.html +++ b/src/app/calculators/generic/calculator.component.html @@ -1,3 +1,8 @@ +<div class="row"> + <div class="col"> + <h1>{{uitextTitre}}</h1> + </div> +</div> <field-set *ngFor="let fs of fieldSets" [style.display]="getFieldsetStyleDisplay(fs.id)" [formId]=_formulaire.uid [id]=fs.id [fieldSet]=fs (onRadio)=onRadioClick($event) (onSelectChange)=onSelectChanged($event)></field-set> diff --git a/src/app/calculators/generic/calculator.component.ts b/src/app/calculators/generic/calculator.component.ts index 7f92cc8f5c2a949f43737bf9f2f68a169c64d7f3..48dddaea7b12d278fbc9cbc779c2dabf7e8bc97d 100644 --- a/src/app/calculators/generic/calculator.component.ts +++ b/src/app/calculators/generic/calculator.component.ts @@ -100,6 +100,28 @@ export class GenericCalculatorComponent implements OnInit, DoCheck, Observer { return this._formulaire.getFieldSets(this._nodeType); } + private get uitextTitre() { + switch (this._calculatorType) { + case CalculatorType.ConduiteDistributrice: + return this.intlService.localizeText("INFO_CONDDISTRI_TITRE"); + + case CalculatorType.LechaptCalmon: + return this.intlService.localizeText("INFO_LECHAPT_TITRE"); + + case CalculatorType.RegimeUniforme: + return this.intlService.localizeText("INFO_REGUNI_TITRE"); + + case CalculatorType.SectionParametree: + return this.intlService.localizeText("INFO_SECTPARAM_TITRE"); + + case CalculatorType.CourbeRemous: + return this.intlService.localizeText("INFO_REMOUS_TITRE") + + default: + return "Invalid calculator type " + this._calculatorType; + } + } + private get uitextCalculer() { return this.intlService.localizeText("INFO_CALCULATOR_CALCULER"); } diff --git a/src/app/calculators/lechapt-calmon/lechaptcalmon.component.html b/src/app/calculators/lechapt-calmon/lechaptcalmon.component.html deleted file mode 100644 index 7f6cabebe7f385e1da546373b26d7f749d488844..0000000000000000000000000000000000000000 --- a/src/app/calculators/lechapt-calmon/lechaptcalmon.component.html +++ /dev/null @@ -1,6 +0,0 @@ -<div class="row"> - <div class="col"> - <h1>{{uitextTitre}}</h1> - </div> -</div> -<hydrocalc type="LechaptCalmon"></hydrocalc> \ No newline at end of file diff --git a/src/app/calculators/lechapt-calmon/lechaptcalmon.component.ts b/src/app/calculators/lechapt-calmon/lechaptcalmon.component.ts deleted file mode 100644 index af8ee271eff7ba9265858199336971d0d36c3411..0000000000000000000000000000000000000000 --- a/src/app/calculators/lechapt-calmon/lechaptcalmon.component.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Component } from '@angular/core'; - -import { InternationalisationService } from '../../services/internationalisation/internationalisation.service'; - -@Component({ - selector: 'lechapt-calmon', - templateUrl: "./lechaptcalmon.component.html" -}) -export class LechaptCalmonComponent { - private get uitextTitre() { - return this.intlService.localizeText("INFO_LECHAPT_TITRE") - } - - constructor(private intlService: InternationalisationService) { - } -} diff --git a/src/app/calculators/regime-uniforme/regime-uniforme.component.html b/src/app/calculators/regime-uniforme/regime-uniforme.component.html deleted file mode 100644 index 530b56067f378bf79d3cc30833f22af936647758..0000000000000000000000000000000000000000 --- a/src/app/calculators/regime-uniforme/regime-uniforme.component.html +++ /dev/null @@ -1,6 +0,0 @@ -<div class="row"> - <div class="col"> - <h1>{{uitextTitre}}</h1> - </div> -</div> -<hydrocalc type="RegimeUniforme"></hydrocalc> \ No newline at end of file diff --git a/src/app/calculators/regime-uniforme/regime-uniforme.component.ts b/src/app/calculators/regime-uniforme/regime-uniforme.component.ts deleted file mode 100644 index 5881e400346c043751016a210bfe52b678c7b323..0000000000000000000000000000000000000000 --- a/src/app/calculators/regime-uniforme/regime-uniforme.component.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Component } from '@angular/core'; - -import { InternationalisationService } from '../../services/internationalisation/internationalisation.service'; - -@Component({ - selector: 'regime-uniforme', - templateUrl: "./regime-uniforme.component.html" -}) -export class RegimeUniformeComponent { - private get uitextTitre() { - return this.intlService.localizeText("INFO_REGUNI_TITRE") - } - - constructor(private intlService: InternationalisationService) { - } -} diff --git a/src/app/calculators/remous/remous.component.html b/src/app/calculators/remous/remous.component.html deleted file mode 100644 index 657c5484f76e3d9d220cd8bb43b3b2a68c77abdd..0000000000000000000000000000000000000000 --- a/src/app/calculators/remous/remous.component.html +++ /dev/null @@ -1,6 +0,0 @@ -<div class="row"> - <div class="col"> - <h1>{{uitextTitre}}</h1> - </div> -</div> -<hydrocalc type="CourbeRemous"></hydrocalc> \ No newline at end of file diff --git a/src/app/calculators/remous/remous.component.ts b/src/app/calculators/remous/remous.component.ts deleted file mode 100644 index 680163d204fb4e2b230e1a1767197856f3a0f148..0000000000000000000000000000000000000000 --- a/src/app/calculators/remous/remous.component.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Component } from '@angular/core'; - -import { InternationalisationService } from '../../services/internationalisation/internationalisation.service'; - -@Component({ - selector: 'courbe-remous', - templateUrl: "./remous.component.html" -}) -export class CourbeRemousComponent { - private get uitextTitre() { - return this.intlService.localizeText("INFO_REMOUS_TITRE") - } - - constructor(private intlService: InternationalisationService) { - } -} diff --git a/src/app/calculators/section-param/section-param.component.html b/src/app/calculators/section-param/section-param.component.html deleted file mode 100644 index 96828c6cbb528a6276f9ef962f314a2d9a598967..0000000000000000000000000000000000000000 --- a/src/app/calculators/section-param/section-param.component.html +++ /dev/null @@ -1,6 +0,0 @@ -<div class="row"> - <div class="col"> - <h1>{{uitextTitre}}</h1> - </div> -</div> -<hydrocalc type="SectionParametree"></hydrocalc> \ No newline at end of file diff --git a/src/app/calculators/section-param/section-param.component.ts b/src/app/calculators/section-param/section-param.component.ts deleted file mode 100644 index 013aa594064b3521baff1b32ef697e07a21c8fa8..0000000000000000000000000000000000000000 --- a/src/app/calculators/section-param/section-param.component.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Component } from '@angular/core'; - -import { InternationalisationService } from '../../services/internationalisation/internationalisation.service'; - -@Component({ - selector: 'section-param', - templateUrl: "./section-param.component.html" -}) -export class SectionParametreeComponent { - private get uitextTitre() { - return this.intlService.localizeText("INFO_SECTPARAM_TITRE") - } - - constructor(private intlService: InternationalisationService) { - } -}