Progress/Activity indicator does not get cleared

Issue #52 resolved
Juan Pablo Caram repo owner created an issue

Seems like sometimes clearing the progress bar happens before it gets set to the last state. Perhaps a Progress class can handle this better.

Comments (5)

  1. Juan Pablo Caram reporter

    The progress bar is being replaced with a busy indicator. The original problem was caused by a process breaking (exception thrown) and never reaching the line where the progress bar was cleared or set to 100%.

    The new mechanism is based on objects that will call a distructor method when their reference is lost. A central storage keeps a "weak reference", which does not prevent the distructor from being called.

  2. Juan Pablo Caram reporter

    Attempting to read the file: /home/jpcaram/flatcam_test_files/board_outline.gbr.fab.gbr

    [WARNING] Line ignored (1905): X348350Y551000D02*X349100Y550250D01*
    [WARNING] Line ignored (1908): Y555500D02*Y551000D01*
    [ERROR] PARSING FAILED. Line 1909: M02*
    [ERROR][Dummy-2] KeyError(None,)
    Line 1909: M02*
    Traceback (most recent call last):
      File "/home/jpcaram/flatcam/FlatCAMWorker.py", line 32, in do_worker_task
        task['fcn'](*task['params'])
      File "/home/jpcaram/flatcam/FlatCAMApp.py", line 1590, in open_gerber
        self.new_object("gerber", name, obj_init)
      File "/home/jpcaram/flatcam/FlatCAMApp.py", line 776, in new_object
        initialize(obj, self)
      File "/home/jpcaram/flatcam/FlatCAMApp.py", line 1572, in obj_init
        gerber_obj.parse_file(filename, follow=follow)
      File "/home/jpcaram/flatcam/camlib.py", line 1429, in parse_file
        self.parse_lines(gstr, follow=follow)
      File "/home/jpcaram/flatcam/camlib.py", line 1928, in parse_lines
        raise ParseError("%s\nLine %d: %s" % (repr(err), line_num, gline))
    camlib.ParseError: KeyError(None,)
    Line 1909: M02*
    

    Failure message is shown in task bar: "Failed to parse file...", but busy indicator still active and showing "Opening Gerber".

  3. Juan Pablo Caram reporter

    Using a combination of exception handling and context managers to avoid problems. No clear generic solution yet.

  4. Log in to comment