- in "Punch Gerber" and "Extract" Plugins - make sure that the aperture markings are deleted on Reset Tool click and upon finishing the Plugin main function
- in Punch Gerber Plugin the object is no longer populated automatically with the generated object - in Corner Markers Plugin fixed the position of "drills in locations" and for Checking Exceloon; the source object is no longer auto-updated to the latest one since we have to always work on the original object
This commit is contained in:
@@ -12,9 +12,12 @@ CHANGELOG for FlatCAM beta
|
|||||||
- updated the Turkish translation files (by Mehmet Kaya)
|
- updated the Turkish translation files (by Mehmet Kaya)
|
||||||
- added a new color in the Object Colors ("indigo")
|
- added a new color in the Object Colors ("indigo")
|
||||||
- now the object color transparency is preserved if a new color is chosen
|
- now the object color transparency is preserved if a new color is chosen
|
||||||
- the Proprties tab UI is now populated with the object UI only when the Properties tab is selected and not on object selection like it was done previously
|
- the Properties tab UI is now populated with the object UI only when the Properties tab is selected and not on object selection like it was done previously
|
||||||
- make sure that if the Properties Tab is selected then the Object UI is updated (built) on object selection on canvas
|
- make sure that if the Properties Tab is selected then the Object UI is updated (built) on object selection on canvas
|
||||||
- code cleanup
|
- code cleanup
|
||||||
|
- in "Punch Gerber" and "Extract" Plugins - make sure that the aperture markings are deleted on Reset Tool click and upon finishing the Plugin main function
|
||||||
|
- in Punch Gerber Plugin the object is no longer populated automatically with the generated object
|
||||||
|
- in Corner Markers Plugin fixed the position of "drills in locations" and for Checking Exceloon; the source object is no longer auto-updated to the latest one since we have to always work on the original object
|
||||||
|
|
||||||
5.10.2021
|
5.10.2021
|
||||||
|
|
||||||
|
|||||||
@@ -507,7 +507,7 @@ class ToolCorners(AppTool):
|
|||||||
grb_obj.source_file = app_obj.f_handlers.export_gerber(obj_name=outname, filename=None, local_use=grb_obj,
|
grb_obj.source_file = app_obj.f_handlers.export_gerber(obj_name=outname, filename=None, local_use=grb_obj,
|
||||||
use_thread=False)
|
use_thread=False)
|
||||||
|
|
||||||
ret = self.app.app_obj.new_object('gerber', outname, initialize, plot=True)
|
ret = self.app.app_obj.new_object('gerber', outname, initialize, plot=True, autoselected=False)
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
@@ -552,29 +552,29 @@ class ToolCorners(AppTool):
|
|||||||
|
|
||||||
if 'manual' not in self.points:
|
if 'manual' not in self.points:
|
||||||
if tl_state:
|
if tl_state:
|
||||||
x = xmin - margin - line_thickness / 2.0 + tooldia / 2.0
|
x = xmin - margin - line_thickness / 2.0
|
||||||
y = ymax + margin + line_thickness / 2.0 - tooldia / 2.0
|
y = ymax + margin + line_thickness / 2.0
|
||||||
drill_list.append(
|
drill_list.append(
|
||||||
Point((x, y))
|
Point((x, y))
|
||||||
)
|
)
|
||||||
|
|
||||||
if tr_state:
|
if tr_state:
|
||||||
x = xmax + margin + line_thickness / 2.0 - tooldia / 2.0
|
x = xmax + margin + line_thickness / 2.0
|
||||||
y = ymax + margin + line_thickness / 2.0 - tooldia / 2.0
|
y = ymax + margin + line_thickness / 2.0
|
||||||
drill_list.append(
|
drill_list.append(
|
||||||
Point((x, y))
|
Point((x, y))
|
||||||
)
|
)
|
||||||
|
|
||||||
if bl_state:
|
if bl_state:
|
||||||
x = xmin - margin - line_thickness / 2.0 + tooldia / 2.0
|
x = xmin - margin - line_thickness / 2.0
|
||||||
y = ymin - margin - line_thickness / 2.0 + tooldia / 2.0
|
y = ymin - margin - line_thickness / 2.0
|
||||||
drill_list.append(
|
drill_list.append(
|
||||||
Point((x, y))
|
Point((x, y))
|
||||||
)
|
)
|
||||||
|
|
||||||
if br_state:
|
if br_state:
|
||||||
x = xmax + margin + line_thickness / 2.0 - tooldia / 2.0
|
x = xmax + margin + line_thickness / 2.0
|
||||||
y = ymin - margin - line_thickness / 2.0 + tooldia / 2.0
|
y = ymin - margin - line_thickness / 2.0
|
||||||
drill_list.append(
|
drill_list.append(
|
||||||
Point((x, y))
|
Point((x, y))
|
||||||
)
|
)
|
||||||
@@ -662,29 +662,29 @@ class ToolCorners(AppTool):
|
|||||||
|
|
||||||
if 'manual' not in self.points:
|
if 'manual' not in self.points:
|
||||||
if tl_state:
|
if tl_state:
|
||||||
x = xmin - margin - line_thickness / 2.0 + tooldia / 2.0
|
x = xmin - margin - line_thickness / 2.0
|
||||||
y = ymax + margin + line_thickness / 2.0 - tooldia / 2.0
|
y = ymax + margin + line_thickness / 2.0
|
||||||
drill_list.append(
|
drill_list.append(
|
||||||
Point((x, y))
|
Point((x, y))
|
||||||
)
|
)
|
||||||
|
|
||||||
if tr_state:
|
if tr_state:
|
||||||
x = xmax + margin + line_thickness / 2.0 - tooldia / 2.0
|
x = xmax + margin + line_thickness / 2.0
|
||||||
y = ymax + margin + line_thickness / 2.0 - tooldia / 2.0
|
y = ymax + margin + line_thickness / 2.0
|
||||||
drill_list.append(
|
drill_list.append(
|
||||||
Point((x, y))
|
Point((x, y))
|
||||||
)
|
)
|
||||||
|
|
||||||
if bl_state:
|
if bl_state:
|
||||||
x = xmin - margin - line_thickness / 2.0 + tooldia / 2.0
|
x = xmin - margin - line_thickness / 2.0
|
||||||
y = ymin - margin - line_thickness / 2.0 + tooldia / 2.0
|
y = ymin - margin - line_thickness / 2.0
|
||||||
drill_list.append(
|
drill_list.append(
|
||||||
Point((x, y))
|
Point((x, y))
|
||||||
)
|
)
|
||||||
|
|
||||||
if br_state:
|
if br_state:
|
||||||
x = xmax + margin + line_thickness / 2.0 - tooldia / 2.0
|
x = xmax + margin + line_thickness / 2.0
|
||||||
y = ymin - margin - line_thickness / 2.0 + tooldia / 2.0
|
y = ymin - margin - line_thickness / 2.0
|
||||||
drill_list.append(
|
drill_list.append(
|
||||||
Point((x, y))
|
Point((x, y))
|
||||||
)
|
)
|
||||||
@@ -891,14 +891,13 @@ class CornersUI:
|
|||||||
# Gerber Source Object
|
# Gerber Source Object
|
||||||
# #############################################################################################################
|
# #############################################################################################################
|
||||||
|
|
||||||
# Gerber object #
|
|
||||||
self.object_label = FCLabel('<span style="color:darkorange;"><b>%s</b></span>' % _("Source Object"))
|
self.object_label = FCLabel('<span style="color:darkorange;"><b>%s</b></span>' % _("Source Object"))
|
||||||
self.object_label.setToolTip(_("The Gerber object to which will be added corner markers."))
|
self.object_label.setToolTip(_("The Gerber object to which will be added corner markers."))
|
||||||
|
|
||||||
self.object_combo = FCComboBox()
|
self.object_combo = FCComboBox()
|
||||||
self.object_combo.setModel(self.app.collection)
|
self.object_combo.setModel(self.app.collection)
|
||||||
self.object_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex()))
|
self.object_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex()))
|
||||||
self.object_combo.is_last = True
|
self.object_combo.is_last = False
|
||||||
self.object_combo.obj_type = "Gerber"
|
self.object_combo.obj_type = "Gerber"
|
||||||
|
|
||||||
self.tools_box.addWidget(self.object_label)
|
self.tools_box.addWidget(self.object_label)
|
||||||
|
|||||||
@@ -345,7 +345,7 @@ class ToolExtract(AppTool):
|
|||||||
self.ui.apertures_table.cellWidget(row, 3).clicked.disconnect()
|
self.ui.apertures_table.cellWidget(row, 3).clicked.disconnect()
|
||||||
except (TypeError, AttributeError):
|
except (TypeError, AttributeError):
|
||||||
pass
|
pass
|
||||||
self.ui.apertures_table.cellWidget(row, 3).clicked.connect(self.on_mark_cb_click_table)
|
self.ui.apertures_table.cellWidget(row, 3).stateChanged.connect(self.on_mark_cb_click_table)
|
||||||
|
|
||||||
def ui_disconnect(self):
|
def ui_disconnect(self):
|
||||||
try:
|
try:
|
||||||
@@ -356,7 +356,7 @@ class ToolExtract(AppTool):
|
|||||||
# Mark Checkboxes
|
# Mark Checkboxes
|
||||||
for row in range(self.ui.apertures_table.rowCount()):
|
for row in range(self.ui.apertures_table.rowCount()):
|
||||||
try:
|
try:
|
||||||
self.ui.apertures_table.cellWidget(row, 3).clicked.disconnect()
|
self.ui.apertures_table.cellWidget(row, 3).stateChanged.disconnect()
|
||||||
except (TypeError, AttributeError):
|
except (TypeError, AttributeError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -409,6 +409,8 @@ class ToolExtract(AppTool):
|
|||||||
use_thread=False)
|
use_thread=False)
|
||||||
|
|
||||||
with self.app.proc_container.new('%s...' % _("Working")):
|
with self.app.proc_container.new('%s...' % _("Working")):
|
||||||
|
self.clear_aperture_marking()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.app.app_obj.new_object("excellon", outname, obj_init, autoselected=False)
|
self.app.app_obj.new_object("excellon", outname, obj_init, autoselected=False)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -931,9 +933,21 @@ class ToolExtract(AppTool):
|
|||||||
else:
|
else:
|
||||||
grb_obj.clear_plot_apertures(aperture=aperture)
|
grb_obj.clear_plot_apertures(aperture=aperture)
|
||||||
|
|
||||||
|
def clear_aperture_marking(self):
|
||||||
|
"""
|
||||||
|
Will clear all aperture markings after creating an Excellon object with extracted drill holes
|
||||||
|
|
||||||
|
:return:
|
||||||
|
:rtype:
|
||||||
|
"""
|
||||||
|
|
||||||
|
for row in range(self.ui.apertures_table.rowCount()):
|
||||||
|
self.ui.apertures_table.cellWidget(row, 3).set_value(False)
|
||||||
|
|
||||||
def reset_fields(self):
|
def reset_fields(self):
|
||||||
self.ui.gerber_object_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex()))
|
self.ui.gerber_object_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex()))
|
||||||
self.ui.gerber_object_combo.setCurrentIndex(0)
|
self.ui.gerber_object_combo.setCurrentIndex(0)
|
||||||
|
self.clear_aperture_marking()
|
||||||
|
|
||||||
|
|
||||||
class ExtractUI:
|
class ExtractUI:
|
||||||
|
|||||||
@@ -529,6 +529,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
self.on_ring_method(self.grb_obj, outname)
|
self.on_ring_method(self.grb_obj, outname)
|
||||||
elif punch_method == 'prop':
|
elif punch_method == 'prop':
|
||||||
self.on_proportional_method(self.grb_obj, outname)
|
self.on_proportional_method(self.grb_obj, outname)
|
||||||
|
self.clear_aperture_marking()
|
||||||
else:
|
else:
|
||||||
if punch_method == 'exc':
|
if punch_method == 'exc':
|
||||||
# get the Excellon file whose geometry will create the punch holes
|
# get the Excellon file whose geometry will create the punch holes
|
||||||
@@ -562,6 +563,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
|
|
||||||
# disconnect flags
|
# disconnect flags
|
||||||
self.poly_sel_disconnect_flag = True
|
self.poly_sel_disconnect_flag = True
|
||||||
|
self.app.ui.notebook.setDisabled(True)
|
||||||
|
|
||||||
# disable the canvas mouse dragging seelction shape
|
# disable the canvas mouse dragging seelction shape
|
||||||
self.old_selection_status = deepcopy(self.app.defaults['global_selection_shape'])
|
self.old_selection_status = deepcopy(self.app.defaults['global_selection_shape'])
|
||||||
@@ -670,7 +672,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
new_obj.source_file = app_obj.f_handlers.export_gerber(obj_name=outname, filename=None,
|
new_obj.source_file = app_obj.f_handlers.export_gerber(obj_name=outname, filename=None,
|
||||||
local_use=new_obj, use_thread=False)
|
local_use=new_obj, use_thread=False)
|
||||||
|
|
||||||
self.app.app_obj.new_object('gerber', outname, init_func)
|
self.app.app_obj.new_object('gerber', outname, init_func, autoselected=False)
|
||||||
|
|
||||||
def on_excellon_manual_method(self, outname):
|
def on_excellon_manual_method(self, outname):
|
||||||
# get the Excellon file whose geometry will create the punch holes
|
# get the Excellon file whose geometry will create the punch holes
|
||||||
@@ -791,7 +793,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
new_obj.source_file = app_obj.f_handlers.export_gerber(obj_name=outname, filename=None,
|
new_obj.source_file = app_obj.f_handlers.export_gerber(obj_name=outname, filename=None,
|
||||||
local_use=new_obj, use_thread=False)
|
local_use=new_obj, use_thread=False)
|
||||||
|
|
||||||
self.app.app_obj.new_object('gerber', outname, init_func)
|
self.app.app_obj.new_object('gerber', outname, init_func, autoselected=False)
|
||||||
|
|
||||||
def on_fixed_method(self, grb_obj, outname):
|
def on_fixed_method(self, grb_obj, outname):
|
||||||
punch_size = float(self.ui.dia_entry.get_value())
|
punch_size = float(self.ui.dia_entry.get_value())
|
||||||
@@ -924,7 +926,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
new_obj.source_file = app_obj.f_handlers.export_gerber(obj_name=outname, filename=None,
|
new_obj.source_file = app_obj.f_handlers.export_gerber(obj_name=outname, filename=None,
|
||||||
local_use=new_obj, use_thread=False)
|
local_use=new_obj, use_thread=False)
|
||||||
|
|
||||||
self.app.app_obj.new_object('gerber', outname, init_func)
|
self.app.app_obj.new_object('gerber', outname, init_func, autoselected=False)
|
||||||
|
|
||||||
def on_fixed_manual_method(self, outname):
|
def on_fixed_manual_method(self, outname):
|
||||||
punch_size = float(self.ui.dia_entry.get_value())
|
punch_size = float(self.ui.dia_entry.get_value())
|
||||||
@@ -1019,7 +1021,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
new_obj.source_file = app_obj.f_handlers.export_gerber(obj_name=outname, filename=None,
|
new_obj.source_file = app_obj.f_handlers.export_gerber(obj_name=outname, filename=None,
|
||||||
local_use=new_obj, use_thread=False)
|
local_use=new_obj, use_thread=False)
|
||||||
|
|
||||||
self.app.app_obj.new_object('gerber', outname, init_func)
|
self.app.app_obj.new_object('gerber', outname, init_func, autoselected=False)
|
||||||
|
|
||||||
def on_ring_method(self, grb_obj, outname):
|
def on_ring_method(self, grb_obj, outname):
|
||||||
circ_r_val = self.ui.circular_ring_entry.get_value()
|
circ_r_val = self.ui.circular_ring_entry.get_value()
|
||||||
@@ -1168,7 +1170,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
new_obj.source_file = app_obj.f_handlers.export_gerber(obj_name=outname, filename=None,
|
new_obj.source_file = app_obj.f_handlers.export_gerber(obj_name=outname, filename=None,
|
||||||
local_use=new_obj, use_thread=False)
|
local_use=new_obj, use_thread=False)
|
||||||
|
|
||||||
self.app.app_obj.new_object('gerber', outname, init_func)
|
self.app.app_obj.new_object('gerber', outname, init_func, autoselected=False)
|
||||||
|
|
||||||
def on_ring_manual_method(self, outname):
|
def on_ring_manual_method(self, outname):
|
||||||
circ_r_val = self.ui.circular_ring_entry.get_value()
|
circ_r_val = self.ui.circular_ring_entry.get_value()
|
||||||
@@ -1308,7 +1310,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
new_obj.source_file = app_obj.f_handlers.export_gerber(obj_name=outname, filename=None,
|
new_obj.source_file = app_obj.f_handlers.export_gerber(obj_name=outname, filename=None,
|
||||||
local_use=new_obj, use_thread=False)
|
local_use=new_obj, use_thread=False)
|
||||||
|
|
||||||
self.app.app_obj.new_object('gerber', outname, init_func)
|
self.app.app_obj.new_object('gerber', outname, init_func, autoselected=False)
|
||||||
|
|
||||||
def on_proportional_method(self, grb_obj, outname):
|
def on_proportional_method(self, grb_obj, outname):
|
||||||
prop_factor = self.ui.factor_entry.get_value() / 100.0
|
prop_factor = self.ui.factor_entry.get_value() / 100.0
|
||||||
@@ -1452,7 +1454,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
new_obj.source_file = app_obj.f_handlers.export_gerber(obj_name=outname, filename=None,
|
new_obj.source_file = app_obj.f_handlers.export_gerber(obj_name=outname, filename=None,
|
||||||
local_use=new_obj, use_thread=False)
|
local_use=new_obj, use_thread=False)
|
||||||
|
|
||||||
self.app.app_obj.new_object('gerber', outname, init_func)
|
self.app.app_obj.new_object('gerber', outname, init_func, autoselected=False)
|
||||||
|
|
||||||
def on_proportional_manual_method(self, outname):
|
def on_proportional_manual_method(self, outname):
|
||||||
prop_factor = self.ui.factor_entry.get_value() / 100.0
|
prop_factor = self.ui.factor_entry.get_value() / 100.0
|
||||||
@@ -1588,7 +1590,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
new_obj.source_file = app_obj.f_handlers.export_gerber(obj_name=outname, filename=None,
|
new_obj.source_file = app_obj.f_handlers.export_gerber(obj_name=outname, filename=None,
|
||||||
local_use=new_obj, use_thread=False)
|
local_use=new_obj, use_thread=False)
|
||||||
|
|
||||||
self.app.app_obj.new_object('gerber', outname, init_func)
|
self.app.app_obj.new_object('gerber', outname, init_func, autoselected=False)
|
||||||
|
|
||||||
def find_pad(self, point):
|
def find_pad(self, point):
|
||||||
pt = Point(point) if type(point) is tuple else point
|
pt = Point(point) if type(point) is tuple else point
|
||||||
@@ -1752,6 +1754,8 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
self.app.tool_shapes.clear(update=True)
|
self.app.tool_shapes.clear(update=True)
|
||||||
|
|
||||||
self.on_manual_punch()
|
self.on_manual_punch()
|
||||||
|
self.clear_aperture_marking()
|
||||||
|
self.app.ui.notebook.setDisabled(False)
|
||||||
|
|
||||||
# initialize the work variables
|
# initialize the work variables
|
||||||
self.manual_pads = []
|
self.manual_pads = []
|
||||||
@@ -1844,8 +1848,9 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
if self.old_selection_status is not None:
|
if self.old_selection_status is not None:
|
||||||
self.app.defaults['global_selection_shape'] = self.old_selection_status
|
self.app.defaults['global_selection_shape'] = self.old_selection_status
|
||||||
|
|
||||||
|
self.app.ui.notebook.setDisabled(False)
|
||||||
self.poly_dict.clear()
|
self.poly_dict.clear()
|
||||||
|
self.clear_aperture_marking()
|
||||||
self.delete_moving_selection_shape()
|
self.delete_moving_selection_shape()
|
||||||
self.delete_tool_selection_shape()
|
self.delete_tool_selection_shape()
|
||||||
|
|
||||||
@@ -1942,9 +1947,22 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
self.app.tool_shapes.redraw()
|
self.app.tool_shapes.redraw()
|
||||||
self.app.inform.emit(_("Selection cleared."))
|
self.app.inform.emit(_("Selection cleared."))
|
||||||
|
|
||||||
|
def clear_aperture_marking(self):
|
||||||
|
"""
|
||||||
|
Will clear all aperture markings after creating an Excellon object with extracted drill holes
|
||||||
|
|
||||||
|
:return:
|
||||||
|
:rtype:
|
||||||
|
"""
|
||||||
|
|
||||||
|
for row in range(self.ui.apertures_table.rowCount()):
|
||||||
|
self.ui.apertures_table.cellWidget(row, 3).set_value(False)
|
||||||
|
|
||||||
def reset_fields(self):
|
def reset_fields(self):
|
||||||
self.ui.gerber_object_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex()))
|
self.ui.gerber_object_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex()))
|
||||||
self.ui.exc_combo.setRootModelIndex(self.app.collection.index(1, 0, QtCore.QModelIndex()))
|
self.ui.exc_combo.setRootModelIndex(self.app.collection.index(1, 0, QtCore.QModelIndex()))
|
||||||
|
self.clear_aperture_marking()
|
||||||
|
|
||||||
self.ui_disconnect()
|
self.ui_disconnect()
|
||||||
|
|
||||||
|
|
||||||
@@ -2008,7 +2026,7 @@ class PunchUI:
|
|||||||
self.gerber_object_combo = FCComboBox()
|
self.gerber_object_combo = FCComboBox()
|
||||||
self.gerber_object_combo.setModel(self.app.collection)
|
self.gerber_object_combo.setModel(self.app.collection)
|
||||||
self.gerber_object_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex()))
|
self.gerber_object_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex()))
|
||||||
self.gerber_object_combo.is_last = True
|
self.gerber_object_combo.is_last = False
|
||||||
self.gerber_object_combo.obj_type = "Gerber"
|
self.gerber_object_combo.obj_type = "Gerber"
|
||||||
|
|
||||||
grid0.addWidget(self.gerber_object_combo, 0, 0, 1, 2)
|
grid0.addWidget(self.gerber_object_combo, 0, 0, 1, 2)
|
||||||
|
|||||||
Reference in New Issue
Block a user