diff --git a/src/app/components/generic-calculator/calculator.component.ts b/src/app/components/generic-calculator/calculator.component.ts index e0977639ffddec1deb081027d2bdbe1e05828f4f..52de7313d4df5d76050195606ce26fb30cfdbf3f 100644 --- a/src/app/components/generic-calculator/calculator.component.ts +++ b/src/app/components/generic-calculator/calculator.component.ts @@ -26,7 +26,8 @@ import { Espece, VariatedDetails, ParallelStructure, - MacrorugoRemous + MacrorugoRemous, + Props } from "jalhyd"; import { generateValuesCombination, getUnformattedIthResult, getUnformattedIthValue } from "../../util/util"; @@ -1273,10 +1274,10 @@ export class GenericCalculatorComponent implements OnInit, DoCheck, AfterViewChe } public async generateBackwaterInPAM() { - const f: FormulaireDefinition = await this.formulaireService.createFormulaire(CalculatorType.MacrorugoRemous); - const mrr = (f.currentNub as MacrorugoRemous); - mrr.setPropValue("nubMacroRugo", this.formulaire.currentNub.uid); - mrr.syncSectionMacroRugo(); + const nub = Session.getInstance().createSessionNub( + new Props({ calcType: CalculatorType.MacrorugoRemous, nubMacroRugo: this.formulaire.currentNub.uid}) + ) as MacrorugoRemous; + const f: FormulaireDefinition = await this.formulaireService.createFormulaire(CalculatorType.MacrorugoRemous, nub); this.router.navigate(["/calculator", f.uid]); } diff --git a/src/app/formulaire/elements/select/select-field-target-pam.ts b/src/app/formulaire/elements/select/select-field-target-pam.ts index 3d0c09ad4c8a2d0be6febd2ce88cb4502623d3a4..6f2b380d2d140532c3b0b63ac1896d6d622f2060 100644 --- a/src/app/formulaire/elements/select/select-field-target-pam.ts +++ b/src/app/formulaire/elements/select/select-field-target-pam.ts @@ -4,12 +4,13 @@ import { CalculatorType, MacrorugoRemous, Message, MessageCode, Session } from " import { SelectField } from "./select-field"; import { FormulaireNode } from "../formulaire-node"; import { SelectEntry } from "./select-entry"; +import { VERSION } from "@angular/core"; // Courbe de remous dans une passe à macro-rugo. export class SelectFieldTargetPam extends SelectField { constructor(parent: FormulaireNode) { super(parent); - // this._associatedProperty = MacrorugoRemous.nubMacroRugo; + this._associatedProperty = "nubMacroRugo"; this._messageWhenEmpty = "INFO_MACRORUGOREMOUS_CREATE_PAM_FIRST"; } @@ -28,9 +29,9 @@ export class SelectFieldTargetPam extends SelectField { } protected initSelectedValue() { - const mrr = (this.nub as MacrorugoRemous).nubMacroRugo; - if (mrr !== undefined) { - this.setValueFromId(this._entriesBaseId + mrr.uid); + const MrUID = this.nub.getPropValue("nubMacroRugo") + if (MrUID !== undefined) { + this.setValueFromId(this._entriesBaseId + MrUID); } }