- working to update the Paint Tool

This commit is contained in:
Marius Stanciu 2020-03-30 23:12:27 +03:00
parent 70dd9aecae
commit 8a2f5fed05
4 changed files with 700 additions and 985 deletions

View File

@ -9,6 +9,10 @@ CAD program, and create G-Code for Isolation routing.
================================================= =================================================
30.03.2020
- working to update the Paint Tool
29.03.2020 29.03.2020
- modified the new database to accept data from NCC and Paint Tools - modified the new database to accept data from NCC and Paint Tools

View File

@ -1470,8 +1470,13 @@ class Geometry(object):
line = LineString([(left, y), (right, y)]) line = LineString([(left, y), (right, y)])
line = line.intersection(margin_poly) line = line.intersection(margin_poly)
for ll in line: try:
lines_trimmed.append(ll) for ll in line:
lines_trimmed.append(ll)
if prog_plot:
self.plot_temp_shapes(ll)
except TypeError:
lines_trimmed.append(line)
if prog_plot: if prog_plot:
self.plot_temp_shapes(line) self.plot_temp_shapes(line)
except Exception as e: except Exception as e:
@ -1502,8 +1507,13 @@ class Geometry(object):
line = LineString([(x, top), (x, bot)]) line = LineString([(x, top), (x, bot)])
line = line.intersection(margin_poly) line = line.intersection(margin_poly)
for ll in line: try:
lines_trimmed.append(ll) for ll in line:
lines_trimmed.append(ll)
if prog_plot:
self.plot_temp_shapes(ll)
except TypeError:
lines_trimmed.append(line)
if prog_plot: if prog_plot:
self.plot_temp_shapes(line) self.plot_temp_shapes(line)
except Exception as e: except Exception as e:

View File

@ -128,6 +128,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
self.tools_box.addWidget(self.tools_table) self.tools_box.addWidget(self.tools_table)
self.tools_table.setColumnCount(4) self.tools_table.setColumnCount(4)
# 3rd column is reserved (and hidden) for the tool ID
self.tools_table.setHorizontalHeaderLabels(['#', _('Diameter'), _('TT'), '']) self.tools_table.setHorizontalHeaderLabels(['#', _('Diameter'), _('TT'), ''])
self.tools_table.setColumnHidden(3, True) self.tools_table.setColumnHidden(3, True)
self.tools_table.setSortingEnabled(False) self.tools_table.setSortingEnabled(False)
@ -3971,6 +3972,13 @@ class NonCopperClear(FlatCAMTool, Gerber):
return return
self.app.inform.emit('[success] %s' % _("Tool from DB added in Tool Table.")) self.app.inform.emit('[success] %s' % _("Tool from DB added in Tool Table."))
# select last tool added
toolid = res
for row in range(self.tools_table.rowCount()):
if int(self.tools_table.item(row, 3).text()) == toolid:
self.tools_table.selectRow(row)
self.on_row_selection_change()
def on_ncc_tool_from_db_inserted(self, tool): def on_ncc_tool_from_db_inserted(self, tool):
""" """
Called from the Tools DB object through a App method when adding a tool from Tools Database Called from the Tools DB object through a App method when adding a tool from Tools Database
@ -4012,9 +4020,9 @@ class NonCopperClear(FlatCAMTool, Gerber):
self.ncc_tools.update({ self.ncc_tools.update({
tooluid: { tooluid: {
'tooldia': float('%.*f' % (self.decimals, tooldia)), 'tooldia': float('%.*f' % (self.decimals, tooldia)),
'offset': 'Path', 'offset': tool['offset'],
'offset_value': 0.0, 'offset_value': tool['offset_value'],
'type': 'Iso', 'type': tool['type'],
'tool_type': tool['tool_type'], 'tool_type': tool['tool_type'],
'data': deepcopy(tool['data']), 'data': deepcopy(tool['data']),
'solid_geometry': [] 'solid_geometry': []

File diff suppressed because it is too large Load Diff