twVolc / PyCamPermanent

Permanent PiCam (SO2) installation project software
GNU General Public License v3.0
1 stars 2 forks source link

Loading a config file after a processing run throws an error #147

Open twVolc opened 1 month ago

twVolc commented 1 month ago

There seem to be issues after a processing run meaning that you can't load in a config file after already processing something in that session. I encounter the following error - this was trying to load the config file that had just been generated by that processing run (basically to just reset to the first image), but I'm pretty sure an error is hit regardless of the config file you try to load.

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Users\gg1tcw\.conda\envs\pycam\lib\tkinter\__init__.py", line 1892, in __call__
    return self.func(*args)
  File "C:\Users\gg1tcw\Documents\PythonProjects\PyCamPermanent\pycam\gui\menu.py", line 730, in load_config_file
    self.reload_config()
  File "C:\Users\gg1tcw\Documents\PythonProjects\PyCamPermanent\pycam\gui\menu.py", line 737, in reload_config
    self.reload_all()
  File "C:\Users\gg1tcw\Documents\PythonProjects\PyCamPermanent\pycam\gui\menu.py", line 714, in reload_all
    self.load_all()
  File "C:\Users\gg1tcw\Documents\PythonProjects\PyCamPermanent\pycam\gui\menu.py", line 704, in load_all
    self.set_all_pcs_lines()
  File "C:\Users\gg1tcw\Documents\PythonProjects\PyCamPermanent\pycam\gui\menu.py", line 592, in set_all_pcs_lines
    self.load_pcs(filename=line, new_line=True)
  File "C:\Users\gg1tcw\Documents\PythonProjects\PyCamPermanent\pycam\gui\menu.py", line 565, in load_pcs
    self.pyplis_worker.fig_tau.add_pcs_line(line, line_num=line_num, force_add=True)
  File "C:\Users\gg1tcw\Documents\PythonProjects\PyCamPermanent\pycam\gui\figures_analysis.py", line 699, in add_pcs_line
    self.PCS_lines_list[line_idx].plot_line_on_grid(ax=self.ax, include_normal=1,
  File "C:\Users\gg1tcw\.conda\envs\pycam\lib\site-packages\pyplis\utils.py", line 920, in plot_line_on_grid
    draw()
  File "C:\Users\gg1tcw\.conda\envs\pycam\lib\site-packages\matplotlib\pyplot.py", line 952, in draw
    gcf().canvas.draw_idle()
  File "C:\Users\gg1tcw\.conda\envs\pycam\lib\site-packages\matplotlib\backends\_backend_tk.py", line 255, in draw_idle
    self._idle_draw_id = self._tkcanvas.after_idle(idle_draw)
  File "C:\Users\gg1tcw\.conda\envs\pycam\lib\tkinter\__init__.py", line 830, in after_idle
    return self.after('idle', func, *args)
  File "C:\Users\gg1tcw\.conda\envs\pycam\lib\tkinter\__init__.py", line 821, in after
    name = self._register(callit)
  File "C:\Users\gg1tcw\.conda\envs\pycam\lib\tkinter\__init__.py", line 1528, in _register
    self.tk.createcommand(name, f)
RuntimeError: main thread is not in main loop

In general, I tend to restart the software after each processing run because I don't fully trust that the software is resetting absolutely everything properly for subsequent processing runs in the same session.