diff --git a/e2e/remous.e2e-spec.ts b/e2e/remous.e2e-spec.ts index f79ad021fc64051b3603da1f4ef797663c59e3ff..78e1668ba1eeeede932a28dc7b749a2748a1d8f4 100644 --- a/e2e/remous.e2e-spec.ts +++ b/e2e/remous.e2e-spec.ts @@ -3,6 +3,7 @@ import { CalculatorPage } from "./calculator.po"; import { browser } from "protractor"; import { Navbar } from "./navbar.po"; import { PreferencesPage } from "./preferences.po"; +import { SideNav } from "./sidenav.po"; /** * Remous @@ -12,12 +13,14 @@ describe("ngHyd − remous", () => { let calcPage: CalculatorPage; let navBar: Navbar; let prefPage: PreferencesPage; + let sidenav: SideNav; beforeEach(async () => { listPage = new ListPage(); prefPage = new PreferencesPage(); calcPage = new CalculatorPage(); navBar = new Navbar(); + sidenav = new SideNav(); // disable evil option "empty fields on module creation" await prefPage.navigateTo(); await prefPage.disableEvilEmptyFields(); @@ -70,4 +73,24 @@ describe("ngHyd − remous", () => { const hasResults = await calcPage.hasResults(); expect(hasResults).toBe(true); }); + + it("Check that calculation with dx >= reach length fails", async () => { + // load backwater curve session file with Dx>=Long + await navBar.clickMenuButton(); + await browser.sleep(200); + await sidenav.clickLoadSessionButton(); + await browser.sleep(200); + await sidenav.loadSessionFile("./session/session-remous-dx-bief.json"); + await browser.sleep(500); + + // Calculate, the calculation should fail + await calcPage.getCalculateButton().click(); + await browser.sleep(500); + + // check error message in log + expect(await calcPage.nbLogEntries()).toBe(1); + + // check there is no result + expect(await calcPage.presentAndVisible("var-results")).toBe(false); + }); }); diff --git a/e2e/session/session-remous-dx-bief.json b/e2e/session/session-remous-dx-bief.json new file mode 100644 index 0000000000000000000000000000000000000000..cd0a7218332564e1a6dcc6d804b53b61e96e1288 --- /dev/null +++ b/e2e/session/session-remous-dx-bief.json @@ -0,0 +1 @@ +{"header":{"source":"jalhyd","format_version":"1.3","created":"2022-06-30T14:31:54.872Z"},"settings":{"precision":1e-7,"maxIterations":100},"documentation":"","session":[{"uid":"amozNT","props":{"calcType":"CourbeRemous","methodeResolution":"RungeKutta4"},"children":[{"uid":"ZzIyZm","props":{"calcType":"Section","nodeType":"SectionRectangle"},"children":[],"parameters":[{"symbol":"Ks","mode":"SINGLE","value":157544.77102709157},{"symbol":"Q","mode":"SINGLE","value":983277.9803235843},{"symbol":"YB","mode":"SINGLE","value":984997.3273467234},{"symbol":"LargeurBerge","mode":"SINGLE","value":756267.5581282576}]}],"parameters":[{"symbol":"Long","mode":"SINGLE","value":639697.7975510269},{"symbol":"Dx","mode":"SINGLE","value":680775.9048205647},{"symbol":"Z1","mode":"SINGLE","value":662459.5272556832},{"symbol":"Z2","mode":"SINGLE","value":142093.39302660408},{"symbol":"ZF1","mode":"SINGLE","value":150635.28017481393},{"symbol":"ZF2","mode":"SINGLE","value":-375069.6377087354}]}]} \ No newline at end of file diff --git a/jalhyd_branch b/jalhyd_branch index d64531f1305e091791eac674c3a36d86b9e17ddd..094bda298f4c32b69e4a6b56399918bfde4dfca0 100644 --- a/jalhyd_branch +++ b/jalhyd_branch @@ -1 +1 @@ -devel +316-courbe-de-remous-et-bief-remonter-une-erreur-quand-le-pas-de-discretisation-est-superieur-la diff --git a/src/locale/messages.en.json b/src/locale/messages.en.json index 5fb1a5f881380329cc1f30600f6b94346de7cba1..a1a25b70017432cc06086e18029a82697e9a54db 100755 --- a/src/locale/messages.en.json +++ b/src/locale/messages.en.json @@ -66,6 +66,7 @@ "WARNING_REMOUS_PAS_CALCUL_DEPUIS_AVAL": "Downstream boundary condition < Critical elevation: no possible calculation from downstream", "ERROR_REMOUS_PAS_CALCUL": "No possible calculation, neither from upstream nor from downstream", "ERROR_REMOUS_PENTE_FORTE": "The water line slope is too steep at abscissa %x% m (the discretisation step should be reduced)", + "ERROR_REMOUS_PAS_SUPERIEUR_BIEF": "Discretisation step should be less than or equal to the reach length", "ERROR_RU_CIRC_LEVEL_TOO_HIGH": "Uniform flow cannot be calculated with a pipe under load", "ERROR_NEWTON_NON_CONVERGENCE": "Non-convergence (Newton's method)", "ERROR_SECTION_NON_CONVERGENCE_NEWTON_HCONJUG": "Non-convergence of the calculation of the combined depth (Newton's method)", diff --git a/src/locale/messages.fr.json b/src/locale/messages.fr.json index 5f937e2c3f4076c995ca85f011c42990d4194757..928503bff8935980624ffe1932ce2f66cd8eca70 100755 --- a/src/locale/messages.fr.json +++ b/src/locale/messages.fr.json @@ -66,6 +66,7 @@ "WARNING_REMOUS_PAS_CALCUL_DEPUIS_AVAL": "Condition limite aval < Hauteur critique : pas de calcul possible depuis l'aval", "ERROR_REMOUS_PAS_CALCUL": "Aucun calcul possible ni depuis l'amont ni depuis l'aval", "ERROR_REMOUS_PENTE_FORTE": "La pente de la ligne d'eau est trop forte à l'abscisse %x% m (il faudrait réduire le pas de discrétisation)", + "ERROR_REMOUS_PAS_SUPERIEUR_BIEF": "Le pas de discrétisation doit être inférieur ou égal à la longueur du bief", "ERROR_RU_CIRC_LEVEL_TOO_HIGH": "Le régime uniforme ne peut pas être calculé avec une conduite en charge", "ERROR_NEWTON_NON_CONVERGENCE": "Non convergence (Méthode de Newton)", "ERROR_SECTION_NON_CONVERGENCE_NEWTON_HCONJUG": "Non convergence du calcul de la hauteur conjuguée (Méthode de Newton)",