From 0eef47c51591b68363dbb5db613fd88b59dc620e Mon Sep 17 00:00:00 2001
From: "mathias.chouet" <mathias.chouet@irstea.fr>
Date: Thu, 9 May 2019 09:53:42 +0200
Subject: [PATCH] Session: improved PabCloisons creation

---
 src/session.ts | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/session.ts b/src/session.ts
index f9620f95..aaf42b71 100644
--- a/src/session.ts
+++ b/src/session.ts
@@ -379,7 +379,13 @@ export class Session {
                 break;
 
             case CalculatorType.PabCloisons:
-                nub = new PabCloisons(undefined); // don't forget to init with a Cloisons model afterwards !
+                const modeleCloisons: string = params.getPropValue("modeleCloisons");
+                if (modeleCloisons) {
+                    const cloisons = (Session.getInstance().findNubByUid(modeleCloisons) as Cloisons);
+                    nub = new PabCloisons(cloisons);
+                } else {
+                    nub = new PabCloisons(undefined); // don't forget to init with a Cloisons model afterwards !
+                }
                 break;
 
             default:
-- 
GitLab