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

Update #288 after merge

parent 8ad08c03
No related branches found
No related tags found
No related merge requests found
Pipeline #137570 failed
......@@ -91,7 +91,7 @@ import { ModulesDiagramComponent } from "./components/modules-diagram/modules-di
import { MacrorugoCompoundResultsTableComponent } from "./components/macrorugo-compound-results/macrorugo-compound-results-table.component";
import { MacrorugoCompoundResultsComponent } from "./components/macrorugo-compound-results/macrorugo-compound-results.component";
import { JetResultsComponent } from "./components/jet-results/jet-results.component";
import { JetTrajectoryGraphComponent } from "./components/jet-trajectory-graph/jet-trajectory-graph.component";
import { JetTrajectoryChartComponent } from "./components/jet-trajectory-chart/jet-trajectory-chart.component";
import { DialogConfirmEmptySessionComponent } from "./components/dialog-confirm-empty-session/dialog-confirm-empty-session.component";
import { DialogConfirmCloseCalcComponent } from "./components/dialog-confirm-close-calc/dialog-confirm-close-calc.component";
......@@ -196,7 +196,7 @@ const appRoutes: Routes = [
JalhydModelValidationMaxDirective,
JalhydModelValidationStepDirective,
JetResultsComponent,
JetTrajectoryGraphComponent,
JetTrajectoryChartComponent,
LogComponent,
LogEntryComponent,
ModulesDiagramComponent,
......
......@@ -2,9 +2,9 @@
<!-- journal -->
<log></log>
<results-graph *ngIf="showVarResults"></results-graph>
<results-chart *ngIf="showVarResults"></results-chart>
<jet-trajectory-graph *ngIf="hasResults"></jet-trajectory-graph>
<jet-trajectory-chart *ngIf="hasResults"></jet-trajectory-chart>
<div>
<!-- table des résultats fixés -->
......
results-graph {
results-chart {
margin-left: 1em;
margin-right: 1em;
}
import { Component, ViewChild } from "@angular/core";
import { FixedVarResultsComponent } from "../fixedvar-results/fixedvar-results.component";
import { JetTrajectoryGraphComponent } from "../jet-trajectory-graph/jet-trajectory-graph.component";
import { JetTrajectoryChartComponent } from "../jet-trajectory-chart/jet-trajectory-chart.component";
@Component({
selector: "jet-results",
......@@ -13,8 +13,8 @@ import { JetTrajectoryGraphComponent } from "../jet-trajectory-graph/jet-traject
export class JetResultsComponent extends FixedVarResultsComponent {
/** graphique de trajectoire */
@ViewChild(JetTrajectoryGraphComponent, { static: false })
private jetTrajectoryGraphComponent: JetTrajectoryGraphComponent;
@ViewChild(JetTrajectoryChartComponent, { static: false })
private jetTrajectoryChartComponent: JetTrajectoryChartComponent;
public get hasResults(): boolean {
return (
......@@ -25,8 +25,8 @@ export class JetResultsComponent extends FixedVarResultsComponent {
}
public updateView() {
if (this.jetTrajectoryGraphComponent) {
this.jetTrajectoryGraphComponent.results = undefined;
if (this.jetTrajectoryChartComponent) {
this.jetTrajectoryChartComponent.results = undefined;
}
super.updateView();
}
......@@ -38,20 +38,20 @@ export class JetResultsComponent extends FixedVarResultsComponent {
protected updateResults() {
const superUpdated = super.updateResults();
let trajectoryGraphUpdated: boolean;
trajectoryGraphUpdated = this.jetTrajectoryGraphComponent !== undefined;
let trajectoryChartUpdated: boolean;
trajectoryChartUpdated = this.jetTrajectoryChartComponent !== undefined;
if (trajectoryGraphUpdated) {
if (trajectoryChartUpdated) {
// draw chart whether params are variating or not,
// hence different Results object for each case
if (this._varResults && this._varResults.hasResults) {
this.jetTrajectoryGraphComponent.results = this._varResults;
this.jetTrajectoryChartComponent.results = this._varResults;
} else {
this.jetTrajectoryGraphComponent.results = this._fixedResults;
this.jetTrajectoryChartComponent.results = this._fixedResults;
}
this.jetTrajectoryGraphComponent.updateView();
this.jetTrajectoryChartComponent.updateView();
}
return superUpdated && trajectoryGraphUpdated;
return superUpdated && trajectoryChartUpdated;
}
}
<div class="graph-results-container" #graphProfile fxLayout="row wrap" fxLayoutAlign="center center">
<div class="chart-results-container" #graphProfile fxLayout="row wrap" fxLayoutAlign="center center">
<div fxFlex="1 1 100%">
<div class="graph-profile-buttons">
<div class="chart-profile-buttons">
<button mat-icon-button (click)="resetZoom()" [disabled]="! zoomWasChanged" [title]="uitextResetZoomTitle">
<mat-icon color="primary">replay</mat-icon>
</button>
......
.graph-results-container{
.chart-results-container{
display: block;
background-color: white;
}
.graph-profile-buttons {
.chart-profile-buttons {
padding-right: 10px;
padding-top: 4px;
margin-bottom: -30px;
......
......@@ -12,13 +12,13 @@ import { fv } from "../../util";
import { Jet } from "jalhyd";
@Component({
selector: "jet-trajectory-graph",
templateUrl: "./jet-trajectory-graph.component.html",
selector: "jet-trajectory-chart",
templateUrl: "./jet-trajectory-chart.component.html",
styleUrls: [
"./jet-trajectory-graph.component.scss"
"./jet-trajectory-chart.component.scss"
]
})
export class JetTrajectoryGraphComponent extends ResultsComponent {
export class JetTrajectoryChartComponent extends ResultsComponent {
@ViewChild(ChartComponent, { static: false })
private chartComponent;
......@@ -132,7 +132,7 @@ export class JetTrajectoryGraphComponent extends ResultsComponent {
}
public set results(r: FixedResults | VarResults) {
this.forceRebuild(); // used for (de)activating legend in generateScatterGraph()
this.forceRebuild(); // used for (de)activating legend in generateScatterChart()
this._results = r;
if (this._results) {
......@@ -170,13 +170,13 @@ export class JetTrajectoryGraphComponent extends ResultsComponent {
}
public updateView() {
this.generateScatterGraph();
this.generateScatterChart();
}
/**
* génère les données d'un graphe de type "scatter"
*/
private generateScatterGraph() {
private generateScatterChart() {
const ySeries = this.getYSeries();
// hide legend when there is only 1 series
......
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