- fixed some decimals issues in NCC Tool, Paint Tool and Excellon Editor (they were still using the harcoded values)
- some small updates in the NCC Tool
This commit is contained in:
@@ -634,11 +634,6 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
||||
def set_tool_ui(self):
|
||||
self.units = self.app.defaults['units'].upper()
|
||||
|
||||
if self.units == "IN":
|
||||
self.decimals = 4
|
||||
else:
|
||||
self.decimals = 2
|
||||
|
||||
self.tools_frame.show()
|
||||
|
||||
self.ncc_order_radio.set_value(self.app.defaults["tools_nccorder"])
|
||||
@@ -701,10 +696,12 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
||||
})
|
||||
|
||||
try:
|
||||
dias = [float(self.app.defaults["tools_ncctools"])]
|
||||
except (ValueError, TypeError):
|
||||
dias = [float(eval(dia)) for dia in self.app.defaults["tools_ncctools"].split(",") if dia != '']
|
||||
except Exception as e:
|
||||
log.error("At least one tool diameter needed. "
|
||||
"Verify in Edit -> Preferences -> TOOLS -> NCC Tools. %s" % str(e))
|
||||
|
||||
if not dias:
|
||||
log.error("At least one tool diameter needed. Verify in Edit -> Preferences -> TOOLS -> NCC Tools.")
|
||||
return
|
||||
|
||||
self.tooluid = 0
|
||||
|
||||
@@ -601,13 +601,6 @@ class ToolPaint(FlatCAMTool, Gerber):
|
||||
# updated units
|
||||
self.units = self.app.defaults['units'].upper()
|
||||
|
||||
if self.units == "IN":
|
||||
self.decimals = 4
|
||||
self.addtool_entry.set_value(0.039)
|
||||
else:
|
||||
self.decimals = 2
|
||||
self.addtool_entry.set_value(1)
|
||||
|
||||
# set the working variables to a known state
|
||||
self.paint_tools.clear()
|
||||
self.tooluid = 0
|
||||
@@ -651,6 +644,14 @@ class ToolPaint(FlatCAMTool, Gerber):
|
||||
except (ValueError, TypeError):
|
||||
diameters = [eval(x) for x in self.app.defaults["tools_painttooldia"].split(",") if x != '']
|
||||
|
||||
if not diameters:
|
||||
log.error("At least one tool diameter needed. Verify in Edit -> Preferences -> TOOLS -> NCC Tools.")
|
||||
self.build_ui()
|
||||
# if the Paint Method is "Single" disable the tool table context menu
|
||||
if self.default_data["selectmethod"] == "single":
|
||||
self.tools_table.setContextMenuPolicy(Qt.NoContextMenu)
|
||||
return
|
||||
|
||||
# call on self.on_tool_add() counts as an call to self.build_ui()
|
||||
# through this, we add a initial row / tool in the tool_table
|
||||
for dia in diameters:
|
||||
|
||||
@@ -621,11 +621,6 @@ class SolderPaste(FlatCAMTool):
|
||||
|
||||
self.units = self.app.defaults['units'].upper()
|
||||
|
||||
if self.units == "IN":
|
||||
self.decimals = 4
|
||||
else:
|
||||
self.decimals = 2
|
||||
|
||||
for name in list(self.app.preprocessors.keys()):
|
||||
# populate only with preprocessor files that start with 'Paste_'
|
||||
if name.partition('_')[0] != 'Paste':
|
||||
|
||||
Reference in New Issue
Block a user