twVolc / PyCamPermanent

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

Error loading config file if DOAS calibration window has been opened #142

Closed twVolc closed 1 month ago

twVolc commented 1 month ago

As above, if I have previously opened and then closed the DOAS calibration window, then load a config file, the following error is thrown:

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 724, in load_config_file
    self.reload_config()
  File "C:\Users\gg1tcw\Documents\PythonProjects\PyCamPermanent\pycam\gui\menu.py", line 740, in reload_config
    calibration_wind.ils_frame.load_ILS()
  File "C:\Users\gg1tcw\Documents\PythonProjects\PyCamPermanent\pycam\gui\figures_doas.py", line 1168, in load_ILS
    self.update_ILS_label()
  File "C:\Users\gg1tcw\Documents\PythonProjects\PyCamPermanent\pycam\gui\figures_doas.py", line 1152, in update_ILS_label
    self.ILS_load_label.configure(text=ILS_filename_short)
  File "C:\Users\gg1tcw\.conda\envs\pycam\lib\tkinter\__init__.py", line 1646, in configure
    return self._configure('configure', cnf, kw)
  File "C:\Users\gg1tcw\.conda\envs\pycam\lib\tkinter\__init__.py", line 1636, in _configure
    self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: invalid command name ".!toplevel.!frame2.!frame.!frame.!frame.!label2"

I think this is because tkinter is trying to update a label that doesn't exist?

It looks to me like the ILSFrame class in figures_doas.py doesn't have a close_frame method that would set self.in_frame to false when the window is closed. This is important for the frame to know when it should try to update its labels and when it should ignore that aspect of loading.

twVolc commented 1 month ago

Fixed and should be closed when dev24.2 is merged with master