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

Cloisons: PAB generation button is disabled if any parameter is varying

parent 4eb6a45c
No related branches found
No related tags found
1 merge request!49Resolve "Ajout du module de calcul d'une passe à bassins"
......@@ -74,7 +74,8 @@
<h1 [innerHTML]="uitextResultsTitle"></h1>
</mat-card-title>
<div fxFlex></div>
<button mat-raised-button color="accent" id="generate-pab" *ngIf="isPABCloisons" (click)="generatePAB()">
<button mat-raised-button color="accent" id="generate-pab" *ngIf="isPABCloisons" (click)="generatePAB()"
[disabled]="! generatePABEnabled" [title]="uitextGeneratePabTitle">
{{ uitextGeneratePAB }}
</button>
</mat-card-header>
......
......@@ -455,6 +455,22 @@ export class GenericCalculatorComponent extends BaseComponent implements OnInit,
);
}
// PAB generation is enabled only if no parameter is varying
public get generatePABEnabled(): boolean {
let ret = true;
for (const p of this._formulaire.currentNub.parameterIterator) {
ret = ret && (! p.hasMultipleValues);
}
return ret;
}
public get uitextGeneratePabTitle() {
if (! this.generatePABEnabled) {
return this.intlService.localizeText("INFO_PAB_PARAMETRES_FIXES");
}
return "";
}
/**
* Génère une passe à bassins à partir du modèle de cloisons en cours
*/
......
......@@ -253,6 +253,7 @@
"INFO_PAB_HEADER_PARAMETERS": "Parameters",
"INFO_PAB_HEADER_VALUES": "Values",
"INFO_PAB_CLOISON_OUVRAGE_N": "Wall : device #%s",
"INFO_PAB_PARAMETRES_FIXES": "All parameters must be fixed",
"INFO_PAB_TITRE_COURT": "Fish ladder",
"INFO_PAB_TITRE": "Fish ladder",
"INFO_PAB_TITRE_PROFIL": "Fish ladder longitudinal profile",
......
......@@ -253,6 +253,7 @@
"INFO_PAB_HEADER_PARAMETERS": "Paramètres",
"INFO_PAB_HEADER_VALUES": "Valeurs",
"INFO_PAB_CLOISON_OUVRAGE_N": "Cloison : ouvrage n° %s",
"INFO_PAB_PARAMETRES_FIXES": "Tous les paramètres doivent être fixés",
"INFO_PAB_TITRE_COURT": "PAB",
"INFO_PAB_TITRE": "Passe à bassins",
"INFO_PAB_TITRE_PROFIL": "Profil en long de la passe",
......
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