diff --git a/src/app/calculators/remous/remous.config.json b/src/app/calculators/remous/remous.config.json index 8fcdf1c4d171b8d9293ff1c1c96ae76a11d172f0..f7ea148e2f859ebe9fbaab5c0aab4706f9c47e5b 100644 --- a/src/app/calculators/remous/remous.config.json +++ b/src/app/calculators/remous/remous.config.json @@ -7,96 +7,43 @@ { "id": "select_section", "type": "select", - "select": [ - { - "id": "select_section_trapez", - "enum": "ComputeNodeType.SectionTrapeze" - }, - { - "id": "select_section_rect", - "enum": "ComputeNodeType.SectionRectangle" - }, - { - "id": "select_section_circ", - "enum": "ComputeNodeType.SectionCercle" - }, - { - "id": "select_section_puiss", - "enum": "ComputeNodeType.SectionPuissance" - } - ] + "source": "acsection_available_sections" }, { "type": "input", "id": "LargeurFond", "nodeType": "SectionTrapeze", - "unit": "m", - "dep_exist": [ - { - "refid": "select_section", - "refvalue": "select_section_trapez" - } - ] + "unit": "m" }, { "type": "input", "id": "Fruit", "nodeType": "SectionTrapeze", - "unit": "m/m", - "dep_exist": [ - { - "refid": "select_section", - "refvalue": "select_section_trapez" - } - ] + "unit": "m/m" }, { "type": "input", "id": "LargeurBerge", "nodeType": "SectionRectangle", - "unit": "m", - "dep_exist": [ - { - "refid": "select_section", - "refvalue": "select_section_rect" - } - ] + "unit": "m" }, { "type": "input", "id": "D", "nodeType": "SectionCercle", - "unit": "m", - "dep_exist": [ - { - "refid": "select_section", - "refvalue": "select_section_circ" - } - ] + "unit": "m" }, { "type": "input", "id": "k", "nodeType": "SectionPuissance", - "unit": "", - "dep_exist": [ - { - "refid": "select_section", - "refvalue": "select_section_puiss" - } - ] + "unit": "" }, { "type": "input", "id": "LargeurBerge", "nodeType": "SectionPuissance", - "unit": "m", - "dep_exist": [ - { - "refid": "select_section", - "refvalue": "select_section_puiss" - } - ] + "unit": "m" } ] }, @@ -166,20 +113,7 @@ { "id": "select_resolution", "type": "select", - "select": [ - { - "id": "select_resolution_trap", - "enum": "MethodeResolution.Trapezes" - }, - { - "id": "select_resolution_rk4", - "enum": "MethodeResolution.RungeKutta4" - }, - { - "id": "select_resolution_euler", - "enum": "MethodeResolution.EulerExplicite" - } - ] + "source": "remous_methode_resolution" } ] }, @@ -190,71 +124,7 @@ { "id": "select_target", "type": "select", - "select": [ - { - "id": "select_target_none" - }, - { - "id": "select_target_Hs", - "value": "Hs" - }, - { - "id": "select_target_Hsc", - "value": "Hsc" - }, - { - "id": "select_target_B", - "value": "B" - }, - { - "id": "select_target_P", - "value": "P" - }, - { - "id": "select_target_S", - "value": "S" - }, - { - "id": "select_target_R", - "value": "R" - }, - { - "id": "select_target_V", - "value": "V" - }, - { - "id": "select_target_Fr", - "value": "Fr" - }, - { - "id": "select_target_Yf", - "value": "Yf" - }, - { - "id": "select_target_Yt", - "value": "Yt" - }, - { - "id": "select_target_Yco", - "value": "Yco" - }, - { - "id": "select_target_J", - "value": "J" - }, - { - "id": "select_target_I-J", - "value": "I-J" - }, - { - "id": "select_target_Imp", - "value": "Imp" - }, - { - "id": "select_target_Tau0", - "value": "Tau0" - } - ] + "source": "remous_target" } ] }, diff --git a/src/app/formulaire/definition/concrete/form-courbe-remous.ts b/src/app/formulaire/definition/concrete/form-courbe-remous.ts index 319f155d20a9b066f38f2e5758e866410990b927..dad046d4cbfda50bf62fc6168d96175acf8fb338 100644 --- a/src/app/formulaire/definition/concrete/form-courbe-remous.ts +++ b/src/app/formulaire/definition/concrete/form-courbe-remous.ts @@ -25,7 +25,7 @@ export class FormulaireCourbeRemous extends FormulaireBase { this._formCompute = new FormComputeCourbeRemous(this, this._formSection, (this._formResult as FormResultRemous)); // default properties this._props["methodeResolution"] = MethodeResolution.Trapezes; - this._props["varCalc"] = undefined; // important + this._props["varCalc"] = ""; // important } protected parseOptions(json: {}) { diff --git a/src/app/formulaire/select-field.ts b/src/app/formulaire/select-field.ts index 22fe8775c624dc3459d22f8952336a418ac7bc46..6f98a6419e403c7b3f1f2562fcf36f99f5e18dac 100644 --- a/src/app/formulaire/select-field.ts +++ b/src/app/formulaire/select-field.ts @@ -1,4 +1,4 @@ -import { LechaptCalmon, acSection } from "jalhyd"; +import { LechaptCalmon, acSection, CourbeRemous } from "jalhyd"; import { Field } from "./field"; import { SelectEntry } from "./select-entry"; @@ -128,7 +128,21 @@ export class SelectField extends Field { case "acsection_available_sections": for (const sec of acSection.availableSectionTypes) { const e: SelectEntry = new SelectEntry("select_section_" + sec.id, sec.value); - console.log(">> adding entry", e); + this.addEntry(e); + } + break; + + case "remous_methode_resolution": + for (const mr of CourbeRemous.availableMethodeResolution) { + const e: SelectEntry = new SelectEntry("select_resolution_" + mr.id, mr.value); + this.addEntry(e); + } + break; + + case "remous_target": + this.addEntry(new SelectEntry("select_target_none", "")); + for (const at of CourbeRemous.availableTargets) { + const e: SelectEntry = new SelectEntry("select_target_" + at, at); this.addEntry(e); } break;