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

Fix #121 : résultats de calcul rétablis sous la section paramétrée

parent 5a7f2d1e
No related branches found
No related tags found
1 merge request!34Resolve "Export des graphiques"
<div class="container-fluid"> <div>
<fixedvar-results></fixedvar-results>
<section-results></section-results> <section-results></section-results>
<remous-results></remous-results> <remous-results></remous-results>
<fixedvar-results></fixedvar-results>
</div> </div>
...@@ -80,12 +80,14 @@ export class FixedResultsComponent { ...@@ -80,12 +80,14 @@ export class FixedResultsComponent {
&& res.resultElement && res.resultElement
&& res.extraResults && res.extraResults
) { ) {
// 2.1. main result // 2.1. main result (sometimes empty, for ex. in "Section paramétrée")
data.push({ if (res.name && res.resultElement.vCalc) {
label: this._fixedResults.calculatedParameterHeader, data.push({
value: this.intlService.formatResult(res.name, res.resultElement.vCalc), label: this._fixedResults.calculatedParameterHeader,
isCalcResult: true // for CSS value: this.intlService.formatResult(res.name, res.resultElement.vCalc),
}); isCalcResult: true // for CSS
});
}
// 2.2. extra results // 2.2. extra results
const extraResults = res.resultElement.extraResults; const extraResults = res.resultElement.extraResults;
......
...@@ -13,18 +13,8 @@ ...@@ -13,18 +13,8 @@
</div> </div>
<!-- graphique --> <!-- graphique -->
<div class="row"> <div class="canvas-container">
<div class="col" style="text-align: center"> <section-canvas></section-canvas>
<section-canvas></section-canvas>
</div>
</div> </div>
</div> </div>
</div> </div>
<!-- tableau de valeurs -->
<div class="col mx-auto">
<table style="width: 100%" cellpadding="15">
<tr vertical-result-element [result-element]=resultElement>
</tr>
</table>
</div>
...@@ -21,3 +21,8 @@ ...@@ -21,3 +21,8 @@
} }
} }
} }
.canvas-container {
// border: dashed red 2px;
text-align: center;
}
...@@ -6,6 +6,7 @@ import { SectionCanvasComponent } from "../section-canvas/section-canvas.compone ...@@ -6,6 +6,7 @@ import { SectionCanvasComponent } from "../section-canvas/section-canvas.compone
import { SectionResults } from "../../results/section-results"; import { SectionResults } from "../../results/section-results";
import { ApplicationSetupService } from "../../services/app-setup/app-setup.service"; import { ApplicationSetupService } from "../../services/app-setup/app-setup.service";
import { CalculatorResults } from "../../results/calculator-results"; import { CalculatorResults } from "../../results/calculator-results";
import { FixedResults } from "../../results/fixed-results";
@Component({ @Component({
selector: "section-results", selector: "section-results",
...@@ -22,19 +23,18 @@ export class SectionResultsComponent implements DoCheck { ...@@ -22,19 +23,18 @@ export class SectionResultsComponent implements DoCheck {
public set results(rs: CalculatorResults[]) { public set results(rs: CalculatorResults[]) {
this._resultElement = undefined; this._resultElement = undefined;
this._results = undefined; this._results = undefined;
if (rs) { if (rs) {
for (const r of rs) { for (const r of rs) {
if (r instanceof SectionResults) { if (r instanceof SectionResults) {
this._results = r; this._results = r;
break;
} }
} }
} }
this.updateView(); this.updateView();
} }
/** détermine s'il y a des résultats de section "fixes" (pas de paramètre varié, graphique de la section) */
public get hasResults(): boolean { public get hasResults(): boolean {
return this._results && this._results.hasResults; return this._results && this._results.hasResults;
} }
...@@ -52,9 +52,8 @@ export class SectionResultsComponent implements DoCheck { ...@@ -52,9 +52,8 @@ export class SectionResultsComponent implements DoCheck {
"Yc": { r: 255, g: 128, b: 0 }, "Yc": { r: 255, g: 128, b: 0 },
"Yco": { r: 255, g: 0, b: 255 }, "Yco": { r: 255, g: 0, b: 255 },
}; };
/**
* résultats non mis en forme /** résultats non mis en forme */
*/
private _results: SectionResults; private _results: SectionResults;
/** /**
......
import { CalculatorType, acSection, ParamsEquation, ComputeNodeType, IObservable } from "jalhyd"; import { IObservable } from "jalhyd";
import { FormResultSection } from "../form-result-section"; import { FormResultSection } from "../form-result-section";
import { FormDefSection } from "../form-def-section"; import { FormDefSection } from "../form-def-section";
import { NgParameter } from "../../ngparam";
import { InputField } from "../../input-field";
import { FormComputeSectionParametree } from "../form-compute-section-parametree"; import { FormComputeSectionParametree } from "../form-compute-section-parametree";
import { FormulaireDefinition } from "../form-definition"; import { FormulaireDefinition } from "../form-definition";
import { I18nService } from "../../../services/internationalisation/internationalisation.service";
import { CalculatorResults } from "../../../results/calculator-results"; import { CalculatorResults } from "../../../results/calculator-results";
import { FormDefFixedVar } from "../form-def-fixedvar"; import { FormDefFixedVar } from "../form-def-fixedvar";
import { FieldSet } from "../../fieldset"; import { FieldSet } from "../../fieldset";
import { SelectField } from "../../select-field";
export class FormulaireSectionParametree extends FormulaireDefinition { export class FormulaireSectionParametree extends FormulaireDefinition {
private _formFixedVar: FormDefFixedVar; private _formFixedVar: FormDefFixedVar;
......
import { SectionParametree, acSection } from "jalhyd"; import { SectionParametree, acSection, Result } from "jalhyd";
import { FormCompute } from "./form-compute"; import { FormCompute } from "./form-compute";
import { NgParameter } from "../ngparam"; import { NgParameter } from "../ngparam";
...@@ -80,9 +80,16 @@ export class FormComputeSectionParametree extends FormCompute { ...@@ -80,9 +80,16 @@ export class FormComputeSectionParametree extends FormCompute {
this._sectionResults.section = sect; this._sectionResults.section = sect;
const computePrec: number = this._formBase.getParameterValue("Pr"); // précision de calcul const computePrec: number = this._formBase.getParameterValue("Pr"); // précision de calcul
this._sectionResults.result = sectNub.CalcSerie(computePrec, const tmpResult: Result = sectNub.CalcSerie(computePrec,
undefined, // valeur initiale, non utilisée dans ce cas undefined, // valeur initiale, non utilisée dans ce cas
undefined // variable à calculer, non utilisée undefined // variable à calculer, non utilisée
); );
// résultats de section (avec le graphique de section)
this._sectionResults.result = tmpResult;
// résultats complémentaires des paramètres fixés
this._formSectionResult.addSectionFixedParameters(false);
this._formSectionResult.fixedResults.result = tmpResult;
} }
} }
import { acSection, Result, ResultElement } from "jalhyd"; import { acSection, Result } from "jalhyd";
import { CalculatorResults } from "./calculator-results"; import { CalculatorResults } from "./calculator-results";
import { NgParameter } from "../formulaire/ngparam";
export class SectionResults extends CalculatorResults { export class SectionResults extends CalculatorResults {
private _result: Result; private _result: Result;
......
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