Skip to content
Snippets Groups Projects
Commit 05ea25e3 authored by François Grand's avatar François Grand
Browse files

fix: remove ERROR_PREBARRAGE_STRUCTURE_ZDV_INF_ZF message when ZDV < ZF

Refs  #353
parent 74272f61
No related branches found
No related tags found
No related merge requests found
......@@ -674,18 +674,6 @@ describe("Class PreBarrage:", () => {
expect(res.resultElement.log.messages[0].extraVar.n).toBe("1");
});
it("device ZDV < ZF of upstream basin", () => {
const pb = createPreBarrageTest();
pb.bassins[0].cloisonsAval[0].structures[0].prms.ZDV.singleValue = pb.bassins[0].prms.ZF.singleValue - 1;
const res = pb.CalcSerie();
expect(res.ok).toBe(false);
expect(res.resultElement.log.messages.length).toBe(1);
expect(res.resultElement.log.messages[0].code).toBe(MessageCode.ERROR_PREBARRAGE_STRUCTURE_ZDV_INF_ZF);
expect(res.resultElement.log.messages[0].extraVar.cub).toBe("B1", "wall upstream basin");
expect(res.resultElement.log.messages[0].extraVar.cdb).toBe("MSG_INFO_LIB_AVAL", "wall downstream basin");
expect(res.resultElement.log.messages[0].extraVar.ns).toBe("1", "structure number in wall");
});
it("PreBarrage must have at least one path from upstream to downstream", () => {
const pb = createPreBarrageTest();
pb.bassins[0].cloisonsAval[0].bassinAval = pb.bassins[0]; // nonsense wall having the same basin at upstream and downstream
......
......@@ -502,21 +502,6 @@ export class PreBarrage extends Nub {
res.resultElement.log.add(m);
}
}
// for each device of each wall: is ZDV < ZF of upstream basin ?
for (const b of this.bassins) {
for (const c of b.cloisonsAval) {
for (const s of c.structures) {
if (s.prms.ZDV.v < b.prms.ZF.v) {
const m = new Message(MessageCode.ERROR_PREBARRAGE_STRUCTURE_ZDV_INF_ZF);
m.extraVar.ns = String(s.findPositionInParent() + 1);
const desc = c.description;
m.extraVar.cub = desc.extraVar.ub;
m.extraVar.cdb = desc.extraVar.db;
res.resultElement.log.add(m);
}
}
}
}
return res;
}
......
......@@ -694,8 +694,6 @@ export enum MessageCode {
/** Pré-barrage : cote de fond du bassin %n% supérieure à la cote de l'eau amont */
WARNING_PREBARRAGE_BASSIN_ZF_SUP_Z1,
/** Pré-barrage : cote de radier de l'ouvrage %ns% inférieure à la cote de fond du bassin amont de la cloison %cub%-%cdb% */
ERROR_PREBARRAGE_STRUCTURE_ZDV_INF_ZF
}
/**
......
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