Skip to content
Snippets Groups Projects
Commit ea948a50 authored by François Grand's avatar François Grand Committed by AUBRY JEAN-PASCAL
Browse files

feat: MacroRugoRemous calculator: add target rock-ramp fishpass select

refs #609
parent 76f96082
No related branches found
No related tags found
2 merge requests!252release: version 4.18.0,!213Resolve "Ajout du module courbe de remous d'une passe à macro-rugosité"
......@@ -11,6 +11,7 @@ import { SelectFieldSearchedParam } from "./select-field-searched-param";
import { SelectFieldSpeciesList } from "./select-field-species-list";
import { SelectFieldTargetPass } from "./select-field-target-pass";
import { SelectFieldNubProperty } from "./select-field-nub-prop";
import { SelectFieldTargetPam } from "./select-field-target-pam";
export class SelectFieldFactory {
/**
......@@ -57,6 +58,9 @@ export class SelectFieldFactory {
case "select_upstream_basin":
return new SelectFieldUpstreamBasin(parent);
case "select_target_pam":
return new SelectFieldTargetPam(parent);
case "select_divingjetsupported":
case "select_gridprofile":
case "select_gridtype":
......
import { ServiceFactory } from "app/services/service-factory";
import { decodeHtml } from "../../../util/util";
import { CalculatorType, MacroRugoRemous } from "jalhyd";
import { SelectField } from "./select-field";
import { FormulaireNode } from "../formulaire-node";
// Courbe de remous dans une passe à macro-rugo.
export class SelectFieldTargetPam extends SelectField {
constructor(parent: FormulaireNode) {
super(parent);
this._associatedProperty = "nubMacroRugo";
}
protected populate() {
const fs = ServiceFactory.formulaireService;
// find all rock-ramp fishpass forms
const macroForms: any[] = fs.formulaires.filter((element, index, self) =>
element.calculatorType === CalculatorType.MacroRugo
);
for (const cn of macroForms) {
const calc = cn.calculatorName;
this.addEntry(this.createOrGetEntry(this._entriesBaseId + cn.uid, cn.uid, decodeHtml(calc)));
}
}
protected initSelectedValue() {
const mrr = (this.nub as MacroRugoRemous).nubMacroRugo;
if (mrr !== undefined) {
this.setValueFromId(this._entriesBaseId + mrr.uid);
}
}
public updateLocalisation() {
// do not override localisation done in populate()
// ie. avoid what is done by SelectField.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