Commit a6568efc authored by Mathias Chouet's avatar Mathias Chouet :spaghetti:
Browse files

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

Showing with 20 additions and 1 deletion
+20 -1
...@@ -74,7 +74,8 @@ ...@@ -74,7 +74,8 @@
<h1 [innerHTML]="uitextResultsTitle"></h1> <h1 [innerHTML]="uitextResultsTitle"></h1>
</mat-card-title> </mat-card-title>
<div fxFlex></div> <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 }} {{ uitextGeneratePAB }}
</button> </button>
</mat-card-header> </mat-card-header>
......
...@@ -455,6 +455,22 @@ export class GenericCalculatorComponent extends BaseComponent implements OnInit, ...@@ -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 * Génère une passe à bassins à partir du modèle de cloisons en cours
*/ */
......
...@@ -253,6 +253,7 @@ ...@@ -253,6 +253,7 @@
"INFO_PAB_HEADER_PARAMETERS": "Parameters", "INFO_PAB_HEADER_PARAMETERS": "Parameters",
"INFO_PAB_HEADER_VALUES": "Values", "INFO_PAB_HEADER_VALUES": "Values",
"INFO_PAB_CLOISON_OUVRAGE_N": "Wall : device #%s", "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_COURT": "Fish ladder",
"INFO_PAB_TITRE": "Fish ladder", "INFO_PAB_TITRE": "Fish ladder",
"INFO_PAB_TITRE_PROFIL": "Fish ladder longitudinal profile", "INFO_PAB_TITRE_PROFIL": "Fish ladder longitudinal profile",
......
...@@ -253,6 +253,7 @@ ...@@ -253,6 +253,7 @@
"INFO_PAB_HEADER_PARAMETERS": "Paramètres", "INFO_PAB_HEADER_PARAMETERS": "Paramètres",
"INFO_PAB_HEADER_VALUES": "Valeurs", "INFO_PAB_HEADER_VALUES": "Valeurs",
"INFO_PAB_CLOISON_OUVRAGE_N": "Cloison : ouvrage n° %s", "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_COURT": "PAB",
"INFO_PAB_TITRE": "Passe à bassins", "INFO_PAB_TITRE": "Passe à bassins",
"INFO_PAB_TITRE_PROFIL": "Profil en long de la passe", "INFO_PAB_TITRE_PROFIL": "Profil en long de la passe",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment