- the application now uses only the default values from the app.options dict, the app.defaults dict holds the definitive default values

- fixed some outstanding issues from the PyQt6 port
- PEP8 fixes
- minor fixes
- updated the saving of Preferences to update the self.options too: the `Apply` action will update the self.options but the `Save` action will save the updated preferences to the file on disk
This commit is contained in:
Marius Stanciu
2022-02-18 23:06:58 +02:00
committed by Marius
parent 14d9ea5470
commit 65d8dcc0b2
92 changed files with 1881 additions and 1882 deletions

View File

@@ -103,22 +103,22 @@ class TclCommandCopperClear(TclCommand):
if 'tooldia' in args:
tooldia = str(args['tooldia'])
else:
tooldia = str(self.app.defaults["tools_ncc_tools"])
tooldia = str(self.app.options["tools_ncc_tools"])
if 'overlap' in args:
overlap = float(args['overlap']) / 100.0
else:
overlap = float(self.app.defaults["tools_ncc_overlap"]) / 100.0
overlap = float(self.app.options["tools_ncc_overlap"]) / 100.0
if 'order' in args:
order = args['order']
else:
order = str(self.app.defaults["tools_ncc_order"])
order = str(self.app.options["tools_ncc_order"])
if 'margin' in args:
margin = float(args['margin'])
else:
margin = float(self.app.defaults["tools_ncc_margin"])
margin = float(self.app.options["tools_ncc_margin"])
if 'method' in args:
method = args['method']
@@ -132,7 +132,7 @@ class TclCommandCopperClear(TclCommand):
return "Method not supported or typo.\n" \
"Supported methods are: 'standard', 'seed' and 'lines'."
else:
method = str(self.app.defaults["tools_ncc_method"])
method = str(self.app.options["tools_ncc_method"])
method_data = method
if 'connect' in args:
@@ -142,7 +142,7 @@ class TclCommandCopperClear(TclCommand):
par = args['connect']
connect = bool(eval(par))
else:
connect = bool(eval(str(self.app.defaults["tools_ncc_connect"])))
connect = bool(eval(str(self.app.options["tools_ncc_connect"])))
if 'contour' in args:
try:
@@ -151,7 +151,7 @@ class TclCommandCopperClear(TclCommand):
par = args['contour']
contour = bool(eval(par))
else:
contour = bool(eval(str(self.app.defaults["tools_ncc_contour"])))
contour = bool(eval(str(self.app.options["tools_ncc_contour"])))
offset = 0.0
if 'offset' in args:
@@ -172,7 +172,7 @@ class TclCommandCopperClear(TclCommand):
par = args['rest']
rest = bool(eval(par))
else:
rest = bool(eval(str(self.app.defaults["tools_ncc_rest"])))
rest = bool(eval(str(self.app.options["tools_ncc_rest"])))
if 'outname' in args:
outname = args['outname']
@@ -202,8 +202,8 @@ class TclCommandCopperClear(TclCommand):
"tools_ncc_contour": contour,
"tools_ncc_overlap": overlap,
"segx": self.app.defaults["geometry_segx"],
"segy": self.app.defaults["geometry_segy"]
"segx": self.app.options["geometry_segx"],
"segy": self.app.options["geometry_segy"]
})
ncc_tools = {}