Cleanup. And fixes #148.

This commit is contained in:
Juan Pablo Caram
2015-09-11 14:45:08 -04:00
parent 71aca80603
commit 22119072d3
6 changed files with 49 additions and 32 deletions

View File

@@ -1814,6 +1814,13 @@ class App(QtCore.QObject):
App.log.debug("Project loaded")
def propagate_defaults(self):
"""
This method is used to set default values in classes. It's
an alternative to project options but allows the use
of values invisible to the user.
:return: None
"""
self.log.debug("propagate_defaults()")
@@ -1822,17 +1829,17 @@ class App(QtCore.QObject):
"zdownrate": CNCjob,
"excellon_zeros": Excellon,
"gerber_use_buffer_for_union": Gerber,
"cncjob_coordinate_format": CNCjob,
"spindlespeed": CNCjob
"cncjob_coordinate_format": CNCjob
# "spindlespeed": CNCjob
}
for param in routes:
if param in routes[param].defaults:
try:
routes[param].defaults[param] = self.defaults[param]
self.log.debug(" " + param + " OK")
except KeyError:
pass
routes[param].defaults[param] = self.defaults[param]
self.log.debug(" " + param + " OK")
except KeyError:
self.log.debug(" ERROR: " + param + " not in defaults.")
else:
# Try extracting the name:
# classname_param here is param in the object