Skip to content
Snippets Groups Projects
Commit 57716378 authored by François Grand's avatar François Grand
Browse files

feat: fish ladder: add upstream/downstream head, submergence results

refs #518
parent faa57697
No related branches found
No related tags found
1 merge request!169Resolve "PAB: Ajouter la charge et l'ennoiement dans le tableau de résultat et l'export"
Pipeline #139845 passed
...@@ -25,5 +25,8 @@ ...@@ -25,5 +25,8 @@
"UNIT_Z": "m", "UNIT_Z": "m",
"UNIT_ZRAM": "m", "UNIT_ZRAM": "m",
"UNIT_ZRB": "m", "UNIT_ZRB": "m",
"UNIT_ZRMB": "m" "UNIT_ZRMB": "m",
"UNIT_H1": "m",
"UNIT_H2": "m",
"UNIT_SUBMERGENCE": "%"
} }
\ No newline at end of file
...@@ -25,5 +25,8 @@ ...@@ -25,5 +25,8 @@
"UNIT_Z": "m", "UNIT_Z": "m",
"UNIT_ZRAM": "m", "UNIT_ZRAM": "m",
"UNIT_ZRB": "m", "UNIT_ZRB": "m",
"UNIT_ZRMB": "m" "UNIT_ZRMB": "m",
"UNIT_H1": "m",
"UNIT_H2": "m",
"UNIT_SUBMERGENCE": "%"
} }
\ No newline at end of file
...@@ -46,7 +46,7 @@ export class PabResultsTableComponent extends ResultsComponentDirective implemen ...@@ -46,7 +46,7 @@ export class PabResultsTableComponent extends ResultsComponentDirective implemen
this.results this.results
&& this.results.cloisonsResults && this.results.cloisonsResults
&& this.results.cloisonsResults.length > 0 && this.results.cloisonsResults.length > 0
&& ! this.results.hasOnlyErrors() && !this.results.hasOnlyErrors()
) { ) {
const pr = this.results; const pr = this.results;
// when a parameter is variating, index of the variating parameter // when a parameter is variating, index of the variating parameter
...@@ -88,7 +88,10 @@ export class PabResultsTableComponent extends ResultsComponentDirective implemen ...@@ -88,7 +88,10 @@ export class PabResultsTableComponent extends ResultsComponentDirective implemen
fv(r2n.YMOY), fv(r2n.YMOY),
fv(r2n.ZRMB), fv(r2n.ZRMB),
fv(r2n.QA), fv(r2n.QA),
this.getJetTypes(pr.cloisonsResults[i], vi) this.getJetTypes(pr.cloisonsResults[i], vi),
this.getStructuresParam(pr.cloisonsResults[i], vi,"H1"),
this.getStructuresParam(pr.cloisonsResults[i], vi,"H2"),
this.getStructuresParam(pr.cloisonsResults[i], vi,"SUBMERGENCE"),
]); ]);
} }
} }
...@@ -104,7 +107,10 @@ export class PabResultsTableComponent extends ResultsComponentDirective implemen ...@@ -104,7 +107,10 @@ export class PabResultsTableComponent extends ResultsComponentDirective implemen
fv(rln.DH), fv(rln.DH),
fv(rln.Q), fv(rln.Q),
"", "", "", "", "", "", "", "",
this.getJetTypes(pr.cloisonAvalResults, vi) this.getJetTypes(pr.cloisonAvalResults, vi),
this.getStructuresParam(pr.cloisonAvalResults, vi, "H1"),
this.getStructuresParam(pr.cloisonAvalResults, vi, "H2"),
this.getStructuresParam(pr.cloisonAvalResults, vi, "SUBMERGENCE"),
]); ]);
// extra lift gate ? // extra lift gate ?
if (cloisonAval && cloisonAval.hasVanneLevante()) { if (cloisonAval && cloisonAval.hasVanneLevante()) {
...@@ -122,19 +128,29 @@ export class PabResultsTableComponent extends ResultsComponentDirective implemen ...@@ -122,19 +128,29 @@ export class PabResultsTableComponent extends ResultsComponentDirective implemen
} }
private getJetTypes(re: Result, vi: number): string { private getJetTypes(re: Result, vi: number): string {
// jet type for each device return this.getStructuresParam(re, vi, "ENUM_StructureJetType", "INFO_ENUM_STRUCTUREJETTYPE_");
}
private getStructuresParam(re: Result, vi: number, propName: string, localisationCode?: string): string {
const devices = re.sourceNub.getChildren(); const devices = re.sourceNub.getChildren();
const jetTypes: string[] = devices.map((device) => { // parameter for each device
const jt = device.result.resultElements[vi].getValue("ENUM_StructureJetType"); const params: string[] = devices.map((device) => {
let jetType = this.intlService.localizeText("INFO_ENUM_STRUCTUREJETTYPE_" + jt); const val = device.result.resultElements[vi].getValue(propName);
let sVal;
if (localisationCode !== undefined) {
sVal = this.intlService.localizeText(localisationCode + val);
}
else {
sVal = fv(val);
}
if (devices.length > 1) { if (devices.length > 1) {
// evil HTML injection in table cell (simpler) // evil HTML injection in table cell (simpler)
jetType = this.intlService.localizeText("INFO_LIB_FS_OUVRAGE") + "" sVal = this.intlService.localizeText("INFO_LIB_FS_OUVRAGE") + ""
+ (device.findPositionInParent() + 1) + ": " + jetType; + (device.findPositionInParent() + 1) + ": " + sVal;
} }
return jetType; return sVal;
}); });
return `<div class="inner-cell-line">` + jetTypes.join(`, </div><div class="inner-cell-line">`) + `</div>`; return `<div class="inner-cell-line">` + params.join(`, </div><div class="inner-cell-line">`) + `</div>`;
} }
public get headers() { public get headers() {
......
...@@ -40,7 +40,10 @@ export class PabResults extends MultiDimensionResults implements PlottableData { ...@@ -40,7 +40,10 @@ export class PabResults extends MultiDimensionResults implements PlottableData {
"YMOY", "YMOY",
"ZRMB", "ZRMB",
"QA", "QA",
"ENUM_StructureJetType" "ENUM_StructureJetType",
"H1",
"H2",
"SUBMERGENCE"
]; ];
// axes par défaut // axes par défaut
this.chartX = this.chartX || "CLOISON"; this.chartX = this.chartX || "CLOISON";
...@@ -61,7 +64,7 @@ export class PabResults extends MultiDimensionResults implements PlottableData { ...@@ -61,7 +64,7 @@ export class PabResults extends MultiDimensionResults implements PlottableData {
if (sn.parent) { if (sn.parent) {
ct = sn.parent.calcType; ct = sn.parent.calcType;
} }
let label = ServiceFactory.formulaireService.expandVariableNameAndUnit(ct , h); let label = ServiceFactory.formulaireService.expandVariableNameAndUnit(ct, h);
label += this.getHelpLink(h); label += this.getHelpLink(h);
return label; return label;
}); });
...@@ -94,7 +97,7 @@ export class PabResults extends MultiDimensionResults implements PlottableData { ...@@ -94,7 +97,7 @@ export class PabResults extends MultiDimensionResults implements PlottableData {
// do not test result.ok else log messages will prevent partial results from being displayed // do not test result.ok else log messages will prevent partial results from being displayed
public get hasResults(): boolean { public get hasResults(): boolean {
return this.result !== undefined && ! this.result.hasOnlyErrors; return this.result !== undefined && !this.result.hasOnlyErrors;
} }
/** retourne true si au moins un calcul a échoué (le log a un code négatif) */ /** retourne true si au moins un calcul a échoué (le log a un code négatif) */
...@@ -231,6 +234,15 @@ export class PabResults extends MultiDimensionResults implements PlottableData { ...@@ -231,6 +234,15 @@ export class PabResults extends MultiDimensionResults implements PlottableData {
data.push(this.Z2[vi]); data.push(this.Z2[vi]);
break; break;
case "H1":
case "H2":
case "SUBMERGENCE":
for (let i = 0; i < l; i++) {
data.push(this.cloisonsResults[i].resultElements[vi].vCalc);
}
data.push(this.cloisonAvalResults.resultElements[vi].vCalc);
break;
case "PV": case "PV":
case "YMOY": case "YMOY":
case "ZRMB": case "ZRMB":
......
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