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

#77 suite à la création de la classe SessionNub dans la lib,...

 #77 suite à la création de la classe SessionNub dans la lib, FormCompute.getCurrentNub() transformée en getCurrentSessionNub()
parent 85ac03ea
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)"
Showing
with 54 additions and 84 deletions
import { ComputeNode, ParamsEquation, ConduiteDistribParams, ConduiteDistrib, ComputeNodeType } from "jalhyd";
import { ComputeNode, ParamsEquation, ConduiteDistribParams, ConduiteDistrib, ComputeNodeType, CalculatorType } from "jalhyd";
import { FormComputeFixedVar } from "./form-compute-fixedvar";
import { FormulaireDefinition } from "./form-definition";
......@@ -9,7 +9,10 @@ export class FormComputeConduiteDistributrice extends FormComputeFixedVar {
super(formBase, formResult);
}
protected getCurrentNub() {
return this._formBase.getNub(ComputeNodeType.None);
protected getCurrentSessionNub() {
return this._formBase.getSessionNub({
"calcType": CalculatorType.ConduiteDistributrice,
"nodeType": ComputeNodeType.None
});
}
}
import { SectionParametree, acSection, ParamsEquation, ComputeNode, Result, MethodeResolution, CourbeRemousParams, CourbeRemous, ResultElement, ParamValues } from "jalhyd";
import { SectionParametree, acSection, ParamsEquation, ComputeNode, Result, MethodeResolution, CourbeRemousParams, CourbeRemous, ResultElement, ParamValues, CalculatorType } from "jalhyd";
import { SelectField } from "../select-field";
import { RemousResults } from "../../results/remous-results";
......@@ -12,12 +12,11 @@ export class FormComputeCourbeRemous extends FormCompute {
super(formBase, formResult);
}
// protected getNubAndParameters(): [ComputeNode, ParamsEquation] {
// return this._formSection.getSectionNubAndParameters(false);
// }
protected getCurrentNub() {
return this._formBase.getNub(this._formSection.sectionNodeType);
protected getCurrentSessionNub() {
return this._formBase.getSessionNub({
"calcType": CalculatorType.SectionParametree,
"nodeType": this._formSection.sectionNodeType
});
}
private get remousResults(): RemousResults {
......@@ -26,7 +25,7 @@ export class FormComputeCourbeRemous extends FormCompute {
}
protected compute() {
const cr: CourbeRemous = this.getCurrentNub() as CourbeRemous;
const cr: CourbeRemous = this.getCurrentSessionNub().nub as CourbeRemous;
const prmCR: CourbeRemousParams = cr.parameters as CourbeRemousParams;
const sect: acSection = prmCR.Sn;
......
......@@ -41,7 +41,7 @@ export abstract class FormComputeFixedVar extends FormCompute {
}
protected compute() {
const nub: Nub = this.getCurrentNub();
const nub: Nub = this.getCurrentSessionNub().nub;
if (this._formBase.hasParameter("Pr"))
var computePrec: number = this._formBase.getParameterValue("Pr"); // précision de calcul
......
import { ComputeNode, ComputeNodeType, ParamsEquation, LechaptCalmonParams, LechaptCalmon } from "jalhyd";
import { ComputeNode, ComputeNodeType, ParamsEquation, LechaptCalmonParams, LechaptCalmon, CalculatorType } from "jalhyd";
import { FormComputeFixedVar } from "./form-compute-fixedvar";
import { FormulaireDefinition } from "./form-definition";
......@@ -9,7 +9,10 @@ export class FormComputeLechaptCalmon extends FormComputeFixedVar {
super(formBase, formResult);
}
protected getCurrentNub() {
return this._formBase.getNub(ComputeNodeType.None);
protected getCurrentSessionNub() {
return this._formBase.getSessionNub({
"calcType": CalculatorType.LechaptCalmon,
"nodeType": ComputeNodeType.None
});
}
}
import { ComputeNode, ParamsEquation, PabDimensionParams, PabDimension, ComputeNodeType } from "jalhyd";
import { ComputeNode, ParamsEquation, PabDimensionParams, PabDimension, ComputeNodeType, CalculatorType } from "jalhyd";
import { FormComputeFixedVar } from "./form-compute-fixedvar";
import { FormulaireDefinition } from "./form-definition";
......@@ -9,7 +9,10 @@ export class FormComputePasseBassinDimensions extends FormComputeFixedVar {
super(formBase, formResult);
}
protected getCurrentNub() {
return this._formBase.getNub(ComputeNodeType.None);
protected getCurrentSessionNub() {
return this._formBase.getSessionNub({
"calcType": CalculatorType.PabDimensions,
"nodeType": ComputeNodeType.None
});
}
}
\ No newline at end of file
import { ComputeNode, ParamsEquation, PabPuissanceParams, PabPuissance, ComputeNodeType } from "jalhyd";
import { ComputeNode, ParamsEquation, PabPuissanceParams, PabPuissance, ComputeNodeType, CalculatorType } from "jalhyd";
import { FormComputeFixedVar } from "./form-compute-fixedvar";
import { FormulaireDefinition } from "./form-definition";
......@@ -9,7 +9,10 @@ export class FormComputePasseBassinPuissance extends FormComputeFixedVar {
super(formBase, formResult);
}
protected getCurrentNub() {
return this._formBase.getNub(ComputeNodeType.None);
protected getCurrentSessionNub() {
return this._formBase.getSessionNub({
"calcType": CalculatorType.PabPuissance,
"nodeType": ComputeNodeType.None
});
}
}
\ No newline at end of file
......@@ -63,52 +63,10 @@ export class FormComputeParallelStructures extends FormComputeFixedVar {
}
}
public getNubAndParameters(): [ComputeNode, ParamsEquation] {
// paramètres communs
const Q: number = this._formBase.getParameterValue("Q"); // Débit
const Z1: number = this._formBase.getParameterValue("Z1"); // Cote de l'eau amont (m)
const Z2: number = this._formBase.getParameterValue("Z2"); // Cote de l'eau aval (m)
const prms = new ParallelStructureParams(Q, Z1, Z2);
const nub: ParallelStructure = new ParallelStructure(prms);
// ouvrages
for (const fs of this._formBase.allFieldsets)
if (fs.calculatorType == CalculatorType.Structure) {
const ts: StructureType = this._formParallelStruct.getStructureType(fs);
const ld: LoiDebit = this._formParallelStruct.getLoiDebit(fs);
// cote de radier
const ZDV = fs.getNodeParameterValue("ZDV");
// ouverture de vanne
try {
var W = fs.getNodeParameterValue("W");
} catch (e) {
}
// création de l'ouvrage
const ouvr = CreateStructure(ts, ld);
// affectation des valeurs (en prenant garde de ne pas écraser les valeurs par défaut dans le cas d'un paramètre à calculer)
if (Z1 != undefined)
ouvr.prms.Z1.v = Z1;
if (Z2 != undefined)
ouvr.prms.Z2.v = Z2;
if (ZDV != undefined)
ouvr.prms.ZDV.v = ZDV;
if (W != undefined)
ouvr.prms.W.v = W;
nub.addStructure(ouvr);
}
return [nub, prms];
}
protected getCurrentNub() {
return undefined;
protected getCurrentSessionNub() {
return this._formBase.getSessionNub({
"calcType": CalculatorType.ParallelStructure,
"nodeType": ComputeNodeType.None
});
}
}
import { ComputeNode, ParamsEquation, RegimeUniforme, acSection } from "jalhyd";
import { ComputeNode, ParamsEquation, RegimeUniforme, acSection, CalculatorType } from "jalhyd";
import { FormComputeFixedVar } from "./form-compute-fixedvar";
import { FormulaireDefinition } from "./form-definition";
......@@ -10,12 +10,10 @@ export class FormComputeRegimeUniforme extends FormComputeFixedVar {
super(formBase, formResult);
}
// protected getNubAndParameters(): [ComputeNode, ParamsEquation] {
// const snp: [acSection, ParamsEquation] = this._formSection.getSectionNubAndParameters();
// return [new RegimeUniforme(snp[0]), snp[1]];
// }
protected getCurrentNub() {
return this._formBase.getNub(this._formSection.sectionNodeType);
protected getCurrentSessionNub() {
return this._formBase.getSessionNub({
"calcType": CalculatorType.RegimeUniforme,
"nodeType": this._formSection.sectionNodeType
});
}
}
\ No newline at end of file
}
import { SectionParametree, acSection, ParamsEquation, ComputeNode, Result, ParamValueMode, Nub, ParamsSection } from "jalhyd";
import { SectionParametree, acSection, ParamsEquation, ComputeNode, Result, ParamValueMode, Nub, ParamsSection, CalculatorType, SessionNub } from "jalhyd";
import { FormCompute } from "./form-compute";
import { NgParameter } from "../ngparam";
......@@ -38,8 +38,11 @@ export class FormComputeSectionParametree extends FormCompute {
return this._formSectionResult.sectionResults;
}
protected getCurrentNub(): Nub {
return this._formBase.getNub(this._formSection.sectionNodeType);
protected getCurrentSessionNub(): SessionNub {
return this._formBase.getSessionNub({
"calcType": CalculatorType.SectionParametree,
"nodeType": this._formSection.sectionNodeType
});
}
/**
......@@ -55,7 +58,7 @@ export class FormComputeSectionParametree extends FormCompute {
// paramètre à calculer en fonction du paramètre à varier
let computedParamInfo = this._formSection.getSectionComputedParam();
const sectNub: SectionParametree = this.getCurrentNub() as SectionParametree;
const sectNub: SectionParametree = this.getCurrentSessionNub().nub as SectionParametree;
const sect: acSection = sectNub.section;
const prms = sectNub.parameters;
......@@ -96,7 +99,7 @@ export class FormComputeSectionParametree extends FormCompute {
return;
}
const sectNub: SectionParametree = this.getCurrentNub() as SectionParametree;
const sectNub: SectionParametree = this.getCurrentSessionNub().nub as SectionParametree;
const sect: acSection = sectNub.section;
this._sectionResults.section = sect;
......
import { ParamValueMode, Nub, Result, ParamDomainValue, ParamDomain } from "jalhyd";
import { ParamValueMode, Nub, Result, ParamDomainValue, ParamDomain, SessionNub } from "jalhyd";
import { FormResult } from "./form-result";
import { FormulaireDefinition } from "./form-definition";
......@@ -8,7 +8,7 @@ export abstract class FormCompute {
constructor(protected _formBase: FormulaireDefinition, protected _formResult: FormResult) {
}
protected abstract getCurrentNub(): Nub;
protected abstract getCurrentSessionNub(): SessionNub;
protected abstract compute();
......
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