Skip to content
Snippets Groups Projects
Commit 42c21f96 authored by AUBRY JEAN-PASCAL's avatar AUBRY JEAN-PASCAL
Browse files

fix: select the right pam when generate back water. Keep session state when a...

fix:  select the right pam when generate back water. Keep session state when a session is saved and loaded after.
Refs #650
parent 80927eb9
No related branches found
No related tags found
2 merge requests!252release: version 4.18.0,!247Resolve "MacrorugoRemous: erreur de sélection de la passe"
Pipeline #162519 passed
......@@ -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]);
}
......
......@@ -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";
}
......@@ -23,15 +24,19 @@ export class SelectFieldTargetPam extends SelectField {
);
for (const cn of macroForms) {
const calc = cn.calculatorName;
this.addEntry(this.createOrGetEntry(this._entriesBaseId + cn.uid, cn.uid, decodeHtml(calc)));
this.addEntry(this.createOrGetEntry(this._entriesBaseId + cn.uid, cn.uid, decodeHtml(calc)));7
}
}
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);
}
// const ntv = (this.nub as MacrorugoRemous).nubToVerify;
// if (ntv !== undefined) {
// this.setValueFromId(this._entriesBaseId + ntv.uid);
// }
}
public updateLocalisation() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment