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

Fix #289 - add Grille module

parent 0bae2c0c
No related branches found
No related tags found
1 merge request!61Resolve "Ajout du module Grille"
Showing
with 366 additions and 54 deletions
master
114-ajout-du-module-devalaison-pertes-de-charge-grille-de-prise-d-eau
[
{
"id": "fs_section",
"type": "fieldset",
"fields": [ "QMax", "CRad", "CEau", "CSomGrille", "B" ]
},
{
"id": "fs_plan",
"type": "fieldset",
"defaultGridType": "Conventional",
"fields": [
{
"id": "select_grid_type",
"type": "select",
"source": "grille_type"
},
"Beta",
"Alpha"
]
},
{
"id": "fs_grille",
"type": "fieldset",
"defaultGridProfile": "Rectangular",
"fields": [
{
"id": "select_grid_profile",
"type": "select",
"source": "grille_profile"
},
"b",
"p",
"e",
"O",
"OEntH",
"cIncl"
]
},
{
"type": "options",
"gridTypeSelectId": "select_grid_type",
"gridProfileSelectId": "select_grid_profile",
"help": "devalaison/grille"
}
]
\ No newline at end of file
{
"fs_section": "Grid plan section characteristics",
"fs_plan": "Grid plan characteristics",
"fs_grille": "Grid characteristics",
"QMax": "Maximum turbined flow",
"CRad": "Bottom elevation (grid foot)",
"CEau": "Water level",
"CSomGrille": "Grid plan submerged top elevation",
"B": "Section width",
"Beta": "Horizontal angle",
"Alpha": "Angle towards flow direction",
"b": "Bars thickness",
"p": "Bars depth",
"e": "Free space between bars",
"O": "Global obstruction of grid plan",
"OEntH": "Effective obstruction due to spacers and transversal elements",
"cIncl": "Average shape coefficient of spacers and transversal elements",
"select_grid_type": "Grid type",
"select_grid_profile": "Bars profile",
"H": "Water height",
"HG": "Grid height",
"S": "Water intake approach section",
"SPDG": "Grid plan approach section",
"VA": "Mean approach speed for maximum turbined flow",
"VAPDG": "Mean approach speed for maximum turbined flow, substracting the potentially stoppered upper part",
"LG": "Submerged grid length",
"D": "Longitudinal distance between emerging point of grid plan and grid foot",
"DG": "Longitudinal distance between submerged top and grid foot",
"SG": "Submerged grid surface",
"VN": "Average normal speed for maximum turbined flow",
"RFB": "Bars shape ratio",
"REEB": "Bars spacing/thickness ratio",
"OB": "Obstruction due to bars only",
"DH00": "Loss of charge - clogging rate 0%",
"DH05": "Loss of charge - clogging rate 5%",
"DH10": "Loss of charge - clogging rate 10%",
"DH15": "Loss of charge - clogging rate 15%",
"DH20": "Loss of charge - clogging rate 20%",
"DH25": "Loss of charge - clogging rate 25%",
"DH30": "Loss of charge - clogging rate 30%",
"DH35": "Loss of charge - clogging rate 35%",
"DH40": "Loss of charge - clogging rate 40%",
"DH45": "Loss of charge - clogging rate 45%",
"DH50": "Loss of charge - clogging rate 50%",
"DH55": "Loss of charge - clogging rate 55%",
"DH60": "Loss of charge - clogging rate 60%",
"UNIT_H": "m",
"UNIT_HG": "m",
"UNIT_S": "m²",
"UNIT_SPDG": "m²",
"UNIT_VA": "m/s",
"UNIT_VAPDG": "m/s",
"UNIT_LG": "m",
"UNIT_D": "m",
"UNIT_DG": "m",
"UNIT_SG": "m²",
"UNIT_VN": "m/s",
"UNIT_DH00": "cm",
"UNIT_DH05": "cm",
"UNIT_DH10": "cm",
"UNIT_DH15": "cm",
"UNIT_DH20": "cm",
"UNIT_DH25": "cm",
"UNIT_DH30": "cm",
"UNIT_DH35": "cm",
"UNIT_DH40": "cm",
"UNIT_DH45": "cm",
"UNIT_DH50": "cm",
"UNIT_DH55": "cm",
"UNIT_DH60": "cm"
}
\ No newline at end of file
{
"fs_section": "Caractéristiques de la section du plan de grille",
"fs_plan": "Caractéristiques du plan de grille",
"fs_grille": "Caractéristiques de la grille",
"QMax": "Débit maximum turbiné",
"CRad": "Cote du radier (pied de grille)",
"CEau": "Cote du niveau d'eau",
"CSomGrille": "Cote du sommet immergé du plan de grille",
"B": "Largeur de la section",
"Beta": "Inclinaison par rapport à l'horizontale",
"Alpha": "Orientation par rapport à la direction de l'écoulement",
"b": "Épaisseur des barreaux",
"p": "Profondeur des barreaux",
"e": "Espacement libre entre les barreaux",
"O": "Obstruction globale du plan de grille",
"OEntH": "Obstruction effective due aux entretoises et éléments transversaux",
"cIncl": "Coefficient de forme moyen des entretoises et éléments transversaux",
"select_grid_type": "Type de grille",
"select_grid_profile": "Profil des barreaux",
"select_grid_type_0": "Conventionnelle",
"select_grid_type_1": "Orientée",
"select_grid_type_2": "Inclinée",
"select_grid_profile_0": "Rectangulaire",
"select_grid_profile_1": "Hydrodynamique",
"H": "Hauteur d'eau",
"HG": "Hauteur de grille",
"S": "Section d'approche de la prise d'eau",
"SPDG": "Section d'approche du plan de grille",
"VA": "Vitesse d'approche moyenne pour le débit maximum turbiné",
"VAPDG": "Vitesse d'approche moyenne pour le débit maximum turbiné, en soustrayant la partie supérieure éventuellement obturée",
"LG": "Longueur de grille immergée",
"D": "Distance longitudinale entre le point émergent du plan de grille et le pied de grille",
"DG": "Distance longitudinale entre le sommet immergé et le pied de grille",
"SG": "Surface de grille immergée",
"VN": "Vitesse normale moyenne pour le débit maximum turbiné",
"RFB": "Rapport de forme des barreaux",
"REEB": "Rapport espacement/épaisseur des barreaux",
"OB": "Obstruction due aux barreaux seuls",
"DH00": "Perte de charge - taux de colmatage 0%",
"DH05": "Perte de charge - taux de colmatage 5%",
"DH10": "Perte de charge - taux de colmatage 10%",
"DH15": "Perte de charge - taux de colmatage 15%",
"DH20": "Perte de charge - taux de colmatage 20%",
"DH25": "Perte de charge - taux de colmatage 25%",
"DH30": "Perte de charge - taux de colmatage 30%",
"DH35": "Perte de charge - taux de colmatage 35%",
"DH40": "Perte de charge - taux de colmatage 40%",
"DH45": "Perte de charge - taux de colmatage 45%",
"DH50": "Perte de charge - taux de colmatage 50%",
"DH55": "Perte de charge - taux de colmatage 55%",
"DH60": "Perte de charge - taux de colmatage 60%",
"UNIT_H": "m",
"UNIT_HG": "m",
"UNIT_S": "m²",
"UNIT_SPDG": "m²",
"UNIT_VA": "m/s",
"UNIT_VAPDG": "m/s",
"UNIT_LG": "m",
"UNIT_D": "m",
"UNIT_DG": "m",
"UNIT_SG": "m²",
"UNIT_VN": "m/s",
"UNIT_DH00": "cm",
"UNIT_DH05": "cm",
"UNIT_DH10": "cm",
"UNIT_DH15": "cm",
"UNIT_DH20": "cm",
"UNIT_DH25": "cm",
"UNIT_DH30": "cm",
"UNIT_DH35": "cm",
"UNIT_DH40": "cm",
"UNIT_DH45": "cm",
"UNIT_DH50": "cm",
"UNIT_DH55": "cm",
"UNIT_DH60": "cm"
}
\ No newline at end of file
......@@ -6,7 +6,6 @@
},
{
"type": "options",
"__idCal": "D",
"help": "devalaison/jet"
}
]
\ No newline at end of file
......@@ -30,7 +30,7 @@
"path": "surface-libre.jpg",
"credits": "PENSER À CHANGER CETTE IMAGE"
},
"calculators": [ 18, 3, 9 ]
"calculators": [ 18, 19, 3, 9 ]
},
{
"name": "HYDRAULIQUE_A_SURFACE_LIBRE",
......
import { IObservable } from "jalhyd";
import { FormulaireBase } from "./form-base";
import { FieldSet } from "../../fieldset";
/**
* Formulaire pour les Grilles (perte de charge)
*/
export class FormulaireGrille extends FormulaireBase {
/** id of select configuring grid profile */
private _gridProfileSelectId: string;
/** id of select configuring grid type */
private _gridTypeSelectId: string;
protected parseOptions(json: {}) {
super.parseOptions(json);
this._gridProfileSelectId = this.getOption(json, "gridProfileSelectId");
this._gridTypeSelectId = this.getOption(json, "gridTypeSelectId");
}
public afterParseFieldset(fs: FieldSet) {
if (this._gridTypeSelectId) {
const sel = fs.getFormulaireNodeById(this._gridTypeSelectId);
if (sel) {
fs.properties.addObserver(this);
}
}
if (this._gridProfileSelectId) {
const sel = fs.getFormulaireNodeById(this._gridProfileSelectId);
if (sel) {
fs.properties.addObserver(this);
}
}
}
// interface Observer
public update(sender: IObservable, data: any) {
super.update(sender, data);
if (data.action === "propertyChange") {
if (data.name === "gridType") {
this.reset();
// Inclined grids have more input fields (OEntH and cIncl)
this.getFieldsetById("fs_grille").updateFields();
}
}
}
}
......@@ -29,11 +29,15 @@ export class FormComputeFixedVar extends FormCompute {
if (varParams.length === 0) {
// pas de paramètre à varier
this.formResult.fixedResults.result = nub.result;
this.formResult.fixedResults.calculatedParameter = computedParam;
if (computedParam !== undefined) {
this.formResult.fixedResults.calculatedParameter = computedParam;
}
} else {
// il y a un paramètre à varier
this.formResult.varResults.variatedParameters = varParams;
this.formResult.varResults.calculatedParameter = computedParam;
if (computedParam !== undefined) {
this.formResult.varResults.calculatedParameter = computedParam;
}
this.formResult.varResults.result = nub.result;
this.formResult.varResults.update();
......
......@@ -44,59 +44,68 @@ export abstract class FormCompute implements Observer {
computedParam = nub.calculatedParam;
}
// const computedParamValue = computedParam.getValue();
const computedParamValue = computedParam.singleValue;
switch (computedParam.domain.domain) {
case ParamDomainValue.ANY:
if (computedParam && computedParam.isDefined) {
init = computedParamValue;
}
if (init === undefined) {
init = 0;
}
break;
case ParamDomainValue.POS_NULL:
if (computedParam && computedParam.isDefined) {
init = Math.max(computedParamValue, 0);
}
if (init === undefined) {
init = 0;
}
break;
case ParamDomainValue.INTERVAL:
init = (computedParam.domain.minValue + computedParam.domain.maxValue) / 2;
break;
case ParamDomainValue.NOT_NULL:
if (computedParam && computedParam.isDefined) {
init = computedParamValue;
}
if (init === undefined || init === 0) {
init = 1e-8;
}
break;
case ParamDomainValue.POS:
if (computedParam && computedParam.isDefined) {
init = Math.max(computedParamValue, 1e-8);
}
if (init === undefined) {
init = 1e-8;
}
break;
}
if (computedParam === undefined) {
// modules that have no calculated param (ex: Grille)
return nub.CalcSerie();
} else {
// const computedParamValue = computedParam.getValue();
const computedParamValue = computedParam.singleValue;
switch (computedParam.domain.domain) {
case ParamDomainValue.ANY:
if (computedParam && computedParam.isDefined) {
init = computedParamValue;
}
if (init === undefined) {
init = 0;
}
break;
case ParamDomainValue.POS_NULL:
if (computedParam && computedParam.isDefined) {
init = Math.max(computedParamValue, 0);
}
if (init === undefined) {
init = 0;
}
break;
case ParamDomainValue.INTERVAL:
init = (computedParam.domain.minValue + computedParam.domain.maxValue) / 2;
break;
return nub.CalcSerie(init, this.getParameterRefid(computedParam));
case ParamDomainValue.NOT_NULL:
if (computedParam && computedParam.isDefined) {
init = computedParamValue;
}
if (init === undefined || init === 0) {
init = 1e-8;
}
break;
case ParamDomainValue.POS:
if (computedParam && computedParam.isDefined) {
init = Math.max(computedParamValue, 1e-8);
}
if (init === undefined) {
init = 1e-8;
}
break;
}
return nub.CalcSerie(init, this.getParameterRefid(computedParam));
}
}
protected getComputedParameter(): NgParameter {
const cpd = this._formBase.currentNub.calculatedParam;
let ngparam = this._formBase.getParamFromSymbol(cpd.symbol);
if (ngparam === undefined) { // calculated parameter is not displayed on screen
ngparam = new NgParameter(cpd, this._formBase);
let ngparam: NgParameter;
if (cpd !== undefined) {
ngparam = this._formBase.getParamFromSymbol(cpd.symbol);
if (ngparam === undefined) { // calculated parameter is not displayed on screen
ngparam = new NgParameter(cpd, this._formBase);
}
}
return ngparam;
}
......
......@@ -312,6 +312,13 @@ export abstract class FormulaireDefinition extends FormulaireNode implements Obs
}
}
public getFieldsetById(id: string): FieldSet {
const res = this.getFormulaireNodeById(id);
if (res instanceof FieldSet) {
return res;
}
}
public getParameterValue(symbol: string): number {
for (const fs of this.allFieldsets) {
const p = fs.getNodeParameter(symbol);
......
......@@ -8,6 +8,8 @@ import {
Observer,
Nub,
MethodeResolution,
GrilleType,
GrilleProfile,
} from "jalhyd";
import { FormulaireElement } from "./formulaire-element";
......@@ -244,6 +246,14 @@ export class FieldSet extends FormulaireElement implements Observer {
case "fs_pass_type": // macro-rugo complexe
this.setSelectValueFromProperty("select_pass_type", "inclinedApron");
break;
case "fs_plan": // Grille
this.setSelectValueFromProperty("select_grid_type", "gridType");
break;
case "fs_grille": // Grille
this.setSelectValueFromProperty("select_grid_profile", "gridProfile");
break;
}
}
......@@ -308,6 +318,8 @@ export class FieldSet extends FormulaireElement implements Observer {
this.setPropertyValueFromConfig(json, "defaultLoiDebit", "loiDebit", LoiDebit);
this.setPropertyValueFromConfig(json, "methodeResolution", "methodeResolution", MethodeResolution);
this.setPropertyValueFromConfig(json, "defaultMaterial", "material", LCMaterial);
this.setPropertyValueFromConfig(json, "defaultGridProfile", "gridProfile", GrilleProfile);
this.setPropertyValueFromConfig(json, "defaultGridType", "gridType", GrilleType);
this.setPropertyValueFromConfig(json, "varCalc", "varCalc");
this.updateFields();
......@@ -382,6 +394,12 @@ export class FieldSet extends FormulaireElement implements Observer {
case "select_pass_type": // macro-rugo complexe
this.setPropValue("inclinedApron", data.value.value);
break;
case "select_grid_type": // Grille
this.setPropValue("gridType", data.value.value);
break;
case "select_grid_profile": // Grille
this.setPropValue("gridProfile", data.value.value);
break;
}
break;
}
......
import { LechaptCalmon, acSection, CourbeRemous, Nub, ParallelStructure, StructureType, LoiDebit } from "jalhyd";
import { LechaptCalmon, acSection, CourbeRemous, Nub, ParallelStructure, StructureType, LoiDebit, GrilleType, GrilleProfile } from "jalhyd";
import { Field } from "./field";
import { SelectEntry } from "./select-entry";
......@@ -161,6 +161,17 @@ export class SelectField extends Field {
this.addEntry(new SelectEntry(this._entriesBaseId + "0", false));
this.addEntry(new SelectEntry(this._entriesBaseId + "1", true));
break;
case "grille_type": // Grille: type de grille
this.addEntry(new SelectEntry(this._entriesBaseId + GrilleType.Conventional, GrilleType.Conventional));
this.addEntry(new SelectEntry(this._entriesBaseId + GrilleType.Oriented, GrilleType.Oriented));
this.addEntry(new SelectEntry(this._entriesBaseId + GrilleType.Inclined, GrilleType.Inclined));
break;
case "grille_profile": // Grille: profil des barreaux
this.addEntry(new SelectEntry(this._entriesBaseId + GrilleProfile.Rectangular, GrilleProfile.Rectangular));
this.addEntry(new SelectEntry(this._entriesBaseId + GrilleProfile.Hydrodynamic, GrilleProfile.Hydrodynamic));
break;
}
}
}
......@@ -37,6 +37,7 @@ import { FieldsetContainer } from "../formulaire/fieldset-container";
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";
@Injectable()
export class FormulaireService extends Observable {
......@@ -79,6 +80,7 @@ export class FormulaireService extends Observable {
this.calculatorPaths[CalculatorType.Pab] = "pab";
this.calculatorPaths[CalculatorType.MacroRugoCompound] = "macrorugo-compound";
this.calculatorPaths[CalculatorType.Jet] = "jet";
this.calculatorPaths[CalculatorType.Grille] = "grille";
}
private get _intlService(): I18nService {
......@@ -316,6 +318,10 @@ export class FormulaireService extends Observable {
f = new FormulaireMacrorugoCompound();
break;
case CalculatorType.Grille:
f = new FormulaireGrille();
break;
default:
f = new FormulaireBase();
}
......
......@@ -147,6 +147,8 @@
"INFO_FIELDSET_MOVE_DOWN": "Move down",
"INFO_FIELDSET_MOVE_LEFT": "Move left",
"INFO_FIELDSET_MOVE_RIGHT": "Move right",
"INFO_GRILLE_TITRE_COURT": "Grid",
"INFO_GRILLE_TITRE": "Loss of charge, water grid",
"INFO_JET_TITRE_COURT": "Jet",
"INFO_JET_TITRE": "Jet impact",
"INFO_WALL_ADDED": "1 wall added",
......
......@@ -147,6 +147,8 @@
"INFO_FIELDSET_MOVE_DOWN": "Déplacer vers le bas",
"INFO_FIELDSET_MOVE_LEFT": "Déplacer vers la gauche",
"INFO_FIELDSET_MOVE_RIGHT": "Déplacer vers la droite",
"INFO_GRILLE_TITRE_COURT": "Grille",
"INFO_GRILLE_TITRE": "Perte de charge, grille de prise d'eau",
"INFO_JET_TITRE_COURT": "Jet",
"INFO_JET_TITRE": "Impact de jet",
"INFO_WALL_ADDED": "1 cloison ajoutée",
......
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