Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • cassiopee/nghyd
1 result
Show changes
Commits on Source (21)
Showing
with 386 additions and 56 deletions
......@@ -6,12 +6,44 @@
Larinier (1992) suggests the following equation:
$$Q = \mu b H_1\sqrt{2g \Delta H}$$
$$Q = C_d b H_1\sqrt{2g \Delta H}$$
With:
* *b* the slot width in m
* *H<sub>1</sub>* the head on the slot m
* *μ* the discharge coefficient (equal to 0.65 by default).
* *C<sub>d</sub>* the discharge coefficient.
The discharge coefficient *μ* may vary from 0.65 for a sharp-edged slot to more than 0.85 when the slot profile is rounded.
# Discharge coefficient **C<sub>d</sub>** for the submerged slot formula (vertical slot fish ladder)
The discharge coefficient **C<sub>d</sub>** is an important parameter for the design of vertical slot weirs. This term is integrated in the formula of conveyance of a submerged slot, which connects the transited flow with the fall between basins, the upstream head on the slot and its width.
**For single vertical slot weirs**, model-reduced studies and numerical simulations have determined average values of discharge coefficients for different configurations, for a typical slot and baffle geometry defined from vertical slot weirs built in France (Figure 1). A different slot and baffle geometry can induce deviations from the average values of the discharge coefficients according to the configurations indicated below.
![Figure 1](fente_noyee_fig1.png)
*Figure 1: typical slot and baffle geometry from which the discharge coefficient values were determined (Ballu, 2017)*
* **Under smooth apron conditions (no bottom roughness) and in the absence of a weir in the slot**, Wang *et al.* (2010) and Ballu *et al.* (2017) showed that the value of **C<sub>d</sub>** is not significantly influenced by discharge and depends mainly on the slope **S** (%) and the ratio of the basin width **B** to the slot width **b** (**B/b**).
* **Under smooth invert conditions (no bottom roughness) with the presence of a weir in the slot**, under 3 configurations of weir heights **h<sub>s</sub>/b** related to slot width **b** (**h<sub>s</sub>/b** = 0.5, 1, and 1.5), Ballu *et al.* (2015) and Ballu (2017) showed that the value of **C<sub>d</sub>** is not significantly influenced by discharge, and is mainly influenced by slope **S**, aspect ratio **B/b**, and weir height **h<sub>s</sub>/b**.
* **Under apron conditions with precast bottom roughnesses and in the absence of a weir in the slot**, with evenly distributed roughnesses of height **h<sub>r</sub>/b** = 2/3 and diameter **Ø<sub>r</sub>/b** = 1/2, under 2 configurations of densities **d<sub>r</sub>** of 10% and 15%, Ballu *et al.* (2017) and Ballu (2017) showed that the value of **C<sub>d</sub>** is not significantly influenced by discharge, and is mainly influenced by slope **S**, aspect ratio **B/b**, and the presence of the bottom roughness **d<sub>r</sub>**.
Depending on these different configurations, the average values of the discharge coefficient range from about 0.62 to nearly 0.88 (Figure 2).
![Figure 2](fente_noyee_fig2.png)
*Figure 2: average values and uncertainties (95% confidence intervals, k = 2) of the discharge coefficients according to the slope S and the shape ratio B/b, for different configurations: (A) smooth raft without weir in the slot, (B) bottom roughness d<sub>r</sub> = 10% without weir in the slot, (C) bottom roughness d<sub>r</sub> = 15% without weir in the slot, (D) weir in the slot h<sub>s</sub>/b = 0.5 and smooth raft, (E) weir in the slot h<sub>s</sub>/b = 1 and smooth raft, (F) weir in the slot h<sub>s</sub>/b = 1.5 and smooth raft*
**For passes with double vertical slots**, **C<sub>d</sub>** values between 0.75 and 0.80 are commonly used for recently constructed devices with longitudinal slopes between 4% and 5.5%. Studies are under way to clarify the influence of different configurations on discharge coefficients and their corresponding values.
**Bibliography:**
Ballu A., Pineau G., Calluaud D., David L. (2015). Experimental study of the influence of sills on vertical slot fishway flow. *36<sup>th</sup> IAHR World Congress*, 7p.
Ballu A. (2017). Étude numérique et expérimentale de l’écoulement turbulent au sein des passes à poissons à fentes verticales. Analyse de l’écoulement tridimensionnel et instationnaire. *Thèse de l’Université de Poitiers*, 223p.
Ballu A., Calluaud D., Pineau G., david L. (2017). Experimental study of the influence of macro‑roughnesses on vertical slot fishway flows. *La Houille Blanche*, 2: 9-14.
Wang R.W., David L., Larinier M. (2010). Contribution of experimental fluid mechanics to the design of vertical slot fish passes. *Knowledge and Management of Aquatic Ecosystems*, 396(2).
docs/en/calculators/structures/fente_noyee_fig1.png

