Spindlespeed KeyError

Issue #148 resolved
Bruno Vunderl created an issue

KeyError occurs when running FlatCam on Fedora 22 with latest matplotlib and other prequisite libs. Fixed issue by adding try: except KeyError: pass

Traceback (most recent call last):
  File "FlatCAM.py", line 14, in <module>
    fc = App()
  File "/home/xeon/Programs/flatcam/FlatCAMApp.py", line 288, in __init__
    self.propagate_defaults()
  File "/home/xeon/Programs/flatcam/FlatCAMApp.py", line 1831, in propagate_defaults
    routes[param].defaults[param] = self.defaults[param]
KeyError: 'spindlespeed'

Comments (10)

  1. Juan Pablo Caram repo owner

    Can you please explain how to reproduce the problem? Does this cause an error in the operation of the program or it's just an error shown in the console?

  2. Bruno Vunderl reporter

    I couldn't run the program. When trying to run without my dirty fix I would get output as above.

  3. Juan Pablo Caram repo owner

    Could you please check that you have the latest source. I made several changes very recently.

  4. martin 321

    Get the same error, with the latest source. Using winpython. Xenosb: where did you insert the "fix"?

  5. Bruno Vunderl reporter

    I have the latest GIT source, just checked.

    I have changed if block at line :1830 to:

            if param in routes[param].defaults:
                    try:
                            routes[param].defaults[param] = self.defaults[param]
                            self.log.debug("  " + param + " OK")
                    except KeyError:
                            pass
    

    This is a dirty fix and doesn't resolve the issue why spindlespeed is not in the dict. But program runs and works without any bugs.

    If you want, I can commit and push that change to the repo. Also, If I catch some time I may add option to use laser engraver instead of CNC since I have that setup at home. Laser turns on with M03 and turns off with M05 instead of Z axis movement so at the moment I am editing generated nc file.

  6. Juan Pablo Caram repo owner

    Can you run this quick test: Backup your ~/.FlatCAM/defaults.json and remove it from that folder. Then try running FlatCAM again. I suspect spindlespeed is coming from the defaults file and it's not used any more by the program.

    (Please create an issue on the laser option if it does not yet exist.)

  7. Juan Pablo Caram repo owner

    I was able to recreate the problem by deleting my ~/.FlatCAM/defaults.json. Not exactly sure how this happened.

  8. Log in to comment