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

feat: add MacroRugoRemous calculator definition

refs #609
parent e534eb43
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é"
Pipeline #150463 passed
......@@ -478,16 +478,19 @@ export abstract class FormulaireDefinition extends FormulaireNode implements Obs
// interface Observer
public update(sender: any, data: any) {
console.log("test")
if (sender instanceof Nub) {
switch (data.action) {
case "resultUpdated":
console.log("test 1");
// forward Nub results update notification to FormCompute objects
this.reaffectResultComponents();
break;
}
}
else if (sender instanceof SessionSettings) {
// reset results if a session setting (max iterations, compute precision) has been modified
console.log("test 2");
// reset results if a session setting (max iterations, compute precision) has bsseen modified
this.reset();
}
}
......
import { RemousResults } from "app/results/remous-results";
import { acSection, CourbeRemous, CourbeRemousParams, MacroRugo, MacrorugoRemous, Props, Result, Session } from "jalhyd";
import { MacrorugoRemousParams} from "jalhyd/build/internal_modules";
import { IObservable, MacrorugoRemousParams, Nub, Verificateur} from "jalhyd/build/internal_modules";
import { FormulaireFixedVar } from "./form-fixedvar";
import { SelectField } from "../elements/select/select-field";
export class FormulaireMacrorugoRemous extends FormulaireFixedVar {
public initNub(props?: Props) {
......@@ -14,8 +15,7 @@ export class FormulaireMacrorugoRemous extends FormulaireFixedVar {
}
}
if (pam !== undefined) {
// props.setPropValue(MacrorugoRemous.nubMacroRugo, pam.uid);
props.setPropValue("Q", pam.prms.Q.V);
props.setPropValue("nubMacroRugo", pam.uid);
}
return super.initNub(props);
}
......@@ -79,6 +79,33 @@ export class FormulaireMacrorugoRemous extends FormulaireFixedVar {
}
}
// interface Observer
// public update(sender: IObservable, data: any) {
// // copied from FormDefinition, to avoid calling super.update() that would trigger an unwanted this.refreshFieldsets();
// if (sender instanceof Nub) {
// switch (data.action) {
// case "resultUpdated":
// // forward Nub results update notification to FormCompute objects
// this.reaffectResultComponents();
// break;
// }
// }
// // copied from FormFixedVar, to avoid calling super.update()
// if (data.action === "propertyChange") {
// this.reset();
// }
// if (sender instanceof SelectField) {
// this.reset(); // reset results
// console.log("update", data.action)
// if (sender.id === "select_target_pam" && data.action === "select") {
// // update Verificateur property: Pass to check
// this._currentNub.setPropValue("nubToVerify", data.value ? data.value.value : undefined);
// }
// }
// }
public resetFormResults() {
this._remousResults.reset();
this.updateCalcResults();
......
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