18.8 KiB

docs/en/calculators/structures/fente_noyee_fig2.png

337 KiB

# Installation
Cassiopée can be installed for use without an internet connection as an executable program or as a progressive web app (PWA).
## Installation of the Cassiopée progressive web application
A progressive web app (PWA) is a web application that consists of pages or websites, and can appear to the user in the same way as native applications or mobile applications.
PWAs are available for all platforms (Windows, Linux, MacOS, Android, and iOS) provided you have a compatible browser:
| Plateforme | Chrome/Chromium | Edge | Firefox | Safari |
|------------|-----------------|------|---------------|--------|
| Windows | Yes | Yes | via extension | |
| Linux | Yes | | via extension | |
| MacOS | Yes | | via extension | |
| Android | Yes | | Yes | |
| iOS | | | | Yes |
The installation is done directly from the web browser at <https://cassiopee.g-eau.net> by clicking on a button located on the right of the address bar. The appearance of the button may vary depending on the browser used:
* Install a PWA with Chrome/Chromium: <https://support.google.com/chrome/answer/9658361?hl=fr>
* Installing a PWA with Edge: <https://learn.microsoft.com/fr-fr/microsoft-edge/progressive-web-apps-chromium/ux>
* Install a PWA (any browser and platform): <https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Installing>
After the installation, Cassiopée can be launched from the application icon on the desktop.
Updates are automatically detected and installed (the user is invited to restart Cassiopée after downloading the update).
N.B.: even without going through the PWA installation procedure, Cassiopée is available in the browser without an internet connection provided it has been previously loaded.
## Installation of the Desktop application (obsolete)
Cassiopée is available as an executable program for Windows, Linux and MacOS platforms. The installation programs can be downloaded at the following address: <https://cassiopee.g-eau.fr/cassiopee-releases/>
The installation in the form of a progressive web application (see above) will definitely replace this installation mode in a future version of Cassiopée.
......@@ -13,9 +13,9 @@ Cassiopée is a software dedicated to rivers hydraulics with especially some hel
## Pre-requisites - installation
Cassiopée does not require any installation. It is available online using an up-to-date browser (tested with Firefox, Chrome and Chromium) by navigating to the following address: [https://cassiopee.g-eau.fr](https://cassiopee.g-eau.fr)
Cassiopée does not require any installation. It is available online using an up-to-date browser (tested with Firefox, Edge, Chrome and Chromium) by navigating to the following address: [https://cassiopee.g-eau.fr](https://cassiopee.g-eau.fr).
Offline versions are available (Windows, Linux, macOS, Android) at the following address : [https://cassiopee.g-eau.fr/cassiopee-releases/](https://cassiopee.g-eau.fr/cassiopee-releases/)
Offline versions are available for the Windows, Linux, macOS, Android platforms. For details, see the ["Installation" section](general/installation.md) in the documentation.
## Documentation
......
......@@ -6,12 +6,44 @@
Larinier (1992) propose l'équation suivante&nbsp;:
$$Q = \mu b H_1\sqrt{2g \Delta H}$$
$$Q = C_d b H_1\sqrt{2g \Delta H}$$
Avec&nbsp;:
* *b* la largeur de la fente en m&nbsp;
* *H<sub>1</sub>* la charge sur la fente m&nbsp;
* *μ* le coefficient de débit (égal à 0.65 par défaut).
* *C<sub>d</sub>* le coefficient de débit.
Le coefficient de débit *μ* peut varier de 0.65 pour une fente à arêtes vives à plus de 0.85 lorsque le profil de la fente est arrondi.
# Coefficient de débit C<sub>d</sub> pour la formule de la fente noyée (passe à bassins à fente verticale)
Le coefficient de débit **C<sub>d</sub>** est un paramètre important pour le dimensionnement des passes à fente(s) verticale(s). Ce terme est intégré dans la formule de débitance d’un déversoir de type fente noyée, qui relie le débit transité avec la chute entre bassins, la charge amont sur la fente et sa largeur.
**Pour les passes à simple fente verticale**, des études réalisées sur modèle-réduit et par simulations numériques ont permis de déterminer des valeurs moyennes de coefficients de débit selon différentes configurations, pour une géométrie type de fente et de déflecteurs définie à partir des passes à fentes verticales construites en France (Figure 1). Une géométrie différente de fente et de déflecteur peut induire des écarts par rapport aux valeurs moyennes des coefficients de débit selon les configurations indiquées ci-dessous.
![Figure 1](fente_noyee_fig1.png)
*Figure 1 : géométrie type de fente et de déflecteurs à partir de laquelle les valeurs des coefficients de débit ont été déterminés (Ballu, 2017)*
* **Dans des conditions de radier lisse (sans rugosité de fond) et en l’absence de seuil dans la fente**, Wang *et al.* (2010) et Ballu *et al.* (2017) ont montré que la valeur du **C<sub>d</sub>** n’est pas significativement influencée par le débit et dépend principalement de la pente **S** (%) et du rapport entre la largeur des bassins **B** et la largeur de la fente **b** (**B/b**).
* **Dans des conditions de radier lisse (sans rugosité de fond) avec la présence d’un seuil dans la fente**, selon 3 configurations de hauteurs de seuils **h<sub>s</sub>** rapportées à la largeur de la fente **b** (**h<sub>s</sub>/b** = 0.5, 1 et 1.5), Ballu *et al.* (2015) et Ballu (2017) ont montré que la valeur du **C<sub>d</sub>** n’est pas significativement influencée par le débit, et qu’elle est principalement influencée par la pente **S**, le rapport de forme **B/b** et la hauteur des seuils **h<sub>s</sub>**.
* **Dans des conditions de radier avec rugosités de fond préfabriquées et en l’absence de seuil dans la fente**, avec des rugosités régulièrement réparties de hauteur **h<sub>r</sub>/b** = 2/3 et de diamètre **Ø<sub>r</sub>/b** = 1/2, selon 2 configurations de densités **d<sub>r</sub>** de 10% et 15%, Ballu *et al.* (2017) et Ballu (2017) ont montré que la valeur du **C<sub>d</sub>** n’est pas significativement influencée par le débit, et qu’elle est principalement influencée par la pente **S**, le rapport de forme **B/b** et la présence de la rugosité de fond **d<sub>r</sub>**.
* En fonction de ces différentes configurations, les valeurs moyennes du coefficient de débit s’étalent d’environ 0.62 jusqu’à près de 0.88 (Figure 2).
![Figure 2](fente_noyee_fig2.png)
*Figure 2 : valeurs moyennes et incertitudes (intervalles de confiance à 95%, k=2) des coefficients de débits selon la pente S et le rapport de forme B/b pour différentes configurations&nbsp;: (A) radier lisse sans seuil dans la fente, (B) rugosités de fond d<sub>r</sub> = 10% sans seuil dans la fente, (C) rugosités de fond d<sub>r</sub> = 15% sans seuil dans la fente, (D) seuil dans la fente h<sub>s</sub>/b = 0.5 et radier lisse, (E) seuil dans la fente h<sub>s</sub>/b = 1 et radier lisse, (F) seuil dans la fente h<sub>s</sub>/b = 1.5 et radier lisse*
**Pour les passes à doubles fentes verticales**, des valeurs de **C<sub>d</sub>** comprises entre 0.75 et 0.80 sont couramment retenues pour les dispositifs construits récemment avec des pentes longitudinales entre 4% et 5.5%. Des études sont en cours afin de préciser l’influence de différentes configurations sur les coefficients de débits et leurs valeurs correspondantes.
**Bibliographie :**
Ballu A., Pineau G., Calluaud D., David L. (2015). Experimental study of the influence of sills on vertical slot fishway flow. *36<sup>th</sup> IAHR World Congress*, 7p.
Ballu A. (2017). Étude numérique et expérimentale de l’écoulement turbulent au sein des passes à poissons à fentes verticales. Analyse de l’écoulement tridimensionnel et instationnaire. *Thèse de l’Université de Poitiers*, 223p.
Ballu A., Calluaud D., Pineau G., david L. (2017). Experimental study of the influence of macro‑roughnesses on vertical slot fishway flows. *La Houille Blanche*, 2: 9-14.
Wang R.W., David L., Larinier M. (2010). Contribution of experimental fluid mechanics to the design of vertical slot fish passes. *Knowledge and Management of Aquatic Ecosystems*, 396(2).
docs/fr/calculators/structures/fente_noyee_fig1.png

18.8 KiB

docs/fr/calculators/structures/fente_noyee_fig2.png

337 KiB

# Installation
Cassiopée peut être installé pour une utilisation sans connexion internet sous la forme d'un programme exécutable ou d'une Web App progressive (PWA).
## Installation de l'application web progressive Cassiopée
Une progressive web app (PWA, application web progressive en français) est une application web qui consiste en des pages ou des sites web, et qui peuvent apparaître à l'utilisateur de la même manière que les applications natives ou les applications mobiles.
Les PWA sont disponibles pour toutes les platesformes (Windows, Linux, MacOS, Android, et iOS) à condition d'avoir un browser compatible :
| Plateforme | Chrome/Chromium | Edge | Firefox | Safari |
|------------|-----------------|------|---------------|--------|
| Windows | Oui | Oui | via extension | |
| Linux | Oui | | via extension | |
| MacOS | Oui | | via extension | |
| Android | Oui | | Oui | |
| iOS | | | | Oui |
L'installation se fait directement à partir du navigateur internet à l'adresse <https://cassiopee.g-eau.net> en cliquant sur un bouton situé à droite de la barre d'adresse. L'aspect du bouton peut varier en fonction du navigateur utilisé :
* Installer une PWA avec Chrome/Chromium : <https://support.google.com/chrome/answer/9658361?hl=fr>
* Installer une PWA avec Edge : <https://learn.microsoft.com/fr-fr/microsoft-edge/progressive-web-apps-chromium/ux>
* Installer une PWA (tout browser et plateforme - en anglais) : <https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Installing>
Après l'installation, Cassiopée peut être lancé à partir de l'icône de l'application présente sur le bureau.
Les mises à jour sont automatiquement détectées et installées (l'utilisateur est invité à redémarrer Cassiopée après le téléchargement de la mise à jour).
N.B.: même sans passer par la procédure d'installation de la PWA, Cassiopée est disponible dans le navigateur sans connection internet à condition d'avoir été chargé précédemment.
## Installation de l'application Desktop (obsolète)
Cassiopée est disponible sous la forme d'un programme exécutable pour les plateformes Windows, Linux et MacOS. Les programmes d'installation sont téléchargeables à l'adresse suivante : <https://cassiopee.g-eau.fr/cassiopee-releases/>
L'installation sous la forme d'une application web progressive (cf. ci-dessus) remplacera définitivement ce mode d'installation dans une prochaine version de Cassiopée.
......@@ -13,9 +13,9 @@ Cassiopée est un logiciel consacré à l'hydraulique des rivières avec notamme
## Pré-requis - installation
Cassiopée ne nécessite aucune installation. Il est disponible en ligne à partir d'un navigateur récent (testé sous Firefox, Chrome et Chromium) en se rendant à l'adresse suivante&nbsp;: [https://cassiopee.g-eau.fr](https://cassiopee.g-eau.fr)
Cassiopée ne nécessite aucune installation. Il est disponible en ligne à partir d'un navigateur récent (testé sous Firefox, Edge, Chrome et Chromium) en se rendant à l'adresse suivante&nbsp;: [https://cassiopee.g-eau.fr](https://cassiopee.g-eau.fr).
Des versions hors-ligne sont disponibles (Windows, Linux, macOS, Android) à l'adresse suivante : [https://cassiopee.g-eau.fr/cassiopee-releases/](https://cassiopee.g-eau.fr/cassiopee-releases/)
Des versions hors-ligne sont installables sur les plateformes Windows, Linux, macOS, Android. Voir le détail dans la [section installation](general/installation.md) de la documentation.
## Documentation
......
......@@ -74,7 +74,7 @@ describe("ngHyd − calculate all parameters of all calculators", () => {
const nbParamsCalc = await calcPage.getCheckedCalcModeButtons().count();
expect(nbParamsCalc).toBe(1);
// check that "compute" button is active
const calcButton = calcPage.checkCalcButtonEnabled(true);
const calcButton = await calcPage.checkCalcButtonEnabled(true);
// click "compute" button
await calcButton.click();
// check that result is not empty
......@@ -84,7 +84,7 @@ describe("ngHyd − calculate all parameters of all calculators", () => {
} else {
// module has no calculable params, just click the "compute" button
// check that "compute" button is active
const calcButton = calcPage.checkCalcButtonEnabled(true);
const calcButton = await calcPage.checkCalcButtonEnabled(true);
// click "compute" button
await calcButton.click();
// check that result is not empty
......
......@@ -49,21 +49,21 @@ describe("Calculate button - ", () => {
await browser.sleep(200);
// check that "compute" button is inactive
calcPage.checkCalcButtonEnabled(false);
await calcPage.checkCalcButtonEnabled(false);
// back to PAB: chute
await navBar.clickCalculatorTab(0);
await browser.sleep(200);
// check that "compute" button is active
calcPage.checkCalcButtonEnabled(true);
await calcPage.checkCalcButtonEnabled(true);
// back to PAB: dimensions
await navBar.clickCalculatorTab(1);
await browser.sleep(200);
// check that "compute" button is inactive
calcPage.checkCalcButtonEnabled(false);
await calcPage.checkCalcButtonEnabled(false);
});
describe("check button status in prébarrages - ", () => {
......@@ -83,7 +83,7 @@ describe("Calculate button - ", () => {
await inputQ.sendKeys("-1");
await browser.sleep(200);
calcPage.checkCalcButtonEnabled(false);
await calcPage.checkCalcButtonEnabled(false);
// upstream item
// look for g element with id starting by "flowchart-amont-"
......@@ -120,7 +120,7 @@ describe("Calculate button - ", () => {
await browser.sleep(200);
// calculate button disabled ?
calcPage.checkCalcButtonEnabled(false);
await calcPage.checkCalcButtonEnabled(false);
// upstream item displayed in error ?
expect(await upstream.getAttribute('class')).toContain("node-highlighted-error"); // upstream item is now selected by default (was 'node-error')
......@@ -132,10 +132,48 @@ describe("Calculate button - ", () => {
await browser.sleep(200);
// calculate button still disabled ? (the basin is not connected to anything)
calcPage.checkCalcButtonEnabled(false);
await calcPage.checkCalcButtonEnabled(false);
// upstream item displayed not in error ?
expect(await upstream.getAttribute('class')).not.toContain("node-error");
});
});
async function checkCalculateButtonValidity(calcType: number) {
// open calculator
await navBar.clickNewCalculatorButton();
await listPage.clickMenuEntryForCalcType(calcType);
await browser.sleep(200);
// for each input, set empty and check calculate button is not active
const inputs = calcPage.getParamInputs();
const ninp = await inputs.count();
for (let i = 0; i < ninp; i++) {
const inp = inputs.get(i);
// set input to fixed mode
await calcPage.setParamMode(inp, "fix");
await browser.sleep(100);
// clear input
await calcPage.clearInput(inp);
await browser.sleep(10);
// check calculate button is disabled
await calcPage.checkCalcButtonEnabled(false);
await browser.sleep(100);
// refill input
await inp.sendKeys("1");
await browser.sleep(100);
}
}
it("check status for various calculators", async () => {
// "parallel structures" calculator
await checkCalculateButtonValidity(8);
// "fish ladder : cross walls" calculator
await checkCalculateButtonValidity(10);
});
});
......@@ -45,7 +45,7 @@ describe("ngHyd − calculate with linked parameters", () => {
async function computeAndCheckPresenceOfResults() {
// check that "compute" button is active
const calcButton = calcPage.checkCalcButtonEnabled(true);
const calcButton = await calcPage.checkCalcButtonEnabled(true);
// click "compute" button
await calcButton.click();
// check that result is not empty
......
import { by, element, ElementFinder, browser, protractor, ElementArrayFinder } from "protractor";
import { by, element, ElementFinder, browser, protractor, ElementArrayFinder, Key } from "protractor";
import { scrollPageToTop, scrollToElement } from "./util.po";
export class CalculatorPage {
......@@ -130,11 +130,11 @@ export class CalculatorPage {
}
getAddStructureButton() {
return element(by.css("structure-fieldset-container .hyd-window-btns button.add-structure"));
return element(by.css("fieldset-container.structure-fieldsetcontainer .hyd-window-btns button.add-structure"));
}
getCopyStructureButton() {
return element(by.css("structure-fieldset-container .hyd-window-btns button.copy-structure"));
return element(by.css("fieldset-container.structure-fieldsetcontainer .hyd-window-btns button.copy-structure"));
}
getAllLinkButtons() {
......@@ -249,6 +249,8 @@ export class CalculatorPage {
||
await this.presentAndVisible("pb-results pb-results-table")
||
await this.presentAndVisible("pb-results pb-cloison-results")
||
await this.presentAndVisible("macrorugo-compound-results macrorugo-compound-results-table")
||
await this.presentAndVisible("jet-results .fixed-results-container")
......@@ -335,9 +337,9 @@ export class CalculatorPage {
}
// check that "compute" button is in given enabled/disabled state
checkCalcButtonEnabled(enabled: boolean) {
async checkCalcButtonEnabled(enabled: boolean) {
const calcButton = this.getCalculateButton();
expect(calcButton.isEnabled()).toBe(enabled);
expect(await calcButton.isEnabled()).toBe(enabled);
return calcButton;
}
......@@ -458,4 +460,15 @@ export class CalculatorPage {
getCalculatorHelpButton() {
return element(by.css("#help-calc"));
}
/**
* reliable input clearing
*/
async clearInput(inp: ElementFinder) {
const txt = await inp.getAttribute('value');
const len = txt.length;
for (let n = 0; n < len; n++) {
await inp.sendKeys(Key.BACK_SPACE);
}
}
}
import { ListPage } from "./list.po";
import { CalculatorPage } from "./calculator.po";
import { Navbar } from "./navbar.po";
import { browser, by, element } from "protractor";
import { AppPage } from "./app.po";
import { SideNav } from "./sidenav.po";
import { PreferencesPage } from "./preferences.po";
import { changeSelectValue, scrollPageToTop } from "./util.po";
/**
* Clone calculators
*/
describe("Prébarrages results - ", () => {
let listPage: ListPage;
let calcPage: CalculatorPage;
let navBar: Navbar;
let prefPage: PreferencesPage;
beforeAll(() => {
listPage = new ListPage();
calcPage = new CalculatorPage();
navBar = new Navbar();
prefPage = new PreferencesPage();
jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 1000;
});
beforeEach(async () => {
// disable evil option "empty fields on module creation"
await prefPage.navigateTo();
await prefPage.disableEvilEmptyFields();
await browser.sleep(200);
});
it("every module shoud have results", async () => {
// create prébarrage calculator
await navBar.clickNewCalculatorButton();
await listPage.clickMenuEntryForCalcType(30);
// run calculation
const calcButton = calcPage.getCalculateButton();
await calcButton.click();
await browser.sleep(200);
const nodes = element.all(by.css("g.nodes > g"));
const nb = await nodes.count();
for (let n = 0; n < nb; n++) {
const node = nodes.get(n);
await node.click();
await browser.sleep(200);
// check that result is not empty
const hasResults = await calcPage.hasResults();
expect(hasResults).toBe(true);
}
});
});
......@@ -63,7 +63,7 @@ describe("Solveur - ", () => {
expect(spV).toContain("Z2 - Cote aval (PAB : chute)");
// check that "compute" button is active
const calcButton = calcPage.checkCalcButtonEnabled(true);
const calcButton = await calcPage.checkCalcButtonEnabled(true);
// click "compute" button
await calcButton.click();
// check that result is not empty
......@@ -113,7 +113,7 @@ describe("Solveur - ", () => {
await calcPage.getInputById("Ytarget").sendKeys("318");
// check that "compute" button is active
const calcButton = calcPage.checkCalcButtonEnabled(true);
const calcButton = await calcPage.checkCalcButtonEnabled(true);
// click "compute" button
await calcButton.click();
// check that result is not empty
......@@ -134,7 +134,7 @@ describe("Solveur - ", () => {
expect(hasResultsClone1).toBe(false);
// check that "compute" button is active
const calcButtonClone = calcPage.checkCalcButtonEnabled(true);
const calcButtonClone = await calcPage.checkCalcButtonEnabled(true);
// click "compute" button
await calcButtonClone.click();
// check that result is not empty
......@@ -405,3 +405,53 @@ describe("Solveur - nghyd#601 without empty fields option", () => {
await browser.sleep(200);
});
});
describe("Solveur - nghyd#606 - a single module cannot be used with solver", () => {
let prefPage: PreferencesPage;
let navBar: Navbar;
let listPage: ListPage;
let calcPage: CalculatorPage;
beforeAll(() => {
prefPage = new PreferencesPage();
navBar = new Navbar();
listPage = new ListPage();
calcPage = new CalculatorPage();
});
async function openCalculator(id: number) {
await navBar.clickNewCalculatorButton();
await browser.sleep(200);
await listPage.clickMenuEntryForCalcType(id);
await browser.sleep(200);
}
async function openSolver() {
await openCalculator(22);
}
beforeEach(async () => {
// await browser.manage().window().setPosition(2000, 30);
// disable evil option "empty fields on module creation"
await prefPage.setEmptyFields(false);
});
it("", async () => {
// open uniform flow calculator
await openCalculator(3);
// open a solver module
await openSolver();
// set speed as target parameter
const trs = calcPage.getSelectById("select_target_result");
await changeSelectValue(trs, 1);
await browser.sleep(200);
// check searched parameter has options
const sps = calcPage.getSelectById("select_searched_param");
expect(await calcPage.isSelectEmpty(sps)).toBe(false);
});
});
......@@ -54,6 +54,6 @@ describe("ngHyd - check invalid values are removed - ", () => {
expect(w).toEqual("");
// check that "compute" button is disabled
calcPage.checkCalcButtonEnabled(false);
await calcPage.checkCalcButtonEnabled(false);
});
});
......@@ -25,6 +25,7 @@ markdown_extensions:
nav:
- Presentation of Cassiopée:
- index.md
- general/installation.md
- general/principe_fonctionnement.md
- general/parametres_application.md
- general/raccourcis_clavier.md
......
......@@ -25,6 +25,7 @@ markdown_extensions:
nav:
- Présentation de Cassiopée:
- index.md
- general/installation.md
- general/principe_fonctionnement.md
- general/parametres_application.md
- general/raccourcis_clavier.md
......
......@@ -7,16 +7,8 @@
const fs = require('fs-extra');
const destPath_JS = "src/assets/docs/javascripts";
const destPath_FR_JS = "src/assets/docs/fr/javascripts"; // pour la compilation en local (français)
const destPath_EN_JS = "src/assets/docs/en/javascripts"; // pour la compilation en local (anglais)
const destPath_CSS = "src/assets/docs/stylesheets";
const destPath_FR_CSS = "src/assets/docs/fr/stylesheets"; // pour la compilation en local (français)
const destPath_EN_CSS = "src/assets/docs/en/stylesheets"; // pour la compilation en local (anglais)
const destPath_JS_MJ = destPath_JS + "/mathjax";
const destPath_FR_JS_MJ = destPath_FR_JS + "/mathjax"; // pour la compilation en local (français)
const destPath_EN_JS_MJ = destPath_EN_JS + "/mathjax"; // pour la compilation en local (anglais)
// empty destination folder
fs.emptyDirSync(destPath_JS);
......@@ -26,29 +18,74 @@ fs.ensureDirSync(destPath_JS_MJ + "/fonts/HTML-CSS/TeX/", { recursive: true });
// copy required files only
fs.copySync("node_modules/mathjax/es5/tex-mml-chtml.js", destPath_JS_MJ + "/tex-mml-chtml.js");
fs.copySync("node_modules/mathjax/es5/tex-mml-chtml.js", destPath_FR_JS_MJ + "/tex-mml-chtml.js");
fs.copySync("node_modules/mathjax/es5/tex-mml-chtml.js", destPath_EN_JS_MJ + "/tex-mml-chtml.js");
fs.copySync("node_modules/mathjax/es5/output/chtml/fonts", destPath_JS_MJ + "/output/chtml/fonts");
fs.copySync("node_modules/mathjax/es5/output/chtml/fonts", destPath_FR_JS_MJ + "/output/chtml/fonts");
fs.copySync("node_modules/mathjax/es5/output/chtml/fonts", destPath_EN_JS_MJ + "/output/chtml/fonts");
fs.copySync("docs/mathjax.config.js", destPath_JS + "/mathjax.config.js");
fs.copySync("docs/mathjax.config.js", destPath_FR_JS + "/mathjax.config.js");
fs.copySync("docs/mathjax.config.js", destPath_EN_JS + "/mathjax.config.js");
fs.copySync("docs/mathjax-scrollbar.css", destPath_CSS + "/mathjax-scrollbar.css");
fs.copySync("docs/matomo-tracking.js", destPath_JS + "/matomo-tracking.js");
fs.copySync("node_modules/mermaid/dist/mermaid.min.js", destPath_JS + "/mermaid.min.js");
fs.copySync("node_modules/mermaid/dist/mermaid.min.js.map", destPath_JS + "/mermaid.min.js.map");
fs.copySync("docs/mathjax-scrollbar.css", destPath_JS + "/mathjax.config.js");
fs.copySync("docs/mathjax.config.js", destPath_FR_JS + "/mathjax.config.js");
fs.copySync("docs/mathjax.config.js", destPath_EN_JS + "/mathjax.config.js");
/*
Ici, on veut que les ressources copiées ci dessus soit accessibles.
fs.copySync("docs/mathjax-scrollbar.css", destPath_CSS + "/mathjax-scrollbar.css");
fs.copySync("docs/mathjax-scrollbar.css", destPath_FR_CSS + "/mathjax-scrollbar.css");
fs.copySync("docs/mathjax-scrollbar.css", destPath_EN_CSS + "/mathjax-scrollbar.css");
mkdocs-xx.yml :
extra_css:
- ../stylesheets/mathjax-scrollbar.css
fs.copySync("docs/matomo-tracking.js", destPath_JS + "/matomo-tracking.js");
fs.copySync("docs/matomo-tracking.js", destPath_FR_JS + "/matomo-tracking.js");
fs.copySync("docs/matomo-tracking.js", destPath_EN_JS + "/matomo-tracking.js");
Fichiers HTML générés :
Par ex src/assets/docs/fr/calculators/maths/solver.html contient <link rel="stylesheet" href="../../stylesheets/mathjax-scrollbar.css">
ce qui fait référence à stylesheets dans src/assets/docs/fr alors qu'on veut référencer stylesheets dans src/assets/docs/
(le chemin généré dépend de l'emplacement du fichier le contenant).
fs.copySync("node_modules/mermaid/dist/mermaid.min.js", destPath_JS + "/mermaid.min.js");
fs.copySync("node_modules/mermaid/dist/mermaid.min.js", destPath_FR_JS + "/mermaid.min.js");
fs.copySync("node_modules/mermaid/dist/mermaid.min.js", destPath_EN_JS + "/mermaid.min.js");
Le problème, c'est que si on modifie extra_css avec ../../stylesheets/mathjax-scrollbar.css, cela génère la même chose
(href="../../stylesheets/mathjax-scrollbar.css") vraisemblablement à cause de site_dir (=docs/fr) qui limite les "remontées"
de niveau de répertoire.
La solution est donc de modifier les fichiers HTML générés pour ajouter ../ dans href="...".
*/
const cp = require('child_process');
function execBashCmd(cmd) {
// console.log(cmd);
// console.log(cp.execSync(cmd, { encoding: 'utf-8' }));
cp.execSync(cmd);
}
function escapeSlash(s) {
return s.replaceAll('/', '\\\/');
}
function escapeDot(s) {
return s.replaceAll('\.', '\\.');
}
function escapeDoubleQuote(s) {
return s.replaceAll('"', '\\"');
}
function applyEscapes(s) {
return escapeDot(escapeSlash(escapeDoubleQuote(s)));
}
function replaceHtml(base_dir, s1, s2) {
s1 = applyEscapes(s1);
s2 = applyEscapes(s2);
const cmd = "find " + base_dir + " -name '*.html' -exec sed -i \"s/" + s1 + "/" + s2 + "/g\" {} \\\;";
execBashCmd(cmd);
}
replaceHtml("src/assets/docs/fr/", "../../stylesheets/mathjax-scrollbar.css", "../../../stylesheets/mathjax-scrollbar.css");
replaceHtml("src/assets/docs/en/", "../../stylesheets/mathjax-scrollbar.css", "../../../stylesheets/mathjax-scrollbar.css");
replaceHtml("src/assets/docs/fr/", "../../javascripts/mathjax.config.js", "../../../javascripts/mathjax.config.js");
replaceHtml("src/assets/docs/en/", "../../javascripts/mathjax.config.js", "../../../javascripts/mathjax.config.js");
replaceHtml("src/assets/docs/fr/", "../../javascripts/matomo-tracking.js", "../../../javascripts/matomo-tracking.js");
replaceHtml("src/assets/docs/en/", "../../javascripts/matomo-tracking.js", "../../../javascripts/matomo-tracking.js");
replaceHtml("src/assets/docs/fr/", "../../javascripts/mermaid.min.js", "../../../javascripts/mermaid.min.js");
replaceHtml("src/assets/docs/en/", "../../javascripts/mermaid.min.js", "../../../javascripts/mermaid.min.js");
replaceHtml("src/assets/docs/fr/", "../../javascripts/mathjax/tex-mml-chtml.js", "../../../javascripts/mathjax/tex-mml-chtml.js");
replaceHtml("src/assets/docs/en/", "../../javascripts/mathjax/tex-mml-chtml.js", "../../../javascripts/mathjax/tex-mml-chtml.js");