From 79660bfd6eb3b717f6f695c1fc613b07bd3a43ae Mon Sep 17 00:00:00 2001
From: Theophile Terraz <theophile.terraz@inrae.fr>
Date: Fri, 9 Aug 2024 11:59:50 +0200
Subject: [PATCH] debug

---
 src/View/Results/CustomPlot/Plot.py | 2 +-
 src/View/Results/Window.py          | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/View/Results/CustomPlot/Plot.py b/src/View/Results/CustomPlot/Plot.py
index b699f3ea..cb45863c 100644
--- a/src/View/Results/CustomPlot/Plot.py
+++ b/src/View/Results/CustomPlot/Plot.py
@@ -439,7 +439,7 @@ class CustomPlot(PamhyrPlot):
 
     @timer
     def update(self):
-        #if not self._init:
+        if not self._init:
             self.draw()
             return
 
diff --git a/src/View/Results/Window.py b/src/View/Results/Window.py
index 2a7f463f..9068876b 100644
--- a/src/View/Results/Window.py
+++ b/src/View/Results/Window.py
@@ -538,6 +538,9 @@ class ResultsWindow(PamhyrWindow):
         )
         plot.draw()
 
+        # Add plot to additional plot
+        self._additional_plot[name] = plot
+
         grid.addWidget(toolbar, 0, 0)
         grid.addWidget(canvas, 1, 0)
         widget.setLayout(grid)
@@ -669,4 +672,5 @@ class ResultsWindow(PamhyrWindow):
 
     def delete_tab(self, index):
         tab_widget = self.find(QTabWidget, f"tabWidget")
+        self._additional_plot.pop(tab_widget.tabText(index))
         tab_widget.removeTab(index)
-- 
GitLab