Skip to content
Snippets Groups Projects
Commit 6f00232d authored by francois.grand's avatar francois.grand
Browse files

#77 adaptation des courbes de remous à la factory de Nub

parent 553b6dd3
No related branches found
No related tags found
1 merge request!15Resolve "faire les modifications nécessaires prendre en compte le ticket cassiopee/jalhyd#46 (Gestion de la session dans la lib)"
......@@ -26,7 +26,6 @@
{
"id": "fs_section_trapez",
"type": "fieldset",
"nodeType": "SectionTrapeze",
"option": "fix",
"dep_exist": [
{
......@@ -38,21 +37,20 @@
{
"type": "input",
"id": "LargeurFond",
"unit": "m",
"value": 2.5
"nodeType": "SectionTrapeze",
"unit": "m"
},
{
"type": "input",
"id": "Fruit",
"unit": "m/m",
"value": 0.56
"nodeType": "SectionTrapeze",
"unit": "m/m"
}
]
},
{
"id": "fs_section_rect",
"type": "fieldset",
"nodeType": "SectionRectangle",
"option": "fix",
"dep_exist": [
{
......@@ -64,15 +62,14 @@
{
"type": "input",
"id": "LargeurBerge",
"unit": "m",
"value": 2.5
"nodeType": "SectionRectangle",
"unit": "m"
}
]
},
{
"id": "fs_section_circ",
"type": "fieldset",
"nodeType": "SectionCercle",
"option": "fix",
"dep_exist": [
{
......@@ -84,15 +81,14 @@
{
"type": "input",
"id": "D",
"unit": "m",
"value": 2
"nodeType": "SectionCercle",
"unit": "m"
}
]
},
{
"id": "fs_section_puiss",
"type": "fieldset",
"nodeType": "SectionPuissance",
"option": "fix",
"dep_exist": [
{
......@@ -104,14 +100,14 @@
{
"type": "input",
"id": "k",
"unit": "",
"value": 0.5
"nodeType": "SectionPuissance",
"unit": ""
},
{
"type": "input",
"id": "LargeurBerge",
"unit": "m",
"value": 2
"nodeType": "SectionPuissance",
"unit": "m"
}
]
},
......@@ -123,26 +119,22 @@
{
"type": "input",
"id": "Ks",
"unit": "m1/3s-1",
"value": 40
"unit": "m1/3s-1"
},
{
"type": "input",
"id": "Long",
"unit": "m",
"value": 100
"unit": "m"
},
{
"type": "input",
"id": "If",
"unit": "m/m",
"value": 0.001
"unit": "m/m"
},
{
"type": "input",
"id": "YB",
"unit": "m",
"value": 1
"unit": "m"
}
]
},
......@@ -154,20 +146,17 @@
{
"type": "input",
"id": "Q",
"unit": "m³/s",
"value": 2
"unit": "m³/s"
},
{
"type": "input",
"id": "Yaval",
"unit": "m",
"value": 0.4
"unit": "m"
},
{
"type": "input",
"id": "Yamont",
"unit": "m",
"value": 0.15
"unit": "m"
}
]
},
......@@ -179,8 +168,7 @@
{
"type": "input",
"id": "Dx",
"unit": "m",
"value": 5
"unit": "m"
},
{
"type": "input",
......
......@@ -244,8 +244,8 @@ export class RemousResultsComponent {
gr1.drawLine(0, 0, 3, "#753F00", this.uitextFond, "#753F00");
// ligne de berge
if (this._remousResults.hautBerge != undefined && this._remousResults.hautBerge.ok)
gr1.drawLine(this._remousResults.hautBerge.vCalc, this._remousResults.hautBerge.vCalc, 4, "#C58F50", this.uitextBerge);
if (this._remousResults.hautBerge)
gr1.drawLine(this._remousResults.hautBerge, this._remousResults.hautBerge, 4, "#C58F50", this.uitextBerge);
// hauteur normale
if (this._remousResults.hautNormale != undefined && this._remousResults.hautNormale.ok)
......
import { CalculatorType } from "jalhyd";
import { CalculatorType, ComputeNodeType } from "jalhyd";
import { ParamService } from "../../../services/param/param.service";
import { ApplicationSetupService } from "../../../services/app-setup/app-setup.service";
......@@ -23,6 +23,10 @@ export class FormulaireCourbeRemous extends FormulaireDefinition {
}
protected createNubs() {
this._nubs.set(ComputeNodeType.SectionCercle, this.paramService.createNub(this.calculatorType, ComputeNodeType.SectionCercle));
this._nubs.set(ComputeNodeType.SectionPuissance, this.paramService.createNub(this.calculatorType, ComputeNodeType.SectionPuissance));
this._nubs.set(ComputeNodeType.SectionRectangle, this.paramService.createNub(this.calculatorType, ComputeNodeType.SectionRectangle));
this._nubs.set(ComputeNodeType.SectionTrapeze, this.paramService.createNub(this.calculatorType, ComputeNodeType.SectionTrapeze));
}
protected initParse() {
......
......@@ -26,23 +26,14 @@ export class FormComputeCourbeRemous extends FormCompute {
}
protected compute() {
// var np: [ComputeNode, ParamsEquation] = this.getNubAndParameters();
// let sect: acSection = np[0] as acSection;
// let prmSect: ParamsEquation = np[1];
const sectNub: SectionParametree = this.getCurrentNub() as SectionParametree;
const sect: acSection = sectNub.section;
let Yamont: number = this._formBase.getParameterValue("Yamont"); // tirant amont
let Yaval: number = this._formBase.getParameterValue("Yaval"); // tirant aval
let Dx: number = this._formBase.getParameterValue("Dx"); // pas de discrétisation
let Long: number = this._formBase.getParameterValue("Long"); // longueur du bief
let If: number = this._formBase.getParameterValue("If"); // pente du fond
let YB: number = this._formBase.getParameterValue("YB"); // hauteur de berge
const cr: CourbeRemous = this.getCurrentNub() as CourbeRemous;
const prmCR: CourbeRemousParams = cr.parameters as CourbeRemousParams;
const sect: acSection = prmCR.Sn;
let Yn: Result = sect.Calc("Yn"); // hauteur normale
let Yc: Result = sect.Calc("Yc"); // hauteur critique
this.remousResults.penteFond = If;
this.remousResults.parameters = prmCR;
// méthode de résolution
......@@ -56,21 +47,18 @@ export class FormComputeCourbeRemous extends FormCompute {
else if (smeth == "select_resolution_euler")
methRes = MethodeResolution.EulerExplicite;
else
throw "GenericCalculatorComponent.doComputeRemous() : type de méthode de résolution '" + smeth + "' inconnu";
throw "FormComputeCourbeRemous.compute() : type de méthode de résolution '" + smeth + "' inconnu";
// paramètre supplémentaire à calculer
// variable supplémentaire à calculer
const extraSymbol: string = this._formBase.getSelectedValue("select_target");
// calcul
let prmCR: CourbeRemousParams = new CourbeRemousParams(sect, Yamont, Yaval, Long, Dx, methRes);
let cr = new CourbeRemous(prmCR);
let res: Result = cr.calculRemous(extraSymbol == "none" ? undefined : extraSymbol);
this.remousResults.result = cr.calculRemous(extraSymbol == "none" ? undefined : extraSymbol);
// affichage du graphe
// données du graphe
this.remousResults.hauteurBerge = new ResultElement(YB);
this.remousResults.hauteurNormale = Yn.resultElement;
this.remousResults.hauteurCritique = Yc.resultElement;
if (extraSymbol != "none") {
......@@ -79,12 +67,5 @@ export class FormComputeCourbeRemous extends FormCompute {
}
else
this.remousResults.extraGraph = false;
// résultats numériques
this.remousResults.result = res;
const xValues = new ParamValues();
xValues.setValues(0, Long, Dx);
this.remousResults.xValues = xValues;
}
}
import { cLog, Result, ResultElement, ParamValues } from "jalhyd";
import { cLog, Result, ResultElement, ParamValues, CourbeRemousParams } from "jalhyd";
import { CalculatorResults } from "./calculator-results";
......@@ -10,7 +10,7 @@ export class RemousResults extends CalculatorResults {
/**
* hauteur de berge
*/
private _hautBerge: ResultElement;
private _hautBerge: number;
/**
* pente du fond
......@@ -75,6 +75,24 @@ export class RemousResults extends CalculatorResults {
this._extraGraph = false;
}
public set parameters(p: CourbeRemousParams) {
// pente du fond
this._penteFond = p.map.If.v;
// hauteur de berge
this._hautBerge = p.map.YB.v;
// longueur du bief
const Long = p.map.Long.v;
// pas d'espace
const Dx = p.map.Dx.v;
// série de valeurs de X
this._xValues = new ParamValues();
this._xValues.setValues(0, Long, Dx);
}
public get log() {
return this._log;
}
......@@ -83,10 +101,6 @@ export class RemousResults extends CalculatorResults {
return this._xValues;
}
public set xValues(p: ParamValues) {
this._xValues = p;
}
public get result(): Result {
return this._result;
}
......@@ -122,18 +136,10 @@ export class RemousResults extends CalculatorResults {
return this._hautBerge;
}
public set hauteurBerge(v: ResultElement) {
this._hautBerge = v;
}
public get penteFond() {
return this._penteFond;
}
public set penteFond(v: number) {
this._penteFond = v;
}
public get hautNormale() {
return this._hautNormale;
}
......
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