diff --git a/src/app/components/generic-calculator/calculator.component.ts b/src/app/components/generic-calculator/calculator.component.ts index 735bc0f5ed04d5052c2cb108aba35d0b6dff7f5f..8aec6d7b541f5ca2cbd430ac1cabc91744c30801 100644 --- a/src/app/components/generic-calculator/calculator.component.ts +++ b/src/app/components/generic-calculator/calculator.component.ts @@ -1274,9 +1274,10 @@ export class GenericCalculatorComponent implements OnInit, DoCheck, AfterViewChe } public async generateBackwaterInPAM() { + console.log("generateBackwaterInPAM") const f: FormulaireDefinition = await this.formulaireService.createFormulaire(CalculatorType.MacrorugoRemous); const mrr = (f.currentNub as MacrorugoRemous); - // mrr.setPropValue(MacrorugoRemous._nubMacroRugo, this.formulaire.currentNub.uid); + mrr.setPropValue("nubMacroRugo", this.formulaire.currentNub.uid); mrr.syncSectionMacroRugo(); this.router.navigate(["/calculator", f.uid]); } diff --git a/src/app/formulaire/definition/form-macrorugo.ts b/src/app/formulaire/definition/form-macrorugo.ts new file mode 100644 index 0000000000000000000000000000000000000000..591a263100a49480520e793bb595b242841c57fe --- /dev/null +++ b/src/app/formulaire/definition/form-macrorugo.ts @@ -0,0 +1,50 @@ +import { RemousResults } from "app/results/remous-results"; +import { acSection, CourbeRemous, CourbeRemousParams, MacroRugo, MacrorugoRemous, Props, Result, Session } from "jalhyd"; +import { IObservable, MacrorugoRemousParams, Nub, Observer, Verificateur} from "jalhyd/build/internal_modules"; +import { FormulaireFixedVar } from "./form-fixedvar"; +import { SelectField } from "../elements/select/select-field"; +import { FallbackRegistry } from "@angular-devkit/core/src/experimental/jobs"; +import { FormulaireDefinition } from "./form-definition"; +import { FormulaireService } from "app/services/formulaire.service"; +import { ServiceFactory } from "app/services/service-factory"; +import { log } from "console"; +import { OnInit, DoCheck, AfterViewChecked, OnDestroy } from "@angular/core"; + +export class FormulaireMacrorugo extends FormulaireFixedVar { + + + /** résultats de courbes de remous */ + + constructor() { + super(); + this.updateCalcResults(); + } + + protected updateCalcResults() { + console.log(console.log("vurrent", this._currentNub)) + for (const n of Session.getInstance().getAllNubs()) { + if(n instanceof MacroRugo) { + console.log(n) + } + let pamRemous: MacrorugoRemous + if (n instanceof MacrorugoRemous) { + pamRemous = n; + console.log(pamRemous) + if (pamRemous !== undefined && this._currentNub !== undefined) { + const form = ServiceFactory.formulaireService.getFormulaireFromNubId(pamRemous.uid); + console.log(form) + form.reset() + } + } + } + } + protected reaffectResultComponents() { + // const ver: MacroRugo = (this.currentNub as MacroRugo); + this.updateCalcResults(); + } + + public resetFormResults() { + // this._verificateurResults.reset(); + this.updateCalcResults(); + } +} diff --git a/src/app/services/formulaire.service.ts b/src/app/services/formulaire.service.ts index 9078a93ab198e7cca860d91060b848a2b32f7d2a..1eb8e7571bccb005daa2ab0782d8dfb6e11abcd5 100644 --- a/src/app/services/formulaire.service.ts +++ b/src/app/services/formulaire.service.ts @@ -60,6 +60,7 @@ import { ServiceFactory } from "./service-factory"; import { FormulairePressureLoss } from "app/formulaire/definition/form-pressureloss"; import { getNubResultUnit } from "jalhyd"; import { FormulaireMacrorugoRemous } from "app/formulaire/definition/form-macrorugo-remous"; +import { FormulaireMacrorugo } from "app/formulaire/definition/form-macrorugo"; @Injectable() export class FormulaireService extends Observable { @@ -349,6 +350,11 @@ export class FormulaireService extends Observable { f = new FormulaireMacrorugoRemous(); break; + + case CalculatorType.MacroRugo: + f = new FormulaireMacrorugo(); + break; + default: f = new FormulaireFixedVar(); }