Skip to content
Snippets Groups Projects
Commit d1bed13a authored by mathias.chouet's avatar mathias.chouet
Browse files

Improved PAB results

fix #229
added translations
fix bug in Z plotted data
parent da9469b2
No related branches found
No related tags found
1 merge request!49Resolve "Ajout du module de calcul d'une passe à bassins"
......@@ -53,7 +53,7 @@ export class PabResultsTableComponent extends ResultsComponent {
// line 1
if (pr.cloisonsResults[0].vCalc) { // parfois le calcul des cloisons échoue
this._dataSet.push([
"",
this.intlService.localizeText("INFO_LIB_AMONT"),
pr.cloisonsResults[0] ? pr.cloisonsResults[0].vCalc.toFixed(nDigits) : "",
"", "", "", "", "", "", ""
]);
......@@ -89,7 +89,7 @@ export class PabResultsTableComponent extends ResultsComponent {
if (pr.cloisonAvalResults.vCalc) {
const rln = pr.cloisonAvalResults.resultElement.extraResults;
this._dataSet.push([
this.intlService.localizeText("INFO_LIB_AVAL"), // n° cloison
this.intlService.localizeText("INFO_LIB_AVAL"),
pr.Z2.toFixed(nDigits),
rln.ZRAM.toFixed(nDigits),
rln.DH.toFixed(nDigits),
......
......@@ -30,7 +30,11 @@ export class PlottablePabResults implements PlottableData {
* @param symbol parameter / result symbol (ex: "Q")
*/
public getChartAxisLabel(symbol: string): string {
return this.pabResults.headers[this.pabResults.columns.indexOf(symbol)];
if (symbol === "x") { // specific case for wall abscissa
return ServiceFactory.instance.i18nService.localizeText("INFO_LIB_ABSCISSE_CLOISON");
} else {
return this.pabResults.headers[this.pabResults.columns.indexOf(symbol)];
}
}
public expandLabelFromSymbol(symbol: string): string {
......@@ -42,7 +46,8 @@ export class PlottablePabResults implements PlottableData {
* as X or Y chart axis
*/
public getAvailableChartAxis(): string[] {
return this.pabResults.columns;
// add wall abscissa on the fly
return [ "x" ].concat(this.pabResults.columns);
}
// just to implement interface
......@@ -67,10 +72,9 @@ export class PlottablePabResults implements PlottableData {
switch (symbol) {
case "CLOISON":
data.push("");
for (let i = 0; i < l; i++) {
for (let i = 0; i <= l; i++) { // <= for one extra step (downwall)
data.push("" + (i + 1));
}
data.push(ServiceFactory.instance.i18nService.localizeText("INFO_LIB_AVAL"));
break;
case "DH":
......@@ -86,7 +90,7 @@ export class PlottablePabResults implements PlottableData {
break;
case "Z":
for (let i = 0; i < l - 1; i++) {
for (let i = 0; i < l; i++) {
data.push(pr.cloisonsResults[i].vCalc.toFixed(nDigits));
}
data.push(pr.cloisonAvalResults.vCalc.toFixed(nDigits));
......@@ -104,6 +108,16 @@ export class PlottablePabResults implements PlottableData {
}
data.push("");
break;
case "x": // wall abscissa
data.push("");
for (let i = 0; i < l; i++) {
const er = pr.cloisonsResults[i].getExtraResult(symbol);
data.push((er !== undefined) ? er.toFixed(nDigits) : "");
}
const erXdw = pr.cloisonAvalResults.getExtraResult(symbol);
data.push((erXdw !== undefined) ? erXdw.toFixed(nDigits) : "");
break;
}
return data;
......
......@@ -111,8 +111,10 @@
"INFO_WALL_REMOVED": "Wall #%s removed",
"INFO_LECHAPTCALMON_TITRE_COURT": "Lechapt-C.",
"INFO_LECHAPTCALMON_TITRE": "Lechapt-Calmon",
"INFO_LIB_ABSCISSE_CLOISON": "Wall abscissa",
"INFO_LIB_ALPHA": "Alpha coefficient",
"INFO_LIB_ALPHA2": "Half-angle at the apex",
"INFO_LIB_AMONT": "Upstream",
"INFO_LIB_AVAL": "Downstream",
"INFO_LIB_B": "Surface width",
"INFO_LIB_BB": "Pool width",
......
......@@ -111,8 +111,10 @@
"INFO_WALL_REMOVED": "Cloison n°%s supprimée",
"INFO_LECHAPTCALMON_TITRE_COURT": "Lechapt-C.",
"INFO_LECHAPTCALMON_TITRE": "Lechapt-Calmon",
"INFO_LIB_ABSCISSE_CLOISON": "Abscisse de la cloison",
"INFO_LIB_ALPHA": "Coefficient alpha",
"INFO_LIB_ALPHA2": "Demi-angle au sommet",
"INFO_LIB_AMONT": "Amont",
"INFO_LIB_AVAL": "Aval",
"INFO_LIB_B": "Largeur au miroir",
"INFO_LIB_BB": "Largeur du bassin",
......
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