Skip to content
Snippets Groups Projects
Commit 043f86ca authored by David Dorchies's avatar David Dorchies
Browse files

Lint et traductions

parent fbc64d38
No related branches found
No related tags found
No related merge requests found
Showing
with 332 additions and 306 deletions
import { Component, ApplicationRef, OnInit, OnDestroy, HostListener, ViewChild, ComponentRef } from '@angular/core';
//import { MdDialog } from '@angular/material';
import { Router, ActivatedRoute } from '@angular/router';
import { Component, ApplicationRef, OnInit, OnDestroy, HostListener, ViewChild, ComponentRef } from "@angular/core";
// import { MdDialog } from '@angular/material';
import { Router, ActivatedRoute } from "@angular/router";
import { Observer } from "jalhyd";
import { environment } from '../environments/environment';
import { InternationalisationService, Language, LanguageCode } from './services/internationalisation/internationalisation.service';
import { ErrorService } from './services/error/error.service';
import { environment } from "../environments/environment";
import { InternationalisationService, Language, LanguageCode } from "./services/internationalisation/internationalisation.service";
import { ErrorService } from "./services/error/error.service";
// import { AlertDialog } from './components/alert-dialog/alert-dialog.component';
import { FormulaireService } from './services/formulaire/formulaire.service';
import { FormulaireDefinition } from './formulaire/definition/form-definition';
import { ServiceFactory } from './services/service-factory';
import { ParamService } from './services/param/param.service';
import { ApplicationSetupService } from './services/app-setup/app-setup.service';
import { HttpService } from './services/http/http.service';
import { HelpService } from './services/help/help.service';
import { HelpComponent } from './components/help/help.component';
import { LoadCalcDialogAnchorDirective } from './components/load-calculator/load-calculator-anchor.directive';
import { LoadCalculatorComponent } from './components/load-calculator/load-calculator.component';
import { SaveCalcDialogAnchorDirective } from './components/save-calculator/save-calculator-anchor.directive';
import { SaveCalculatorComponent } from './components/save-calculator/save-calculator.component';
import { FormulaireService } from "./services/formulaire/formulaire.service";
import { FormulaireDefinition } from "./formulaire/definition/form-definition";
import { ServiceFactory } from "./services/service-factory";
import { ParamService } from "./services/param/param.service";
import { ApplicationSetupService } from "./services/app-setup/app-setup.service";
import { HttpService } from "./services/http/http.service";
import { HelpService } from "./services/help/help.service";
import { HelpComponent } from "./components/help/help.component";
import { LoadCalcDialogAnchorDirective } from "./components/load-calculator/load-calculator-anchor.directive";
import { LoadCalculatorComponent } from "./components/load-calculator/load-calculator.component";
import { SaveCalcDialogAnchorDirective } from "./components/save-calculator/save-calculator-anchor.directive";
import { SaveCalculatorComponent } from "./components/save-calculator/save-calculator.component";
@Component({
selector: 'nghyd-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
selector: "nghyd-app",
templateUrl: "./app.component.html",
styleUrls: ["./app.component.scss"]
})
export class AppComponent implements OnInit, OnDestroy, Observer {
private _displayErrorDialog: boolean = false;
private _displayErrorDialog = false;
/**
* liste des calculettes. Forme des objets :
......@@ -115,8 +115,8 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
}
private updateLocale() {
let tag = this.intlService.currentLanguage.tag;
document['locale'] = tag;
const tag = this.intlService.currentLanguage.tag;
document["locale"] = tag;
// location.reload(true);
// this.cdRef.markForCheck();
......@@ -136,8 +136,7 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
// }
// else
console.log(data);
}
else if (sender instanceof FormulaireService) {
} else if (sender instanceof FormulaireService) {
switch (data["action"]) {
case "createForm":
const f: FormulaireDefinition = data["form"];
......@@ -175,11 +174,9 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
this.closeCalculator(form);
break;
}
}
else if (sender instanceof InternationalisationService) {
} else if (sender instanceof InternationalisationService) {
this.updateLocale();
}
else if (sender instanceof FormulaireDefinition) {
} else if (sender instanceof FormulaireDefinition) {
switch (data["action"]) {
case "nameChanged":
this.updateCalculatorTitle(sender, data["name"]);
......@@ -193,8 +190,9 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
private getCalculatorIndexFromId(formId: number) {
const index = this._calculators.reduce((resultIndex, calc, currIndex) => {
if (resultIndex == -1 && calc["uid"] == formId)
if (resultIndex === -1 && calc["uid"] === formId) {
resultIndex = currIndex;
}
return resultIndex;
}, -1);
......@@ -215,7 +213,7 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
const compRef: ComponentRef<SaveCalculatorComponent> = this.saveCalcDialogAnchor.createDialog();
// création de la liste des formulaires
let list = [];
const list = [];
for (const c of this._calculators) {
const uid = +c["uid"];
list.push({
......@@ -233,22 +231,24 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
// ajout extension ".json"
const re = /.+\.json/;
const match = re.exec(name.toLowerCase());
if (match === null)
if (match === null) {
name = name + ".json";
}
this.saveSession(list, name)
this.saveSession(list, name);
});
}
private saveSession(calcList: any[], filename) {
let elems = [];
for (const c of calcList)
const elems = [];
for (const c of calcList) {
if (c.selected) {
console.log(c.title);
const form: FormulaireDefinition = this.formulaireService.getFormulaireFromId(c.uid);
elems.push(form.JSONserialise());
}
let session = { "session": { "elements": elems } };
}
const session = { "session": { "elements": elems } };
this.formulaireService.saveSession(session, filename);
}
......@@ -264,50 +264,51 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
const closedIndex = this.getCalculatorIndexFromId(formId);
/*
* détermination de la nouvelle calculette à afficher :
* détermination de la nouvelle calculette à afficher :
* - celle après celle supprimée
* - ou celle avant celle supprimée si on supprime la dernière
*/
let newId: number = -1;
let newId = -1;
const l = this._calculators.length;
if (l > 1) {
if (closedIndex == l - 1)
if (closedIndex === l - 1) {
newId = +this._calculators[closedIndex - 1]["uid"];
else
} else {
newId = +this._calculators[closedIndex + 1]["uid"];
}
}
// suppression
this._calculators = this._calculators.filter(calc => {
return formId != +calc["uid"]
return formId !== +calc["uid"];
});
// MAJ affichage
if (newId == -1) {
if (newId === -1) {
this.toList();
this._currentFormId = -1;
}
else
} else {
this.toCalc(newId);
}
}
private toList() {
this.router.navigate(['/list']);
this.router.navigate(["/list"]);
}
private toCalc(id: number) {
this.router.navigate(['/calculator', id]);
this.router.navigate(["/calculator", id]);
}
private toHelp(form: FormulaireDefinition) {
// Activated.firstChild.component : type du composant actuellement affiché par le router outlet
this.router.navigate(['/help']).then(_ => {
this.router.navigate(["/help"]).then(_ => {
const helpComp = this._routerCurrentComponent as HelpComponent;
helpComp.formHelp = form;
})
});
}
/**
......@@ -318,7 +319,7 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
}
private getHighlightClass(uid: number) {
return uid == this._currentFormId ? "blue darken-2" : "";
return uid === this._currentFormId ? "blue darken-2" : "";
}
// flag d'affichage des repères des colonnes Bootstrap : uniquement en mode dev
......@@ -358,7 +359,7 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
private params() {
this.closeNav();
this.router.navigate(['/setup']);
this.router.navigate(["/setup"]);
}
// /sidenav
......@@ -366,11 +367,11 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
/**
* détection de la fermeture de la page/navigateur et demande de confirmation
*/
@HostListener('window:beforeunload', ['$event'])
@HostListener("window:beforeunload", ["$event"])
confirmExit($event) {
if (environment.production) {
// affecter une valeur différente de null provoque l'affichage d'un dialogue de confirmation, mais le texte n'est pas affiché
$event.returnValue = 'Your data will be lost !';
$event.returnValue = "Your data will be lost !";
}
}
}
......@@ -4,7 +4,5 @@
"D": "Diamètre du tuyau",
"J": "Perte de charge",
"Lg": "Longueur du tuyau",
"Nu": "Viscosité dynamique",
"fs_param_calc": "Paramètres de calcul",
"Pr": "Précision de calcul"
"Nu": "Viscosité dynamique"
}
\ No newline at end of file
......@@ -14,29 +14,23 @@
"select_ouvrage_seuil_triang": "Seuil triangulaire",
"select_ouvrage_seuil_triangtrunc": "Seuil triangulaire tronqué",
"W": "Ouverture de vanne",
"select_loidebit1": "Loi de débit",
"select_loidebit1_seuildenoye": "Seuil dénoyé",
"select_loidebit1_cunge80": "Cunge 80",
"select_loidebit1_cem88d": "Déversoir/Orifice Cemagref 88",
"select_loidebit1_cem88v": "Déversoir/Vanne de fond Cemagref 88",
"select_loidebit1_kivi": "Kindsvater-Carter et Villemonte",
"select_loidebit2": "Loi de débit",
"select_loidebit2_vannedenoye": "Vanne dénoyé",
"select_loidebit2_vannenoye": "Vanne noyé",
"select_loidebit2_cunge80": "Cunge 80",
"select_loidebit2_cem88d": "Déversoir/Orifice Cemagref 88",
"select_loidebit2_cem88v": "Déversoir/Vanne de fond Cemagref 88",
"select_loidebit3": "Loi de débit",
"select_loidebit3_seuiltriang": "Seuil triangulaire",
"select_loidebit4": "Loi de débit",
"select_loidebit4_seuiltriangtrunc": "Seuil triangulaire tronqué",
"select_loidebit3_seuiltriang": "Déversoir triangulaire dénoyé",
"select_loidebit4_seuiltriangtrunc": "Déversoir triangulaire tronqué dénoyé",
"ZDV": "Cote de la crête du déversoir ou du radier de la vanne",
"L": "Largeur du déversoir",
"Cd": "Coefficient de débit",
"alpha": "Coefficient alpha",
"beta": "Coefficient béta",
"ZRAM": "Cote du radier amont",
"struct_container": "Ouvrages",
"fs_param_calc": "Paramètres de calcul",
"Pr": "Précision de calcul"
"struct_container": "Ouvrages"
}
\ No newline at end of file
......@@ -26,7 +26,5 @@
"fs_hydraulique": "Caractéristiques globales",
"Q": "Débit",
"Y_A": "Cote de l'eau à l'amont",
"Y_a": "Cote de l'eau à l'aval",
"fs_param_calc": "Paramètres de calcul",
"Pr": "Précision de calcul"
"Y_a": "Cote de l'eau à l'aval"
}
\ No newline at end of file
......@@ -3,7 +3,5 @@
"DH": "Drop",
"Q": "Discharge",
"V": "Volume",
"Pv": "Dissipated power",
"fs_param_calc": "Calculation parameters",
"Pr": "Display accuracy"
"Pv": "Dissipated power"
}
\ No newline at end of file
......@@ -3,7 +3,5 @@
"DH": "Chute entre bassins",
"Q": "Débit",
"V": "Volume",
"Pv": "Puissance dissipée",
"fs_param_calc": "Paramètres de calcul",
"Pr": "Précision de calcul"
"Pv": "Puissance dissipée"
}
\ No newline at end of file
......@@ -13,15 +13,11 @@
"select_ouvrage_seuil_trap": "Seuil trapézoïdal",
"select_ouvrage_vanne_trap": "Vanne trapézoïdale",
"W": "Ouverture de vanne",
"select_loidebit1": "Loi de débit",
"select_loidebit1_seuildenoye": "Seuil dénoyé",
"select_loidebit1_cunge80": "Cunge 80",
"select_loidebit1_cem88d": "Déversoir/Orifice Cemagref 88",
"select_loidebit1_cem88v": "Déversoir/Vanne de fond Cemagref 88",
"select_loidebit1_kivi": "Kindsvater-Carter et Villemonte",
"select_loidebit2": "Loi de débit",
"select_loidebit3": "Loi de débit",
"select_loidebit4": "Loi de débit",
"select_loidebit2_vannedenoye": "Vanne dénoyé",
"select_loidebit2_vannenoye": "Vanne noyé",
"select_loidebit2_cunge80": "Cunge 80",
......@@ -38,7 +34,5 @@
"alpha2": "Demi-angle au sommet (°)",
"BT": "Demi-ouverture du triangle (m)",
"ZT": "Cote haute du triangle (m)",
"struct_container": "Ouvrages",
"fs_param_calc": "Paramètres de calcul",
"Pr": "Précision de calcul"
"struct_container": "Ouvrages"
}
\ No newline at end of file
......@@ -152,7 +152,7 @@
},
{
"type": "options",
"defaultNodeType": "SectionCercle",
"defaultNodeType": "SectionRectangle",
"idCal": "Q",
"sectionSourceId": "fs_section"
}
......
......@@ -20,7 +20,4 @@
"YB": "Embankment elevation",
"fs_hydraulique": "Hydraulic features",
"Q": "Flow",
"Y": "Draft",
"fs_param_calc": "Calculation parameters",
"Pr": "Display accuracy"
}
\ No newline at end of file
"Y": "Draft"}
\ No newline at end of file
......@@ -20,7 +20,5 @@
"YB": "Hauteur de berge",
"fs_hydraulique": "Caractéristiques hydrauliques",
"Q": "Débit",
"Y": "Tirant d'eau",
"fs_param_calc": "Paramètres de calcul",
"Pr": "Précision de calcul"
"Y": "Tirant d'eau"
}
\ No newline at end of file
......@@ -260,7 +260,7 @@
},
{
"type": "options",
"defaultNodeType": "SectionPuissance",
"defaultNodeType": "SectionRectangle",
"sectionSourceId": "select_section",
"targetSelectId": "select_target",
"methodSelectId": "select_resolution"
......
......@@ -274,7 +274,7 @@
},
{
"type": "options",
"defaultNodeType": "SectionCercle",
"defaultNodeType": "SectionRectangle",
"sectionSourceId": "select_section",
"targetSelectId": "select_target"
}
......
import { Component, OnInit } from "@angular/core";
import { Router } from '@angular/router';
import { Router } from "@angular/router";
import { CalculatorType, EnumEx } from "jalhyd";
import { FormulaireDefinition } from "../../formulaire/definition/form-definition";
import { ServiceFactory } from "../../services/service-factory";
import { InternationalisationService } from '../../services/internationalisation/internationalisation.service';
import { InternationalisationService } from "../../services/internationalisation/internationalisation.service";
import { FormulaireParallelStructure } from "../../formulaire/definition/concrete/form-parallel-structures";
import { FieldsetContainer } from "../../formulaire/fieldset-container";
......@@ -34,24 +34,28 @@ export class CalculatorListComponent implements OnInit {
private updateLocale() {
this._items = [];
for (let t of EnumEx.getValues(CalculatorType))
if (t !== CalculatorType.Structure)
for (const t of EnumEx.getValues(CalculatorType)) {
if (t !== CalculatorType.Structure) {
this._items.push(new ListElement(t));
}
}
}
private create(t: CalculatorType) {
const p: Promise<FormulaireDefinition> = ServiceFactory.instance.formulaireService.createFormulaire(t);
p.then(f => {
this.router.navigate(['/calculator', f.uid]);
this.router.navigate(["/calculator", f.uid]);
return f;
}).then(f => {
// on ajoute un ouvrage après l'ouverture de la calculette "ouvrages parallèles"
if (f instanceof FormulaireParallelStructure)
for (const e of f.allFormElements)
if (f instanceof FormulaireParallelStructure) {
for (const e of f.allFormElements) {
if (e instanceof FieldsetContainer) {
e.addFromTemplate(0);
break;
}
}
}
});
}
......
import { Component, OnInit, DoCheck, OnDestroy, ViewChild, ViewChildren, QueryList, AfterViewChecked } from "@angular/core";
import { ActivatedRoute } from '@angular/router';
import { ActivatedRoute } from "@angular/router";
import { Observer } from "jalhyd";
......@@ -19,7 +19,7 @@ import { HelpService } from "../../services/help/help.service";
import { ServiceFactory } from "../../services/service-factory";
@Component({
selector: 'hydrocalc',
selector: "hydrocalc",
templateUrl: "./calculator.component.html",
styles: [`
.button_compute_ok {
......@@ -82,19 +82,19 @@ export class GenericCalculatorComponent extends BaseComponent implements OnInit,
* La validité de l'UI comprend la forme (pas de chaîne alpha dans les champs numériques, etc..).
* La validité formulaire comprend le domaine de définition des valeurs saisies.
*/
private _isUIValid: boolean = false;
private _isUIValid = false;
/**
* flag disabled du bouton "calculer"
*/
private isCalculateDisabled: boolean = true;
private isCalculateDisabled = true;
/**
* flag (+info) indiquant un événement onRadio à traiter
* nécessaire avec l'introduction du mode de valeur LINK des paramètres car quand on modifie le mode à LINK, les possibles
* paramètres liables ne sont pas encore connus
*/
private _pendingRadioClick: boolean = false;
private _pendingRadioClick = false;
private _pendingRadioClickInfo: any;
// services
......@@ -111,8 +111,9 @@ export class GenericCalculatorComponent extends BaseComponent implements OnInit,
}
private get formElements(): FormulaireElement[] {
if (this._formulaire == undefined)
if (this._formulaire === undefined) {
return [];
}
return this._formulaire.kids as FormulaireElement[];
}
......@@ -131,7 +132,7 @@ export class GenericCalculatorComponent extends BaseComponent implements OnInit,
}
private get hasForm() {
return this._formulaire != undefined;
return this._formulaire !== undefined;
}
private get hasResults() {
......@@ -170,13 +171,14 @@ export class GenericCalculatorComponent extends BaseComponent implements OnInit,
ngOnInit() {
this.intlService.addObserver(this);
this.formulaireService.addObserver(this);
this.subscribeRouter();
this.formulaireService.updateLocalisation();
this.subscribeRouter();
}
ngDoCheck() {
if (this._formulaire != undefined)
if (this._formulaire !== undefined) {
this.isCalculateDisabled = !(this._formulaire.isValid && this._isUIValid);
}
}
ngOnDestroy() {
......@@ -188,7 +190,7 @@ export class GenericCalculatorComponent extends BaseComponent implements OnInit,
private subscribeRouter() {
// récupération des paramètres passés avec la route (URL)
this._subscription = this.route.params.subscribe(params => {
const uid: number = params['uid'];
const uid: number = params["uid"];
this.formulaireService.setCurrentForm(+uid);
});
}
......@@ -270,15 +272,15 @@ export class GenericCalculatorComponent extends BaseComponent implements OnInit,
}
private setForm(f: FormulaireDefinition) {
if (this._formulaire != undefined)
if (this._formulaire !== undefined)
this._formulaire.removeObserver(this);
this._formulaire = f;
if (this._formulaire != undefined)
if (this._formulaire !== undefined)
this._formulaire.addObserver(this);
}
private updateFormulaireResults(uid: number) {
if (this._formulaire.uid == uid)
if (this._formulaire.uid === uid)
this.resultsComponent.updateView();
}
......@@ -288,8 +290,7 @@ export class GenericCalculatorComponent extends BaseComponent implements OnInit,
if (sender instanceof InternationalisationService) {
this.formulaireService.updateLocalisation();
this._formulaire.updateHelp();
}
else if (sender instanceof FormulaireService) {
} else if (sender instanceof FormulaireService) {
switch (data["action"]) {
case "currentFormChanged":
const uid: number = +data["formId"];
......@@ -298,11 +299,11 @@ export class GenericCalculatorComponent extends BaseComponent implements OnInit,
this._calculatorNameComponent.model = this._formulaire;
break;
}
}
else if (sender instanceof FormulaireDefinition) {
} else if (sender instanceof FormulaireDefinition) {
let f: FormulaireDefinition;
switch (data["action"]) {
case "resetForm": // réinitialisation du formulaire
var f = sender as FormulaireDefinition;
f = sender as FormulaireDefinition;
this.updateFormulaireResults(f.uid);
// this.updateUI();
break;
......@@ -327,7 +328,7 @@ export class GenericCalculatorComponent extends BaseComponent implements OnInit,
private updateUIValidity() {
this._isUIValid = false;
if (this._fieldsetComponents != undefined)
if (this._fieldsetComponents !== undefined)
this._isUIValid = this._fieldsetComponents.reduce(
// callback
(
......@@ -345,7 +346,7 @@ export class GenericCalculatorComponent extends BaseComponent implements OnInit,
// valeur initiale
, this._fieldsetComponents.length > 0);
if (this._fieldsetContainerComponents != undefined)
if (this._fieldsetContainerComponents !== undefined)
this._isUIValid = this._isUIValid && this._fieldsetContainerComponents.reduce(
// callback
(
......
......@@ -122,11 +122,11 @@ export class FieldSet extends FormulaireElement implements Observer {
const input_id: string = json["id"];
const paramService: ParamService = ServiceFactory.instance.paramService;
const calcType: CalculatorType = this.getPropValue("calcType");
let res: NgParameter;
switch (input_id) {
case "Pr":
var res: NgParameter = paramService.createParameter(input_id, this);
res = paramService.createParameter(input_id, this);
break;
default:
......
......@@ -5,8 +5,10 @@ import { DependencyCondition, DependencyConditionType } from "./dependency/depen
import { ValueDependencyCondition } from "./dependency/value-dependency-condition";
import { ExistenceDependency } from "./dependency/existence-dependency";
import { DeepFormulaireElementIterator } from "./form-iterator/deep-element-iterator";
import { InternationalisationService } from "../services/internationalisation/internationalisation.service";
import { ServiceFactory } from "../services/service-factory";
/**
/**
* élément (enfant) du formulaire : fieldset, input, container, ...
*/
export abstract class FormulaireElement extends FormulaireNode {
......@@ -25,11 +27,22 @@ export abstract class FormulaireElement extends FormulaireNode {
*/
private _labelNumber: number;
private intlService: InternationalisationService;
protected _dependencies: Dependency[] = [];
public static removePrefix(s: string, prefix: string): string {
if (s.startsWith(prefix)) {
const l = prefix.length;
return s.substr(l, s.length - l);
}
return undefined;
}
constructor(parent: FormulaireNode) {
super(parent);
this._isDisplayed = true;
this.intlService = ServiceFactory.instance.internationalisationService;
}
get isDisplayed(): boolean {
......@@ -38,18 +51,20 @@ export abstract class FormulaireElement extends FormulaireNode {
set isDisplayed(b: boolean) {
this._isDisplayed = b;
for (const k of this.getKids())
for (const k of this.getKids()) {
k.isDisplayed = b;
}
}
get label(): string {
let res = this._label;
if (res && this._labelNumber)
if (res && this._labelNumber) {
res += "" + String(this._labelNumber);
}
return res;
}
public set labelNumber(n: number) {
set labelNumber(n: number) {
this._labelNumber = n;
}
......@@ -62,9 +77,12 @@ export abstract class FormulaireElement extends FormulaireNode {
*/
public get parentForm(): FormulaireNode {
let res = this.parent;
//while (!(res instanceof FormulaireDefinition))
while (!("calculatorName" in res)) // pour éviter de faire référence au type FormulaireDefinition, supprimer l'import correspondant et casser les dépendances circulaires d'import
// while (!(res instanceof FormulaireDefinition))
while (!("calculatorName" in res)) {
// pour éviter de faire référence au type FormulaireDefinition, supprimer l'import correspondant et
// casser les dépendances circulaires d'import
res = res.parent;
}
return res;
}
......@@ -73,32 +91,37 @@ export abstract class FormulaireElement extends FormulaireNode {
* @param json configuration de la dépendance
*/
private parse_existence_dependencies(json: {}) {
for (let di in json) {
let d = json[di];
let rv = d["refvalue"];
if (rv != undefined)
var mc: DependencyCondition = new ValueDependencyCondition(rv);
else {
let cond = d["cond"];
if (cond != undefined) {
switch (cond) {
case "isvar":
var mc = new DependencyCondition(DependencyConditionType.IsVariable);
break;
case "isdisp":
var mc = new DependencyCondition(DependencyConditionType.IsDisplayed);
break;
default:
throw "Formulaire.parse_existence_dependencies() : type de condition '" + cond + "' non pris en charge";
for (const di in json) {
if (json.hasOwnProperty(di)) {
const d = json[di];
const rv = d["refvalue"];
let mc: DependencyCondition;
if (rv !== undefined) {
mc = new ValueDependencyCondition(rv);
} else {
const cond = d["cond"];
if (cond !== undefined) {
switch (cond) {
case "isvar":
mc = new DependencyCondition(DependencyConditionType.IsVariable);
break;
case "isdisp":
mc = new DependencyCondition(DependencyConditionType.IsDisplayed);
break;
default:
throw new Error(
"Formulaire.parse_existence_dependencies() : type de condition '" + cond + "' non pris en charge"
);
}
} else {
throw new Error("Formulaire.parse_existence_dependencies() : infos de dépendance manquantes/non prises en charge");
}
}
else
throw "Formulaire.parse_existence_dependencies() : infos de dépendance manquantes/non prises en charge";
const dep = new ExistenceDependency(this, d["refid"], mc);
this._dependencies.push(dep);
}
let dep = new ExistenceDependency(this, d["refid"], mc);
this._dependencies.push(dep);
}
}
......@@ -109,74 +132,75 @@ export abstract class FormulaireElement extends FormulaireNode {
*/
public parseDependencies(json: {}) {
const dep = json["dep_exist"];
if (dep != undefined)
if (dep !== undefined) {
this.parse_existence_dependencies(dep);
}
}
public verifiesDependency(d: Dependency): boolean {
if (d.masterCondition.type == DependencyConditionType.IsDisplayed)
if (d.masterCondition.type === DependencyConditionType.IsDisplayed) {
return this._isDisplayed;
}
}
/**
* applique une dépendance dont la condition a été vérifiée
*/
public applyDependency(d: Dependency) {
if (d instanceof ExistenceDependency)
if (d instanceof ExistenceDependency) {
this.isDisplayed = true;
}
}
private prepareExistenceDependencies() {
// si des FormulaireElement sont présents dans des ExistenceDependency, on met leur membre isDisplayed à false
for (let d of this._dependencies)
for (const d of this._dependencies) {
if (d instanceof ExistenceDependency) {
this.isDisplayed = false;
break;
}
}
}
public applyDependencies() {
this.prepareExistenceDependencies();
for (let d of this._dependencies) {
for (const d of this._dependencies) {
d.apply();
}
for (const k of this.getKids())
for (const k of this.getKids()) {
k.applyDependencies();
}
}
public printDependencies() {
for (let d of this._dependencies)
for (const d of this._dependencies) {
console.log(d.toString());
}
}
public updateLocalisation(loc: StringMap, key?: string) {
if (!key)
if (!key) {
key = this._confId;
if (loc)
this._label = loc[key];
if (this._label == undefined)
console.log(`WARNING : pas de traduction pour l'id ${this.id}`);
for (let f of this.getKids())
}
if (loc[key] !== undefined) {
this._label = this.intlService.localizeText(key, loc);
} else {
// Recherche du code dans locale/error_message.xx.json
this._label = this.intlService.localizeText("INFO_LIB_" + key.replace(/\d+$/, "").toLocaleUpperCase());
}
for (const f of this.getKids()) {
f.updateLocalisation(loc);
}
}
public toString() {
return "id:" + this.id + (this._isDisplayed ? " displayed" : " NOT displayed") + " label:" + this.label;
}
public static removePrefix(s: string, prefix: string): string {
if (s.startsWith(prefix)) {
let l = prefix.length;
return s.substr(l, s.length - l);
}
return undefined;
}
/**
* itère sur tous les FormulaireElement
*/
......
......@@ -68,7 +68,7 @@ export class FormulaireService extends Observable {
*/
private updateFormulaireLocalisation(formId: number, localisation: StringMap) {
for (let f of this._formulaires)
if (f.uid == formId) {
if (f.uid === formId) {
f.updateLocalisation(localisation);
break;
}
......@@ -80,7 +80,7 @@ export class FormulaireService extends Observable {
*/
private updateFormulaireHelp(formId: number) {
for (let f of this._formulaires)
if (f.uid == formId) {
if (f.uid === formId) {
f.updateHelp();
break;
}
......@@ -101,9 +101,11 @@ export class FormulaireService extends Observable {
for (const c of EnumEx.getValues(CalculatorType)) {
const prom: Promise<StringMap> = this.loadLocalisation(c);
prom.then(loc => {
for (const f of this._formulaires)
if (f.calculatorType == c)
for (const f of this._formulaires) {
if (f.calculatorType === c) {
this.updateFormulaireLocalisation(f.uid, loc);
}
}
}
);
}
......@@ -212,7 +214,7 @@ export class FormulaireService extends Observable {
public getFormulaireFromId(uid: number): FormulaireDefinition {
for (let f of this._formulaires)
if (f.uid == uid)
if (f.uid === uid)
return f;
return undefined;
......@@ -241,9 +243,9 @@ export class FormulaireService extends Observable {
private getFormulaireElementById(formId: number, elemId: string): FormulaireElement {
for (let f of this._formulaires)
if (f.uid == formId) {
if (f.uid === formId) {
let s = f.getFormulaireNodeById(elemId);
if (s != undefined)
if (s !== undefined)
return s as FormulaireElement;
}
return undefined;
......@@ -259,7 +261,7 @@ export class FormulaireService extends Observable {
}
public getConfigPathPrefix(ct: CalculatorType): string {
if (ct == undefined)
if (ct === undefined)
throw "FormulaireService.getConfigPathPrefix() : invalid undefined CalculatorType"
switch (ct) {
......@@ -294,13 +296,13 @@ export class FormulaireService extends Observable {
return "app/calculators/dever/dever.";
default:
throw "FormulaireService.getConfigPathPrefix() : valeur de CalculatorType " + ct + " non implémentée"
throw new Error("FormulaireService.getConfigPathPrefix() : valeur de CalculatorType " + ct + " non implémentée")
}
}
public requestCloseForm(uid: number) {
const form = this.getFormulaireFromId(uid);
if (form != undefined) {
if (form !== undefined) {
this._formulaires = this._formulaires.filter(f => f.uid !== uid);
this.notifyObservers({
......@@ -316,14 +318,13 @@ export class FormulaireService extends Observable {
public setCurrentForm(formId: number) {
const form = this.getFormulaireFromId(formId);
if (form == undefined) {
if (form === undefined) {
this._currentFormId = -1;
this.notifyObservers({
"action": "invalidFormId",
"formId": formId
});
}
else {
} else {
this._currentFormId = formId;
this.notifyObservers({
"action": "currentFormChanged",
......@@ -338,7 +339,7 @@ export class FormulaireService extends Observable {
public get currentFormHasResults(): boolean {
const form = this.currentForm;
if (form != undefined)
if (form !== undefined)
return form.hasResults;
return false;
......@@ -441,7 +442,7 @@ export class FormulaireService extends Observable {
const form = element[keys[0]];
for (const i of formInfos)
if (i["uid"] == form["uid"] && i["selected"])
if (i["uid"] === form["uid"] && i["selected"])
this.deserialiseForm(form);
break;
......
import { Injectable } from '@angular/core';
import { Response } from '@angular/http';
import { Injectable } from "@angular/core";
import { Response } from "@angular/http";
import { Message, MessageCode, Observable } from "jalhyd";
import { StringMap } from "../../stringmap";
import { ServiceFactory } from '../service-factory';
import { ServiceFactory } from "../service-factory";
/*
language tag : fr-FR
......@@ -70,47 +70,45 @@ export class InternationalisationService extends Observable {
}
private getLanguageFromCode(lc: LanguageCode) {
for (let l of this._languages) {
if (l.code === lc)
for (const l of this._languages) {
if (l.code === lc) {
return l;
}
}
throw new Message(MessageCode.ERROR_LANG_UNSUPPORTED);
}
private getLanguageFromTag(tag: string) {
for (let l of this._languages) {
if (l.tag === tag)
for (const l of this._languages) {
if (l.tag === tag) {
return l;
}
}
let e = new Message(MessageCode.ERROR_LANG_UNSUPPORTED);
const e = new Message(MessageCode.ERROR_LANG_UNSUPPORTED);
e.extraVar["locale"] = tag;
throw e;
}
public setLocale(lng: string | LanguageCode) {
if (this._currLang !== undefined)
var oldLang: LanguageCode = this._currLang.code;
if (typeof lng === "string") {
let t: string = lng.substr(0, 2).toLowerCase();
const t: string = lng.substr(0, 2).toLowerCase();
this._currLang = this.getLanguageFromTag(t);
}
else {
} else {
this._currLang = this.getLanguageFromCode(lng);
}
let prom = this.httpGetMessages();
prom.then((res) => {
this.httpGetMessages().then((res) => {
this.notifyObservers(undefined);
})
});
}
private httpGetMessages(): Promise<Response> {
let is: InternationalisationService = this;
let processData = function (s: string) {
const is: InternationalisationService = this;
const processData = function (s: string) {
// fermeture nécessaire pour capturer la valeur de this (undefined sinon)
is._Messages = JSON.parse(s);
}
};
let l;
switch (this._currLang.code) {
......@@ -122,17 +120,17 @@ export class InternationalisationService extends Observable {
l = "en";
}
let f: string = "error_messages." + l + ".json"
const f: string = "error_messages." + l + ".json";
return ServiceFactory.instance.httpService.httpGetRequest(undefined, undefined, undefined, "locale/" + f, processData);
}
private getMessageFromCode(c: MessageCode): string {
let sCode: string = MessageCode[c];
const sCode: string = MessageCode[c];
return this._Messages[MessageCode[c]];
}
private replaceAll(str: string, find: string, replace: string) {
return str.replace(new RegExp(find, 'g'), replace);
return str.replace(new RegExp(find, "g"), replace);
}
/**
......@@ -141,34 +139,39 @@ export class InternationalisationService extends Observable {
* @param nDigits nombre de chiffres à utiliser pour l'arrondi dans le cas de données numériques
*/
public localizeMessage(r: Message, nDigits: number = 3): string {
let sCode: string = MessageCode[r.code];
const sCode: string = MessageCode[r.code];
let m: string = this.getMessageFromCode(r.code);
for (let k in r.extraVar) {
let v: any = r.extraVar[k];
if (typeof v === "number")
var s = v.toFixed(nDigits);
else
s = v;
m = this.replaceAll(m, "%" + k + "%", s);
for (const k in r.extraVar) {
if (r.extraVar.hasOwnProperty(k)) {
const v: any = r.extraVar[k];
let s: string;
if (typeof v === "number") {
s = v.toFixed(nDigits);
} else {
s = v;
}
m = this.replaceAll(m, "%" + k + "%", s);
}
}
return m;
}
/**
* Traduit un texte défini dans les fichiers error_message.xx.json
* Traduit un texte défini dans un fichier de langue (locale/error_message.xx.json par défaut)
* Les ids dans ces fichiers sont soit un enum de JalHyd, soit une chaine libre correspondant au code passé àlocalizeText()
* @param code id du texte
* @param messages Contenu du fichier de langua à utiliser (locale/error_message.xx.json par défaut)
*/
public localizeText(code: string) {
if (this._Messages === undefined) {
return "*** messages not loaded: ${code} ***";
public localizeText(code: string, messages = this._Messages) {
if (messages === undefined) {
return `*** messages not loaded: ${code} ***`;
}
if (this._Messages[code] === undefined) {
if (messages[code] === undefined) {
return `*** message not exists: ${code} ***`;
}
return this._Messages[code];
return messages[code];
}
/**
......
......@@ -26,17 +26,17 @@ export class ParamService {
}
/**
*
*
* @param calcType crée un NgParameter n'appartenant pas à un ComputeNode
* @param symbol symbole du paramètre à créer
*/
public createParameter(symbol: string, parent: FormulaireNode): NgParameter {
let p: NgParameter;
if (symbol === "Pr") {
var prmDef: ParamDefinition = this.createAccuracyParameter();
var p = new NgParameter(prmDef.clone(), parent);
const prmDef: ParamDefinition = this.createAccuracyParameter();
p = new NgParameter(prmDef.clone(), parent);
p.confId = "Pr";
}
else {
} else {
const dom = new ParamDomain(ParamDomainValue.POS_NULL);
p = new NgParameter(new ParamDefinition(symbol, dom), parent);
p.confId = symbol;
......@@ -86,9 +86,9 @@ export class ParamService {
default:
throw new Error(`ParamService.createParameter() : symbole ${symbol} non pris en charge`);
}
p.updateLocalisation(this._intlService.currentMap);
}
p.updateLocalisation(this._intlService.currentMap);
return p;
}
......
{
"ERROR_DICHO_INIT_DOMAIN": "Dichotomy: target %targetSymbol%=%targetValue% does not exist for variable %variableSymbol% valued in interval %variableInterval%",
"ERROR_DICHO_INITVALUE_LOW": "Dichotomy: initial value %variableSymbol%=%variableInitValue% is too low (target is %targetSymbol%=%targetValue%, %targetSymbol%(%variableSymbol%=%variableInitValue%)=%initTarget%)",
"ERROR_DICHO_CONVERGE": "Dichotomy could not converge",
"ERROR_DICHO_FUNCTION_VARIATION": "unable to determinate function direction of variation",
"ERROR_DICHO_INITVALUE_HIGH": "Dichotomy: initial value %variableSymbol%=%variableInitValue% is too high (target is %targetSymbol%=%targetValue%, %targetSymbol%(%variableSymbol%=%variableInitValue%)=%initTarget%)",
"ERROR_DICHO_NULL_STEP": "Dichotomy (initial interval search): invalid null step",
"ERROR_DICHO_INITVALUE_LOW": "Dichotomy: initial value %variableSymbol%=%variableInitValue% is too low (target is %targetSymbol%=%targetValue%, %targetSymbol%(%variableSymbol%=%variableInitValue%)=%initTarget%)",
"ERROR_DICHO_INIT_DOMAIN": "Dichotomy: target %targetSymbol%=%targetValue% does not exist for variable %variableSymbol% valued in interval %variableInterval%",
"ERROR_DICHO_INVALID_STEP_GROWTH": "Dichotomy (initial interval search): invalid null step growth",
"ERROR_DICHO_FUNCTION_VARIATION": "unable to determinate function direction of variation",
"ERROR_DICHO_CONVERGE": "Dichotomy could not converge",
"ERROR_DICHO_NULL_STEP": "Dichotomy (initial interval search): invalid null step",
"ERROR_INTERVAL_OUTSIDE": "Interval: value %value% is outside of %interval",
"ERROR_INTERVAL_UNDEF": "Interval: invalid 'undefined' value",
"ERROR_LANG_UNSUPPORTED": "internationalisation: unsupported '%locale%' locale",
"ERROR_NEWTON_DERIVEE_NULLE": "Null function derivative in Newton computation",
"ERROR_PARAMDOMAIN_INTERVAL_BOUNDS": "invalid %minValue%/%maxValue% min/max boundaries for 'interval' parameter definition domain",
"ERROR_PARAMDEF_CALC_UNDEFINED": "calculability of '%symbol%' parameter is undefined",
"ERROR_PARAMDEF_VALUE_UNDEFINED": "value of '%symbol%' parameter is undefined",
"ERROR_PARAMDEF_VALUE_FIXED": "value of '%symbol%' parameter cannot be changed",
"ERROR_PARAMDEF_VALUE_INTERVAL": "parameter '%symbol%': value %value% is out of [%minValue%, %maxValue%] interval",
"ERROR_PARAMDEF_VALUE_NULL": "value of '%symbol%' parameter cannot be 0",
"ERROR_PARAMDEF_VALUE_POS": "value %value% of '%symbol%' parameter is invalid (cannot be <=0)",
"ERROR_PARAMDEF_VALUE_POSNULL": "value %value% of '%symbol%' parameter is invalid (cannot be <0)",
"ERROR_PARAMDEF_VALUE_NULL": "value of '%symbol%' parameter cannot be 0",
"ERROR_PARAMDEF_VALUE_INTERVAL": "parameter '%symbol%': value %value% is out of [%minValue%, %maxValue%] interval",
"ERROR_PARAMDEF_VALUE_UNDEFINED": "value of '%symbol%' parameter is undefined",
"ERROR_PARAMDOMAIN_INTERVAL_BOUNDS": "invalid %minValue%/%maxValue% min/max boundaries for 'interval' parameter definition domain",
"ERROR_PARAMDOMAIN_INVALID": "parameter '%symbol%: non supported '%domain%' definition domain",
"ERROR_INTERVAL_UNDEF": "Interval: invalid 'undefined' value",
"ERROR_INTERVAL_OUTSIDE": "Interval: value %value% is outside of %interval",
"ERROR_LANG_UNSUPPORTED": "internationalisation: unsupported '%locale%' locale",
"WARNING_REMOUS_ARRET_CRITIQUE": "Calculation stopped: critical elevation reached at abscissa %x%",
"INFO_REMOUS_CALCUL_FLUVIAL": "Downstream boundary condition >= Critical elevation: calculation of subcritical part from downstream",
"INFO_REMOUS_CALCUL_TORRENTIEL": "Uptream boundary condition <= Critical elevation: calculation of supercritical part from upstream",
"INFO_REMOUS_RESSAUT_DEHORS": "Hydraulic jump detected %sens% abscissa %x% m",
"INFO_REMOUS_LARGEUR_BERGE": "Width at embankment level = %B% m",
"INFO_REMOUS_H_CRITIQUE": "Width at embankment level = %Yc% m",
"INFO_REMOUS_H_NORMALE": "Normal water level = %Yn% m",
"INFO_REMOUS_RESSAUT_HYDRO": "Hydraulic jump detected between abscissa %xmin% and %xmax% m",
"ERROR_REMOUS_PENTE_FORTE": "The water line slope is too steep at abscissa %x% m (the discretisation step should be reduced)",
"ERROR_REMOUS_PAS_CALCUL_DEPUIS_AVAL": "Downstream boundary condition < Critical elevation: no possible calculation from downstream",
"ERROR_REMOUS_PAS_CALCUL_DEPUIS_AMONT": "Upstream boundary condition < Critical elevation: no possible calculation from upstream",
"INFO_PARAMFIELD_PARAMFIXE": "Fixed",
"INFO_PARAMFIELD_PARAMVARIER": "Vary",
"INFO_PARAMFIELD_PARAMCALCULER": "Calculate",
"INFO_PARAMFIELD_PARAMLIE": "Link",
"INFO_PARAMFIELD_VALEURMINI": "From minimum value",
"INFO_PARAMFIELD_VALEURMAXI": "to maximum value",
"INFO_PARAMFIELD_PASVARIATION": "with a variation step of:",
"ERROR_REMOUS_PAS_CALCUL_DEPUIS_AVAL": "Downstream boundary condition < Critical elevation: no possible calculation from downstream",
"ERROR_REMOUS_PENTE_FORTE": "The water line slope is too steep at abscissa %x% m (the discretisation step should be reduced)",
"ERROR_SECTION_NON_CONVERGENCE_NEWTON_HCONJUG": "Non-convergence of the calculation of the combined depth (Newton's method)",
"ERROR_SECTION_NON_CONVERGENCE_NEWTON_HCRITIQUE": "Non-convergence of the calculation of the critical depth (Newton's method)",
"ERROR_SECTION_NON_CONVERGENCE_NEWTON_HFLU": "Non convergence of the calculation of the corresponding elevation (Newton's method) for the calculation of the subcritical depth",
"ERROR_SECTION_NON_CONVERGENCE_NEWTON_HNORMALE": "Non convergence of the calculation of the normal depth (Newton's method)",
"ERROR_SECTION_NON_CONVERGENCE_NEWTON_HTOR": "Non convergence of the calculation of the corresponding height (Newton's method) for the calculation of the supercritical depth",
"ERROR_SECTION_PENTE_NEG_NULLE_HNORMALE_INF": "The slope is negative or zero, the normal depth is infinite",
"INFO_CALCULATOR_CALCULER": "Compute",
"INFO_CALCULATOR_PARAMFIXES": "Fixed parameters",
"INFO_CALCULATOR_VALEURS": "Values",
"INFO_CONDDISTRI_TITRE": "Distributor pipe",
"INFO_LECHAPT_TITRE": "Lechapt-Calmon",
"INFO_REGUNI_TITRE": "Uniform flow calculation",
"INFO_SECTPARAM_TITRE": "Parametric section",
"INFO_GRANDEUR_Q": "Flow (m³/s)",
"INFO_GRANDEUR_HS": "Specific head (m)",
"INFO_GRANDEUR_HSC": "Critical head (m)",
"INFO_GRANDEUR_B": "Surface width (m)",
"INFO_GRANDEUR_P": "Wetted perimeter (m)",
"INFO_GRANDEUR_S": "Wetted area (m²)",
"INFO_GRANDEUR_R": "Hydraulic radius (m)",
"INFO_GRANDEUR_V": "Average speed (m/s)",
"INFO_GRANDEUR_FR": "Froude number",
"INFO_GRANDEUR_YC": "Critical depth (m)",
"INFO_GRANDEUR_YN": "Normal depth (m)",
"INFO_GRANDEUR_YF": "Subcritical depth (m)",
"INFO_GRANDEUR_YT": "Supercritical depth (m)",
"INFO_GRANDEUR_YCO": "Conjugate depth (m)",
"INFO_GRANDEUR_J": "Head loss (m)",
"INFO_GRANDEUR_I-J": "Linear variation of specific head (m/m)",
"INFO_GRANDEUR_IMP": "Impulse (N)",
"INFO_GRANDEUR_TAU0": "Tractive force (Pa)",
"INFO_REMOUS_TITRE": "Backwater curves",
"INFO_REMOUSRESULTS_TITREJOURNAL": "Calculation log",
"INFO_REMOUSRESULTS_LIGNEFLUVIALE": "Subcritical water profile",
"INFO_REMOUSRESULTS_LIGNETORRENTIELLE": "Supercritical water profile",
"INFO_CLOSE_DIALOGUE_TEXT": "Warning ! Parameters and results will be lost. Really close?",
"INFO_CLOSE_DIALOGUE_TITRE": "Please confirm",
"INFO_CONDUITEDISTRIBUTRICE_TITRE": "Distributor pipe",
"INFO_COURBEREMOUS_TITRE": "Backwater curves",
"INFO_DEVER_TITRE": "Fish ladder: weir stage-discharge laws",
"INFO_EXTRARES_ENUM_OUVRAGE_Q_MODE_0": "Weir",
"INFO_EXTRARES_ENUM_OUVRAGE_Q_MODE_1": "Orifice",
"INFO_EXTRARES_ENUM_OUVRAGE_Q_MODE_2": "Zero flow",
"INFO_EXTRARES_ENUM_OUVRAGE_Q_REGIME_0": "Free flow",
"INFO_EXTRARES_ENUM_OUVRAGE_Q_REGIME_1": "Partially submerged",
"INFO_EXTRARES_ENUM_OUVRAGE_Q_REGIME_2": "Submerged",
"INFO_EXTRARES_ENUM_OUVRAGE_Q_REGIME_3": "Zero flow",
"INFO_EXTRARES_LIB_B": "Surface width (m)",
"INFO_EXTRARES_LIB_CV": "Cv: Velocity coefficient",
"INFO_EXTRARES_LIB_CVQT": "CV.QT: Corrected discharge (m³/s)",
"INFO_EXTRARES_LIB_EC": "EC: Kinetic energy (m)",
"INFO_EXTRARES_LIB_FLU": "Subcritical water line",
"INFO_EXTRARES_LIB_FR": "Froude number",
"INFO_EXTRARES_LIB_HS": "Specific head (m)",
"INFO_EXTRARES_LIB_HSC": "Critical head (m)",
"INFO_EXTRARES_LIB_I-J": "Linear variation of specific head (m/m)",
"INFO_EXTRARES_LIB_IMP": "Impulse (N)",
"INFO_EXTRARES_LIB_J": "Head loss (m)",
"INFO_EXTRARES_LIB_OUVRAGE_Q": "Discharge (m³/s)",
"INFO_EXTRARES_LIB_OUVRAGE_Q_MODE": "Mode",
"INFO_EXTRARES_LIB_OUVRAGE_Q_REGIME": "Regime",
"INFO_EXTRARES_LIB_P": "Wetted perimeter (m)",
"INFO_EXTRARES_LIB_Q": "Flow (m³/s)",
"INFO_EXTRARES_LIB_R": "Hydraulic radius (m)",
"INFO_EXTRARES_LIB_S": "Wetted area (m²)",
"INFO_EXTRARES_LIB_TAU0": "Tractive force (Pa)",
"INFO_EXTRARES_LIB_TOR": "Supercritical water line",
"INFO_EXTRARES_LIB_V": "Average speed (m/s)",
"INFO_EXTRARES_LIB_YC": "Critical depth (m)",
"INFO_EXTRARES_LIB_YCO": "Conjugate depth (m)",
"INFO_EXTRARES_LIB_YF": "Subcritical depth (m)",
"INFO_EXTRARES_LIB_YN": "Normal depth (m)",
"INFO_EXTRARES_LIB_YT": "Supercritical depth (m)",
"INFO_LECHAPTCALMON_TITRE": "Lechapt-Calmon",
"INFO_LIB_FS_PARAM_CALC": "Calculation parameters",
"INFO_LIB_PR": "Display accuracy",
"INFO_LIB_SELECT_LOIDEBIT": "Stage-discharge law",
"INFO_MENU_NOUVELLE_CALC": "New calculator",
"INFO_OPTION_NO": "No",
"INFO_OPTION_YES": "Yes",
"INFO_OUVRAGE": "Structure",
"INFO_PABDIMENSIONS_TITRE": "Fish ladder: dimensions",
"INFO_PABPUISSANCE_TITRE": "Fish ladder: dissipated power",
"INFO_PARALLELSTRUCTURE_TITRE": "Parallel structures",
"INFO_PARAMFIELD_PARAMCALCULER": "Calculate",
"INFO_PARAMFIELD_PARAMFIXE": "Fixed",
"INFO_PARAMFIELD_PARAMLIE": "Link",
"INFO_PARAMFIELD_PARAMVARIER": "Vary",
"INFO_PARAMFIELD_PASVARIATION": "with a variation step of:",
"INFO_PARAMFIELD_VALEURMAXI": "to maximum value",
"INFO_PARAMFIELD_VALEURMINI": "From minimum value",
"INFO_REGIMEUNIFORME_TITRE": "Uniform flow calculation",
"INFO_REMOUSRESULTS_ABSCISSE": "Abscissa (m)",
"INFO_REMOUSRESULTS_TIRANT": "Draft (m)",
"INFO_REMOUSRESULTS_FOND": "Bottom",
"INFO_REMOUSRESULTS_BERGE": "Embankment",
"INFO_REMOUSRESULTS_TIRANTNORMAL": "Normal water level",
"INFO_REMOUSRESULTS_FOND": "Bottom",
"INFO_REMOUSRESULTS_TIRANT": "Draft (m)",
"INFO_REMOUSRESULTS_TIRANTCRITIQUE": "Critical water level",
"INFO_SETUP_TITLE": "Application setup",
"INFO_REMOUSRESULTS_TIRANTNORMAL": "Normal water level",
"INFO_REMOUSRESULTS_TITREJOURNAL": "Calculation log",
"INFO_REMOUS_CALCUL_FLUVIAL": "Downstream boundary condition >= Critical elevation: calculation of subcritical part from downstream",
"INFO_REMOUS_CALCUL_TORRENTIEL": "Uptream boundary condition <= Critical elevation: calculation of supercritical part from upstream",
"INFO_REMOUS_H_CRITIQUE": "Width at embankment level = %Yc% m",
"INFO_REMOUS_H_NORMALE": "Normal water level = %Yn% m",
"INFO_REMOUS_LARGEUR_BERGE": "Width at embankment level = %B% m",
"INFO_REMOUS_RESSAUT_DEHORS": "Hydraulic jump detected %sens% abscissa %x% m",
"INFO_REMOUS_RESSAUT_HYDRO": "Hydraulic jump detected between abscissa %xmin% and %xmax% m",
"INFO_SECTIONPARAMETREE_TITRE": "Parametric section",
"INFO_SETUP_NEWTON_MAX_ITER": "Newton iteration limit",
"INFO_SETUP_PRECISION_AFFICHAGE": "Display accuracy",
"INFO_SETUP_PRECISION_CALCUL": "Computation accuracy",
"INFO_SETUP_NEWTON_MAX_ITER": "Newton iteration limit",
"INFO_MENU_NOUVELLE_CALC": "New calculator",
"INFO_CLOSE_DIALOGUE_TITRE": "Please confirm",
"INFO_CLOSE_DIALOGUE_TEXT": "Warning ! Parameters and results will be lost. Really close?",
"INFO_OPTION_YES": "Yes",
"INFO_OPTION_NO": "No",
"INFO_PABDIM_TITRE": "Pool pass: dimensions",
"INFO_PABPUISS_TITRE": "Pool pass: dissipated power",
"INFO_OUVRAGEPARAL_TITRE": "Parallel structures",
"INFO_OUVRAGE": "Structure",
"INFO_TYPE_ECOULEMENT": "Mode",
"INFO_REGIME": "Regime",
"INFO_LIB_ENUM_RES_STRUCTURE_MODE_0": "Weir",
"INFO_LIB_ENUM_RES_STRUCTURE_MODE_1": "Orifice",
"INFO_LIB_ENUM_RES_STRUCTURE_MODE_2": "Zero flow",
"INFO_LIB_ENUM_RES_STRUCTURE_REGIME_0": "Free flow",
"INFO_LIB_ENUM_RES_STRUCTURE_REGIME_1": "Partially submerged",
"INFO_LIB_ENUM_RES_STRUCTURE_REGIME_2": "Submerged",
"INFO_LIB_ENUM_RES_STRUCTURE_REGIME_3": "Zero flow"
"INFO_SETUP_TITLE": "Application setup",
"WARNING_REMOUS_ARRET_CRITIQUE": "Calculation stopped: critical elevation reached at abscissa %x%",
"WARNING_STRUCTUREKIVI_HP_TROP_ELEVE": "h/p must not be greater than 2.5. h/p is forced to 2.5",
"WARNING_STRUCTUREKIVI_PELLE_TROP_FAIBLE": "Threshold height should be greater than 0.1 m. Beta coefficient is forced to 0"
}
\ No newline at end of file
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