diff --git a/schainpy/gui/viewcontroller/basicwindow.py b/schainpy/gui/viewcontroller/basicwindow.py index 95acda0..8ff94b7 100644 --- a/schainpy/gui/viewcontroller/basicwindow.py +++ b/schainpy/gui/viewcontroller/basicwindow.py @@ -4751,15 +4751,15 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): self.threadStarted = False self.controllerThread.stop() - while self.controllerThread.isRunning(): + while not self.plotManager.isEmpty(): self.plotManager.run() - sleep(0.5) - if self.plotManager is not None: - self.plotManager.stop() - self.plotManager.close() - self.plotManager = None + self.plotManager.close() + self.plotManager = None + while self.controllerThread.isRunning(): + sleep(0.5) + self._disable_stop_button() self._enable_play_button() diff --git a/schainpy/model/graphics/jroplotter.py b/schainpy/model/graphics/jroplotter.py index 8896386..b5a2142 100644 --- a/schainpy/model/graphics/jroplotter.py +++ b/schainpy/model/graphics/jroplotter.py @@ -113,10 +113,12 @@ class PlotManager(): plotter = self.plotInstanceDict[plot_id] plotter.run(dataPlot, plot_id, **kwargs) - - self.__lock.release() - + + def isEmpty(self): + + return self.__queue.empty() + def stop(self): self.__lock.acquire()