Commit 5b0d1234 authored by Mathias Chouet's avatar Mathias Chouet :spaghetti:
Browse files

Fix #74

Showing with 61 additions and 1 deletion
+61 -1
......@@ -6,6 +6,7 @@
*/
// import { describe, expect, it, xdescribe, xit } from "../mock_jasmine";
import { ParamDefinition } from "../../src/index";
import { Cloisons } from "../../src/structure/cloisons";
import { CloisonsParams } from "../../src/structure/cloisons_params";
import { CreateStructure } from "../../src/structure/factory_structure";
......@@ -41,6 +42,7 @@ const fente: StructureWeirSubmergedLarinier = new StructureWeirSubmergedLarinier
cloisons.addChild(fente);
describe("Class Cloisons: ", () => {
describe("Calc(Q) Fente noyée (Larinier 1992)", () => {
it("vCalc should return 0.407", () => {
expect(cloisons.Calc("Q").vCalc).toBeCloseTo(0.407, 3);
......@@ -82,4 +84,62 @@ describe("Class Cloisons: ", () => {
expect(prmsKivi.ZRAM.v).toBeCloseTo(101, 3);
});
});
describe("Calcul avec Calc - ", () => {
const descs = [
"Q",
"Z1",
"DH"
];
for (const desc of descs) {
describe("calcul de " + JSON.stringify(desc), () => {
it("", () => {
expect(cloisons.Calc(desc).vCalc).toBeDefined();
});
});
}
});
describe("Calcul avec CalcSerie - ", () => {
const descs = [
"Q",
"Z1",
"DH",
{ uid: fente.uid, symbol: "ZDV" },
{ uid: fente.uid, symbol: "L" },
{ uid: fente.uid, symbol: "Cd" }
];
for (const desc of descs) {
describe("calcul de " + JSON.stringify(desc), () => {
it("", () => {
expect(cloisons.CalcSerie(0, desc).vCalc).toBeDefined();
});
});
}
});
describe("Calcul avec CalcSerie et calculatedParam - ", () => {
const descs = [
"Q",
"Z1",
"DH",
{ uid: fente.uid, symbol: "ZDV" },
{ uid: fente.uid, symbol: "L" },
{ uid: fente.uid, symbol: "Cd" }
];
for (const desc of descs) {
describe("calcul de " + JSON.stringify(desc), () => {
it("", () => {
let p: ParamDefinition;
if (typeof desc === "string") {
p = cloisons.getParameter(desc);
} else {
p = fente.getParameter(desc.symbol);
}
cloisons.calculatedParam = p;
expect(cloisons.CalcSerie().vCalc).toBeDefined();
});
});
}
});
});
......@@ -23,7 +23,7 @@ export class PabPuissanceParams extends ParamsEquation {
constructor(rDH: number, rQ: number, rV: number, rPV?: number) {
super();
this._DH = new ParamDefinition(this, "DH", ParamDomainValue.POS, rDH, ParamFamily.HEIGHTS);
this._Q = new ParamDefinition(this, "Q", ParamDomainValue.POS, rQ, ParamFamily.FLOWS);
this._Q = new ParamDefinition(this, "Q", ParamDomainValue.POS_NULL, rQ, ParamFamily.FLOWS);
this._V = new ParamDefinition(this, "V", ParamDomainValue.POS, rV, ParamFamily.VOLUMES);
this._PV = new ParamDefinition(this, "PV", ParamDomainValue.POS, rPV);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment