Skip to content
Snippets Groups Projects
Commit 0c6542ab authored by mathias.chouet's avatar mathias.chouet
Browse files

Bief

parent 6053d4cd
No related branches found
No related tags found
1 merge request!64Resolve "Ajout du module Bief"
[
{
"id": "fs_water_line",
"type": "fieldset",
"fields": [
{
"id": "select_regime",
"type": "select",
"source": "bief_regime"
}
]
},
{
"id": "fs_section",
"type": "fieldset",
"fields": [
{
"id": "select_section",
"type": "select",
"help": {
"SectionRectangle": "hsl/types_sections.html#section-rectangulaire",
"SectionCercle": "hsl/types_sections.html#section-circulaire",
"SectionTrapeze": "hsl/types_sections.html#section-trapezoidale",
"SectionPuissance": "hsl/types_sections.html#section-parabolique"
},
"source": "acsection_section"
},
"LargeurFond",
"Fruit",
"LargeurBerge",
"D",
"k"
]
},
{
"id": "fs_bief",
"type": "fieldset",
"fields": [
"Ks",
"Long",
"YB",
"ZF1",
"ZF2"
]
},
{
"id": "fs_condlim",
"type": "fieldset",
"fields": [
"Q",
"Z1",
"Z2"
]
},
{
"id": "fs_param_calc",
"type": "fieldset",
"fields": [
"Dx"
]
},
{
"type": "options",
"defaultNodeType": "SectionRectangle",
"defaultRegime": "Fluvial",
"sectionSourceId": "select_section",
"regimeSelectId": "select_regime",
"help": "hsl/bief.html"
}
]
\ No newline at end of file
{
"fs_water_line": "Type of water line",
"select_regime": "Regime",
"select_regime_0": "Fluvial",
"select_regime_1": "Torrential",
"fs_section": "Type of section",
"select_section": "Choice of section type",
"select_section_SectionTrapeze": "Trapezoidal",
"select_section_SectionRectangle": "Rectangular",
"select_section_SectionCercle": "Circular",
"select_section_SectionPuissance": "Parabolic",
"LargeurFond": "Width at bottom",
"Fruit": "Bank slope",
"D": "Diameter",
"k": "Coefficient",
"LargeurBerge": "Width at embankment level",
"fs_bief": "Reach features",
"Ks": "Strickler coefficient",
"Hs": "Head",
"Long": "Length of reach",
"YB": "Embankment elevation",
"fs_condlim": "Boundary conditions",
"Q": "Upstream flow",
"S": "Wet surface",
"fs_param_calc": "Calculation parameters",
"Dx": "Discretisation step",
"Z1": "Upstream water elevation",
"Z2": "Downstream water elevation",
"ZF1": "Upstream bottom elevation",
"ZF2": "Downstream bottom elevation"
}
\ No newline at end of file
{
"fs_water_line": "Type de ligne d'eau",
"select_regime": "Régime",
"select_regime_0": "Fluvial",
"select_regime_1": "Torrentiel",
"fs_section": "Type de section",
"select_section": "Choix du type de section",
"select_section_SectionTrapeze": "Trapézoïdale",
"select_section_SectionRectangle": "Rectangulaire",
"select_section_SectionCercle": "Circulaire",
"select_section_SectionPuissance": "Parabolique",
"LargeurFond": "Largeur au fond",
"Fruit": "Fruit des berges",
"D": "Diamètre",
"k": "Coefficient",
"LargeurBerge": "Largeur de berge",
"fs_bief": "Caractéristiques du bief",
"Ks": "Coefficient de Strickler",
"Hs": "Charge",
"Long": "Longueur du bief",
"YB": "Hauteur de berge",
"fs_condlim": "Conditions aux limites",
"Q": "Débit amont",
"S": "Surface mouillée",
"Dx": "Pas de discrétisation",
"fs_param_calc": "Paramètres de calcul",
"Z1": "Cote de l'eau à l'amont",
"Z2": "Cote de l'eau à l'aval",
"ZF1": "Cote du fond à l'amont",
"ZF2": "Cote du fond à l'aval"
}
\ No newline at end of file
......@@ -38,7 +38,7 @@
"path": "surface-libre.jpg",
"credits": "David Dorchies / Irstea"
},
"calculators": [ 2, 3, 4, 20 ]
"calculators": [ 2, 3, 4, 20, 21 ]
},
{
"name": "HYDRAULIQUE_EN_CHARGE",
......
import { IObservable, SectionNub, Session, BiefRegime } from "jalhyd";
import { FormDefSection } from "../form-def-section";
import { FieldSet } from "../../fieldset";
import { FormulaireBase } from "./form-base";
export class FormulaireBief extends FormulaireBase {
private _formSection: FormDefSection;
/** id du select configurant le régime */
private _regimeSelectId: string;
constructor() {
super();
this._formSection = new FormDefSection(this);
// default properties
this._props["regime"] = BiefRegime.Fluvial;
}
protected parseOptions(json: {}) {
super.parseOptions(json);
this._formSection.parseOptions(json);
// id du select configurant la méthode de résolution
this._regimeSelectId = this.getOption(json, "regimeSelectId");
}
public afterParseFieldset(fs: FieldSet) {
this._formSection.afterParseFieldset(fs);
// si le FieldSet contient le select de méthode de résolution
if (this._regimeSelectId) {
const sel = fs.getFormulaireNodeById(this._regimeSelectId);
if (sel) {
// on abonne le formulaire aux propriétés du FieldSet
fs.properties.addObserver(this);
}
}
}
// interface Observer
update(sender: IObservable, data: any) {
super.update(sender, data);
if (sender instanceof FieldSet && data.action === "propertyChange") {
switch (sender.id) {
case "fs_section":
// replace underlying section without replacing whole Nub
const newSect = Session.getInstance().createSection(data.value);
(this._currentNub as SectionNub).setSection(newSect);
// reflect changes in GUI
for (const fs of this.allFieldsets) {
// show / hide dependent fields
fs.updateFields();
}
this.reset();
break;
case "fs_water_line":
console.log("reset water line");
this.reset();
// Either Z1 or Z2 is calculable, depending on Regime
this.getFieldsetById("fs_condlim").updateFields();
break;
}
}
}
}
import {
CalculatorType,
ComputeNodeType,
ParamDefinition,
LCMaterial,
LoiDebit,
......@@ -10,6 +9,7 @@ import {
MethodeResolution,
GrilleType,
GrilleProfile,
BiefRegime,
} from "jalhyd";
import { FormulaireElement } from "./formulaire-element";
......@@ -254,6 +254,10 @@ export class FieldSet extends FormulaireElement implements Observer {
case "fs_grille": // Grille
this.setSelectValueFromProperty("select_grid_profile", "gridProfile");
break;
case "fs_water_line": // Bief
this.setSelectValueFromProperty("select_regime", "regime");
break;
}
}
......@@ -315,6 +319,7 @@ export class FieldSet extends FormulaireElement implements Observer {
this.setPropertyValueFromConfig(json, "defaultMaterial", "material", LCMaterial);
this.setPropertyValueFromConfig(json, "defaultGridProfile", "gridProfile", GrilleProfile);
this.setPropertyValueFromConfig(json, "defaultGridType", "gridType", GrilleType);
this.setPropertyValueFromConfig(json, "defaultRegime", "regime", BiefRegime);
this.setPropertyValueFromConfig(json, "varCalc", "varCalc");
this.updateFields();
......@@ -404,6 +409,9 @@ export class FieldSet extends FormulaireElement implements Observer {
case "select_grid_profile": // Grille
this.setPropValue("gridProfile", data.value.value);
break;
case "select_regime": // Bief
this.setPropValue("regime", data.value.value);
break;
}
break;
}
......
import { LechaptCalmon, acSection, CourbeRemous, Nub, ParallelStructure, StructureType, LoiDebit, GrilleType, GrilleProfile } from "jalhyd";
import {
BiefRegime,
LechaptCalmon,
acSection,
CourbeRemous,
Nub,
ParallelStructure,
StructureType,
LoiDebit,
GrilleType,
GrilleProfile
} from "jalhyd";
import { Field } from "./field";
import { SelectEntry } from "./select-entry";
......@@ -172,6 +183,11 @@ export class SelectField extends Field {
this.addEntry(new SelectEntry(this._entriesBaseId + GrilleProfile.Rectangular, GrilleProfile.Rectangular));
this.addEntry(new SelectEntry(this._entriesBaseId + GrilleProfile.Hydrodynamic, GrilleProfile.Hydrodynamic));
break;
case "bief_regime": // Bief: type de régime
this.addEntry(new SelectEntry(this._entriesBaseId + BiefRegime.Fluvial, BiefRegime.Fluvial));
this.addEntry(new SelectEntry(this._entriesBaseId + BiefRegime.Torrentiel, BiefRegime.Torrentiel));
break;
}
}
}
......@@ -38,6 +38,7 @@ import { FormulairePab } from "../formulaire/definition/concrete/form-pab";
import { FormulaireMacrorugoCompound } from "../formulaire/definition/concrete/form-macrorugo-compound";
import { FormulaireLechaptCalmon } from "../formulaire/definition/concrete/form-lechapt-calmon";
import { FormulaireGrille } from "../formulaire/definition/concrete/form-grille";
import { FormulaireBief } from "../formulaire/definition/concrete/form-bief";
@Injectable()
export class FormulaireService extends Observable {
......@@ -82,6 +83,7 @@ export class FormulaireService extends Observable {
this.calculatorPaths[CalculatorType.Jet] = "jet";
this.calculatorPaths[CalculatorType.Grille] = "grille";
this.calculatorPaths[CalculatorType.Pente] = "pente";
this.calculatorPaths[CalculatorType.Bief] = "bief";
}
private get _intlService(): I18nService {
......@@ -323,6 +325,10 @@ export class FormulaireService extends Observable {
f = new FormulaireGrille();
break;
case CalculatorType.Bief:
f = new FormulaireBief();
break;
default:
f = new FormulaireBase();
}
......
......@@ -62,6 +62,8 @@
"INFO_CALCULATOR_SAVE": "Save",
"INFO_CALCULATOR_USED_BY": "Used by",
"INFO_CALCULATOR_VALEURS": "Values",
"INFO_BIEF_TITRE_COURT": "Reach",
"INFO_BIEF_TITRE": "Up/downstream elevations of a reach",
"INFO_CLOISONS_TITRE_COURT": "Cross walls",
"INFO_CLOISONS_TITRE": "Fish ladder: Cross walls",
"INFO_CLOSE_DIALOGUE_DEPENDING_MODULES": "The following modules depend on the one you are closing:",
......
......@@ -62,6 +62,8 @@
"INFO_CALCULATOR_SAVE": "Enregistrer",
"INFO_CALCULATOR_USED_BY": "Utilisé par",
"INFO_CALCULATOR_VALEURS": "Valeurs",
"INFO_BIEF_TITRE_COURT": "Bief",
"INFO_BIEF_TITRE": "Cotes amont/aval d'un bief",
"INFO_CLOISONS_TITRE_COURT": "Cloisons",
"INFO_CLOISONS_TITRE": "Passe à bassins : Cloisons",
"INFO_CLOSE_DIALOGUE_DEPENDING_MODULES": "Les modules suivants dépendent de celui que vous êtes en train de fermer :",
......
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