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

Fix #175

parent acbb18c9
No related branches found
No related tags found
1 merge request!43Resolve "Section paramétrée: varier un paramètre fait échouer le calcul"
......@@ -7,7 +7,19 @@
</mat-select>
</mat-form-field>
<mat-icon #tooltip="matTooltip" [matTooltip]="tooltipText" matTooltipClass="linked-param-tooltip"
<div class="status-icons-container">
<mat-icon [title]="uitextVariated" class="status-info" *ngIf="isVariable">
show_chart
</mat-icon>
<mat-icon [title]="uitextCalculated" class="status-info" *ngIf="isCalculated && ! isAwaitingCalculation">
check_circle
</mat-icon>
<mat-icon [title]="uitextAwaitingCalculation" class="status-info" *ngIf="isAwaitingCalculation">
timelapse
</mat-icon>
</div>
<mat-icon id="info-tooltip" #tooltip="matTooltip" [matTooltip]="tooltipText" matTooltipClass="linked-param-tooltip"
(click)="tooltip.toggle()"
(mouseenter)="$event.stopImmediatePropagation()" (mouseleave)="$event.stopImmediatePropagation()">
info_outline
......
......@@ -32,11 +32,23 @@
}
}
mat-icon {
.status-icons-container {
position: absolute;
top: 7px;
top: -8px;
right: 8px;
> mat-icon {
transform: scale(0.7);
color: grey;
cursor: default;
}
}
mat-icon#info-tooltip {
position: absolute;
top: 12px;
right: 8px;
transform: scale(0.9);
cursor: pointer;
transform: scale(0.9);
}
}
......@@ -46,6 +46,36 @@ export class ParamLinkComponent implements OnChanges, Observer, OnDestroy {
return "linked_" + this.param.symbol;
}
public get isVariable(): boolean {
return this.param.paramDefinition.hasMultipleValues;
}
/**
* Returns true if current target needs to be calculated,
* whether the result is already available or not
*/
public get isCalculated(): boolean {
const refValue = this.param.paramDefinition.referencedValue;
return (refValue.isResult() || refValue.isExtraResult());
}
/**
* Returns true if current target needs to be calculated,
* but result is not yet available
*/
public get isAwaitingCalculation(): boolean {
if (this.isCalculated) {
const refValue = this.param.paramDefinition.referencedValue;
try {
refValue.getParamValues();
return false;
} catch (e) {
return true;
}
}
return false;
}
constructor(
private intlService: I18nService
) {
......@@ -100,6 +130,18 @@ export class ParamLinkComponent implements OnChanges, Observer, OnDestroy {
return this._currentIndex !== -1 && this.param.isValid;
}
public get uitextVariated() {
return this.intlService.localizeText("INFO_PARAMFIELD_VARIATED");
}
public get uitextCalculated() {
return this.intlService.localizeText("INFO_PARAMFIELD_CALCULATED");
}
public get uitextAwaitingCalculation() {
return this.intlService.localizeText("INFO_PARAMFIELD_AWAITING_CALCULATION");
}
/**
* Label d'une entrée du select des paramètres liés
*/
......
......@@ -166,6 +166,8 @@
"INFO_PABPUISSANCE_TITRE_COURT": "FL: diss. power",
"INFO_PARALLELSTRUCTURE_TITRE": "Parallel structures",
"INFO_PARALLELSTRUCTURE_TITRE_COURT": "// structures",
"INFO_PARAMFIELD_AWAITING_CALCULATION": "Awaiting calculation",
"INFO_PARAMFIELD_CALCULATED": "Calculated",
"INFO_PARAMFIELD_GRAPH_TYPE": "Graph type",
"INFO_PARAMFIELD_GRAPH_TYPE_HISTOGRAM": "Histogram",
"INFO_PARAMFIELD_GRAPH_SELECT_X_AXIS": "Variable for X axis",
......@@ -191,6 +193,7 @@
"INFO_PARAMFIELD_PARAMVARIER_VALUES_FORMAT_ERROR": "Incorrect format; accepted separator: %s",
"INFO_PARAMFIELD_VALEURMAXI": "To maximum value",
"INFO_PARAMFIELD_VALEURMINI": "From minimum value",
"INFO_PARAMFIELD_VARIATED": "Variated",
"INFO_PARAMMODE_MINMAX": "Min/max",
"INFO_PARAMMODE_LIST": "Values list",
"INFO_REGIMEUNIFORME_TITRE": "Uniform flow calculation",
......
......@@ -166,6 +166,8 @@
"INFO_PABPUISSANCE_TITRE_COURT": "PAB&nbsp;: puissance",
"INFO_PARALLELSTRUCTURE_TITRE": "Lois d'ouvrages",
"INFO_PARALLELSTRUCTURE_TITRE_COURT": "Ouvrages",
"INFO_PARAMFIELD_AWAITING_CALCULATION": "En attente de calcul",
"INFO_PARAMFIELD_CALCULATED": "Calculé",
"INFO_PARAMFIELD_GRAPH_TYPE": "Type de graphe",
"INFO_PARAMFIELD_GRAPH_TYPE_HISTOGRAM": "Histogramme",
"INFO_PARAMFIELD_GRAPH_SELECT_X_AXIS": "Variable en abscisse",
......@@ -191,6 +193,7 @@
"INFO_PARAMFIELD_PARAMVARIER_VALUES_FORMAT_ERROR": "Format incorrect; séparateurs acceptés: %s",
"INFO_PARAMFIELD_VALEURMAXI": "À la valeur maximum",
"INFO_PARAMFIELD_VALEURMINI": "De la valeur minimum",
"INFO_PARAMFIELD_VARIATED": "Varié",
"INFO_PARAMMODE_MINMAX": "Min/max",
"INFO_PARAMMODE_LIST": "Liste de valeurs",
"INFO_REGIMEUNIFORME_TITRE": "Régime uniforme",
......
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