Skip to content
Snippets Groups Projects
Commit 9e769faf authored by AUBRY JEAN-PASCAL's avatar AUBRY JEAN-PASCAL
Browse files

Merge branch 'devel' into 659-mise-a-jour-vers-angular-15

parents 94e3010b 038c93bf
No related branches found
No related tags found
2 merge requests!275Release v4.19.0,!256Mise à jour vers Angular 15
Pipeline #170081 failed
This commit is part of merge request !256. Comments created here will be created in the context of that merge request.
Showing
with 788 additions and 971 deletions
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "Cassiopée",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
//"image": "geaucassiopee/ci-cd-cross-platform-webapp:v3",
"build": { "dockerfile": "../Dockerfile" },
"customizations": {
"vscode": {
"extensions": [
"eamodio.gitlens",
"streetsidesoftware.code-spell-checker",
"streetsidesoftware.code-spell-checker-french",
"ms-vscode.vscode-typescript-next",
"dbaeumer.vscode-eslint"
]
}
}
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
......@@ -6,7 +6,7 @@ It represents the closest reasonable ESLint configuration to this
project's original TSLint configuration.
We recommend eventually switching this configuration to extend from
the recommended rulesets in typescript-eslint.
the recommended rulesets in typescript-eslint.
https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md
Happy linting! 💖
......@@ -18,7 +18,7 @@ module.exports = {
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"project": ["./e2e/tsconfig.e2e.json"],
"sourceType": "module"
},
"plugins": [
......
......@@ -10,7 +10,7 @@ stages:
default:
tags: [docker]
image: geaucassiopee/ci-cd-cross-platform-webapp:v3
image: $CI_REGISTRY/cassiopee/nghyd:latest
variables:
# from Gitlab CI/CD environment variables :
......@@ -37,36 +37,25 @@ before_script:
- mkdir -p ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
cache:
key:
files:
- jalhyd_branch
- package.json
paths:
- node_modules/
- jalhyd/
install:
stage: install
only:
- pushes
- tags
- schedules
- web
artifacts:
paths:
- node_modules/
- jalhyd/
expire_in: 1 min
script:
- JALHYD_BRANCH=`cat jalhyd_branch`
- echo "CI_COMMIT_REF_NAME - $CI_COMMIT_REF_NAME"
- if [ "$CI_COMMIT_REF_NAME" = "master" ]; then JALHYD_BRANCH="master"; fi
- if [ "$CI_COMMIT_REF_NAME" = "devel" ]; then JALHYD_BRANCH="devel"; fi
- echo "Branche JalHyd - $JALHYD_BRANCH"
- rm -rf jalhyd
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.irstea.fr/cassiopee/jalhyd.git
- git clone https://forgemia.inra.fr/cassiopee/jalhyd.git
- cd jalhyd
- git checkout "$JALHYD_BRANCH" || git checkout devel
- npm ci --force
- npm run build
- cd ..
- rm -rf node_modules
- npm ci --force --unsafe-perm
test:
......@@ -76,15 +65,20 @@ test:
- schedules
- web
- master
- devel
script:
- npm run e2e
timeout: 2h
.build:
stage: build
dependencies:
- install
artifacts:
expire_in: 10 min
paths:
- dist/
- build
script:
# -baseref option is used by npm to set the npm_config_basehref environment variable
# used in package.json
......@@ -157,7 +151,8 @@ releases-nightly:
except:
# exclude master to apply releases-nightly on devel only
- master
dependencies: []
dependencies:
- install
script:
- ./scripts/release-version.sh nightly $PROD_LOGIN $PROD_HOST $RELEASES_PATH
......@@ -166,6 +161,7 @@ releases-version:
only:
variables:
- $CI_COMMIT_REF_NAME =~ /^[0-9]+\.[0-9]+\.[0-9]+$/ # version tag
dependencies: []
dependencies:
- install
script:
- ./scripts/release-version.sh $CI_COMMIT_REF_NAME $PROD_LOGIN $PROD_HOST $RELEASES_PATH
{
"cSpell.words": [
"prms"
],
"cSpell.language": "en,fr-FR"
}
\ No newline at end of file
This diff is collapsed.
# Documentation ngHyd pour les développeurs
Voir aussi :
Voir aussi :
* [ngHyd installation instructions](README.md)
* [JaLHyd developers documentation](https://gitlab.irstea.fr/cassiopee/jalhyd/blob/master/DEVELOPERS.md)
* [JaLHyd developers documentation](https://forgemia.inra.fr/cassiopee/jalhyd/blob/master/DEVELOPERS.md)
## Description
ngHyd est une interface Web pour [JaLHyd](https://gitlab.irstea.fr/cassiopee/jalhyd) écrite en Angular/typescript.
ngHyd est une interface Web pour [JaLHyd](https://forgemia.inra.fr/cassiopee/jalhyd) écrite en Angular/typescript.
Elle est déclinée à l'aide d'Electron et de l'ensemble de technologies PWA (Progressive Web Application dont les service workers) sous forme d'application hors-ligne pour Linux, Mac, Windows et Android.
......@@ -31,17 +31,13 @@ La documentation est générée avec Mkdocs, pandoc et LaTeX.
### pour le développement
* nodejs / npm
* python (pour mkdocs)
* wine (pour Electron / windows)
* pandoc (pour la documentation PDF)
* une distribution LaTeX, par exemple texlive (pour la documentation PDF)
Voir la section *Requirements* du fichier `README.md`.
### pour l'exécution
* version Web : une connexion Internet et un navigateur à jour (Firefox, Chrome/Chromium, Safari, Edge…)
* version hors-ligne : Linux, MacOS, Windows 7 ou plus récent, Android 7 ou plus récent
## Grands principes
### interface
......@@ -141,7 +137,7 @@ Dans cet exemple nous considérerons le module fictif "Addition" proposé dans l
### JaLHyd
Voir la [documentation JaLHyd pour les développeurs](https://gitlab.irstea.fr/cassiopee/jalhyd/blob/master/DEVELOPERS.md) (en anglais)
Voir la [documentation JaLHyd pour les développeurs](https://forgemia.inra.fr/cassiopee/jalhyd/blob/master/DEVELOPERS.md) (en anglais)
### configuration du module
......@@ -150,7 +146,7 @@ Créer les fichiers de configuration du module de calcul :
Dans `src/app/calculators`, créer un dossier nommé comme la clé du type de calculateur (`CalculatorType`), en minuscules. Par exemple pour `CalculatorType.Addition`, on aura : `src/app/calculators/addition`.
Dans ce nouveau dossier, créer le fichier `config.json`, comme suit :
```json
[
{
......@@ -168,7 +164,7 @@ Dans ce nouveau dossier, créer le fichier `config.json`, comme suit :
}
]
```
Dans cet exemple, on définit un seul groupe de champs nommé arbitrairement "fs_addition", dans lequel on ajoute tous les paramètres de l'équation, désignés par leur symbole, qui doit correspondre au symbole fourni comme deuxième argument de `ParamDefinition()` dans JaLHyd.
Le deuxième et dernier bloc contient les options pour ce module: ici uniquement le lien vers la page de documentation pour ce module (`help`).
......@@ -209,7 +205,7 @@ Différents éléments de la configuration peuvent contenir une clé `help` donn
"HG": "devalaison/grille.html#hauteur-de-grille"
}
```
#### traduction
Dans le dossier de configuration `src/app/calculators/addition`, créer les fichiers d'internationalisation, par exemple `fr.json` pour le français. Il doivent reprendre tous les identifiants utilisés dans le fichier de configuration (paramètres, groupes de champs, listes déroulantes…) et fournir leur traduction, comme suit :
......@@ -400,7 +396,7 @@ Ainsi, pour rendre la visibilité d'un champ dépendante du choix dans la liste,
* écouter le changement de propriété (méthode `update()`, action `propertyChange`),
* selon la nouvelle valeur, ajuster la propriété `visible` des paramètres concernés.
Il n'y a rien à faire de particulier dans ngHyd.
### si le module agrège une section
......
Dockerfile 0 → 100644
FROM docker.io/node:18.18-bookworm-slim
LABEL maintainer="bug@cassiopee.g-eau.fr"
LABEL version="3.1"
ENV DEBIAN_FRONTEND noninteractive
# Install base packages
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
locales \
curl \
build-essential \
wget \
ca-certificates \
gnupg \
git \
rsync \
openssh-client \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Set UTF-8 locale
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
&& locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# Add Repositories
## Wine
RUN dpkg --add-architecture i386 \
&& wget -nc https://dl.winehq.org/wine-builds/winehq.key \
&& apt-key add winehq.key \
&& echo "deb https://dl.winehq.org/wine-builds/debian/ bookworm main" > /etc/apt/sources.list.d/winehq.list
# Install packages
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
## MkDocs
mkdocs \
python3-mdx-math \
mkdocs-material-extensions \
## Pandoc & LaTeX for PDF doc
pandoc \
texlive \
latexmk \
texlive-latex-extra \
texlive-bibtex-extra \
texlive-lang-french \
texlive-xetex \
## Wine
winehq-stable \
## chromium and procps (e2e)
chromium chromium-driver procps \
## Clean cache
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
WORKDIR /build
ENV SHELL /bin/bash
......@@ -10,7 +10,7 @@ Requirements for developping Cassiopee can be achieved by manually install the r
#### Required dependencies
* [jalhyd](https://gitlab.irstea.fr/cassiopee/jalhyd)
* [jalhyd](https://forgemia.inra.fr/cassiopee/jalhyd)
* npm
* python3
* pandoc ^2 (optional, for PDF documentation only)
......@@ -31,9 +31,9 @@ sudo apt install pandoc texlive latexmk texlive-latex-extra texlive-bibtex-extra
#### Using docker container
Download and use the following docker image: https://hub.docker.com/repository/docker/geaucassiopee/ci-cd-cross-platform-webapp
More details on how to use it on vscode are available at https://gitlab.irstea.fr/cassiopee/cassiopee2-integration
Use the DockerFile provided at the root of this repository. This repository also
provide a `.devcontainer` configuration for developing nghyd in vscode
(See https://code.visualstudio.com/docs/devcontainers/containers).
### Install dependencies
......@@ -206,7 +206,38 @@ To draw the diagram:
npm run viz
```
## Caveats
### CI/CD docker image
Gitlab CI/CD uses a docker image created with the `DockerFile` located at the root
of this repository. This image needs to be pushed on the Gitlab registry in order to
be used by the CI/CD.
#### Requirements
You need to have Docker installed on your computer (See: https://docs.docker.com/get-docker/).
On Windows, you first need to install a Linux distro under WSL2 (See
https://learn.microsoft.com/en-us/windows/wsl/install).
#### Build and push container images to the Container Registry
This notice is inspired from
https://docs.gitlab.com/ee/user/packages/container_registry/build_and_push_images.html.
You first need to create an access token (personal or project token):
Go to https://gitlab.irstea.fr/-/profile/personal_access_tokens
and create a token with a minimum scope `write_registry` and `read_registry`.
Open a terminal in the root folder of this repository on your local machine,
and type (with `<token name>` and `<token value>` the credentials
of the access token):
```
docker login registry.forgemia.inra.fr -u <token name> -p <token value>
docker build -t registry.forgemia.inra.fr/cassiopee/nghyd .
docker push registry.forgemia.inra.fr/cassiopee/nghyd
```
### Deployment
......@@ -222,7 +253,7 @@ Use [semantic versioning](https://semver.org/).
**It's discouraged to execute release steps manually, skip this section and see Release Script below**
Before releasing a new stable version, a new version of JaLHyd should be tagged, see "Release Policy" in [JaLHyd's README.md](https://gitlab.irstea.fr/cassiopee/jalhyd/blob/master/README.md)
Before releasing a new stable version, a new version of JaLHyd should be tagged, see "Release Policy" in [JaLHyd's README.md](https://forgemia.inra.fr/cassiopee/jalhyd/blob/master/README.md)
Then, one should complete the following files:
- `CHANGELOG.md`
......
docs/en/calculators/devalaison/ge.png

19.5 KiB

......@@ -199,10 +199,6 @@ Blockage ratio due to spacers. Scope of validity of the formula: \(O_{entH} \leq
<div style="position: relative"><a id="profil-des-barreaux" style="position: absolute; top: -60px;"></a></div>
### Bar profile
![Bar profile](profil-barreaux.png)
*Raynal, Sylvain. « Étude expérimentale et numérique des grilles ichtyocompatibles ». Sciences et ingénierie en matériaux, mécanique, énergétique et aéronautique - SIMMEA, 2013.*
#### Conventional trashrack
The shape coefficient of the bars \(a\) is 2.89 for the rectangular profile (PR) and 1.70 for the hydrodynamic profile (PH).
......@@ -217,6 +213,7 @@ The shape coefficient of the bars \(c\) is 1.69 for the rectangular profile (PR)
| Bar shape | Droplet | Plétina | Tadpole 8 | Tadpole 10 | Hydrodynamic | Rectangular |
| --- | --- | --- | --- | --- | --- | --- |
| | <img src="ge.png" alt="Droplet" style="width:65px;height:289px;"> | <img src="pletina.png" alt="Plétina" style="width:65px;height:289px;"> | <img src="tadpole8.png" alt="Tadpole 8" style="width:65px;height:289px;"> | <img src="tadpole10.png" alt="Tadpole 10" style="width:65px;height:289px;"> | <img src="hydrodynamique.png" alt="Hydrodynamique" style="width:65px;height:289px;"> | <img src="rec.png" alt="Rectangulaire" style="width:65px;height:289px;"> |
| Bar coefficient $A_i$| 2.47 | 1.75 | 1.27 | 1.79 | 2.10 | 3.85 |
After Lemkecher et al. (2020)[^4]
......
docs/en/calculators/devalaison/hydrodynamique.png

20.5 KiB

......@@ -30,7 +30,7 @@ With:
- \(g\): acceleration of gravity = 9.81 m.s-2
- \(D\): horizontal distance travelled between the start of the jet and the point of impact (m)
- \(\alpha\)&nbsp;: angle of shooting in relation to the horizontal (°)
- \(\V_0\)&nbsp;: initial speed (m/s)
- \(V_0\)&nbsp;: initial speed (m/s)
### Impact abscissa (horizontal distance covered)
......
docs/en/calculators/devalaison/pletina.png

12.8 KiB

docs/en/calculators/devalaison/rec.png

7.38 KiB

docs/en/calculators/devalaison/tadpole10.png

19.9 KiB

docs/en/calculators/devalaison/tadpole8.png

21.2 KiB

......@@ -6,7 +6,7 @@ The slope used in all Cassiopée's modules is the topographic slope:
> The grade (also called slope, incline, gradient, mainfall, pitch or rise) of a physical feature, landform or constructed line refers to the tangent of the angle of that surface to the horizontal. (Source: [Wikipedia](https://en.wikipedia.org/wiki/Grade_(slope)))
![Longitudinal cross-sectional scheme of a rectilinear section](pente.svg)
![Longitudinal cross-sectional scheme of a rectilinear section](pente.png)
The slope (\(I\)) in m/m used in Cassiopee's modules is:
......
docs/en/calculators/hsl/pente.png

9.79 KiB

This diff is collapsed.
......@@ -44,16 +44,3 @@ The correlation table of the coefficients is as follows:
| Hydraulically smooth pipe - 0.25 &le; D &le; 1 | 0.00 | 0.971 | 1.81 | 4.81 |
Table: Materials and coefficients used in the Lechapt and Calmon formula
## Singular head loss
$$ J_S = K_S \frac{V^2}{2g}$$
With:
- \(K_S\)&nbsp;: singular head loss coefficient
- \(V\)&nbsp;: water speed in the pipe (\(V = 4 Q / \pi / D^2\))
## Darcy's head loss coefficient
$$ f_D = \frac{2g J D}{l_T V^2}
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